Commit 1c5dc97b authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

use tl-> consistently


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1282 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 31f42eaf
...@@ -110,9 +110,9 @@ const char *vcc_default_vcl_b, *vcc_default_vcl_e; ...@@ -110,9 +110,9 @@ const char *vcc_default_vcl_b, *vcc_default_vcl_e;
tl->indent -= INDENT; \ tl->indent -= INDENT; \
} while (0) } while (0)
#define C(tl, sep) do { \ #define C(tl, sep) do { \
Fc(tl, 1, "VRT_count(sp, %u)%s\n", ++tl->cnt, sep); \ Fc(tl, 1, "VRT_count(sp, %u)%s\n", ++tl->cnt, sep); \
tl->t->cnt = tl->cnt; \ tl->t->cnt = tl->cnt; \
} while (0) } while (0)
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
...@@ -1527,7 +1527,7 @@ vcc_resolve_includes(struct tokenlist *tl) ...@@ -1527,7 +1527,7 @@ vcc_resolve_includes(struct tokenlist *tl)
static char * static char *
vcc_CompileSource(struct vsb *sb, struct source *sp) vcc_CompileSource(struct vsb *sb, struct source *sp)
{ {
struct tokenlist tokens, *tl; struct tokenlist tokenlist, *tl;
struct ref *r; struct ref *r;
struct token *t; struct token *t;
FILE *fo; FILE *fo;
...@@ -1535,31 +1535,31 @@ vcc_CompileSource(struct vsb *sb, struct source *sp) ...@@ -1535,31 +1535,31 @@ vcc_CompileSource(struct vsb *sb, struct source *sp)
char buf[BUFSIZ]; char buf[BUFSIZ];
int i; int i;
memset(&tokens, 0, sizeof tokens); memset(&tokenlist, 0, sizeof tokenlist);
tl = &tokens; tl = &tokenlist;
TAILQ_INIT(&tl->tokens); TAILQ_INIT(&tl->tokens);
TAILQ_INIT(&tl->refs); TAILQ_INIT(&tl->refs);
TAILQ_INIT(&tl->procs); TAILQ_INIT(&tl->procs);
TAILQ_INIT(&tl->sources); TAILQ_INIT(&tl->sources);
tokens.sb = sb; tl->sb = sb;
tl->nsources = 0; tl->nsources = 0;
tokens.fc = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND); tl->fc = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND);
assert(tokens.fc != NULL); assert(tl->fc != NULL);
tokens.fh = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND); tl->fh = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND);
assert(tokens.fh != NULL); assert(tl->fh != NULL);
tokens.fi = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND); tl->fi = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND);
assert(tokens.fi != NULL); assert(tl->fi != NULL);
tokens.ff = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND); tl->ff = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND);
assert(tokens.ff != NULL); assert(tl->ff != NULL);
#define VCL_MET_MAC(l,U,m) \ #define VCL_MET_MAC(l,U,m) \
tokens.fm_##l = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND); \ tl->fm_##l = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND); \
assert(tokens.fm_##l != NULL); assert(tl->fm_##l != NULL);
#include "vcl_returns.h" #include "vcl_returns.h"
#undef VCL_MET_MAC #undef VCL_MET_MAC
...@@ -1570,7 +1570,7 @@ vcc_CompileSource(struct vsb *sb, struct source *sp) ...@@ -1570,7 +1570,7 @@ vcc_CompileSource(struct vsb *sb, struct source *sp)
TAILQ_INSERT_TAIL(&tl->sources, sp, list); TAILQ_INSERT_TAIL(&tl->sources, sp, list);
sp->idx = tl->nsources++; sp->idx = tl->nsources++;
vcc_Lexer(tl, sp); vcc_Lexer(tl, sp);
if (tokens.err) if (tl->err)
goto done; goto done;
sp = vcc_new_source(vcc_default_vcl_b, vcc_default_vcl_e, "Default"); sp = vcc_new_source(vcc_default_vcl_b, vcc_default_vcl_e, "Default");
...@@ -1578,19 +1578,19 @@ vcc_CompileSource(struct vsb *sb, struct source *sp) ...@@ -1578,19 +1578,19 @@ vcc_CompileSource(struct vsb *sb, struct source *sp)
sp->idx = tl->nsources++; sp->idx = tl->nsources++;
vcc_Lexer(tl, sp); vcc_Lexer(tl, sp);
vcc_AddToken(tl, EOI, sp->e, sp->e); vcc_AddToken(tl, EOI, sp->e, sp->e);
if (tokens.err) if (tl->err)
goto done; goto done;
vcc_resolve_includes(tl); vcc_resolve_includes(tl);
if (tokens.err) if (tl->err)
goto done; goto done;
tokens.t = TAILQ_FIRST(&tl->tokens); tl->t = TAILQ_FIRST(&tl->tokens);
Parse(tl); Parse(tl);
if (tokens.err) if (tl->err)
goto done; goto done;
Consistency(tl); Consistency(tl);
if (tokens.err) if (tl->err)
goto done; goto done;
LocTable(tl); LocTable(tl);
...@@ -1619,13 +1619,13 @@ vcc_CompileSource(struct vsb *sb, struct source *sp) ...@@ -1619,13 +1619,13 @@ vcc_CompileSource(struct vsb *sb, struct source *sp)
vcl_output_lang_h(fo); vcl_output_lang_h(fo);
fputs(vrt_obj_h, fo); fputs(vrt_obj_h, fo);
vsb_finish(tokens.fh); vsb_finish(tl->fh);
fputs(vsb_data(tokens.fh), fo); fputs(vsb_data(tl->fh), fo);
vsb_delete(tokens.fh); vsb_delete(tl->fh);
vsb_finish(tokens.fc); vsb_finish(tl->fc);
fputs(vsb_data(tokens.fc), fo); fputs(vsb_data(tl->fc), fo);
vsb_delete(tokens.fc); vsb_delete(tl->fc);
i = pclose(fo); i = pclose(fo);
fprintf(stderr, "pclose=%d\n", i); fprintf(stderr, "pclose=%d\n", i);
...@@ -1637,7 +1637,7 @@ vcc_CompileSource(struct vsb *sb, struct source *sp) ...@@ -1637,7 +1637,7 @@ vcc_CompileSource(struct vsb *sb, struct source *sp)
} }
done: done:
#define VCL_MET_MAC(l,U,m) vsb_delete(tokens.fm_##l); #define VCL_MET_MAC(l,U,m) vsb_delete(tl->fm_##l);
#include "vcl_returns.h" #include "vcl_returns.h"
#undef VCL_MET_MAC #undef VCL_MET_MAC
......
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