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
afbe27c0
Commit
afbe27c0
authored
Sep 25, 2014
by
Poul-Henning Kamp
Committed by
Lasse Karstensen
Jan 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce "VRT_CTX" as a shorthand macro for "const struct vrt_ctx *ctx"
parent
06056e30
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
140 additions
and
140 deletions
+140
-140
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+19
-19
cache_vrt_re.c
bin/varnishd/cache/cache_vrt_re.c
+2
-2
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+40
-40
vrt.h
include/vrt.h
+21
-21
generate.py
lib/libvcc/generate.py
+4
-3
vcc_acl.c
lib/libvcc/vcc_acl.c
+1
-1
vcc_compile.c
lib/libvcc/vcc_compile.c
+2
-2
vcc_parse.c
lib/libvcc/vcc_parse.c
+2
-2
vmodtool.py
lib/libvcc/vmodtool.py
+2
-3
vmod_debug.c
lib/libvmod_debug/vmod_debug.c
+8
-8
vmod_debug_obj.c
lib/libvmod_debug/vmod_debug_obj.c
+4
-4
fall_back.c
lib/libvmod_directors/fall_back.c
+3
-3
hash.c
lib/libvmod_directors/hash.c
+3
-3
random.c
lib/libvmod_directors/random.c
+3
-3
round_robin.c
lib/libvmod_directors/round_robin.c
+3
-3
vmod_std.c
lib/libvmod_std/vmod_std.c
+14
-14
vmod_std_conversions.c
lib/libvmod_std/vmod_std_conversions.c
+7
-7
vmod_std_fileread.c
lib/libvmod_std/vmod_std_fileread.c
+1
-1
vmod_std_querysort.c
lib/libvmod_std/vmod_std_querysort.c
+1
-1
No files found.
bin/varnishd/cache/cache_vrt.c
View file @
afbe27c0
...
@@ -52,7 +52,7 @@ const void * const vrt_magic_string_unset = &vrt_magic_string_unset;
...
@@ -52,7 +52,7 @@ const void * const vrt_magic_string_unset = &vrt_magic_string_unset;
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
void
void
VRT_error
(
const
struct
vrt_ctx
*
ctx
,
unsigned
code
,
const
char
*
reason
)
VRT_error
(
VRT_CTX
,
unsigned
code
,
const
char
*
reason
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -69,7 +69,7 @@ VRT_error(const struct vrt_ctx *ctx, unsigned code, const char *reason)
...
@@ -69,7 +69,7 @@ VRT_error(const struct vrt_ctx *ctx, unsigned code, const char *reason)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
void
void
VRT_count
(
const
struct
vrt_ctx
*
ctx
,
unsigned
u
)
VRT_count
(
VRT_CTX
,
unsigned
u
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -81,7 +81,7 @@ VRT_count(const struct vrt_ctx *ctx, unsigned u)
...
@@ -81,7 +81,7 @@ VRT_count(const struct vrt_ctx *ctx, unsigned u)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
void
void
VRT_acl_log
(
const
struct
vrt_ctx
*
ctx
,
const
char
*
msg
)
VRT_acl_log
(
VRT_CTX
,
const
char
*
msg
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -91,7 +91,7 @@ VRT_acl_log(const struct vrt_ctx *ctx, const char *msg)
...
@@ -91,7 +91,7 @@ VRT_acl_log(const struct vrt_ctx *ctx, const char *msg)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
static
struct
http
*
static
struct
http
*
vrt_selecthttp
(
const
struct
vrt_ctx
*
ctx
,
enum
gethdr_e
where
)
vrt_selecthttp
(
VRT_CTX
,
enum
gethdr_e
where
)
{
{
struct
http
*
hp
;
struct
http
*
hp
;
...
@@ -121,7 +121,7 @@ vrt_selecthttp(const struct vrt_ctx *ctx, enum gethdr_e where)
...
@@ -121,7 +121,7 @@ vrt_selecthttp(const struct vrt_ctx *ctx, enum gethdr_e where)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
char
*
char
*
VRT_GetHdr
(
const
struct
vrt_ctx
*
ctx
,
const
struct
gethdr_s
*
hs
)
VRT_GetHdr
(
VRT_CTX
,
const
struct
gethdr_s
*
hs
)
{
{
char
*
p
;
char
*
p
;
struct
http
*
hp
;
struct
http
*
hp
;
...
@@ -199,7 +199,7 @@ VRT_String(struct ws *ws, const char *h, const char *p, va_list ap)
...
@@ -199,7 +199,7 @@ VRT_String(struct ws *ws, const char *h, const char *p, va_list ap)
*/
*/
const
char
*
const
char
*
VRT_CollectString
(
const
struct
vrt_ctx
*
ctx
,
const
char
*
p
,
...)
VRT_CollectString
(
VRT_CTX
,
const
char
*
p
,
...)
{
{
va_list
ap
;
va_list
ap
;
const
char
*
b
;
const
char
*
b
;
...
@@ -215,7 +215,7 @@ VRT_CollectString(const struct vrt_ctx *ctx, const char *p, ...)
...
@@ -215,7 +215,7 @@ VRT_CollectString(const struct vrt_ctx *ctx, const char *p, ...)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
void
void
VRT_SetHdr
(
const
struct
vrt_ctx
*
ctx
,
const
struct
gethdr_s
*
hs
,
VRT_SetHdr
(
VRT_CTX
,
const
struct
gethdr_s
*
hs
,
const
char
*
p
,
...)
const
char
*
p
,
...)
{
{
struct
http
*
hp
;
struct
http
*
hp
;
...
@@ -245,7 +245,7 @@ VRT_SetHdr(const struct vrt_ctx *ctx , const struct gethdr_s *hs,
...
@@ -245,7 +245,7 @@ VRT_SetHdr(const struct vrt_ctx *ctx , const struct gethdr_s *hs,
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
void
void
VRT_handling
(
const
struct
vrt_ctx
*
ctx
,
unsigned
hand
)
VRT_handling
(
VRT_CTX
,
unsigned
hand
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -258,7 +258,7 @@ VRT_handling(const struct vrt_ctx *ctx, unsigned hand)
...
@@ -258,7 +258,7 @@ VRT_handling(const struct vrt_ctx *ctx, unsigned hand)
*/
*/
void
void
VRT_hashdata
(
const
struct
vrt_ctx
*
ctx
,
const
char
*
str
,
...)
VRT_hashdata
(
VRT_CTX
,
const
char
*
str
,
...)
{
{
va_list
ap
;
va_list
ap
;
const
char
*
p
;
const
char
*
p
;
...
@@ -285,7 +285,7 @@ VRT_hashdata(const struct vrt_ctx *ctx, const char *str, ...)
...
@@ -285,7 +285,7 @@ VRT_hashdata(const struct vrt_ctx *ctx, const char *str, ...)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
double
double
VRT_r_now
(
const
struct
vrt_ctx
*
ctx
)
VRT_r_now
(
VRT_CTX
)
{
{
(
void
)
ctx
;
(
void
)
ctx
;
...
@@ -295,7 +295,7 @@ VRT_r_now(const struct vrt_ctx *ctx)
...
@@ -295,7 +295,7 @@ VRT_r_now(const struct vrt_ctx *ctx)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
char
*
char
*
VRT_IP_string
(
const
struct
vrt_ctx
*
ctx
,
VCL_IP
ip
)
VRT_IP_string
(
VRT_CTX
,
VCL_IP
ip
)
{
{
char
*
p
;
char
*
p
;
unsigned
len
;
unsigned
len
;
...
@@ -315,7 +315,7 @@ VRT_IP_string(const struct vrt_ctx *ctx, VCL_IP ip)
...
@@ -315,7 +315,7 @@ VRT_IP_string(const struct vrt_ctx *ctx, VCL_IP ip)
}
}
char
*
char
*
VRT_INT_string
(
const
struct
vrt_ctx
*
ctx
,
long
num
)
VRT_INT_string
(
VRT_CTX
,
long
num
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -323,7 +323,7 @@ VRT_INT_string(const struct vrt_ctx *ctx, long num)
...
@@ -323,7 +323,7 @@ VRT_INT_string(const struct vrt_ctx *ctx, long num)
}
}
char
*
char
*
VRT_REAL_string
(
const
struct
vrt_ctx
*
ctx
,
double
num
)
VRT_REAL_string
(
VRT_CTX
,
double
num
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -331,7 +331,7 @@ VRT_REAL_string(const struct vrt_ctx *ctx, double num)
...
@@ -331,7 +331,7 @@ VRT_REAL_string(const struct vrt_ctx *ctx, double num)
}
}
char
*
char
*
VRT_TIME_string
(
const
struct
vrt_ctx
*
ctx
,
double
t
)
VRT_TIME_string
(
VRT_CTX
,
double
t
)
{
{
char
*
p
;
char
*
p
;
...
@@ -361,7 +361,7 @@ VRT_BOOL_string(unsigned val)
...
@@ -361,7 +361,7 @@ VRT_BOOL_string(unsigned val)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
void
void
VRT_Rollback
(
const
struct
vrt_ctx
*
ctx
,
const
struct
http
*
hp
)
VRT_Rollback
(
VRT_CTX
,
const
struct
http
*
hp
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -382,7 +382,7 @@ VRT_Rollback(const struct vrt_ctx *ctx, const struct http *hp)
...
@@ -382,7 +382,7 @@ VRT_Rollback(const struct vrt_ctx *ctx, const struct http *hp)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
void
void
VRT_synth_page
(
const
struct
vrt_ctx
*
ctx
,
const
char
*
str
,
...)
VRT_synth_page
(
VRT_CTX
,
const
char
*
str
,
...)
{
{
va_list
ap
;
va_list
ap
;
const
char
*
p
;
const
char
*
p
;
...
@@ -412,7 +412,7 @@ VRT_synth_page(const struct vrt_ctx *ctx, const char *str, ...)
...
@@ -412,7 +412,7 @@ VRT_synth_page(const struct vrt_ctx *ctx, const char *str, ...)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
void
void
VRT_ban_string
(
const
struct
vrt_ctx
*
ctx
,
const
char
*
str
)
VRT_ban_string
(
VRT_CTX
,
const
char
*
str
)
{
{
char
*
a1
,
*
a2
,
*
a3
;
char
*
a1
,
*
a2
,
*
a3
;
char
**
av
;
char
**
av
;
...
@@ -479,7 +479,7 @@ VRT_ban_string(const struct vrt_ctx *ctx, const char *str)
...
@@ -479,7 +479,7 @@ VRT_ban_string(const struct vrt_ctx *ctx, const char *str)
*/
*/
int
int
VRT_CacheReqBody
(
const
struct
vrt_ctx
*
ctx
,
long
long
maxsize
)
VRT_CacheReqBody
(
VRT_CTX
,
long
long
maxsize
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -497,7 +497,7 @@ VRT_CacheReqBody(const struct vrt_ctx *ctx, long long maxsize)
...
@@ -497,7 +497,7 @@ VRT_CacheReqBody(const struct vrt_ctx *ctx, long long maxsize)
*/
*/
void
void
VRT_purge
(
const
struct
vrt_ctx
*
ctx
,
double
ttl
,
double
grace
,
double
keep
)
VRT_purge
(
VRT_CTX
,
double
ttl
,
double
grace
,
double
keep
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
...
bin/varnishd/cache/cache_vrt_re.c
View file @
afbe27c0
...
@@ -62,7 +62,7 @@ VRT_re_fini(void *rep)
...
@@ -62,7 +62,7 @@ VRT_re_fini(void *rep)
}
}
int
int
VRT_re_match
(
const
struct
vrt_ctx
*
ctx
,
const
char
*
s
,
void
*
re
)
VRT_re_match
(
VRT_CTX
,
const
char
*
s
,
void
*
re
)
{
{
vre_t
*
t
;
vre_t
*
t
;
int
i
;
int
i
;
...
@@ -81,7 +81,7 @@ VRT_re_match(const struct vrt_ctx *ctx, const char *s, void *re)
...
@@ -81,7 +81,7 @@ VRT_re_match(const struct vrt_ctx *ctx, const char *s, void *re)
}
}
const
char
*
const
char
*
VRT_regsub
(
const
struct
vrt_ctx
*
ctx
,
int
all
,
const
char
*
str
,
void
*
re
,
VRT_regsub
(
VRT_CTX
,
int
all
,
const
char
*
str
,
void
*
re
,
const
char
*
sub
)
const
char
*
sub
)
{
{
int
ovector
[
30
];
int
ovector
[
30
];
...
...
bin/varnishd/cache/cache_vrt_var.c
View file @
afbe27c0
This diff is collapsed.
Click to expand it.
include/vrt.h
View file @
afbe27c0
...
@@ -105,6 +105,8 @@ struct vrt_ctx {
...
@@ -105,6 +105,8 @@ struct vrt_ctx {
double
now
;
double
now
;
};
};
#define VRT_CTX const struct vrt_ctx *ctx
/***********************************************************************/
/***********************************************************************/
struct
vmod_data
{
struct
vmod_data
{
...
@@ -186,42 +188,40 @@ struct vrt_ref {
...
@@ -186,42 +188,40 @@ struct vrt_ref {
/* ACL related */
/* ACL related */
#define VRT_ACL_MAXADDR 16
/* max(IPv4, IPv6) */
#define VRT_ACL_MAXADDR 16
/* max(IPv4, IPv6) */
void
VRT_acl_log
(
const
struct
vrt_ctx
*
,
const
char
*
msg
);
void
VRT_acl_log
(
VRT_CTX
,
const
char
*
msg
);
/* req related */
/* req related */
int
VRT_CacheReqBody
(
const
struct
vrt_ctx
*
,
long
long
maxsize
);
int
VRT_CacheReqBody
(
VRT_CTX
,
long
long
maxsize
);
/* Regexp related */
/* Regexp related */
void
VRT_re_init
(
void
**
,
const
char
*
);
void
VRT_re_init
(
void
**
,
const
char
*
);
void
VRT_re_fini
(
void
*
);
void
VRT_re_fini
(
void
*
);
int
VRT_re_match
(
const
struct
vrt_ctx
*
,
const
char
*
,
void
*
re
);
int
VRT_re_match
(
VRT_CTX
,
const
char
*
,
void
*
re
);
const
char
*
VRT_regsub
(
const
struct
vrt_ctx
*
,
int
all
,
const
char
*
,
const
char
*
VRT_regsub
(
VRT_CTX
,
int
all
,
const
char
*
,
void
*
,
const
char
*
);
void
*
,
const
char
*
);
void
VRT_ban_string
(
const
struct
vrt_ctx
*
,
const
char
*
);
void
VRT_ban_string
(
VRT_CTX
,
const
char
*
);
void
VRT_purge
(
const
struct
vrt_ctx
*
,
double
ttl
,
double
grace
,
double
keep
);
void
VRT_purge
(
VRT_CTX
,
double
ttl
,
double
grace
,
double
keep
);
void
VRT_count
(
const
struct
vrt_ctx
*
,
unsigned
);
void
VRT_count
(
VRT_CTX
,
unsigned
);
int
VRT_rewrite
(
const
char
*
,
const
char
*
);
int
VRT_rewrite
(
const
char
*
,
const
char
*
);
void
VRT_error
(
const
struct
vrt_ctx
*
,
unsigned
,
const
char
*
);
void
VRT_error
(
VRT_CTX
,
unsigned
,
const
char
*
);
int
VRT_switch_config
(
const
char
*
);
int
VRT_switch_config
(
const
char
*
);
char
*
VRT_GetHdr
(
const
struct
vrt_ctx
*
,
const
struct
gethdr_s
*
);
char
*
VRT_GetHdr
(
VRT_CTX
,
const
struct
gethdr_s
*
);
void
VRT_SetHdr
(
const
struct
vrt_ctx
*
,
const
struct
gethdr_s
*
,
void
VRT_SetHdr
(
VRT_CTX
,
const
struct
gethdr_s
*
,
const
char
*
,
...);
const
char
*
,
...);
void
VRT_handling
(
VRT_CTX
,
unsigned
hand
);
void
VRT_handling
(
const
struct
vrt_ctx
*
,
unsigned
hand
);
void
VRT_hashdata
(
const
struct
vrt_ctx
*
,
const
char
*
str
,
...);
void
VRT_hashdata
(
VRT_CTX
,
const
char
*
str
,
...);
/* Simple stuff */
/* Simple stuff */
int
VRT_strcmp
(
const
char
*
s1
,
const
char
*
s2
);
int
VRT_strcmp
(
const
char
*
s1
,
const
char
*
s2
);
void
VRT_memmove
(
void
*
dst
,
const
void
*
src
,
unsigned
len
);
void
VRT_memmove
(
void
*
dst
,
const
void
*
src
,
unsigned
len
);
void
VRT_Rollback
(
const
struct
vrt_ctx
*
,
const
struct
http
*
);
void
VRT_Rollback
(
VRT_CTX
,
const
struct
http
*
);
/* Synthetic pages */
/* Synthetic pages */
void
VRT_synth_page
(
const
struct
vrt_ctx
*
,
const
char
*
,
...);
void
VRT_synth_page
(
VRT_CTX
,
const
char
*
,
...);
/* Backend related */
/* Backend related */
void
VRT_init_dir
(
struct
cli
*
,
struct
director
**
,
int
idx
,
const
void
*
priv
);
void
VRT_init_dir
(
struct
cli
*
,
struct
director
**
,
int
idx
,
const
void
*
priv
);
...
@@ -252,10 +252,10 @@ int VRT_Stv(const char *nm);
...
@@ -252,10 +252,10 @@ int VRT_Stv(const char *nm);
/* Convert things to string */
/* Convert things to string */
char
*
VRT_IP_string
(
const
struct
vrt_ctx
*
,
VCL_IP
);
char
*
VRT_IP_string
(
VRT_CTX
,
VCL_IP
);
char
*
VRT_INT_string
(
const
struct
vrt_ctx
*
,
VCL_INT
);
char
*
VRT_INT_string
(
VRT_CTX
,
VCL_INT
);
char
*
VRT_REAL_string
(
const
struct
vrt_ctx
*
,
VCL_REAL
);
char
*
VRT_REAL_string
(
VRT_CTX
,
VCL_REAL
);
char
*
VRT_TIME_string
(
const
struct
vrt_ctx
*
,
VCL_TIME
);
char
*
VRT_TIME_string
(
VRT_CTX
,
VCL_TIME
);
const
char
*
VRT_BOOL_string
(
VCL_BOOL
);
const
char
*
VRT_BOOL_string
(
VCL_BOOL
);
const
char
*
VRT_BACKEND_string
(
VCL_BACKEND
);
const
char
*
VRT_BACKEND_string
(
VCL_BACKEND
);
const
char
*
VRT_CollectString
(
const
struct
vrt_ctx
*
,
const
char
*
p
,
...);
const
char
*
VRT_CollectString
(
VRT_CTX
,
const
char
*
p
,
...);
lib/libvcc/generate.py
View file @
afbe27c0
...
@@ -915,6 +915,7 @@ file_header(fo)
...
@@ -915,6 +915,7 @@ file_header(fo)
fo
.
write
(
"""
fo
.
write
(
"""
struct vrt_ctx;
struct vrt_ctx;
#define VRT_CTX const struct vrt_ctx *ctx
struct req;
struct req;
struct busyobj;
struct busyobj;
struct ws;
struct ws;
...
@@ -923,7 +924,7 @@ struct worker;
...
@@ -923,7 +924,7 @@ struct worker;
typedef int vcl_init_f(struct cli *);
typedef int vcl_init_f(struct cli *);
typedef void vcl_fini_f(struct cli *);
typedef void vcl_fini_f(struct cli *);
typedef int vcl_func_f(
const struct vrt_ctx *ctx
);
typedef int vcl_func_f(
VRT_CTX
);
"""
)
"""
)
def
tbl40
(
a
,
b
):
def
tbl40
(
a
,
b
):
...
@@ -1057,7 +1058,7 @@ def one_var(nm, spec):
...
@@ -1057,7 +1058,7 @@ def one_var(nm, spec):
fo
.
write
(
'
\t
"VRT_r_
%
s(ctx)",
\n
'
%
cnam
)
fo
.
write
(
'
\t
"VRT_r_
%
s(ctx)",
\n
'
%
cnam
)
if
nm
==
i
[
0
]:
if
nm
==
i
[
0
]:
fh
.
write
(
"VCL_"
+
typ
+
fh
.
write
(
"VCL_"
+
typ
+
" VRT_r_
%
s(
const struct vrt_ctx *
);
\n
"
%
cnam
)
" VRT_r_
%
s(
VRT_CTX
);
\n
"
%
cnam
)
restrict
(
fo
,
spec
[
2
])
restrict
(
fo
,
spec
[
2
])
if
len
(
spec
[
3
])
==
0
:
if
len
(
spec
[
3
])
==
0
:
...
@@ -1070,7 +1071,7 @@ def one_var(nm, spec):
...
@@ -1070,7 +1071,7 @@ def one_var(nm, spec):
fo
.
write
(
'
\t
"VRT_l_
%
s(ctx, ",
\n
'
%
cnam
)
fo
.
write
(
'
\t
"VRT_l_
%
s(ctx, ",
\n
'
%
cnam
)
if
nm
==
i
[
0
]:
if
nm
==
i
[
0
]:
fh
.
write
(
fh
.
write
(
"void VRT_l_
%
s(
const struct vrt_ctx *
, "
%
cnam
)
"void VRT_l_
%
s(
VRT_CTX
, "
%
cnam
)
if
typ
!=
"STRING"
:
if
typ
!=
"STRING"
:
fh
.
write
(
"VCL_"
+
typ
+
");
\n
"
)
fh
.
write
(
"VCL_"
+
typ
+
");
\n
"
)
else
:
else
:
...
...
lib/libvcc/vcc_acl.c
View file @
afbe27c0
...
@@ -354,7 +354,7 @@ vcc_acl_emit(struct vcc *tl, const char *acln, int anon)
...
@@ -354,7 +354,7 @@ vcc_acl_emit(struct vcc *tl, const char *acln, int anon)
Fh
(
tl
,
0
,
"
\n
static int
\n
"
);
Fh
(
tl
,
0
,
"
\n
static int
\n
"
);
Fh
(
tl
,
0
,
Fh
(
tl
,
0
,
"match_acl_%s_%s(
const struct vrt_ctx *ctx
, const VCL_IP p)
\n
"
,
"match_acl_%s_%s(
VRT_CTX
, const VCL_IP p)
\n
"
,
anon
?
"anon"
:
"named"
,
acln
);
anon
?
"anon"
:
"named"
,
acln
);
Fh
(
tl
,
0
,
"{
\n
"
);
Fh
(
tl
,
0
,
"{
\n
"
);
Fh
(
tl
,
0
,
"
\t
const unsigned char *a;
\n
"
);
Fh
(
tl
,
0
,
"
\t
const unsigned char *a;
\n
"
);
...
...
lib/libvcc/vcc_compile.c
View file @
afbe27c0
...
@@ -670,11 +670,11 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
...
@@ -670,11 +670,11 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
for
(
i
=
1
;
i
<
VCL_MET_MAX
;
i
++
)
{
for
(
i
=
1
;
i
<
VCL_MET_MAX
;
i
++
)
{
Fh
(
tl
,
1
,
"
\n
int __match_proto__(vcl_func_f)
\n
"
);
Fh
(
tl
,
1
,
"
\n
int __match_proto__(vcl_func_f)
\n
"
);
Fh
(
tl
,
1
,
Fh
(
tl
,
1
,
"VGC_function_%s(
const struct vrt_ctx *ctx
);
\n
"
,
"VGC_function_%s(
VRT_CTX
);
\n
"
,
method_tab
[
i
].
name
);
method_tab
[
i
].
name
);
Fc
(
tl
,
1
,
"
\n
int __match_proto__(vcl_func_f)
\n
"
);
Fc
(
tl
,
1
,
"
\n
int __match_proto__(vcl_func_f)
\n
"
);
Fc
(
tl
,
1
,
Fc
(
tl
,
1
,
"VGC_function_%s(
const struct vrt_ctx *ctx
)
\n
"
,
"VGC_function_%s(
VRT_CTX
)
\n
"
,
method_tab
[
i
].
name
);
method_tab
[
i
].
name
);
AZ
(
VSB_finish
(
tl
->
fm
[
i
]));
AZ
(
VSB_finish
(
tl
->
fm
[
i
]));
Fc
(
tl
,
1
,
"{
\n
"
);
Fc
(
tl
,
1
,
"{
\n
"
);
...
...
lib/libvcc/vcc_parse.c
View file @
afbe27c0
...
@@ -251,9 +251,9 @@ vcc_ParseFunction(struct vcc *tl)
...
@@ -251,9 +251,9 @@ vcc_ParseFunction(struct vcc *tl)
}
}
tl
->
curproc
=
vcc_AddProc
(
tl
,
tl
->
t
);
tl
->
curproc
=
vcc_AddProc
(
tl
,
tl
->
t
);
Fh
(
tl
,
0
,
"int VGC_function_%.*s "
Fh
(
tl
,
0
,
"int VGC_function_%.*s "
"(
const struct vrt_ctx *ctx
);
\n
"
,
PF
(
tl
->
t
));
"(
VRT_CTX
);
\n
"
,
PF
(
tl
->
t
));
Fc
(
tl
,
1
,
"
\n
int __match_proto__(vcl_func_t)
\n
"
);
Fc
(
tl
,
1
,
"
\n
int __match_proto__(vcl_func_t)
\n
"
);
Fc
(
tl
,
1
,
"VGC_function_%.*s(
const struct vrt_ctx *ctx
)
\n
"
,
Fc
(
tl
,
1
,
"VGC_function_%.*s(
VRT_CTX
)
\n
"
,
PF
(
tl
->
t
));
PF
(
tl
->
t
));
}
}
vcc_NextToken
(
tl
);
vcc_NextToken
(
tl
);
...
...
lib/libvcc/vmodtool.py
View file @
afbe27c0
...
@@ -358,7 +358,7 @@ class Func(object):
...
@@ -358,7 +358,7 @@ class Func(object):
s
=
ctypes
[
self
.
retval
]
+
" vmod_"
+
self
.
cnam
+
"("
s
=
ctypes
[
self
.
retval
]
+
" vmod_"
+
self
.
cnam
+
"("
p
=
""
p
=
""
if
not
fini
:
if
not
fini
:
s
+=
"
const struct vrt_ctx *
"
s
+=
"
VRT_CTX
"
p
=
", "
p
=
", "
if
self
.
pfx
!=
None
:
if
self
.
pfx
!=
None
:
s
+=
p
+
self
.
pfx
s
+=
p
+
self
.
pfx
...
@@ -375,7 +375,7 @@ class Func(object):
...
@@ -375,7 +375,7 @@ class Func(object):
s
+=
" td_"
+
modname
+
"_"
+
self
.
cnam
+
"("
s
+=
" td_"
+
modname
+
"_"
+
self
.
cnam
+
"("
p
=
""
p
=
""
if
not
fini
:
if
not
fini
:
s
+=
"
const struct vrt_ctx *
"
s
+=
"
VRT_CTX
"
p
=
", "
p
=
", "
if
self
.
pfx
!=
None
:
if
self
.
pfx
!=
None
:
s
+=
p
+
self
.
pfx
s
+=
p
+
self
.
pfx
...
@@ -859,7 +859,6 @@ def runmain(inputvcc, outputname="vcc_if"):
...
@@ -859,7 +859,6 @@ def runmain(inputvcc, outputname="vcc_if"):
write_c_file_warning
(
fc
)
write_c_file_warning
(
fc
)
write_c_file_warning
(
fh
)
write_c_file_warning
(
fh
)
fh
.
write
(
'struct vrt_ctx;
\n
'
)
fh
.
write
(
'struct VCL_conf;
\n
'
)
fh
.
write
(
'struct VCL_conf;
\n
'
)
fh
.
write
(
'struct vmod_priv;
\n
'
)
fh
.
write
(
'struct vmod_priv;
\n
'
)
fh
.
write
(
"
\n
"
)
fh
.
write
(
"
\n
"
)
...
...
lib/libvmod_debug/vmod_debug.c
View file @
afbe27c0
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
#include "vcc_if.h"
#include "vcc_if.h"
VCL_VOID
__match_proto__
(
td_debug_panic
)
VCL_VOID
__match_proto__
(
td_debug_panic
)
vmod_panic
(
const
struct
vrt_ctx
*
ctx
,
const
char
*
str
,
...)
vmod_panic
(
VRT_CTX
,
const
char
*
str
,
...)
{
{
va_list
ap
;
va_list
ap
;
const
char
*
b
;
const
char
*
b
;
...
@@ -50,7 +50,7 @@ vmod_panic(const struct vrt_ctx *ctx, const char *str, ...)
...
@@ -50,7 +50,7 @@ vmod_panic(const struct vrt_ctx *ctx, const char *str, ...)
}
}
VCL_STRING
__match_proto__
(
td_debug_author
)
VCL_STRING
__match_proto__
(
td_debug_author
)
vmod_author
(
const
struct
vrt_ctx
*
ctx
,
VCL_ENUM
id
)
vmod_author
(
VRT_CTX
,
VCL_ENUM
id
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -76,7 +76,7 @@ init_function(struct vmod_priv *priv, const struct VCL_conf *cfg)
...
@@ -76,7 +76,7 @@ init_function(struct vmod_priv *priv, const struct VCL_conf *cfg)
}
}
VCL_VOID
__match_proto__
(
td_debug_test_priv_call
)
VCL_VOID
__match_proto__
(
td_debug_test_priv_call
)
vmod_test_priv_call
(
const
struct
vrt_ctx
*
ctx
,
struct
vmod_priv
*
priv
)
vmod_test_priv_call
(
VRT_CTX
,
struct
vmod_priv
*
priv
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -89,7 +89,7 @@ vmod_test_priv_call(const struct vrt_ctx *ctx, struct vmod_priv *priv)
...
@@ -89,7 +89,7 @@ vmod_test_priv_call(const struct vrt_ctx *ctx, struct vmod_priv *priv)
}
}
VCL_VOID
__match_proto__
(
td_debug_test_priv_vcl
)
VCL_VOID
__match_proto__
(
td_debug_test_priv_vcl
)
vmod_test_priv_vcl
(
const
struct
vrt_ctx
*
ctx
,
struct
vmod_priv
*
priv
)
vmod_test_priv_vcl
(
VRT_CTX
,
struct
vmod_priv
*
priv
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -97,7 +97,7 @@ vmod_test_priv_vcl(const struct vrt_ctx *ctx, struct vmod_priv *priv)
...
@@ -97,7 +97,7 @@ vmod_test_priv_vcl(const struct vrt_ctx *ctx, struct vmod_priv *priv)
}
}
VCL_BLOB
VCL_BLOB
vmod_str2blob
(
const
struct
vrt_ctx
*
ctx
,
VCL_STRING
s
)
vmod_str2blob
(
VRT_CTX
,
VCL_STRING
s
)
{
{
struct
vmod_priv
*
p
;
struct
vmod_priv
*
p
;
...
@@ -111,7 +111,7 @@ vmod_str2blob(const struct vrt_ctx *ctx, VCL_STRING s)
...
@@ -111,7 +111,7 @@ vmod_str2blob(const struct vrt_ctx *ctx, VCL_STRING s)
}
}
VCL_STRING
VCL_STRING
vmod_blob2hex
(
const
struct
vrt_ctx
*
ctx
,
VCL_BLOB
b
)
vmod_blob2hex
(
VRT_CTX
,
VCL_BLOB
b
)
{
{
char
*
s
,
*
p
;
char
*
s
,
*
p
;
uint8_t
*
q
;
uint8_t
*
q
;
...
@@ -131,7 +131,7 @@ vmod_blob2hex(const struct vrt_ctx *ctx, VCL_BLOB b)
...
@@ -131,7 +131,7 @@ vmod_blob2hex(const struct vrt_ctx *ctx, VCL_BLOB b)
}
}
VCL_BACKEND
VCL_BACKEND
vmod_no_backend
(
const
struct
vrt_ctx
*
ctx
)
vmod_no_backend
(
VRT_CTX
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -139,7 +139,7 @@ vmod_no_backend(const struct vrt_ctx *ctx)
...
@@ -139,7 +139,7 @@ vmod_no_backend(const struct vrt_ctx *ctx)
}
}
VCL_VOID
__match_proto__
(
td_debug_rot52
)
VCL_VOID
__match_proto__
(
td_debug_rot52
)
vmod_rot52
(
const
struct
vrt_ctx
*
ctx
,
VCL_HTTP
hp
)
vmod_rot52
(
VRT_CTX
,
VCL_HTTP
hp
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
...
lib/libvmod_debug/vmod_debug_obj.c
View file @
afbe27c0
...
@@ -42,7 +42,7 @@ struct vmod_debug_obj {
...
@@ -42,7 +42,7 @@ struct vmod_debug_obj {
};
};
VCL_VOID
VCL_VOID
vmod_obj__init
(
const
struct
vrt_ctx
*
ctx
,
struct
vmod_debug_obj
**
op
,
vmod_obj__init
(
VRT_CTX
,
struct
vmod_debug_obj
**
op
,
const
char
*
vcl_name
,
VCL_STRING
s
)
const
char
*
vcl_name
,
VCL_STRING
s
)
{
{
struct
vmod_debug_obj
*
o
;
struct
vmod_debug_obj
*
o
;
...
@@ -70,7 +70,7 @@ vmod_obj__fini(struct vmod_debug_obj **op)
...
@@ -70,7 +70,7 @@ vmod_obj__fini(struct vmod_debug_obj **op)
}
}
VCL_VOID
__match_proto__
()
VCL_VOID
__match_proto__
()
vmod_obj_enum
(
const
struct
vrt_ctx
*
ctx
,
struct
vmod_debug_obj
*
o
,
VCL_ENUM
e
)
vmod_obj_enum
(
VRT_CTX
,
struct
vmod_debug_obj
*
o
,
VCL_ENUM
e
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -79,7 +79,7 @@ vmod_obj_enum(const struct vrt_ctx *ctx, struct vmod_debug_obj *o, VCL_ENUM e)
...
@@ -79,7 +79,7 @@ vmod_obj_enum(const struct vrt_ctx *ctx, struct vmod_debug_obj *o, VCL_ENUM e)
}
}
VCL_STRING
__match_proto__
()
VCL_STRING
__match_proto__
()
vmod_obj_foo
(
const
struct
vrt_ctx
*
ctx
,
struct
vmod_debug_obj
*
o
,
VCL_STRING
s
)
vmod_obj_foo
(
VRT_CTX
,
struct
vmod_debug_obj
*
o
,
VCL_STRING
s
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -90,7 +90,7 @@ vmod_obj_foo(const struct vrt_ctx *ctx, struct vmod_debug_obj *o, VCL_STRING s)
...
@@ -90,7 +90,7 @@ vmod_obj_foo(const struct vrt_ctx *ctx, struct vmod_debug_obj *o, VCL_STRING s)
}
}
VCL_TIME
__match_proto__
()
VCL_TIME
__match_proto__
()
vmod_obj_date
(
const
struct
vrt_ctx
*
ctx
,
struct
vmod_debug_obj
*
o
)
vmod_obj_date
(
VRT_CTX
,
struct
vmod_debug_obj
*
o
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
...
lib/libvmod_directors/fall_back.c
View file @
afbe27c0
...
@@ -75,7 +75,7 @@ vmod_rr_getfd(const struct director *dir, struct busyobj *bo)
...
@@ -75,7 +75,7 @@ vmod_rr_getfd(const struct director *dir, struct busyobj *bo)
}
}
VCL_VOID
__match_proto__
()
VCL_VOID
__match_proto__
()
vmod_fallback__init
(
const
struct
vrt_ctx
*
ctx
,
vmod_fallback__init
(
VRT_CTX
,
struct
vmod_directors_fallback
**
rrp
,
const
char
*
vcl_name
)
struct
vmod_directors_fallback
**
rrp
,
const
char
*
vcl_name
)
{
{
struct
vmod_directors_fallback
*
rr
;
struct
vmod_directors_fallback
*
rr
;
...
@@ -102,7 +102,7 @@ vmod_fallback__fini(struct vmod_directors_fallback **rrp)
...
@@ -102,7 +102,7 @@ vmod_fallback__fini(struct vmod_directors_fallback **rrp)
}
}
VCL_VOID
__match_proto__
()
VCL_VOID
__match_proto__
()
vmod_fallback_add_backend
(
const
struct
vrt_ctx
*
ctx
,
vmod_fallback_add_backend
(
VRT_CTX
,
struct
vmod_directors_fallback
*
rr
,
VCL_BACKEND
be
)
struct
vmod_directors_fallback
*
rr
,
VCL_BACKEND
be
)
{
{
...
@@ -112,7 +112,7 @@ vmod_fallback_add_backend(const struct vrt_ctx *ctx,
...
@@ -112,7 +112,7 @@ vmod_fallback_add_backend(const struct vrt_ctx *ctx,
}
}
VCL_BACKEND
__match_proto__
()
VCL_BACKEND
__match_proto__
()
vmod_fallback_backend
(
const
struct
vrt_ctx
*
ctx
,
vmod_fallback_backend
(
VRT_CTX
,
struct
vmod_directors_fallback
*
rr
)
struct
vmod_directors_fallback
*
rr
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
...
lib/libvmod_directors/hash.c
View file @
afbe27c0
...
@@ -52,7 +52,7 @@ struct vmod_directors_hash {
...
@@ -52,7 +52,7 @@ struct vmod_directors_hash {
};
};
VCL_VOID
__match_proto__
()
VCL_VOID
__match_proto__
()
vmod_hash__init
(
const
struct
vrt_ctx
*
ctx
,
struct
vmod_directors_hash
**
rrp
,
vmod_hash__init
(
VRT_CTX
,
struct
vmod_directors_hash
**
rrp
,
const
char
*
vcl_name
)
const
char
*
vcl_name
)
{
{
struct
vmod_directors_hash
*
rr
;
struct
vmod_directors_hash
*
rr
;
...
@@ -82,7 +82,7 @@ vmod_hash__fini(struct vmod_directors_hash **rrp)
...
@@ -82,7 +82,7 @@ vmod_hash__fini(struct vmod_directors_hash **rrp)
}
}
VCL_VOID
__match_proto__
()
VCL_VOID
__match_proto__
()
vmod_hash_add_backend
(
const
struct
vrt_ctx
*
ctx
,
vmod_hash_add_backend
(
VRT_CTX
,
struct
vmod_directors_hash
*
rr
,
VCL_BACKEND
be
,
double
w
)
struct
vmod_directors_hash
*
rr
,
VCL_BACKEND
be
,
double
w
)
{
{
...
@@ -93,7 +93,7 @@ vmod_hash_add_backend(const struct vrt_ctx *ctx,
...
@@ -93,7 +93,7 @@ vmod_hash_add_backend(const struct vrt_ctx *ctx,
}
}
VCL_BACKEND
__match_proto__
()
VCL_BACKEND
__match_proto__
()
vmod_hash_backend
(
const
struct
vrt_ctx
*
ctx
,
struct
vmod_directors_hash
*
rr
,
vmod_hash_backend
(
VRT_CTX
,
struct
vmod_directors_hash
*
rr
,
const
char
*
arg
,
...)
const
char
*
arg
,
...)
{
{
struct
SHA256Context
sha_ctx
;
struct
SHA256Context
sha_ctx
;
...
...
lib/libvmod_directors/random.c
View file @
afbe27c0
...
@@ -74,7 +74,7 @@ vmod_rr_getfd(const struct director *dir, struct busyobj *bo)
...
@@ -74,7 +74,7 @@ vmod_rr_getfd(const struct director *dir, struct busyobj *bo)
}
}
VCL_VOID
__match_proto__
()
VCL_VOID
__match_proto__
()
vmod_random__init
(
const
struct
vrt_ctx
*
ctx
,
struct
vmod_directors_random
**
rrp
,
vmod_random__init
(
VRT_CTX
,
struct
vmod_directors_random
**
rrp
,
const
char
*
vcl_name
)
const
char
*
vcl_name
)
{
{
struct
vmod_directors_random
*
rr
;
struct
vmod_directors_random
*
rr
;
...
@@ -101,7 +101,7 @@ vmod_random__fini(struct vmod_directors_random **rrp)
...
@@ -101,7 +101,7 @@ vmod_random__fini(struct vmod_directors_random **rrp)
}
}
VCL_VOID
__match_proto__
()
VCL_VOID
__match_proto__
()
vmod_random_add_backend
(
const
struct
vrt_ctx
*
ctx
,
vmod_random_add_backend
(
VRT_CTX
,
struct
vmod_directors_random
*
rr
,
VCL_BACKEND
be
,
double
w
)
struct
vmod_directors_random
*
rr
,
VCL_BACKEND
be
,
double
w
)
{
{
...
@@ -112,7 +112,7 @@ vmod_random_add_backend(const struct vrt_ctx *ctx,
...
@@ -112,7 +112,7 @@ vmod_random_add_backend(const struct vrt_ctx *ctx,
}
}
VCL_BACKEND
__match_proto__
()
VCL_BACKEND
__match_proto__
()
vmod_random_backend
(
const
struct
vrt_ctx
*
ctx
,
struct
vmod_directors_random
*
rr
)
vmod_random_backend
(
VRT_CTX
,
struct
vmod_directors_random
*
rr
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
rr
,
VMOD_DIRECTORS_RANDOM_MAGIC
);
CHECK_OBJ_NOTNULL
(
rr
,
VMOD_DIRECTORS_RANDOM_MAGIC
);
...
...
lib/libvmod_directors/round_robin.c
View file @
afbe27c0
...
@@ -78,7 +78,7 @@ vmod_rr_getfd(const struct director *dir, struct busyobj *bo)
...
@@ -78,7 +78,7 @@ vmod_rr_getfd(const struct director *dir, struct busyobj *bo)
}
}
VCL_VOID
__match_proto__
()
VCL_VOID
__match_proto__
()
vmod_round_robin__init
(
const
struct
vrt_ctx
*
ctx
,
vmod_round_robin__init
(
VRT_CTX
,
struct
vmod_directors_round_robin
**
rrp
,
const
char
*
vcl_name
)
struct
vmod_directors_round_robin
**
rrp
,
const
char
*
vcl_name
)
{
{
struct
vmod_directors_round_robin
*
rr
;
struct
vmod_directors_round_robin
*
rr
;
...
@@ -105,7 +105,7 @@ vmod_round_robin__fini(struct vmod_directors_round_robin **rrp)
...
@@ -105,7 +105,7 @@ vmod_round_robin__fini(struct vmod_directors_round_robin **rrp)
}
}
VCL_VOID
__match_proto__
()
VCL_VOID
__match_proto__
()
vmod_round_robin_add_backend
(
const
struct
vrt_ctx
*
ctx
,
vmod_round_robin_add_backend
(
VRT_CTX
,
struct
vmod_directors_round_robin
*
rr
,
VCL_BACKEND
be
)
struct
vmod_directors_round_robin
*
rr
,
VCL_BACKEND
be
)
{
{
...
@@ -115,7 +115,7 @@ vmod_round_robin_add_backend(const struct vrt_ctx *ctx,
...
@@ -115,7 +115,7 @@ vmod_round_robin_add_backend(const struct vrt_ctx *ctx,
}
}
VCL_BACKEND
__match_proto__
()
VCL_BACKEND
__match_proto__
()
vmod_round_robin_backend
(
const
struct
vrt_ctx
*
ctx
,
vmod_round_robin_backend
(
VRT_CTX
,
struct
vmod_directors_round_robin
*
rr
)
struct
vmod_directors_round_robin
*
rr
)
{
{
...
...
lib/libvmod_std/vmod_std.c
View file @
afbe27c0
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
#include "vcc_if.h"
#include "vcc_if.h"
VCL_VOID
__match_proto__
(
td_std_set_ip_tos
)
VCL_VOID
__match_proto__
(
td_std_set_ip_tos
)
vmod_set_ip_tos
(
const
struct
vrt_ctx
*
ctx
,
VCL_INT
tos
)
vmod_set_ip_tos
(
VRT_CTX
,
VCL_INT
tos
)
{
{
int
itos
=
tos
;
int
itos
=
tos
;
...
@@ -59,7 +59,7 @@ vmod_set_ip_tos(const struct vrt_ctx *ctx, VCL_INT tos)
...
@@ -59,7 +59,7 @@ vmod_set_ip_tos(const struct vrt_ctx *ctx, VCL_INT tos)
}
}
static
const
char
*
static
const
char
*
vmod_updown
(
const
struct
vrt_ctx
*
ctx
,
int
up
,
const
char
*
s
,
va_list
ap
)
vmod_updown
(
VRT_CTX
,
int
up
,
const
char
*
s
,
va_list
ap
)
{
{
unsigned
u
;
unsigned
u
;
char
*
b
,
*
e
;
char
*
b
,
*
e
;
...
@@ -95,7 +95,7 @@ vmod_updown(const struct vrt_ctx *ctx, int up, const char *s, va_list ap)
...
@@ -95,7 +95,7 @@ vmod_updown(const struct vrt_ctx *ctx, int up, const char *s, va_list ap)
}
}
VCL_STRING
__match_proto__
(
td_std_toupper
)
VCL_STRING
__match_proto__
(
td_std_toupper
)
vmod_toupper
(
const
struct
vrt_ctx
*
ctx
,
const
char
*
s
,
...)
vmod_toupper
(
VRT_CTX
,
const
char
*
s
,
...)
{
{
const
char
*
p
;
const
char
*
p
;
va_list
ap
;
va_list
ap
;
...
@@ -108,7 +108,7 @@ vmod_toupper(const struct vrt_ctx *ctx, const char *s, ...)
...
@@ -108,7 +108,7 @@ vmod_toupper(const struct vrt_ctx *ctx, const char *s, ...)
}
}
VCL_STRING
__match_proto__
(
td_std_tolower
)
VCL_STRING
__match_proto__
(
td_std_tolower
)
vmod_tolower
(
const
struct
vrt_ctx
*
ctx
,
const
char
*
s
,
...)
vmod_tolower
(
VRT_CTX
,
const
char
*
s
,
...)
{
{
const
char
*
p
;
const
char
*
p
;
va_list
ap
;
va_list
ap
;
...
@@ -121,7 +121,7 @@ vmod_tolower(const struct vrt_ctx *ctx, const char *s, ...)
...
@@ -121,7 +121,7 @@ vmod_tolower(const struct vrt_ctx *ctx, const char *s, ...)
}
}
VCL_REAL
__match_proto__
(
td_std_random
)
VCL_REAL
__match_proto__
(
td_std_random
)
vmod_random
(
const
struct
vrt_ctx
*
ctx
,
VCL_REAL
lo
,
VCL_REAL
hi
)
vmod_random
(
VRT_CTX
,
VCL_REAL
lo
,
VCL_REAL
hi
)
{
{
double
a
;
double
a
;
...
@@ -133,7 +133,7 @@ vmod_random(const struct vrt_ctx *ctx, VCL_REAL lo, VCL_REAL hi)
...
@@ -133,7 +133,7 @@ vmod_random(const struct vrt_ctx *ctx, VCL_REAL lo, VCL_REAL hi)
}
}
VCL_VOID
__match_proto__
(
td_std_log
)
VCL_VOID
__match_proto__
(
td_std_log
)
vmod_log
(
const
struct
vrt_ctx
*
ctx
,
const
char
*
fmt
,
...)
vmod_log
(
VRT_CTX
,
const
char
*
fmt
,
...)
{
{
unsigned
u
;
unsigned
u
;
va_list
ap
;
va_list
ap
;
...
@@ -154,7 +154,7 @@ vmod_log(const struct vrt_ctx *ctx, const char *fmt, ...)
...
@@ -154,7 +154,7 @@ vmod_log(const struct vrt_ctx *ctx, const char *fmt, ...)
}
}
VCL_VOID
__match_proto__
(
td_std_syslog
)
VCL_VOID
__match_proto__
(
td_std_syslog
)
vmod_syslog
(
const
struct
vrt_ctx
*
ctx
,
VCL_INT
fac
,
const
char
*
fmt
,
...)
vmod_syslog
(
VRT_CTX
,
VCL_INT
fac
,
const
char
*
fmt
,
...)
{
{
unsigned
u
;
unsigned
u
;
va_list
ap
;
va_list
ap
;
...
@@ -172,7 +172,7 @@ vmod_syslog(const struct vrt_ctx *ctx, VCL_INT fac, const char *fmt, ...)
...
@@ -172,7 +172,7 @@ vmod_syslog(const struct vrt_ctx *ctx, VCL_INT fac, const char *fmt, ...)
}
}
VCL_VOID
__match_proto__
(
td_std_collect
)
VCL_VOID
__match_proto__
(
td_std_collect
)
vmod_collect
(
const
struct
vrt_ctx
*
ctx
,
VCL_HEADER
hdr
)
vmod_collect
(
VRT_CTX
,
VCL_HEADER
hdr
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -187,7 +187,7 @@ vmod_collect(const struct vrt_ctx *ctx, VCL_HEADER hdr)
...
@@ -187,7 +187,7 @@ vmod_collect(const struct vrt_ctx *ctx, VCL_HEADER hdr)
}
}
VCL_BOOL
__match_proto__
(
td_std_healthy
)
VCL_BOOL
__match_proto__
(
td_std_healthy
)
vmod_healthy
(
const
struct
vrt_ctx
*
ctx
,
VCL_BACKEND
be
)
vmod_healthy
(
VRT_CTX
,
VCL_BACKEND
be
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
if
(
be
==
NULL
)
if
(
be
==
NULL
)
...
@@ -197,7 +197,7 @@ vmod_healthy(const struct vrt_ctx *ctx, VCL_BACKEND be)
...
@@ -197,7 +197,7 @@ vmod_healthy(const struct vrt_ctx *ctx, VCL_BACKEND be)
}
}
VCL_INT
__match_proto__
(
td_std_port
)
VCL_INT
__match_proto__
(
td_std_port
)
vmod_port
(
const
struct
vrt_ctx
*
ctx
,
VCL_IP
ip
)
vmod_port
(
VRT_CTX
,
VCL_IP
ip
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
if
(
ip
==
NULL
)
if
(
ip
==
NULL
)
...
@@ -206,13 +206,13 @@ vmod_port(const struct vrt_ctx *ctx, VCL_IP ip)
...
@@ -206,13 +206,13 @@ vmod_port(const struct vrt_ctx *ctx, VCL_IP ip)
}
}
VCL_VOID
__match_proto__
(
td_std_rollback
)
VCL_VOID
__match_proto__
(
td_std_rollback
)
vmod_rollback
(
const
struct
vrt_ctx
*
ctx
,
VCL_HTTP
hp
)
vmod_rollback
(
VRT_CTX
,
VCL_HTTP
hp
)
{
{
VRT_Rollback
(
ctx
,
hp
);
VRT_Rollback
(
ctx
,
hp
);
}
}
VCL_VOID
__match_proto__
(
td_std_timestamp
)
VCL_VOID
__match_proto__
(
td_std_timestamp
)
vmod_timestamp
(
const
struct
vrt_ctx
*
ctx
,
VCL_STRING
label
)
vmod_timestamp
(
VRT_CTX
,
VCL_STRING
label
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -232,7 +232,7 @@ vmod_timestamp(const struct vrt_ctx *ctx, VCL_STRING label)
...
@@ -232,7 +232,7 @@ vmod_timestamp(const struct vrt_ctx *ctx, VCL_STRING label)
}
}
VCL_STRING
__match_proto__
(
td_std_strstr
)
VCL_STRING
__match_proto__
(
td_std_strstr
)
vmod_strstr
(
const
struct
vrt_ctx
*
ctx
,
VCL_STRING
mstr
,
VCL_STRING
msubstr
)
vmod_strstr
(
VRT_CTX
,
VCL_STRING
mstr
,
VCL_STRING
msubstr
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -243,7 +243,7 @@ vmod_strstr(const struct vrt_ctx *ctx, VCL_STRING mstr, VCL_STRING msubstr)
...
@@ -243,7 +243,7 @@ vmod_strstr(const struct vrt_ctx *ctx, VCL_STRING mstr, VCL_STRING msubstr)
}
}
VCL_VOID
__match_proto__
(
td_std_cache_req_body
)
VCL_VOID
__match_proto__
(
td_std_cache_req_body
)
vmod_cache_req_body
(
const
struct
vrt_ctx
*
ctx
,
VCL_BYTES
size
)
vmod_cache_req_body
(
VRT_CTX
,
VCL_BYTES
size
)
{
{
int
result
;
int
result
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
...
lib/libvmod_std/vmod_std_conversions.c
View file @
afbe27c0
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
#include "vcc_if.h"
#include "vcc_if.h"
VCL_DURATION
__match_proto__
(
td_std_duration
)
VCL_DURATION
__match_proto__
(
td_std_duration
)
vmod_duration
(
const
struct
vrt_ctx
*
ctx
,
VCL_STRING
p
,
VCL_DURATION
d
)
vmod_duration
(
VRT_CTX
,
VCL_STRING
p
,
VCL_DURATION
d
)
{
{
char
*
e
;
char
*
e
;
double
r
;
double
r
;
...
@@ -102,7 +102,7 @@ vmod_duration(const struct vrt_ctx *ctx, VCL_STRING p, VCL_DURATION d)
...
@@ -102,7 +102,7 @@ vmod_duration(const struct vrt_ctx *ctx, VCL_STRING p, VCL_DURATION d)
}
}
VCL_INT
__match_proto__
(
td_std_integer
)
VCL_INT
__match_proto__
(
td_std_integer
)
vmod_integer
(
const
struct
vrt_ctx
*
ctx
,
VCL_STRING
p
,
VCL_INT
i
)
vmod_integer
(
VRT_CTX
,
VCL_STRING
p
,
VCL_INT
i
)
{
{
char
*
e
;
char
*
e
;
long
r
;
long
r
;
...
@@ -129,7 +129,7 @@ vmod_integer(const struct vrt_ctx *ctx, VCL_STRING p, VCL_INT i)
...
@@ -129,7 +129,7 @@ vmod_integer(const struct vrt_ctx *ctx, VCL_STRING p, VCL_INT i)
}
}
VCL_IP
VCL_IP
vmod_ip
(
const
struct
vrt_ctx
*
ctx
,
VCL_STRING
s
,
VCL_IP
d
)
vmod_ip
(
VRT_CTX
,
VCL_STRING
s
,
VCL_IP
d
)
{
{
struct
addrinfo
hints
,
*
res0
=
NULL
;
struct
addrinfo
hints
,
*
res0
=
NULL
;
const
struct
addrinfo
*
res
;
const
struct
addrinfo
*
res
;
...
@@ -168,7 +168,7 @@ vmod_ip(const struct vrt_ctx *ctx, VCL_STRING s, VCL_IP d)
...
@@ -168,7 +168,7 @@ vmod_ip(const struct vrt_ctx *ctx, VCL_STRING s, VCL_IP d)
}
}
VCL_REAL
__match_proto__
(
td_std_real
)
VCL_REAL
__match_proto__
(
td_std_real
)
vmod_real
(
const
struct
vrt_ctx
*
ctx
,
VCL_STRING
p
,
VCL_REAL
d
)
vmod_real
(
VRT_CTX
,
VCL_STRING
p
,
VCL_REAL
d
)
{
{
char
*
e
;
char
*
e
;
double
r
;
double
r
;
...
@@ -198,7 +198,7 @@ vmod_real(const struct vrt_ctx *ctx, VCL_STRING p, VCL_REAL d)
...
@@ -198,7 +198,7 @@ vmod_real(const struct vrt_ctx *ctx, VCL_STRING p, VCL_REAL d)
}
}
VCL_TIME
__match_proto__
(
td_std_real2time
)
VCL_TIME
__match_proto__
(
td_std_real2time
)
vmod_real2time
(
const
struct
vrt_ctx
*
ctx
,
VCL_REAL
r
)
vmod_real2time
(
VRT_CTX
,
VCL_REAL
r
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -206,7 +206,7 @@ vmod_real2time(const struct vrt_ctx *ctx, VCL_REAL r)
...
@@ -206,7 +206,7 @@ vmod_real2time(const struct vrt_ctx *ctx, VCL_REAL r)
}
}
VCL_INT
__match_proto__
(
td_std_time2integer
)
VCL_INT
__match_proto__
(
td_std_time2integer
)
vmod_time2integer
(
const
struct
vrt_ctx
*
ctx
,
VCL_TIME
t
)
vmod_time2integer
(
VRT_CTX
,
VCL_TIME
t
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
@@ -214,7 +214,7 @@ vmod_time2integer(const struct vrt_ctx *ctx, VCL_TIME t)
...
@@ -214,7 +214,7 @@ vmod_time2integer(const struct vrt_ctx *ctx, VCL_TIME t)
}
}
VCL_REAL
__match_proto__
(
td_std_time2real
)
VCL_REAL
__match_proto__
(
td_std_time2real
)
vmod_time2real
(
const
struct
vrt_ctx
*
ctx
,
VCL_TIME
t
)
vmod_time2real
(
VRT_CTX
,
VCL_TIME
t
)
{
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
...
lib/libvmod_std/vmod_std_fileread.c
View file @
afbe27c0
...
@@ -83,7 +83,7 @@ free_frfile(void *ptr)
...
@@ -83,7 +83,7 @@ free_frfile(void *ptr)
}
}
VCL_STRING
__match_proto__
(
td_std_fileread
)
VCL_STRING
__match_proto__
(
td_std_fileread
)
vmod_fileread
(
const
struct
vrt_ctx
*
ctx
,
struct
vmod_priv
*
priv
,
vmod_fileread
(
VRT_CTX
,
struct
vmod_priv
*
priv
,
VCL_STRING
file_name
)
VCL_STRING
file_name
)
{
{
struct
frfile
*
frf
=
NULL
;
struct
frfile
*
frf
=
NULL
;
...
...
lib/libvmod_std/vmod_std_querysort.c
View file @
afbe27c0
...
@@ -50,7 +50,7 @@ compa(const void *a, const void *b)
...
@@ -50,7 +50,7 @@ compa(const void *a, const void *b)
}
}
VCL_STRING
__match_proto__
(
td_std_querysort
)
VCL_STRING
__match_proto__
(
td_std_querysort
)
vmod_querysort
(
const
struct
vrt_ctx
*
ctx
,
VCL_STRING
url
)
vmod_querysort
(
VRT_CTX
,
VCL_STRING
url
)
{
{
const
char
*
cq
,
*
cu
;
const
char
*
cq
,
*
cu
;
char
*
p
,
*
r
;
char
*
p
,
*
r
;
...
...
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