From: phk Date: Wed, 23 Jul 2008 15:30:02 +0000 (+0000) Subject: Prefix acl functions with "named_" and "anon_" to avoid naming conflicts. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f86d47b66046b5da4be1504612dc3a922641acdb;p=varnish Prefix acl functions with "named_" and "anon_" to avoid naming conflicts. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2999 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/lib/libvcl/vcc_acl.c b/varnish-cache/lib/libvcl/vcc_acl.c index 1f5a4010..85f1f9ba 100644 --- a/varnish-cache/lib/libvcl/vcc_acl.c +++ b/varnish-cache/lib/libvcl/vcc_acl.c @@ -319,7 +319,7 @@ vcc_acl_entry(struct tokenlist *tl) } static void -vcc_acl_bot(const struct tokenlist *tl, const char *acln, int silent) +vcc_acl_bot(const struct tokenlist *tl, const char *acln, int silent, const char *pfx) { struct acl_e *ae; int depth, l, m, i; @@ -327,7 +327,8 @@ vcc_acl_bot(const struct tokenlist *tl, const char *acln, int silent) const char *oc; Fh(tl, 0, "\nstatic int\n"); - Fh(tl, 0, "match_acl_%s(const struct sess *sp, const void *p)\n", acln); + Fh(tl, 0, "match_acl_%s_%s(const struct sess *sp, const void *p)\n", + pfx, acln); Fh(tl, 0, "{\n"); Fh(tl, 0, "\tunsigned fam;\n"); Fh(tl, 0, "\tconst unsigned char *a;\n"); @@ -421,7 +422,7 @@ vcc_Cond_Ip(const struct var *vp, struct tokenlist *tl) vcc_NextToken(tl); ExpectErr(tl, ID); vcc_AddRef(tl, tl->t, R_ACL); - Fb(tl, 1, "match_acl_%.*s(sp, %s)\n", PF(tl->t), vp->rname); + Fb(tl, 1, "match_acl_named_%.*s(sp, %s)\n", PF(tl->t), vp->rname); vcc_NextToken(tl); break; case T_EQ: @@ -430,11 +431,11 @@ vcc_Cond_Ip(const struct var *vp, struct tokenlist *tl) VTAILQ_INIT(&tl->acl); tcond = tl->t->tok; vcc_NextToken(tl); - asprintf(&acln, "acl_%u", tl->cnt); + asprintf(&acln, "%u", tl->cnt); assert(acln != NULL); vcc_acl_entry(tl); - vcc_acl_bot(tl, acln, 1); - Fb(tl, 1, "%smatch_acl_%s(sp, %s)\n", + vcc_acl_bot(tl, acln, 1, "anon"); + Fb(tl, 1, "%smatch_acl_anon_%s(sp, %s)\n", (tcond == T_NEQ ? "!" : ""), acln, vp->rname); free(acln); break; @@ -477,7 +478,7 @@ vcc_Acl(struct tokenlist *tl) ExpectErr(tl, '}'); vcc_NextToken(tl); - vcc_acl_bot(tl, acln, 0); + vcc_acl_bot(tl, acln, 0, "named"); free(acln); }