From: phk Date: Mon, 25 Jun 2007 07:04:13 +0000 (+0000) Subject: Add VCL_MET_${METHOD} bitmap defines X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1c8ce2cf42413678e65686ea21b6b7119fbb71f;p=varnish Add VCL_MET_${METHOD} bitmap defines git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1550 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/include/vcl_returns.h b/varnish-cache/include/vcl_returns.h index 6bc0e606..009cc3fb 100644 --- a/varnish-cache/include/vcl_returns.h +++ b/varnish-cache/include/vcl_returns.h @@ -41,5 +41,15 @@ VCL_MET_MAC(hit,HIT,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_DELIVER)) VCL_MET_MAC(fetch,FETCH,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_INSERT)) VCL_MET_MAC(timeout,TIMEOUT,(VCL_RET_FETCH|VCL_RET_DISCARD)) VCL_MET_MAC(discard,DISCARD,(VCL_RET_DISCARD|VCL_RET_PASS)) +#else +#define VCL_MET_RECV (1 << 0) +#define VCL_MET_PIPE (1 << 1) +#define VCL_MET_PASS (1 << 2) +#define VCL_MET_HASH (1 << 3) +#define VCL_MET_MISS (1 << 4) +#define VCL_MET_HIT (1 << 5) +#define VCL_MET_FETCH (1 << 6) +#define VCL_MET_TIMEOUT (1 << 7) +#define VCL_MET_DISCARD (1 << 8) #endif #define N_METHODS 9 diff --git a/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl b/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl index 2ec2fa82..8c2d6977 100755 --- a/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl +++ b/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl @@ -192,6 +192,12 @@ foreach m $methods { puts $for ")" incr u } +puts $for "#else" +set u 0 +foreach m $methods { + puts $for "#define VCL_MET_[string toupper [lindex $m 0]]\t(1 << $u)" + incr u +} puts $for "#endif" puts $for "#define N_METHODS $u" close $for