Commit 681da739 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Lasse Karstensen

Pass the type of VCL method (B(ackend)/C(lient)/H(ousekeeping)

into the macro-table.
parent 15897007
......@@ -1005,7 +1005,7 @@ void VCL_Refresh(struct vcl **);
void VCL_Rel(struct vcl **);
const char *VCL_Return_Name(unsigned);
#define VCL_MET_MAC(l,u,b) \
#define VCL_MET_MAC(l,u,t,b) \
void VCL_##l##_method(struct vcl *, struct worker *, struct req *, \
struct busyobj *bo, void *specific);
#include "tbl/vcl_returns.h"
......
......@@ -129,7 +129,7 @@ VCL_Method_Name(unsigned m)
{
switch (m) {
#define VCL_MET_MAC(func, upper, bitmap) case VCL_MET_##upper: return (#upper);
#define VCL_MET_MAC(func, upper, typ, bitmap) case VCL_MET_##upper: return (#upper);
#include "tbl/vcl_returns.h"
#undef VCL_MET_MAC
default:
......@@ -905,7 +905,7 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo,
assert(aws == WS_Snapshot(wrk->aws));
}
#define VCL_MET_MAC(func, upper, bitmap) \
#define VCL_MET_MAC(func, upper, typ, bitmap) \
void \
VCL_##func##_method(struct vcl *vcl, struct worker *wrk, \
struct req *req, struct busyobj *bo, void *specific) \
......
......@@ -139,11 +139,11 @@ returns =(
# Housekeeping
('init',
"",
"H",
('ok', 'fail')
),
('fini',
"",
"H",
('ok',)
),
)
......@@ -993,7 +993,8 @@ fo.write("#endif\n")
fo.write("\n#ifdef VCL_MET_MAC\n")
for i in ll:
fo.write("VCL_MET_MAC(%s, %s," % (i[0].lower(), i[0].upper()))
fo.write("VCL_MET_MAC(%s, %s, %s," %
(i[0].lower(), i[0].upper(), i[1]))
p = " (\n\t"
lll = list(i[2])
lll.sort()
......
......@@ -66,7 +66,7 @@
struct method method_tab[] = {
{ "none", 0U, 0},
#define VCL_MET_MAC(l,U,m) { "vcl_"#l, m, VCL_MET_##U },
#define VCL_MET_MAC(l,U,t,b) { "vcl_"#l, b, VCL_MET_##U },
#include "tbl/vcl_returns.h"
#undef VCL_MET_MAC
{ NULL, 0U, 0}
......@@ -483,7 +483,7 @@ EmitStruct(const struct vcc *tl)
Fc(tl, 0, "\t.nsrc = VGC_NSRCS,\n");
Fc(tl, 0, "\t.srcname = srcname,\n");
Fc(tl, 0, "\t.srcbody = srcbody,\n");
#define VCL_MET_MAC(l,u,b) \
#define VCL_MET_MAC(l,u,t,b) \
Fc(tl, 0, "\t." #l "_func = VGC_function_vcl_" #l ",\n");
#include "tbl/vcl_returns.h"
#undef VCL_MET_MAC
......
......@@ -77,7 +77,7 @@ vcc_Stv_mkvar(struct vcc *tl, const struct token *t, enum var_type fmt)
v->name = TlDupTok(tl, t);
v->r_methods = 0;
#define VCL_MET_MAC(l,u,b) v->r_methods |= VCL_MET_##u;
#define VCL_MET_MAC(l,u,t,b) v->r_methods |= VCL_MET_##u;
#include "tbl/vcl_returns.h"
#undef VCL_MET_MAC
v->fmt = fmt;
......
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