Commit afbe27c0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Lasse Karstensen

Introduce "VRT_CTX" as a shorthand macro for "const struct vrt_ctx *ctx"

parent 06056e30
......@@ -52,7 +52,7 @@ const void * const vrt_magic_string_unset = &vrt_magic_string_unset;
/*--------------------------------------------------------------------*/
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);
......@@ -69,7 +69,7 @@ VRT_error(const struct vrt_ctx *ctx, unsigned code, const char *reason)
/*--------------------------------------------------------------------*/
void
VRT_count(const struct vrt_ctx *ctx, unsigned u)
VRT_count(VRT_CTX, unsigned u)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
......@@ -81,7 +81,7 @@ VRT_count(const struct vrt_ctx *ctx, unsigned u)
/*--------------------------------------------------------------------*/
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);
......@@ -91,7 +91,7 @@ VRT_acl_log(const struct vrt_ctx *ctx, const char *msg)
/*--------------------------------------------------------------------*/
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;
......@@ -121,7 +121,7 @@ vrt_selecthttp(const struct vrt_ctx *ctx, enum gethdr_e where)
/*--------------------------------------------------------------------*/
char *
VRT_GetHdr(const struct vrt_ctx *ctx, const struct gethdr_s *hs)
VRT_GetHdr(VRT_CTX, const struct gethdr_s *hs)
{
char *p;
struct http *hp;
......@@ -199,7 +199,7 @@ VRT_String(struct ws *ws, const char *h, const char *p, va_list ap)
*/
const char *
VRT_CollectString(const struct vrt_ctx *ctx, const char *p, ...)
VRT_CollectString(VRT_CTX, const char *p, ...)
{
va_list ap;
const char *b;
......@@ -215,7 +215,7 @@ VRT_CollectString(const struct vrt_ctx *ctx, const char *p, ...)
/*--------------------------------------------------------------------*/
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, ...)
{
struct http *hp;
......@@ -245,7 +245,7 @@ VRT_SetHdr(const struct vrt_ctx *ctx , const struct gethdr_s *hs,
/*--------------------------------------------------------------------*/
void
VRT_handling(const struct vrt_ctx *ctx, unsigned hand)
VRT_handling(VRT_CTX, unsigned hand)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
......@@ -258,7 +258,7 @@ VRT_handling(const struct vrt_ctx *ctx, unsigned hand)
*/
void
VRT_hashdata(const struct vrt_ctx *ctx, const char *str, ...)
VRT_hashdata(VRT_CTX, const char *str, ...)
{
va_list ap;
const char *p;
......@@ -285,7 +285,7 @@ VRT_hashdata(const struct vrt_ctx *ctx, const char *str, ...)
/*--------------------------------------------------------------------*/
double
VRT_r_now(const struct vrt_ctx *ctx)
VRT_r_now(VRT_CTX)
{
(void)ctx;
......@@ -295,7 +295,7 @@ VRT_r_now(const struct vrt_ctx *ctx)
/*--------------------------------------------------------------------*/
char *
VRT_IP_string(const struct vrt_ctx *ctx, VCL_IP ip)
VRT_IP_string(VRT_CTX, VCL_IP ip)
{
char *p;
unsigned len;
......@@ -315,7 +315,7 @@ VRT_IP_string(const struct vrt_ctx *ctx, VCL_IP ip)
}
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);
......@@ -323,7 +323,7 @@ VRT_INT_string(const struct vrt_ctx *ctx, long num)
}
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);
......@@ -331,7 +331,7 @@ VRT_REAL_string(const struct vrt_ctx *ctx, double num)
}
char *
VRT_TIME_string(const struct vrt_ctx *ctx, double t)
VRT_TIME_string(VRT_CTX, double t)
{
char *p;
......@@ -361,7 +361,7 @@ VRT_BOOL_string(unsigned val)
/*--------------------------------------------------------------------*/
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);
......@@ -382,7 +382,7 @@ VRT_Rollback(const struct vrt_ctx *ctx, const struct http *hp)
/*--------------------------------------------------------------------*/
void
VRT_synth_page(const struct vrt_ctx *ctx, const char *str, ...)
VRT_synth_page(VRT_CTX, const char *str, ...)
{
va_list ap;
const char *p;
......@@ -412,7 +412,7 @@ VRT_synth_page(const struct vrt_ctx *ctx, const char *str, ...)
/*--------------------------------------------------------------------*/
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 **av;
......@@ -479,7 +479,7 @@ VRT_ban_string(const struct vrt_ctx *ctx, const char *str)
*/
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);
......@@ -497,7 +497,7 @@ VRT_CacheReqBody(const struct vrt_ctx *ctx, long long maxsize)
*/
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);
......
......@@ -62,7 +62,7 @@ VRT_re_fini(void *rep)
}
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;
int i;
......@@ -81,7 +81,7 @@ VRT_re_match(const struct vrt_ctx *ctx, const char *s, void *re)
}
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)
{
int ovector[30];
......
This diff is collapsed.
......@@ -105,6 +105,8 @@ struct vrt_ctx {
double now;
};
#define VRT_CTX const struct vrt_ctx *ctx
/***********************************************************************/
struct vmod_data {
......@@ -186,42 +188,40 @@ struct vrt_ref {
/* ACL related */
#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 */
int VRT_CacheReqBody(const struct vrt_ctx *, long long maxsize);
int VRT_CacheReqBody(VRT_CTX, long long maxsize);
/* Regexp related */
void VRT_re_init(void **, const char *);
void VRT_re_fini(void *);
int VRT_re_match(const struct vrt_ctx *, const char *, void *re);
const char *VRT_regsub(const struct vrt_ctx *, int all, const char *,
void *, const char *);
int VRT_re_match(VRT_CTX, const char *, void *re);
const char *VRT_regsub(VRT_CTX, int all, const char *, void *, const char *);
void VRT_ban_string(const struct vrt_ctx *, const char *);
void VRT_purge(const struct vrt_ctx *, double ttl, double grace, double keep);
void VRT_ban_string(VRT_CTX, const char *);
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 *);
void VRT_error(const struct vrt_ctx *, unsigned, const char *);
void VRT_error(VRT_CTX, unsigned, const char *);
int VRT_switch_config(const char *);
char *VRT_GetHdr(const struct vrt_ctx *, const struct gethdr_s *);
void VRT_SetHdr(const struct vrt_ctx *, const struct gethdr_s *,
const char *, ...);
void VRT_handling(const struct vrt_ctx *, unsigned hand);
char *VRT_GetHdr(VRT_CTX, const struct gethdr_s *);
void VRT_SetHdr(VRT_CTX, const struct gethdr_s *, const char *, ...);
void VRT_handling(VRT_CTX, unsigned hand);
void VRT_hashdata(const struct vrt_ctx *, const char *str, ...);
void VRT_hashdata(VRT_CTX, const char *str, ...);
/* Simple stuff */
int VRT_strcmp(const char *s1, const char *s2);
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 */
void VRT_synth_page(const struct vrt_ctx *, const char *, ...);
void VRT_synth_page(VRT_CTX, const char *, ...);
/* Backend related */
void VRT_init_dir(struct cli *, struct director **, int idx, const void *priv);
......@@ -252,10 +252,10 @@ int VRT_Stv(const char *nm);
/* Convert things to string */
char *VRT_IP_string(const struct vrt_ctx *, VCL_IP);
char *VRT_INT_string(const struct vrt_ctx *, VCL_INT);
char *VRT_REAL_string(const struct vrt_ctx *, VCL_REAL);
char *VRT_TIME_string(const struct vrt_ctx *, VCL_TIME);
char *VRT_IP_string(VRT_CTX, VCL_IP);
char *VRT_INT_string(VRT_CTX, VCL_INT);
char *VRT_REAL_string(VRT_CTX, VCL_REAL);
char *VRT_TIME_string(VRT_CTX, VCL_TIME);
const char *VRT_BOOL_string(VCL_BOOL);
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, ...);
......@@ -915,6 +915,7 @@ file_header(fo)
fo.write("""
struct vrt_ctx;
#define VRT_CTX const struct vrt_ctx *ctx
struct req;
struct busyobj;
struct ws;
......@@ -923,7 +924,7 @@ struct worker;
typedef int vcl_init_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):
......@@ -1057,7 +1058,7 @@ def one_var(nm, spec):
fo.write('\t "VRT_r_%s(ctx)",\n' % cnam)
if nm == i[0]:
fh.write("VCL_" + typ +
" VRT_r_%s(const struct vrt_ctx *);\n" % cnam )
" VRT_r_%s(VRT_CTX);\n" % cnam )
restrict(fo, spec[2])
if len(spec[3]) == 0:
......@@ -1070,7 +1071,7 @@ def one_var(nm, spec):
fo.write('\t "VRT_l_%s(ctx, ",\n' % cnam)
if nm == i[0]:
fh.write(
"void VRT_l_%s(const struct vrt_ctx *, " % cnam)
"void VRT_l_%s(VRT_CTX, " % cnam)
if typ != "STRING":
fh.write("VCL_" + typ + ");\n")
else:
......
......@@ -354,7 +354,7 @@ vcc_acl_emit(struct vcc *tl, const char *acln, int anon)
Fh(tl, 0, "\nstatic int\n");
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);
Fh(tl, 0, "{\n");
Fh(tl, 0, "\tconst unsigned char *a;\n");
......
......@@ -670,11 +670,11 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
for (i = 1; i < VCL_MET_MAX; i++) {
Fh(tl, 1, "\nint __match_proto__(vcl_func_f)\n");
Fh(tl, 1,
"VGC_function_%s(const struct vrt_ctx *ctx);\n",
"VGC_function_%s(VRT_CTX);\n",
method_tab[i].name);
Fc(tl, 1, "\nint __match_proto__(vcl_func_f)\n");
Fc(tl, 1,
"VGC_function_%s(const struct vrt_ctx *ctx)\n",
"VGC_function_%s(VRT_CTX)\n",
method_tab[i].name);
AZ(VSB_finish(tl->fm[i]));
Fc(tl, 1, "{\n");
......
......@@ -251,9 +251,9 @@ vcc_ParseFunction(struct vcc *tl)
}
tl->curproc = vcc_AddProc(tl, tl->t);
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, "\nint __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));
}
vcc_NextToken(tl);
......
......@@ -358,7 +358,7 @@ class Func(object):
s = ctypes[self.retval] + " vmod_" + self.cnam + "("
p = ""
if not fini:
s += "const struct vrt_ctx *"
s += "VRT_CTX"
p = ", "
if self.pfx != None:
s += p + self.pfx
......@@ -375,7 +375,7 @@ class Func(object):
s += " td_" + modname + "_" + self.cnam + "("
p = ""
if not fini:
s += "const struct vrt_ctx *"
s += "VRT_CTX"
p = ", "
if self.pfx != None:
s += p + self.pfx
......@@ -859,7 +859,6 @@ def runmain(inputvcc, outputname="vcc_if"):
write_c_file_warning(fc)
write_c_file_warning(fh)
fh.write('struct vrt_ctx;\n')
fh.write('struct VCL_conf;\n')
fh.write('struct vmod_priv;\n')
fh.write("\n")
......
......@@ -37,7 +37,7 @@
#include "vcc_if.h"
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;
const char *b;
......@@ -50,7 +50,7 @@ vmod_panic(const struct vrt_ctx *ctx, const char *str, ...)
}
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);
......@@ -76,7 +76,7 @@ init_function(struct vmod_priv *priv, const struct VCL_conf *cfg)
}
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);
......@@ -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)
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);
......@@ -97,7 +97,7 @@ vmod_test_priv_vcl(const struct vrt_ctx *ctx, struct vmod_priv *priv)
}
VCL_BLOB
vmod_str2blob(const struct vrt_ctx *ctx, VCL_STRING s)
vmod_str2blob(VRT_CTX, VCL_STRING s)
{
struct vmod_priv *p;
......@@ -111,7 +111,7 @@ vmod_str2blob(const struct vrt_ctx *ctx, VCL_STRING s)
}
VCL_STRING
vmod_blob2hex(const struct vrt_ctx *ctx, VCL_BLOB b)
vmod_blob2hex(VRT_CTX, VCL_BLOB b)
{
char *s, *p;
uint8_t *q;
......@@ -131,7 +131,7 @@ vmod_blob2hex(const struct vrt_ctx *ctx, VCL_BLOB b)
}
VCL_BACKEND
vmod_no_backend(const struct vrt_ctx *ctx)
vmod_no_backend(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
......@@ -139,7 +139,7 @@ vmod_no_backend(const struct vrt_ctx *ctx)
}
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);
......
......@@ -42,7 +42,7 @@ struct vmod_debug_obj {
};
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)
{
struct vmod_debug_obj *o;
......@@ -70,7 +70,7 @@ vmod_obj__fini(struct vmod_debug_obj **op)
}
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);
......@@ -79,7 +79,7 @@ vmod_obj_enum(const struct vrt_ctx *ctx, struct vmod_debug_obj *o, VCL_ENUM e)
}
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);
......@@ -90,7 +90,7 @@ vmod_obj_foo(const struct vrt_ctx *ctx, struct vmod_debug_obj *o, VCL_STRING s)
}
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);
......
......@@ -75,7 +75,7 @@ vmod_rr_getfd(const struct director *dir, struct busyobj *bo)
}
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 *rr;
......@@ -102,7 +102,7 @@ vmod_fallback__fini(struct vmod_directors_fallback **rrp)
}
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)
{
......@@ -112,7 +112,7 @@ vmod_fallback_add_backend(const struct vrt_ctx *ctx,
}
VCL_BACKEND __match_proto__()
vmod_fallback_backend(const struct vrt_ctx *ctx,
vmod_fallback_backend(VRT_CTX,
struct vmod_directors_fallback *rr)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
......
......@@ -52,7 +52,7 @@ struct vmod_directors_hash {
};
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)
{
struct vmod_directors_hash *rr;
......@@ -82,7 +82,7 @@ vmod_hash__fini(struct vmod_directors_hash **rrp)
}
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)
{
......@@ -93,7 +93,7 @@ vmod_hash_add_backend(const struct vrt_ctx *ctx,
}
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, ...)
{
struct SHA256Context sha_ctx;
......
......@@ -74,7 +74,7 @@ vmod_rr_getfd(const struct director *dir, struct busyobj *bo)
}
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)
{
struct vmod_directors_random *rr;
......@@ -101,7 +101,7 @@ vmod_random__fini(struct vmod_directors_random **rrp)
}
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)
{
......@@ -112,7 +112,7 @@ vmod_random_add_backend(const struct vrt_ctx *ctx,
}
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(rr, VMOD_DIRECTORS_RANDOM_MAGIC);
......
......@@ -78,7 +78,7 @@ vmod_rr_getfd(const struct director *dir, struct busyobj *bo)
}
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 *rr;
......@@ -105,7 +105,7 @@ vmod_round_robin__fini(struct vmod_directors_round_robin **rrp)
}
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)
{
......@@ -115,7 +115,7 @@ vmod_round_robin_add_backend(const struct vrt_ctx *ctx,
}
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)
{
......
......@@ -49,7 +49,7 @@
#include "vcc_if.h"
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;
......@@ -59,7 +59,7 @@ vmod_set_ip_tos(const struct vrt_ctx *ctx, VCL_INT tos)
}
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;
char *b, *e;
......@@ -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)
vmod_toupper(const struct vrt_ctx *ctx, const char *s, ...)
vmod_toupper(VRT_CTX, const char *s, ...)
{
const char *p;
va_list ap;
......@@ -108,7 +108,7 @@ vmod_toupper(const struct vrt_ctx *ctx, const char *s, ...)
}
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;
va_list ap;
......@@ -121,7 +121,7 @@ vmod_tolower(const struct vrt_ctx *ctx, const char *s, ...)
}
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;
......@@ -133,7 +133,7 @@ vmod_random(const struct vrt_ctx *ctx, VCL_REAL lo, VCL_REAL hi)
}
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;
va_list ap;
......@@ -154,7 +154,7 @@ vmod_log(const struct vrt_ctx *ctx, const char *fmt, ...)
}
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;
va_list ap;
......@@ -172,7 +172,7 @@ vmod_syslog(const struct vrt_ctx *ctx, VCL_INT fac, const char *fmt, ...)
}
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);
......@@ -187,7 +187,7 @@ vmod_collect(const struct vrt_ctx *ctx, VCL_HEADER hdr)
}
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);
if (be == NULL)
......@@ -197,7 +197,7 @@ vmod_healthy(const struct vrt_ctx *ctx, VCL_BACKEND be)
}
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);
if (ip == NULL)
......@@ -206,13 +206,13 @@ vmod_port(const struct vrt_ctx *ctx, VCL_IP ip)
}
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);
}
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);
......@@ -232,7 +232,7 @@ vmod_timestamp(const struct vrt_ctx *ctx, VCL_STRING label)
}
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);
......@@ -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)
vmod_cache_req_body(const struct vrt_ctx *ctx, VCL_BYTES size)
vmod_cache_req_body(VRT_CTX, VCL_BYTES size)
{
int result;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
......
......@@ -45,7 +45,7 @@
#include "vcc_if.h"
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;
double r;
......@@ -102,7 +102,7 @@ vmod_duration(const struct vrt_ctx *ctx, VCL_STRING p, VCL_DURATION d)
}
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;
long r;
......@@ -129,7 +129,7 @@ vmod_integer(const struct vrt_ctx *ctx, VCL_STRING p, VCL_INT i)
}
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;
const struct addrinfo *res;
......@@ -168,7 +168,7 @@ vmod_ip(const struct vrt_ctx *ctx, VCL_STRING s, VCL_IP d)
}
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;
double r;
......@@ -198,7 +198,7 @@ vmod_real(const struct vrt_ctx *ctx, VCL_STRING p, VCL_REAL d)
}
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);
......@@ -206,7 +206,7 @@ vmod_real2time(const struct vrt_ctx *ctx, VCL_REAL r)
}
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);
......@@ -214,7 +214,7 @@ vmod_time2integer(const struct vrt_ctx *ctx, VCL_TIME t)
}
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);
......
......@@ -83,7 +83,7 @@ free_frfile(void *ptr)
}
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)
{
struct frfile *frf = NULL;
......
......@@ -50,7 +50,7 @@ compa(const void *a, const void *b)
}
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;
char *p, *r;
......
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