Commit fce691c1 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Adjust to VCL_RET_* being enum instead of bitmap.

This solves the "restart" procaction issue in a non-hackish way
and looks better overall.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3485 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent eb5885fc
...@@ -595,11 +595,9 @@ void VCL_Rel(struct VCL_conf **vcc); ...@@ -595,11 +595,9 @@ void VCL_Rel(struct VCL_conf **vcc);
void VCL_Get(struct VCL_conf **vcc); void VCL_Get(struct VCL_conf **vcc);
void VCL_Poll(void); void VCL_Poll(void);
#define VCL_RET_MAC(l,u,b,n)
#define VCL_MET_MAC(l,u,b) void VCL_##l##_method(struct sess *); #define VCL_MET_MAC(l,u,b) void VCL_##l##_method(struct sess *);
#include "vcl_returns.h" #include "vcl_returns.h"
#undef VCL_MET_MAC #undef VCL_MET_MAC
#undef VCL_RET_MAC
/* cache_vrt_esi.c */ /* cache_vrt_esi.c */
......
...@@ -300,8 +300,6 @@ ccf_config_use(struct cli *cli, const char * const *av, void *priv) ...@@ -300,8 +300,6 @@ ccf_config_use(struct cli *cli, const char * const *av, void *priv)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
#define VCL_RET_MAC(l,u,b,n)
#define VCL_MET_MAC(func, upper, bitmap) \ #define VCL_MET_MAC(func, upper, bitmap) \
void \ void \
VCL_##func##_method(struct sess *sp) \ VCL_##func##_method(struct sess *sp) \
...@@ -313,13 +311,12 @@ VCL_##func##_method(struct sess *sp) \ ...@@ -313,13 +311,12 @@ VCL_##func##_method(struct sess *sp) \
sp->vcl->func##_func(sp); \ sp->vcl->func##_func(sp); \
WSP(sp, SLT_VCL_return, "%s", VCC_Return_Name(sp->handling)); \ WSP(sp, SLT_VCL_return, "%s", VCC_Return_Name(sp->handling)); \
sp->cur_method = 0; \ sp->cur_method = 0; \
assert(sp->handling & bitmap); \ assert((1 << sp->handling) & bitmap); \
assert(!(sp->handling & ~bitmap)); \ assert(!((1 << sp->handling) & ~bitmap)); \
} }
#include "vcl_returns.h" #include "vcl_returns.h"
#undef VCL_MET_MAC #undef VCL_MET_MAC
#undef VCL_RET_MAC
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
......
...@@ -348,7 +348,7 @@ VRT_handling(struct sess *sp, unsigned hand) ...@@ -348,7 +348,7 @@ VRT_handling(struct sess *sp, unsigned hand)
{ {
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
assert(!(hand & (hand -1))); /* must be power of two */ assert(hand < VCL_RET_MAX);
sp->handling = hand; sp->handling = hand;
} }
......
...@@ -30,16 +30,16 @@ typedef int vcl_func_f(struct sess *sp); ...@@ -30,16 +30,16 @@ typedef int vcl_func_f(struct sess *sp);
#define VCL_MET_MAX 12 #define VCL_MET_MAX 12
/* VCL Returns */ /* VCL Returns */
#define VCL_RET_ERROR (1 << 0) #define VCL_RET_ERROR 0
#define VCL_RET_LOOKUP (1 << 1) #define VCL_RET_LOOKUP 1
#define VCL_RET_HASH (1 << 2) #define VCL_RET_HASH 2
#define VCL_RET_PIPE (1 << 3) #define VCL_RET_PIPE 3
#define VCL_RET_PASS (1 << 4) #define VCL_RET_PASS 4
#define VCL_RET_FETCH (1 << 5) #define VCL_RET_FETCH 5
#define VCL_RET_DELIVER (1 << 6) #define VCL_RET_DELIVER 6
#define VCL_RET_DISCARD (1 << 7) #define VCL_RET_DISCARD 7
#define VCL_RET_KEEP (1 << 8) #define VCL_RET_KEEP 8
#define VCL_RET_RESTART (1 << 9) #define VCL_RET_RESTART 9
#define VCL_RET_MAX 10 #define VCL_RET_MAX 10
......
...@@ -7,43 +7,72 @@ ...@@ -7,43 +7,72 @@
*/ */
#ifdef VCL_RET_MAC #ifdef VCL_RET_MAC
#ifdef VCL_RET_MAC_E VCL_RET_MAC(error, ERROR)
VCL_RET_MAC_E(error, ERROR, (1 << 0), 0) VCL_RET_MAC(lookup, LOOKUP)
#endif VCL_RET_MAC(hash, HASH)
VCL_RET_MAC(lookup, LOOKUP, (1 << 1), 1) VCL_RET_MAC(pipe, PIPE)
VCL_RET_MAC(hash, HASH, (1 << 2), 2) VCL_RET_MAC(pass, PASS)
VCL_RET_MAC(pipe, PIPE, (1 << 3), 3) VCL_RET_MAC(fetch, FETCH)
VCL_RET_MAC(pass, PASS, (1 << 4), 4) VCL_RET_MAC(deliver, DELIVER)
VCL_RET_MAC(fetch, FETCH, (1 << 5), 5) VCL_RET_MAC(discard, DISCARD)
VCL_RET_MAC(deliver, DELIVER, (1 << 6), 6) VCL_RET_MAC(keep, KEEP)
VCL_RET_MAC(discard, DISCARD, (1 << 7), 7) VCL_RET_MAC(restart, RESTART)
VCL_RET_MAC(keep, KEEP, (1 << 8), 8)
VCL_RET_MAC(restart, RESTART, (1 << 9), 9)
#endif #endif
#ifdef VCL_MET_MAC #ifdef VCL_MET_MAC
VCL_MET_MAC(recv,RECV, VCL_MET_MAC(recv,RECV,
(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_PIPE|VCL_RET_LOOKUP)) ((1 << VCL_RET_ERROR)
| (1 << VCL_RET_PASS)
| (1 << VCL_RET_PIPE)
| (1 << VCL_RET_LOOKUP)
))
VCL_MET_MAC(pipe,PIPE, VCL_MET_MAC(pipe,PIPE,
(VCL_RET_ERROR|VCL_RET_PIPE)) ((1 << VCL_RET_ERROR)
| (1 << VCL_RET_PIPE)
))
VCL_MET_MAC(pass,PASS, VCL_MET_MAC(pass,PASS,
(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS)) ((1 << VCL_RET_ERROR)
| (1 << VCL_RET_RESTART)
| (1 << VCL_RET_PASS)
))
VCL_MET_MAC(hash,HASH, VCL_MET_MAC(hash,HASH,
(VCL_RET_HASH)) ((1 << VCL_RET_HASH)
))
VCL_MET_MAC(miss,MISS, VCL_MET_MAC(miss,MISS,
(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_FETCH)) ((1 << VCL_RET_ERROR)
| (1 << VCL_RET_RESTART)
| (1 << VCL_RET_PASS)
| (1 << VCL_RET_FETCH)
))
VCL_MET_MAC(hit,HIT, VCL_MET_MAC(hit,HIT,
(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_DELIVER)) ((1 << VCL_RET_ERROR)
| (1 << VCL_RET_RESTART)
| (1 << VCL_RET_PASS)
| (1 << VCL_RET_DELIVER)
))
VCL_MET_MAC(fetch,FETCH, VCL_MET_MAC(fetch,FETCH,
(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_DELIVER)) ((1 << VCL_RET_ERROR)
| (1 << VCL_RET_RESTART)
| (1 << VCL_RET_PASS)
| (1 << VCL_RET_DELIVER)
))
VCL_MET_MAC(deliver,DELIVER, VCL_MET_MAC(deliver,DELIVER,
(VCL_RET_RESTART|VCL_RET_DELIVER)) ((1 << VCL_RET_RESTART)
| (1 << VCL_RET_DELIVER)
))
VCL_MET_MAC(prefetch,PREFETCH, VCL_MET_MAC(prefetch,PREFETCH,
(VCL_RET_FETCH|VCL_RET_PASS)) ((1 << VCL_RET_FETCH)
| (1 << VCL_RET_PASS)
))
VCL_MET_MAC(timeout,TIMEOUT, VCL_MET_MAC(timeout,TIMEOUT,
(VCL_RET_FETCH|VCL_RET_DISCARD)) ((1 << VCL_RET_FETCH)
| (1 << VCL_RET_DISCARD)
))
VCL_MET_MAC(discard,DISCARD, VCL_MET_MAC(discard,DISCARD,
(VCL_RET_DISCARD|VCL_RET_KEEP)) ((1 << VCL_RET_DISCARD)
| (1 << VCL_RET_KEEP)
))
VCL_MET_MAC(error,ERROR, VCL_MET_MAC(error,ERROR,
(VCL_RET_DELIVER)) ((1 << VCL_RET_DELIVER)
))
#endif #endif
...@@ -48,18 +48,16 @@ parse_action(struct tokenlist *tl) ...@@ -48,18 +48,16 @@ parse_action(struct tokenlist *tl)
Expect(tl, ID); Expect(tl, ID);
#define VCL_RET_MAC(l, u, b, i) \ #define VCL_RET_MAC(l, U) \
do { \ do { \
if (vcc_IdIs(tl->t, #l)) { \ if (vcc_IdIs(tl->t, #l)) { \
Fb(tl, 1, "VRT_done(sp, VCL_RET_%s);\n", #u); \ Fb(tl, 1, "VRT_done(sp, VCL_RET_" #U ");\n"); \
vcc_ProcAction(tl->curproc, i, tl->t); \ vcc_ProcAction(tl->curproc, VCL_RET_##U, tl->t);\
retval = 1; \ retval = 1; \
} \ } \
} while (0); } while (0);
#define VCL_RET_MAC_E(l, u, b, i) VCL_RET_MAC(l, u, b, i)
#include "vcl_returns.h" #include "vcl_returns.h"
#undef VCL_RET_MAC #undef VCL_RET_MAC
#undef VCL_RET_MAC_E
if (!retval) { if (!retval) {
vsb_printf(tl->sb, "Expected action name.\n"); vsb_printf(tl->sb, "Expected action name.\n");
vcc_ErrWhere(tl, tl->t); vcc_ErrWhere(tl, tl->t);
...@@ -85,8 +83,7 @@ parse_restart(struct tokenlist *tl) ...@@ -85,8 +83,7 @@ parse_restart(struct tokenlist *tl)
ERRCHK(tl); ERRCHK(tl);
} }
Fb(tl, 1, "VRT_done(sp, VCL_RET_RESTART);\n"); Fb(tl, 1, "VRT_done(sp, VCL_RET_RESTART);\n");
assert(VCL_RET_RESTART == (1 << 9)); /* XXX: BANDAID FIXME! */ vcc_ProcAction(tl->curproc, VCL_RET_RESTART, tl->t);
vcc_ProcAction(tl->curproc, 9, tl->t);
vcc_NextToken(tl); vcc_NextToken(tl);
} }
...@@ -465,7 +462,7 @@ static struct action_table { ...@@ -465,7 +462,7 @@ static struct action_table {
} action_table[] = { } action_table[] = {
{ "restart", parse_restart }, { "restart", parse_restart },
{ "error", parse_error }, { "error", parse_error },
#define VCL_RET_MAC(l, u, b, i) { #l, parse_action }, #define VCL_RET_MAC(l, U) { #l, parse_action },
#include "vcl_returns.h" #include "vcl_returns.h"
#undef VCL_RET_MAC #undef VCL_RET_MAC
......
...@@ -84,11 +84,9 @@ ...@@ -84,11 +84,9 @@
#include "libvarnish.h" #include "libvarnish.h"
struct method method_tab[] = { struct method method_tab[] = {
#define VCL_RET_MAC(l,U,b,n)
#define VCL_MET_MAC(l,U,m) { "vcl_"#l, m, VCL_MET_##U }, #define VCL_MET_MAC(l,U,m) { "vcl_"#l, m, VCL_MET_##U },
#include "vcl_returns.h" #include "vcl_returns.h"
#undef VCL_MET_MAC #undef VCL_MET_MAC
#undef VCL_RET_MAC
{ NULL, 0U, 0} { NULL, 0U, 0}
}; };
...@@ -360,12 +358,10 @@ EmitStruct(const struct tokenlist *tl) ...@@ -360,12 +358,10 @@ EmitStruct(const struct tokenlist *tl)
Fc(tl, 0, "\t.srcname = srcname,\n"); Fc(tl, 0, "\t.srcname = srcname,\n");
Fc(tl, 0, "\t.srcbody = srcbody,\n"); Fc(tl, 0, "\t.srcbody = srcbody,\n");
Fc(tl, 0, "\t.nhashcount = %u,\n", tl->nhashcount); Fc(tl, 0, "\t.nhashcount = %u,\n", tl->nhashcount);
#define VCL_RET_MAC(l,u,b,n)
#define VCL_MET_MAC(l,u,b) \ #define VCL_MET_MAC(l,u,b) \
Fc(tl, 0, "\t." #l "_func = VGC_function_vcl_" #l ",\n"); Fc(tl, 0, "\t." #l "_func = VGC_function_vcl_" #l ",\n");
#include "vcl_returns.h" #include "vcl_returns.h"
#undef VCL_MET_MAC #undef VCL_MET_MAC
#undef VCL_RET_MAC
Fc(tl, 0, "};\n"); Fc(tl, 0, "};\n");
} }
...@@ -669,11 +665,8 @@ VCC_Return_Name(unsigned method) ...@@ -669,11 +665,8 @@ VCC_Return_Name(unsigned method)
{ {
switch (method) { switch (method) {
case 0: return ("<none>"); #define VCL_RET_MAC(l, U) case VCL_RET_##U: return(#l);
#define VCL_RET_MAC(l, u, b, i) case b: return(#l);
#define VCL_RET_MAC_E(l, u, b, i) case b: return(#l);
#include "vcl_returns.h" #include "vcl_returns.h"
#undef VCL_RET_MAC_E
#undef VCL_RET_MAC #undef VCL_RET_MAC
} }
return (NULL); return (NULL);
......
...@@ -142,7 +142,7 @@ struct var { ...@@ -142,7 +142,7 @@ struct var {
struct method { struct method {
const char *name; const char *name;
unsigned returns; unsigned ret_bitmap;
unsigned bitval; unsigned bitval;
}; };
......
...@@ -154,21 +154,11 @@ const char * const vcl_tnames[256] = { ...@@ -154,21 +154,11 @@ const char * const vcl_tnames[256] = {
void void
vcl_output_lang_h(struct vsb *sb) vcl_output_lang_h(struct vsb *sb)
{ {
vsb_cat(sb, "#define VCL_RET_ERROR (1 << 0)\n");
vsb_cat(sb, "#define VCL_RET_LOOKUP (1 << 1)\n");
vsb_cat(sb, "#define VCL_RET_HASH (1 << 2)\n");
vsb_cat(sb, "#define VCL_RET_PIPE (1 << 3)\n");
vsb_cat(sb, "#define VCL_RET_PASS (1 << 4)\n");
vsb_cat(sb, "#define VCL_RET_FETCH (1 << 5)\n");
vsb_cat(sb, "#define VCL_RET_DELIVER (1 << 6)\n");
vsb_cat(sb, "#define VCL_RET_DISCARD (1 << 7)\n");
vsb_cat(sb, "#define VCL_RET_KEEP (1 << 8)\n");
vsb_cat(sb, "#define VCL_RET_RESTART (1 << 9)\n");
/* ../../include/vcl.h */ /* ../../include/vcl.h */
vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 3482 2008-12-21 16"); vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 3484 2008-12-21 17");
vsb_cat(sb, ":18:39Z phk $\n *\n * NB: This file is machine genera"); vsb_cat(sb, ":01:58Z phk $\n *\n * NB: This file is machine genera");
vsb_cat(sb, "ted, DO NOT EDIT!\n *\n * Edit and run vcc_gen_fixed_t"); vsb_cat(sb, "ted, DO NOT EDIT!\n *\n * Edit and run vcc_gen_fixed_t");
vsb_cat(sb, "oken.tcl instead\n */\n\nstruct sess;\n"); vsb_cat(sb, "oken.tcl instead\n */\n\nstruct sess;\n");
vsb_cat(sb, "struct cli;\n\ntypedef void vcl_init_f(struct cli *);\n"); vsb_cat(sb, "struct cli;\n\ntypedef void vcl_init_f(struct cli *);\n");
...@@ -187,18 +177,14 @@ vcl_output_lang_h(struct vsb *sb) ...@@ -187,18 +177,14 @@ vcl_output_lang_h(struct vsb *sb)
vsb_cat(sb, "#define VCL_MET_DISCARD\t\t(1 << 10)\n"); vsb_cat(sb, "#define VCL_MET_DISCARD\t\t(1 << 10)\n");
vsb_cat(sb, "#define VCL_MET_ERROR\t\t(1 << 11)\n"); vsb_cat(sb, "#define VCL_MET_ERROR\t\t(1 << 11)\n");
vsb_cat(sb, "\n#define VCL_MET_MAX\t\t12\n\n"); vsb_cat(sb, "\n#define VCL_MET_MAX\t\t12\n\n");
vsb_cat(sb, "/* VCL Returns */\n#define VCL_RET_ERROR\t\t(1 << 0)\n"); vsb_cat(sb, "/* VCL Returns */\n#define VCL_RET_ERROR\t\t0\n");
vsb_cat(sb, "#define VCL_RET_LOOKUP\t\t(1 << 1)\n"); vsb_cat(sb, "#define VCL_RET_LOOKUP\t\t1\n#define VCL_RET_HASH\t\t2");
vsb_cat(sb, "#define VCL_RET_HASH\t\t(1 << 2)\n"); vsb_cat(sb, "\n#define VCL_RET_PIPE\t\t3\n#define VCL_RET_PASS\t\t4");
vsb_cat(sb, "#define VCL_RET_PIPE\t\t(1 << 3)\n"); vsb_cat(sb, "\n#define VCL_RET_FETCH\t\t5\n#define VCL_RET_DELIVER\t");
vsb_cat(sb, "#define VCL_RET_PASS\t\t(1 << 4)\n"); vsb_cat(sb, "\t6\n#define VCL_RET_DISCARD\t\t7\n");
vsb_cat(sb, "#define VCL_RET_FETCH\t\t(1 << 5)\n"); vsb_cat(sb, "#define VCL_RET_KEEP\t\t8\n#define VCL_RET_RESTART\t\t");
vsb_cat(sb, "#define VCL_RET_DELIVER\t\t(1 << 6)\n"); vsb_cat(sb, "9\n\n#define VCL_RET_MAX\t\t10\n");
vsb_cat(sb, "#define VCL_RET_DISCARD\t\t(1 << 7)\n"); vsb_cat(sb, "\nstruct VCL_conf {\n\tunsigned\tmagic;\n");
vsb_cat(sb, "#define VCL_RET_KEEP\t\t(1 << 8)\n");
vsb_cat(sb, "#define VCL_RET_RESTART\t\t(1 << 9)\n");
vsb_cat(sb, "\n#define VCL_RET_MAX\t\t10\n\n");
vsb_cat(sb, "struct VCL_conf {\n\tunsigned\tmagic;\n");
vsb_cat(sb, "#define VCL_CONF_MAGIC\t0x7406c509\t/* from /dev/rando"); vsb_cat(sb, "#define VCL_CONF_MAGIC\t0x7406c509\t/* from /dev/rando");
vsb_cat(sb, "m */\n\n\tstruct director\t**director;\n"); vsb_cat(sb, "m */\n\n\tstruct director\t**director;\n");
vsb_cat(sb, "\tunsigned\tndirector;\n\tstruct vrt_ref\t*ref;\n"); vsb_cat(sb, "\tunsigned\tndirector;\n\tstruct vrt_ref\t*ref;\n");
......
...@@ -68,7 +68,7 @@ struct proc { ...@@ -68,7 +68,7 @@ struct proc {
VTAILQ_HEAD(,proccall) calls; VTAILQ_HEAD(,proccall) calls;
VTAILQ_HEAD(,procuse) uses; VTAILQ_HEAD(,procuse) uses;
struct token *name; struct token *name;
unsigned returns; unsigned ret_bitmap;
unsigned exists; unsigned exists;
unsigned called; unsigned called;
unsigned active; unsigned active;
...@@ -242,14 +242,15 @@ void ...@@ -242,14 +242,15 @@ void
vcc_ProcAction(struct proc *p, unsigned returns, struct token *t) vcc_ProcAction(struct proc *p, unsigned returns, struct token *t)
{ {
p->returns |= (1U << returns); assert(returns < VCL_RET_MAX);
p->ret_bitmap |= (1U << returns);
/* Record the first instance of this return */ /* Record the first instance of this return */
if (p->return_tok[returns] == NULL) if (p->return_tok[returns] == NULL)
p->return_tok[returns] = t; p->return_tok[returns] = t;
} }
static int static int
vcc_CheckActionRecurse(struct tokenlist *tl, struct proc *p, unsigned returns) vcc_CheckActionRecurse(struct tokenlist *tl, struct proc *p, unsigned bitmap)
{ {
unsigned u; unsigned u;
struct proccall *pc; struct proccall *pc;
...@@ -264,13 +265,13 @@ vcc_CheckActionRecurse(struct tokenlist *tl, struct proc *p, unsigned returns) ...@@ -264,13 +265,13 @@ vcc_CheckActionRecurse(struct tokenlist *tl, struct proc *p, unsigned returns)
vcc_ErrWhere(tl, p->name); vcc_ErrWhere(tl, p->name);
return (1); return (1);
} }
u = p->returns & ~returns; u = p->ret_bitmap & ~bitmap;
if (u) { if (u) {
/*lint -save -e525 -e539 */ /*lint -save -e525 -e539 */
#define VCL_RET_MAC(a, b, c, d) \ #define VCL_RET_MAC(l, U) \
if (u & VCL_RET_##b) { \ if (u & (1 << (VCL_RET_##U))) { \
vsb_printf(tl->sb, "Invalid return \"%s\"\n", #a); \ vsb_printf(tl->sb, "Invalid return \"" #l "\"\n");\
vcc_ErrWhere(tl, p->return_tok[d]); \ vcc_ErrWhere(tl, p->return_tok[VCL_RET_##U]); \
} }
#include "vcl_returns.h" #include "vcl_returns.h"
#undef VCL_RET_MAC #undef VCL_RET_MAC
...@@ -281,7 +282,7 @@ vcc_CheckActionRecurse(struct tokenlist *tl, struct proc *p, unsigned returns) ...@@ -281,7 +282,7 @@ vcc_CheckActionRecurse(struct tokenlist *tl, struct proc *p, unsigned returns)
} }
p->active = 1; p->active = 1;
VTAILQ_FOREACH(pc, &p->calls, list) { VTAILQ_FOREACH(pc, &p->calls, list) {
if (vcc_CheckActionRecurse(tl, pc->p, returns)) { if (vcc_CheckActionRecurse(tl, pc->p, bitmap)) {
vsb_printf(tl->sb, "\n...called from \"%.*s\"\n", vsb_printf(tl->sb, "\n...called from \"%.*s\"\n",
PF(p->name)); PF(p->name));
vcc_ErrWhere(tl, pc->t); vcc_ErrWhere(tl, pc->t);
...@@ -305,19 +306,17 @@ vcc_CheckAction(struct tokenlist *tl) ...@@ -305,19 +306,17 @@ vcc_CheckAction(struct tokenlist *tl)
if (i < 0) if (i < 0)
continue; continue;
m = method_tab + i; m = method_tab + i;
if (vcc_CheckActionRecurse(tl, p, m->returns)) { if (vcc_CheckActionRecurse(tl, p, m->ret_bitmap)) {
vsb_printf(tl->sb, vsb_printf(tl->sb,
"\n...which is the \"%s\" method\n", m->name); "\n...which is the \"%s\" method\n", m->name);
vsb_printf(tl->sb, "Legal returns are:"); vsb_printf(tl->sb, "Legal returns are:");
#define VCL_RET_MAC(a, b, c, d) \ #define VCL_RET_MAC(l, U) \
if (m->returns & c) \ if (m->ret_bitmap & ((1 << VCL_RET_##U))) \
vsb_printf(tl->sb, " \"%s\"", #a); vsb_printf(tl->sb, " \"%s\"", #l);
#define VCL_RET_MAC_E(a, b, c, d) VCL_RET_MAC(a, b, c, d)
/*lint -save -e525 -e539 */ /*lint -save -e525 -e539 */
#include "vcl_returns.h" #include "vcl_returns.h"
/*lint +e525 */ /*lint +e525 */
#undef VCL_RET_MAC #undef VCL_RET_MAC
#undef VCL_RET_MAC_E
/*lint -restore */ /*lint -restore */
vsb_printf(tl->sb, "\n"); vsb_printf(tl->sb, "\n");
return (1); return (1);
......
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