]> err.no Git - varnish/commitdiff
I got confused about the terminology. An action is something we do
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 1 Apr 2007 08:23:48 +0000 (08:23 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 1 Apr 2007 08:23:48 +0000 (08:23 +0000)
in the program, a "return" is when we quit the program.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1295 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/lib/libvcl/vcc_compile.h
varnish-cache/lib/libvcl/vcc_xref.c

index 6fcfa985a11d22bb289b54e3bae20e56ebcb7bc7..a2ac5bf8002da09474a13c8b426e7108afac40bd 100644 (file)
@@ -120,7 +120,7 @@ struct var {
 
 struct method {
        const char              *name;
-       unsigned                actions;
+       unsigned                returns;
 };
 
 struct proc;
index 4cbd151b6ad92f2843b713722b0b0d929cfdcb09..b45d884d3e291e0b7f39d1724406297dd36652f6 100644 (file)
@@ -59,11 +59,11 @@ struct proc {
        TAILQ_ENTRY(proc)       list;
        TAILQ_HEAD(,proccall)   calls;
        struct token            *name;
-       unsigned                actions;
+       unsigned                returns;
        unsigned                exists;
        unsigned                called;
        unsigned                active;
-       struct token            *action_tok[VCL_RET_MAX];
+       struct token            *return_tok[VCL_RET_MAX];
 };
 
 /*--------------------------------------------------------------------*/
@@ -171,7 +171,7 @@ vcc_CheckReferences(struct tokenlist *tl)
 }
 
 /*--------------------------------------------------------------------
- * Returned action checks
+ * Returns checks
  */
 
 static struct proc *
@@ -216,17 +216,17 @@ vcc_AddCall(struct tokenlist *tl, struct token *t)
 }
 
 void
-vcc_ProcAction(struct proc *p, unsigned action, struct token *t)
+vcc_ProcAction(struct proc *p, unsigned returns, struct token *t)
 {
 
-       p->actions |= (1 << action);
-       /* Record the first instance of this action */
-       if (p->action_tok[action] == NULL)
-               p->action_tok[action] = t;
+       p->returns |= (1 << returns);
+       /* Record the first instance of this return */
+       if (p->return_tok[returns] == NULL)
+               p->return_tok[returns] = t;
 }
 
 static int
-vcc_CheckActionRecurse(struct tokenlist *tl, struct proc *p, unsigned actions)
+vcc_CheckActionRecurse(struct tokenlist *tl, struct proc *p, unsigned returns)
 {
        unsigned u;
        struct proccall *pc;
@@ -241,12 +241,12 @@ vcc_CheckActionRecurse(struct tokenlist *tl, struct proc *p, unsigned actions)
                vcc_ErrWhere(tl, p->name);
                return (1);
        }
-       u = p->actions & ~actions;
+       u = p->returns & ~returns;
        if (u) {
 #define VCL_RET_MAC(a, b, c, d) \
                if (u & VCL_RET_##b) { \
-                       vsb_printf(tl->sb, "Illegal action \"%s\"\n", #a); \
-                       vcc_ErrWhere(tl, p->action_tok[d]); \
+                       vsb_printf(tl->sb, "Illegal return \"%s\"\n", #a); \
+                       vcc_ErrWhere(tl, p->return_tok[d]); \
                }
 #include "vcl_returns.h"
 #undef VCL_RET_MAC
@@ -256,7 +256,7 @@ vcc_CheckActionRecurse(struct tokenlist *tl, struct proc *p, unsigned actions)
        }
        p->active = 1;
        TAILQ_FOREACH(pc, &p->calls, list) {
-               if (vcc_CheckActionRecurse(tl, pc->p, actions)) {
+               if (vcc_CheckActionRecurse(tl, pc->p, returns)) {
                        vsb_printf(tl->sb, "\n...called from \"%.*s\"\n",
                            PF(p->name));
                        vcc_ErrWhere(tl, pc->t);
@@ -280,12 +280,12 @@ vcc_CheckAction(struct tokenlist *tl)
                if (i < 0)
                        continue;
                m = method_tab + i;
-               if (vcc_CheckActionRecurse(tl, p, m->actions)) {
+               if (vcc_CheckActionRecurse(tl, p, m->returns)) {
                        vsb_printf(tl->sb,
                            "\n...which is the \"%s\" method\n", m->name);
-                       vsb_printf(tl->sb, "Legal actions are:");
+                       vsb_printf(tl->sb, "Legal returns are:");
 #define VCL_RET_MAC(a, b, c, d) \
-                       if (m->actions & c) \
+                       if (m->returns & c) \
                                vsb_printf(tl->sb, " \"%s\"", #a);
 #define VCL_RET_MAC_E(a, b, c, d) VCL_RET_MAC(a, b, c, d)
 #include "vcl_returns.h"