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
26647ab0
Commit
26647ab0
authored
Nov 15, 2013
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Export a grouping mode to string array from the API
parent
ee9fbf50
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
vsl.h
include/vapi/vsl.h
+6
-0
libvarnishapi.map
lib/libvarnishapi/libvarnishapi.map
+1
-0
vsl_arg.c
lib/libvarnishapi/vsl_arg.c
+4
-4
No files found.
include/vapi/vsl.h
View file @
26647ab0
...
...
@@ -79,6 +79,7 @@ enum VSL_grouping_e {
VSL_g_vxid
,
VSL_g_request
,
VSL_g_session
,
VSL_g__MAX
,
};
typedef
int
VSLQ_dispatch_f
(
struct
VSL_data
*
vsl
,
...
...
@@ -170,6 +171,11 @@ int VSL_List2Tags(const char *list, int l, VSL_tagfind_f *func, void *priv);
* -3: Syntax error
*/
extern
const
char
*
VSLQ_grouping
[
VSL_g__MAX
];
/*
* Grouping mode to string array.
*/
int
VSLQ_Name2Grouping
(
const
char
*
name
,
int
l
);
/*
* Convert string to grouping (= enum VSL_grouping_e)
...
...
lib/libvarnishapi/libvarnishapi.map
View file @
26647ab0
...
...
@@ -119,4 +119,5 @@ LIBVARNISHAPI_1.3 {
VSL_List2Tags;
VSM_N_Arg;
# Variables:
VSLQ_grouping;
} LIBVARNISHAPI_1.0;
lib/libvarnishapi/vsl_arg.c
View file @
26647ab0
...
...
@@ -183,7 +183,7 @@ VSL_List2Tags(const char *list, int l, VSL_tagfind_f *func, void *priv)
return
(
t
);
}
static
const
char
*
const
vsl_grouping
[
]
=
{
const
char
*
VSLQ_grouping
[
VSL_g__MAX
]
=
{
[
VSL_g_raw
]
=
"raw"
,
[
VSL_g_vxid
]
=
"vxid"
,
[
VSL_g_request
]
=
"request"
,
...
...
@@ -198,9 +198,9 @@ VSLQ_Name2Grouping(const char *name, int l)
if
(
l
==
-
1
)
l
=
strlen
(
name
);
n
=
-
1
;
for
(
i
=
0
;
i
<
sizeof
vsl_grouping
/
sizeof
vsl_grouping
[
0
]
;
i
++
)
{
if
(
!
strncasecmp
(
name
,
vsl
_grouping
[
i
],
l
))
{
if
(
strlen
(
vsl
_grouping
[
i
])
==
l
)
{
for
(
i
=
0
;
i
<
VSL_g__MAX
;
i
++
)
{
if
(
!
strncasecmp
(
name
,
VSLQ
_grouping
[
i
],
l
))
{
if
(
strlen
(
VSLQ
_grouping
[
i
])
==
l
)
{
/* Exact match */
return
(
i
);
}
...
...
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