[4.0] afbe27c Introduce "VRT_CTX" as a shorthand macro for "const struct vrt_ctx *ctx"
Lasse Karstensen
lkarsten at varnish-software.com
Thu Jan 22 16:45:34 CET 2015
commit afbe27c0ef296d8770293ab46aba5fb68bb1a086
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Sep 25 08:50:50 2014 +0000
Introduce "VRT_CTX" as a shorthand macro for "const struct vrt_ctx *ctx"
diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c
index 4ffb51a..cdeba66 100644
--- a/bin/varnishd/cache/cache_vrt.c
+++ b/bin/varnishd/cache/cache_vrt.c
@@ -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);
diff --git a/bin/varnishd/cache/cache_vrt_re.c b/bin/varnishd/cache/cache_vrt_re.c
index fd6353a..0695633 100644
--- a/bin/varnishd/cache/cache_vrt_re.c
+++ b/bin/varnishd/cache/cache_vrt_re.c
@@ -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];
diff --git a/bin/varnishd/cache/cache_vrt_var.c b/bin/varnishd/cache/cache_vrt_var.c
index a5f0bde..45614c8 100644
--- a/bin/varnishd/cache/cache_vrt_var.c
+++ b/bin/varnishd/cache/cache_vrt_var.c
@@ -68,7 +68,7 @@ vrt_do_string(struct http *hp, int fld,
#define VRT_HDR_L(obj, hdr, fld) \
void \
-VRT_l_##obj##_##hdr(const struct vrt_ctx *ctx, const char *p, ...) \
+VRT_l_##obj##_##hdr(VRT_CTX, const char *p, ...) \
{ \
va_list ap; \
\
@@ -80,7 +80,7 @@ VRT_l_##obj##_##hdr(const struct vrt_ctx *ctx, const char *p, ...) \
#define VRT_HDR_R(obj, hdr, fld) \
const char * \
-VRT_r_##obj##_##hdr(const struct vrt_ctx *ctx) \
+VRT_r_##obj##_##hdr(VRT_CTX) \
{ \
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
CHECK_OBJ_NOTNULL(ctx->http_##obj, HTTP_MAGIC); \
@@ -93,7 +93,7 @@ VRT_r_##obj##_##hdr(const struct vrt_ctx *ctx) \
#define VRT_STATUS_L(obj) \
void \
-VRT_l_##obj##_status(const struct vrt_ctx *ctx, long num) \
+VRT_l_##obj##_status(VRT_CTX, long num) \
{ \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
@@ -112,7 +112,7 @@ VRT_l_##obj##_status(const struct vrt_ctx *ctx, long num) \
#define VRT_STATUS_R(obj) \
long \
-VRT_r_##obj##_status(const struct vrt_ctx *ctx) \
+VRT_r_##obj##_status(VRT_CTX) \
{ \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
@@ -148,7 +148,7 @@ VRT_STATUS_R(beresp)
#define VBERESPW0(field)
#define VBERESPW1(field) \
void \
-VRT_l_beresp_##field(const struct vrt_ctx *ctx, unsigned a) \
+VRT_l_beresp_##field(VRT_CTX, unsigned a) \
{ \
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC); \
@@ -158,7 +158,7 @@ VRT_l_beresp_##field(const struct vrt_ctx *ctx, unsigned a) \
#define VBERESPR0(field)
#define VBERESPR1(field) \
unsigned \
-VRT_r_beresp_##field(const struct vrt_ctx *ctx) \
+VRT_r_beresp_##field(VRT_CTX) \
{ \
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC); \
@@ -174,7 +174,7 @@ VRT_r_beresp_##field(const struct vrt_ctx *ctx) \
/*--------------------------------------------------------------------*/
unsigned
-VRT_r_bereq_uncacheable(const struct vrt_ctx *ctx)
+VRT_r_bereq_uncacheable(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC);
@@ -182,7 +182,7 @@ VRT_r_bereq_uncacheable(const struct vrt_ctx *ctx)
}
void
-VRT_l_beresp_uncacheable(const struct vrt_ctx *ctx, unsigned a)
+VRT_l_beresp_uncacheable(VRT_CTX, unsigned a)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC);
@@ -196,7 +196,7 @@ VRT_l_beresp_uncacheable(const struct vrt_ctx *ctx, unsigned a)
}
unsigned
-VRT_r_beresp_uncacheable(const struct vrt_ctx *ctx)
+VRT_r_beresp_uncacheable(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC);
@@ -206,7 +206,7 @@ VRT_r_beresp_uncacheable(const struct vrt_ctx *ctx)
/*--------------------------------------------------------------------*/
const char *
-VRT_r_client_identity(const struct vrt_ctx *ctx)
+VRT_r_client_identity(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -218,7 +218,7 @@ VRT_r_client_identity(const struct vrt_ctx *ctx)
}
void
-VRT_l_client_identity(const struct vrt_ctx *ctx, const char *str, ...)
+VRT_l_client_identity(VRT_CTX, const char *str, ...)
{
va_list ap;
const char *b;
@@ -240,7 +240,7 @@ VRT_l_client_identity(const struct vrt_ctx *ctx, const char *str, ...)
#define BEREQ_TIMEOUT(which) \
void \
-VRT_l_bereq_##which(const struct vrt_ctx *ctx, double num) \
+VRT_l_bereq_##which(VRT_CTX, double num) \
{ \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
@@ -249,7 +249,7 @@ VRT_l_bereq_##which(const struct vrt_ctx *ctx, double num) \
} \
\
double \
-VRT_r_bereq_##which(const struct vrt_ctx *ctx) \
+VRT_r_bereq_##which(VRT_CTX) \
{ \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
@@ -264,7 +264,7 @@ BEREQ_TIMEOUT(between_bytes_timeout)
/*--------------------------------------------------------------------*/
const char *
-VRT_r_beresp_backend_name(const struct vrt_ctx *ctx)
+VRT_r_beresp_backend_name(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -279,7 +279,7 @@ VRT_r_beresp_backend_name(const struct vrt_ctx *ctx)
}
VCL_IP
-VRT_r_beresp_backend_ip(const struct vrt_ctx *ctx)
+VRT_r_beresp_backend_ip(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -294,7 +294,7 @@ VRT_r_beresp_backend_ip(const struct vrt_ctx *ctx)
/*--------------------------------------------------------------------*/
const char *
-VRT_r_beresp_storage_hint(const struct vrt_ctx *ctx)
+VRT_r_beresp_storage_hint(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC);
@@ -305,7 +305,7 @@ VRT_r_beresp_storage_hint(const struct vrt_ctx *ctx)
}
void
-VRT_l_beresp_storage_hint(const struct vrt_ctx *ctx, const char *str, ...)
+VRT_l_beresp_storage_hint(VRT_CTX, const char *str, ...)
{
va_list ap;
const char *b;
@@ -328,7 +328,7 @@ VRT_l_beresp_storage_hint(const struct vrt_ctx *ctx, const char *str, ...)
#define REQ_VAR_L(nm, elem, type,extra) \
\
void \
-VRT_l_req_##nm(const struct vrt_ctx *ctx, type arg) \
+VRT_l_req_##nm(VRT_CTX, type arg) \
{ \
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC); \
@@ -339,7 +339,7 @@ VRT_l_req_##nm(const struct vrt_ctx *ctx, type arg) \
#define REQ_VAR_R(nm, elem, type) \
\
type \
-VRT_r_req_##nm(const struct vrt_ctx *ctx) \
+VRT_r_req_##nm(VRT_CTX) \
{ \
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC); \
@@ -354,7 +354,7 @@ REQ_VAR_R(ttl, d_ttl, double)
/*--------------------------------------------------------------------*/
void
-VRT_l_bereq_backend(const struct vrt_ctx *ctx, struct director *be)
+VRT_l_bereq_backend(VRT_CTX, struct director *be)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -363,7 +363,7 @@ VRT_l_bereq_backend(const struct vrt_ctx *ctx, struct director *be)
}
struct director *
-VRT_r_bereq_backend(const struct vrt_ctx *ctx)
+VRT_r_bereq_backend(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -374,7 +374,7 @@ VRT_r_bereq_backend(const struct vrt_ctx *ctx)
/*--------------------------------------------------------------------*/
void
-VRT_l_req_esi(const struct vrt_ctx *ctx, unsigned process_esi)
+VRT_l_req_esi(VRT_CTX, unsigned process_esi)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -388,7 +388,7 @@ VRT_l_req_esi(const struct vrt_ctx *ctx, unsigned process_esi)
}
unsigned
-VRT_r_req_esi(const struct vrt_ctx *ctx)
+VRT_r_req_esi(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -397,7 +397,7 @@ VRT_r_req_esi(const struct vrt_ctx *ctx)
}
long
-VRT_r_req_esi_level(const struct vrt_ctx *ctx)
+VRT_r_req_esi_level(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -408,7 +408,7 @@ VRT_r_req_esi_level(const struct vrt_ctx *ctx)
/*--------------------------------------------------------------------*/
unsigned
-VRT_r_req_can_gzip(const struct vrt_ctx *ctx)
+VRT_r_req_can_gzip(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -419,7 +419,7 @@ VRT_r_req_can_gzip(const struct vrt_ctx *ctx)
/*--------------------------------------------------------------------*/
long
-VRT_r_req_restarts(const struct vrt_ctx *ctx)
+VRT_r_req_restarts(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -428,7 +428,7 @@ VRT_r_req_restarts(const struct vrt_ctx *ctx)
}
long
-VRT_r_bereq_retries(const struct vrt_ctx *ctx)
+VRT_r_bereq_retries(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -444,7 +444,7 @@ VRT_r_bereq_retries(const struct vrt_ctx *ctx)
#define VRT_DO_EXP_L(which, sexp, fld) \
\
void \
-VRT_l_##which##_##fld(const struct vrt_ctx *ctx, double a) \
+VRT_l_##which##_##fld(VRT_CTX, double a) \
{ \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
@@ -458,7 +458,7 @@ VRT_l_##which##_##fld(const struct vrt_ctx *ctx, double a) \
#define VRT_DO_EXP_R(which, sexp, fld, offset) \
\
double \
-VRT_r_##which##_##fld(const struct vrt_ctx *ctx) \
+VRT_r_##which##_##fld(VRT_CTX) \
{ \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
@@ -484,7 +484,7 @@ VRT_DO_EXP_R(beresp, ctx->bo->exp, keep, 0)
*/
const char *
-VRT_r_req_xid(const struct vrt_ctx *ctx)
+VRT_r_req_xid(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -495,7 +495,7 @@ VRT_r_req_xid(const struct vrt_ctx *ctx)
}
const char *
-VRT_r_bereq_xid(const struct vrt_ctx *ctx)
+VRT_r_bereq_xid(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -509,7 +509,7 @@ VRT_r_bereq_xid(const struct vrt_ctx *ctx)
#define REQ_BOOL(hash_var) \
void \
-VRT_l_req_##hash_var(const struct vrt_ctx *ctx, unsigned val) \
+VRT_l_req_##hash_var(VRT_CTX, unsigned val) \
{ \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
@@ -518,7 +518,7 @@ VRT_l_req_##hash_var(const struct vrt_ctx *ctx, unsigned val) \
} \
\
unsigned \
-VRT_r_req_##hash_var(const struct vrt_ctx *ctx) \
+VRT_r_req_##hash_var(VRT_CTX) \
{ \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
@@ -532,7 +532,7 @@ REQ_BOOL(hash_always_miss)
/*--------------------------------------------------------------------*/
VCL_IP
-VRT_r_client_ip(const struct vrt_ctx *ctx)
+VRT_r_client_ip(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -542,7 +542,7 @@ VRT_r_client_ip(const struct vrt_ctx *ctx)
}
VCL_IP
-VRT_r_server_ip(const struct vrt_ctx *ctx)
+VRT_r_server_ip(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -552,7 +552,7 @@ VRT_r_server_ip(const struct vrt_ctx *ctx)
}
const char*
-VRT_r_server_identity(const struct vrt_ctx *ctx)
+VRT_r_server_identity(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -563,7 +563,7 @@ VRT_r_server_identity(const struct vrt_ctx *ctx)
}
const char*
-VRT_r_server_hostname(const struct vrt_ctx *ctx)
+VRT_r_server_hostname(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -575,7 +575,7 @@ VRT_r_server_hostname(const struct vrt_ctx *ctx)
/*--------------------------------------------------------------------*/
long
-VRT_r_obj_hits(const struct vrt_ctx *ctx)
+VRT_r_obj_hits(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
@@ -585,7 +585,7 @@ VRT_r_obj_hits(const struct vrt_ctx *ctx)
}
unsigned
-VRT_r_obj_uncacheable(const struct vrt_ctx *ctx)
+VRT_r_obj_uncacheable(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -598,7 +598,7 @@ VRT_r_obj_uncacheable(const struct vrt_ctx *ctx)
#define HTTP_VAR(x) \
struct http * \
-VRT_r_##x(const struct vrt_ctx *ctx) \
+VRT_r_##x(VRT_CTX) \
{ \
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
CHECK_OBJ_NOTNULL(ctx->http_##x, HTTP_MAGIC); \
diff --git a/include/vrt.h b/include/vrt.h
index 1c5eea2..e7939aa 100644
--- a/include/vrt.h
+++ b/include/vrt.h
@@ -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, ...);
diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
index 372ef1c..884fe3d 100755
--- a/lib/libvcc/generate.py
+++ b/lib/libvcc/generate.py
@@ -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:
diff --git a/lib/libvcc/vcc_acl.c b/lib/libvcc/vcc_acl.c
index 997ae3c..72dd304 100644
--- a/lib/libvcc/vcc_acl.c
+++ b/lib/libvcc/vcc_acl.c
@@ -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");
diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c
index 4077c1c..7bc4bc2 100644
--- a/lib/libvcc/vcc_compile.c
+++ b/lib/libvcc/vcc_compile.c
@@ -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");
diff --git a/lib/libvcc/vcc_parse.c b/lib/libvcc/vcc_parse.c
index 2b52846..e235090 100644
--- a/lib/libvcc/vcc_parse.c
+++ b/lib/libvcc/vcc_parse.c
@@ -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);
diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
index bf386f3..0fcf148 100755
--- a/lib/libvcc/vmodtool.py
+++ b/lib/libvcc/vmodtool.py
@@ -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")
diff --git a/lib/libvmod_debug/vmod_debug.c b/lib/libvmod_debug/vmod_debug.c
index b952f64..76e5a5f 100644
--- a/lib/libvmod_debug/vmod_debug.c
+++ b/lib/libvmod_debug/vmod_debug.c
@@ -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);
diff --git a/lib/libvmod_debug/vmod_debug_obj.c b/lib/libvmod_debug/vmod_debug_obj.c
index ad24578..91dfa0d 100644
--- a/lib/libvmod_debug/vmod_debug_obj.c
+++ b/lib/libvmod_debug/vmod_debug_obj.c
@@ -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);
diff --git a/lib/libvmod_directors/fall_back.c b/lib/libvmod_directors/fall_back.c
index edec2af..3552116 100644
--- a/lib/libvmod_directors/fall_back.c
+++ b/lib/libvmod_directors/fall_back.c
@@ -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);
diff --git a/lib/libvmod_directors/hash.c b/lib/libvmod_directors/hash.c
index 090039f..6ff2a77 100644
--- a/lib/libvmod_directors/hash.c
+++ b/lib/libvmod_directors/hash.c
@@ -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;
diff --git a/lib/libvmod_directors/random.c b/lib/libvmod_directors/random.c
index c32167e..91a281e 100644
--- a/lib/libvmod_directors/random.c
+++ b/lib/libvmod_directors/random.c
@@ -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);
diff --git a/lib/libvmod_directors/round_robin.c b/lib/libvmod_directors/round_robin.c
index 629bbbf..89e588b 100644
--- a/lib/libvmod_directors/round_robin.c
+++ b/lib/libvmod_directors/round_robin.c
@@ -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)
{
diff --git a/lib/libvmod_std/vmod_std.c b/lib/libvmod_std/vmod_std.c
index ea2a41d..63af0e6 100644
--- a/lib/libvmod_std/vmod_std.c
+++ b/lib/libvmod_std/vmod_std.c
@@ -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);
diff --git a/lib/libvmod_std/vmod_std_conversions.c b/lib/libvmod_std/vmod_std_conversions.c
index 181f9f9..298b7c4 100644
--- a/lib/libvmod_std/vmod_std_conversions.c
+++ b/lib/libvmod_std/vmod_std_conversions.c
@@ -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);
diff --git a/lib/libvmod_std/vmod_std_fileread.c b/lib/libvmod_std/vmod_std_fileread.c
index 4fce9a2..0e37268 100644
--- a/lib/libvmod_std/vmod_std_fileread.c
+++ b/lib/libvmod_std/vmod_std_fileread.c
@@ -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;
diff --git a/lib/libvmod_std/vmod_std_querysort.c b/lib/libvmod_std/vmod_std_querysort.c
index 8f7f93b..6f6a90b 100644
--- a/lib/libvmod_std/vmod_std_querysort.c
+++ b/lib/libvmod_std/vmod_std_querysort.c
@@ -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;
More information about the varnish-commit
mailing list