Commit 38f712a6 authored by Nils Goroll's avatar Nils Goroll

use a table file for vmod enum to c enum

parent 328cea21
......@@ -10,7 +10,8 @@ libvmod_blob_la_SOURCES = \
hex.c \
url.c \
wb.h \
wb.c
wb.c \
tbl_encodings.h
base64.o: base64.c base64.h
......
VMODENUM(BASE64)
VMODENUM(BASE64URL)
VMODENUM(BASE64URLNOPAD)
VMODENUM(HEX)
VMODENUM(IDENTITY)
VMODENUM(URL)
#undef VMODENUM
......@@ -119,12 +119,8 @@ static const struct vmod_priv null_blob[1] =
static enum encoding
parse_encoding(VCL_ENUM e)
{
if (e == vmod_enum_BASE64) return(BASE64);
if (e == vmod_enum_BASE64URL) return(BASE64URL);
if (e == vmod_enum_BASE64URLNOPAD) return(BASE64URLNOPAD);
if (e == vmod_enum_HEX) return(HEX);
if (e == vmod_enum_IDENTITY) return(IDENTITY);
if (e == vmod_enum_URL) return(URL);
#define VMODENUM(n) if (e == vmod_enum_ ## n) return(n);
#include "tbl_encodings.h"
WRONG("illegal encoding enum");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment