[master] f584202 Introduce "VRT_CTX" as a shorthand macro for "const struct vrt_ctx *ctx"

Poul-Henning Kamp phk at FreeBSD.org
Thu Sep 25 10:51:26 CEST 2014


commit f584202c8a497a597be82954ac0f93a112a5b4b7
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_backend.c b/bin/varnishd/cache/cache_backend.c
index 7c25563..845da6a 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -517,7 +517,7 @@ vdi_simple_finish(const struct director *d, struct worker *wrk,
 /*--------------------------------------------------------------------*/
 
 void
-VRT_fini_dir(const struct vrt_ctx *ctx, struct director *d)
+VRT_fini_dir(VRT_CTX, struct director *d)
 {
 	struct vdi_simple *vs;
 
@@ -534,7 +534,7 @@ VRT_fini_dir(const struct vrt_ctx *ctx, struct director *d)
 }
 
 void
-VRT_init_dir(const struct vrt_ctx *ctx, struct director **bp, int idx,
+VRT_init_dir(VRT_CTX, struct director **bp, int idx,
     const void *priv)
 {
 	const struct vrt_backend *t;
diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c
index 8422f79..b45cdf9 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;
 
@@ -118,7 +118,7 @@ vrt_selecthttp(const struct vrt_ctx *ctx, enum gethdr_e where)
 /*--------------------------------------------------------------------*/
 
 const 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;
@@ -202,7 +202,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;
@@ -218,7 +218,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;
@@ -248,7 +248,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);
@@ -261,7 +261,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;
@@ -288,7 +288,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;
@@ -298,7 +298,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;
@@ -318,7 +318,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);
@@ -326,7 +326,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);
@@ -334,7 +334,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;
 
@@ -364,7 +364,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);
@@ -385,7 +385,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;
@@ -415,7 +415,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;
@@ -482,7 +482,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);
@@ -500,7 +500,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 d0ecb78..d198d1f 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 0679086..ff49d3a 100644
--- a/bin/varnishd/cache/cache_vrt_var.c
+++ b/bin/varnishd/cache/cache_vrt_var.c
@@ -68,7 +68,7 @@ vrt_do_string(const 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);				\
@@ -142,7 +142,7 @@ VRT_STATUS_R(beresp)
  */
 
 long
-VRT_r_obj_status(const struct vrt_ctx *ctx)
+VRT_r_obj_status(VRT_CTX)
 {
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
@@ -152,7 +152,7 @@ VRT_r_obj_status(const struct vrt_ctx *ctx)
 }
 
 const char *
-VRT_r_obj_proto(const struct vrt_ctx *ctx)
+VRT_r_obj_proto(VRT_CTX)
 {
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
@@ -162,7 +162,7 @@ VRT_r_obj_proto(const struct vrt_ctx *ctx)
 }
 
 const char *
-VRT_r_obj_reason(const struct vrt_ctx *ctx)
+VRT_r_obj_reason(VRT_CTX)
 {
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
@@ -178,7 +178,7 @@ VRT_r_obj_reason(const struct vrt_ctx *ctx)
 #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);			\
@@ -188,7 +188,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);			\
@@ -204,7 +204,7 @@ VRT_r_beresp_##field(const struct vrt_ctx *ctx)				\
 /*--------------------------------------------------------------------*/
 
 void
-VRT_l_bereq_uncacheable(const struct vrt_ctx *ctx, unsigned a)
+VRT_l_bereq_uncacheable(VRT_CTX, unsigned a)
 {
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC);
@@ -218,7 +218,7 @@ VRT_l_bereq_uncacheable(const struct vrt_ctx *ctx, unsigned a)
 }
 
 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);
@@ -226,7 +226,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);
@@ -240,7 +240,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);
@@ -250,7 +250,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);
@@ -262,7 +262,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;
@@ -284,7 +284,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);			\
@@ -293,7 +293,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);			\
@@ -308,7 +308,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);
@@ -319,7 +319,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);
@@ -334,7 +334,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);
@@ -345,7 +345,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;
@@ -368,7 +368,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);				\
@@ -379,7 +379,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);				\
@@ -394,7 +394,7 @@ REQ_VAR_R(ttl, d_ttl, double)
 /*--------------------------------------------------------------------*/
 
 void
-VRT_l_bereq_backend(const struct vrt_ctx *ctx, const struct director *be)
+VRT_l_bereq_backend(VRT_CTX, const struct director *be)
 {
 
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -403,7 +403,7 @@ VRT_l_bereq_backend(const struct vrt_ctx *ctx, const struct director *be)
 }
 
 const struct director *
-VRT_r_bereq_backend(const struct vrt_ctx *ctx)
+VRT_r_bereq_backend(VRT_CTX)
 {
 
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -412,7 +412,7 @@ VRT_r_bereq_backend(const struct vrt_ctx *ctx)
 }
 
 const struct director *
-VRT_r_beresp_backend(const struct vrt_ctx *ctx)
+VRT_r_beresp_backend(VRT_CTX)
 {
 
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -423,7 +423,7 @@ VRT_r_beresp_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);
@@ -437,7 +437,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);
@@ -446,7 +446,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);
@@ -457,7 +457,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);
@@ -468,7 +468,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);
@@ -477,7 +477,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);
@@ -498,7 +498,7 @@ VRT_r_bereq_retries(const struct vrt_ctx *ctx)
 #define VRT_DO_EXP_L(which, sexp, fld, offset)			\
 								\
 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);			\
@@ -513,7 +513,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)		\
 {								\
 	double d;						\
 								\
@@ -545,7 +545,7 @@ VRT_DO_EXP_R(beresp, ctx->bo->fetch_objcore->exp, keep, 0)
 #define VRT_DO_AGE_R(which, sexp)				\
 								\
 double								\
-VRT_r_##which##_##age(const struct vrt_ctx *ctx)		\
+VRT_r_##which##_##age(VRT_CTX)		\
 {								\
 								\
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);			\
@@ -560,7 +560,7 @@ VRT_DO_AGE_R(beresp, ctx->bo->fetch_objcore->exp)
  */
 
 const char *
-VRT_r_req_xid(const struct vrt_ctx *ctx)
+VRT_r_req_xid(VRT_CTX)
 {
 
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
@@ -570,7 +570,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);
@@ -583,7 +583,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);			\
@@ -592,7 +592,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);			\
@@ -606,7 +606,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);
@@ -616,7 +616,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);
@@ -626,7 +626,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);
@@ -637,7 +637,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);
@@ -649,7 +649,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);
@@ -659,7 +659,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);
@@ -672,7 +672,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/bin/varnishd/cache/cache_vrt_vmod.c b/bin/varnishd/cache/cache_vrt_vmod.c
index b1aef3e..2c393b7 100644
--- a/bin/varnishd/cache/cache_vrt_vmod.c
+++ b/bin/varnishd/cache/cache_vrt_vmod.c
@@ -63,7 +63,7 @@ static VTAILQ_HEAD(,vmod)	vmods = VTAILQ_HEAD_INITIALIZER(vmods);
 
 int
 VRT_Vmod_Init(void **hdl, void *ptr, int len, const char *nm,
-    const char *path, const char *file_id, const struct vrt_ctx *ctx)
+    const char *path, const char *file_id, VRT_CTX)
 {
 	struct vmod *v;
 	const struct vmod_data *d;
diff --git a/include/vrt.h b/include/vrt.h
index 2d9a6be..3e21a5f 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,54 +188,51 @@ 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 *);
 
-const 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);
+const 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(const struct vrt_ctx*, struct director **, int idx,
-    const void *priv);
-void VRT_fini_dir(const struct vrt_ctx*, struct director *);
+void VRT_init_dir(VRT_CTX, struct director **, int idx, const void *priv);
+void VRT_fini_dir(VRT_CTX, struct director *);
 
 /* Suckaddr related */
 int VRT_VSA_GetPtr(const struct suckaddr *sua, const unsigned char ** dst);
 
 /* VMOD/Modules related */
 int VRT_Vmod_Init(void **hdl, void *ptr, int len, const char *nm,
-    const char *path, const char *file_id, const struct vrt_ctx *ctx);
+    const char *path, const char *file_id, VRT_CTX);
 void VRT_Vmod_Fini(void **hdl);
 
 struct vmod_priv;
@@ -253,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 962f89c..c82ae0e 100755
--- a/lib/libvcc/generate.py
+++ b/lib/libvcc/generate.py
@@ -923,15 +923,16 @@ file_header(fo)
 
 fo.write("""
 struct vrt_ctx;
+#define VRT_CTX const struct vrt_ctx *ctx
 struct req;
 struct busyobj;
 struct ws;
 struct cli;
 struct worker;
 
-typedef int vcl_init_f(const struct vrt_ctx *ctx);
-typedef void vcl_fini_f(const struct vrt_ctx *ctx);
-typedef int vcl_func_f(const struct vrt_ctx *ctx);
+typedef int vcl_init_f(VRT_CTX);
+typedef void vcl_fini_f(VRT_CTX);
+typedef int vcl_func_f(VRT_CTX);
 """)
 
 def tbl40(a, b):
@@ -1065,7 +1066,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:
@@ -1078,7 +1079,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 9085e2c..237a07c 100644
--- a/lib/libvcc/vcc_compile.c
+++ b/lib/libvcc/vcc_compile.c
@@ -302,7 +302,7 @@ EmitInitFunc(const struct vcc *tl)
 {
 	struct inifin *p;
 
-	Fc(tl, 0, "\nstatic int\nVGC_Init(const struct vrt_ctx *ctx)\n{\n\n");
+	Fc(tl, 0, "\nstatic int\nVGC_Init(VRT_CTX)\n{\n\n");
 	VTAILQ_FOREACH(p, &tl->inifin, list) {
 		AZ(VSB_finish(p->ini));
 		if (VSB_len(p->ini))
@@ -319,7 +319,7 @@ EmitFiniFunc(const struct vcc *tl)
 {
 	struct inifin *p;
 
-	Fc(tl, 0, "\nstatic void\nVGC_Fini(const struct vrt_ctx *ctx)\n{\n\n");
+	Fc(tl, 0, "\nstatic void\nVGC_Fini(VRT_CTX)\n{\n\n");
 
 	VTAILQ_FOREACH_REVERSE(p, &tl->inifin, inifinhead, list) {
 		AZ(VSB_finish(p->fin));
@@ -671,11 +671,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 dab1131..9412a58 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 96fa347..6ad9504 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
@@ -377,7 +377,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
@@ -861,7 +861,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 a721617..a317e46 100644
--- a/lib/libvmod_directors/fall_back.c
+++ b/lib/libvmod_directors/fall_back.c
@@ -79,7 +79,7 @@ vmod_fallback_resolve(const struct director *dir, struct worker *wrk,
 }
 
 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;
@@ -107,7 +107,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)
 {
 
@@ -117,7 +117,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 0e7c0a4..d83b840 100644
--- a/lib/libvmod_directors/random.c
+++ b/lib/libvmod_directors/random.c
@@ -77,7 +77,7 @@ vmod_random_resolve(const struct director *dir, struct worker *wrk,
 }
 
 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;
@@ -108,7 +108,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)
 {
 
@@ -119,7 +119,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 a8fba65..1f7d9e8 100644
--- a/lib/libvmod_directors/round_robin.c
+++ b/lib/libvmod_directors/round_robin.c
@@ -82,7 +82,7 @@ vmod_rr_resolve(const struct director *dir, struct worker *wrk,
 }
 
 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;
@@ -109,7 +109,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)
 {
 
@@ -119,7 +119,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 ad0066a..a5aec9d 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_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);
@@ -241,7 +241,7 @@ vmod_cache_req_body(const struct vrt_ctx *ctx, VCL_BYTES size)
 }
 
 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);
 
diff --git a/lib/libvmod_std/vmod_std_conversions.c b/lib/libvmod_std/vmod_std_conversions.c
index cdcd3cb..d050f43 100644
--- a/lib/libvmod_std/vmod_std_conversions.c
+++ b/lib/libvmod_std/vmod_std_conversions.c
@@ -44,7 +44,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;
@@ -101,7 +101,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;
@@ -128,7 +128,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;
@@ -167,7 +167,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;
@@ -197,7 +197,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);
 
@@ -205,7 +205,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);
 
@@ -213,7 +213,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