Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
38f712a6
Commit
38f712a6
authored
Dec 10, 2017
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use a table file for vmod enum to c enum
parent
328cea21
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
Makefile.am
lib/libvmod_blob/Makefile.am
+2
-1
tbl_encodings.h
lib/libvmod_blob/tbl_encodings.h
+7
-0
vmod_blob.c
lib/libvmod_blob/vmod_blob.c
+2
-6
No files found.
lib/libvmod_blob/Makefile.am
View file @
38f712a6
...
@@ -10,7 +10,8 @@ libvmod_blob_la_SOURCES = \
...
@@ -10,7 +10,8 @@ libvmod_blob_la_SOURCES = \
hex.c
\
hex.c
\
url.c
\
url.c
\
wb.h
\
wb.h
\
wb.c
wb.c
\
tbl_encodings.h
base64.o
:
base64.c base64.h
base64.o
:
base64.c base64.h
...
...
lib/libvmod_blob/tbl_encodings.h
0 → 100644
View file @
38f712a6
VMODENUM
(
BASE64
)
VMODENUM
(
BASE64URL
)
VMODENUM
(
BASE64URLNOPAD
)
VMODENUM
(
HEX
)
VMODENUM
(
IDENTITY
)
VMODENUM
(
URL
)
#undef VMODENUM
lib/libvmod_blob/vmod_blob.c
View file @
38f712a6
...
@@ -119,12 +119,8 @@ static const struct vmod_priv null_blob[1] =
...
@@ -119,12 +119,8 @@ static const struct vmod_priv null_blob[1] =
static
enum
encoding
static
enum
encoding
parse_encoding
(
VCL_ENUM
e
)
parse_encoding
(
VCL_ENUM
e
)
{
{
if
(
e
==
vmod_enum_BASE64
)
return
(
BASE64
);
#define VMODENUM(n) if (e == vmod_enum_ ## n) return(n);
if
(
e
==
vmod_enum_BASE64URL
)
return
(
BASE64URL
);
#include "tbl_encodings.h"
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
);
WRONG
(
"illegal encoding enum"
);
WRONG
(
"illegal encoding enum"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment