[master] fa7b4f2 Use the new VCL_* typedefs.

Poul-Henning Kamp phk at varnish-cache.org
Fri Oct 19 13:04:47 CEST 2012


commit fa7b4f2b33e8f50f24cc5d0c214f4e3c32c99dbc
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Oct 19 11:04:31 2012 +0000

    Use the new VCL_* typedefs.

diff --git a/lib/libvcl/vmodtool.py b/lib/libvcl/vmodtool.py
index 56e361b..d5681ee 100755
--- a/lib/libvcl/vmodtool.py
+++ b/lib/libvcl/vmodtool.py
@@ -46,20 +46,20 @@ else:
 	specfile = "vmod.vcc"
 
 ctypes = {
-	'IP':		"struct sockaddr_storage *",
-	'STRING':	"const char *",
-	'STRING_LIST':	"const char *, ...",
-	'BOOL':		"unsigned",
-	'BACKEND':	"struct director *",
-	'ENUM':		"const char *",
-	'TIME':		"double",
-	'REAL':		"double",
-	'DURATION':	"double",
-	'INT':		"long",
+	'BACKEND':	"VCL_BACKEND",
+	'BOOL':		"VCL_BOOL",
+	'DURATION':	"VCL_DURATION",
+	'ENUM':		"VCL_ENUM",
 	'HEADER':	"const struct gethdr_s *",
-	'PRIV_VCL':	"struct vmod_priv *",
+	'INT':		"VCL_INT",
+	'IP':		"VCL_IP",
 	'PRIV_CALL':	"struct vmod_priv *",
-	'VOID':		"void",
+	'PRIV_VCL':	"struct vmod_priv *",
+	'REAL':		"VCL_REAL",
+	'STRING':	"VCL_STRING",
+	'STRING_LIST':	"const char *, ...",
+	'TIME':		"VCL_TIME",
+	'VOID':		"VCL_VOID",
 }
 
 #######################################################################
diff --git a/lib/libvmod_debug/vmod_debug.c b/lib/libvmod_debug/vmod_debug.c
index fd1a135..ee062ac 100644
--- a/lib/libvmod_debug/vmod_debug.c
+++ b/lib/libvmod_debug/vmod_debug.c
@@ -35,7 +35,7 @@
 #include "vrt.h"
 #include "vcc_if.h"
 
-void __match_proto__(td_debug_panic)
+VCL_VOID __match_proto__(td_debug_panic)
 vmod_panic(struct req *req, const char *str, ...)
 {
 	va_list ap;
@@ -48,8 +48,8 @@ vmod_panic(struct req *req, const char *str, ...)
 	VAS_Fail("VCL", "", 0, b, 0, VAS_VCL);
 }
 
-const char * __match_proto__(td_debug_author)
-vmod_author(struct req *req, const char *id)
+VCL_STRING __match_proto__(td_debug_author)
+vmod_author(struct req *req, VCL_ENUM id)
 {
 
 	CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
@@ -74,7 +74,7 @@ init_function(struct vmod_priv *priv, const struct VCL_conf *cfg)
 	return (0);
 }
 
-void __match_proto__(td_debug_test_priv_call)
+VCL_VOID __match_proto__(td_debug_test_priv_call)
 vmod_test_priv_call(struct req *req, struct vmod_priv *priv)
 {
 
@@ -87,7 +87,7 @@ vmod_test_priv_call(struct req *req, struct vmod_priv *priv)
 	}
 }
 
-void __match_proto__(td_debug_test_priv_vcl)
+VCL_VOID __match_proto__(td_debug_test_priv_vcl)
 vmod_test_priv_vcl(struct req *req, struct vmod_priv *priv)
 {
 
diff --git a/lib/libvmod_std/vmod_std.c b/lib/libvmod_std/vmod_std.c
index b90d847..86b2ad3 100644
--- a/lib/libvmod_std/vmod_std.c
+++ b/lib/libvmod_std/vmod_std.c
@@ -45,8 +45,8 @@
 
 #include "vcc_if.h"
 
-void __match_proto__(td_std_set_ip_tos)
-vmod_set_ip_tos(struct req *req, long tos)
+VCL_VOID __match_proto__(td_std_set_ip_tos)
+vmod_set_ip_tos(struct req *req, VCL_INT tos)
 {
 	int itos = tos;
 
@@ -91,7 +91,7 @@ vmod_updown(struct req *req, int up, const char *s, va_list ap)
 	}
 }
 
-const char * __match_proto__(td_std_toupper)
+VCL_STRING __match_proto__(td_std_toupper)
 vmod_toupper(struct req *req, const char *s, ...)
 {
 	const char *p;
@@ -104,7 +104,7 @@ vmod_toupper(struct req *req, const char *s, ...)
 	return (p);
 }
 
-const char * __match_proto__(td_std_tolower)
+VCL_STRING __match_proto__(td_std_tolower)
 vmod_tolower(struct req *req, const char *s, ...)
 {
 	const char *p;
@@ -117,8 +117,8 @@ vmod_tolower(struct req *req, const char *s, ...)
 	return (p);
 }
 
-double __match_proto__(td_std_random)
-vmod_random(struct req *req, double lo, double hi)
+VCL_REAL __match_proto__(td_std_random)
+vmod_random(struct req *req, VCL_REAL lo, VCL_REAL hi)
 {
 	double a;
 
@@ -129,7 +129,7 @@ vmod_random(struct req *req, double lo, double hi)
 	return (a);
 }
 
-void __match_proto__(td_std_log)
+VCL_VOID __match_proto__(td_std_log)
 vmod_log(struct req *req, const char *fmt, ...)
 {
 	unsigned u;
@@ -150,8 +150,8 @@ vmod_log(struct req *req, const char *fmt, ...)
 	WS_Release(req->ws, 0);
 }
 
-void __match_proto__(td_std_syslog)
-vmod_syslog(struct req *req, long fac, const char *fmt, ...)
+VCL_VOID __match_proto__(td_std_syslog)
+vmod_syslog(struct req *req, VCL_INT fac, const char *fmt, ...)
 {
 	char *p;
 	unsigned u;
@@ -168,7 +168,7 @@ vmod_syslog(struct req *req, long fac, const char *fmt, ...)
 	WS_Release(req->ws, 0);
 }
 
-void __match_proto__(td_std_collect)
+VCL_VOID __match_proto__(td_std_collect)
 vmod_collect(struct req *req, const struct gethdr_s *hdr)
 {
 
diff --git a/lib/libvmod_std/vmod_std_conversions.c b/lib/libvmod_std/vmod_std_conversions.c
index e728611..96456b2 100644
--- a/lib/libvmod_std/vmod_std_conversions.c
+++ b/lib/libvmod_std/vmod_std_conversions.c
@@ -38,8 +38,8 @@
 #include "vrt.h"
 #include "vcc_if.h"
 
-double __match_proto__()
-vmod_duration(struct req *req, const char *p, double d)
+VCL_DURATION __match_proto__()
+vmod_duration(struct req *req, const char *p, VCL_DURATION d)
 {
 	char *e;
 	double r;
@@ -88,8 +88,8 @@ vmod_duration(struct req *req, const char *p, double d)
 	return (r);
 }
 
-long __match_proto__()
-vmod_integer(struct req *req, const char *p, long i)
+VCL_INT __match_proto__()
+vmod_integer(struct req *req, const char *p, VCL_INT i)
 {
 	char *e;
 	long r;
diff --git a/lib/libvmod_std/vmod_std_fileread.c b/lib/libvmod_std/vmod_std_fileread.c
index d424d75..163926c 100644
--- a/lib/libvmod_std/vmod_std_fileread.c
+++ b/lib/libvmod_std/vmod_std_fileread.c
@@ -82,8 +82,8 @@ free_frfile(void *ptr)
 	}
 }
 
-const char * __match_proto__(td_std_fileread)
-vmod_fileread(struct req *req, struct vmod_priv *priv, const char *file_name)
+VCL_STRING __match_proto__(td_std_fileread)
+vmod_fileread(struct req *req, struct vmod_priv *priv, VCL_STRING file_name)
 {
 	struct frfile *frf = NULL;
 	char *s;



More information about the varnish-commit mailing list