Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
51a5d553
Commit
51a5d553
authored
Jun 02, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Beautify the compiled VCL a bit
parent
5f67a2e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
generate.py
lib/libvcc/generate.py
+3
-2
vcc_compile.c
lib/libvcc/vcc_compile.c
+1
-1
vcc_vmod.c
lib/libvcc/vcc_vmod.c
+5
-3
No files found.
lib/libvcc/generate.py
View file @
51a5d553
...
@@ -726,7 +726,7 @@ def emit_file(fo, fd, bn):
...
@@ -726,7 +726,7 @@ def emit_file(fo, fd, bn):
x
=
0
x
=
0
l
=
0
l
=
0
fo
.
write
(
"
\n\t
/*
%
s */
\n\n
"
%
fn
)
fo
.
write
(
"
\n\t
/*
%
s */
\n\n
"
%
fn
)
fo
.
write
(
'
\t
VSB_cat(sb, "/* ---===###
%
s ###===--- */
\\
n");
\n
'
%
bn
)
fo
.
write
(
'
\t
VSB_cat(sb, "/* ---===###
%
s ###===--- */
\\
n
\\
n
");
\n
'
%
bn
)
for
c
in
fc
:
for
c
in
fc
:
if
l
==
0
:
if
l
==
0
:
fo
.
write
(
"
\t
VSB_cat(sb,
\"
"
)
fo
.
write
(
"
\t
VSB_cat(sb,
\"
"
)
...
@@ -764,9 +764,10 @@ def emit_file(fo, fd, bn):
...
@@ -764,9 +764,10 @@ def emit_file(fo, fd, bn):
fo
.
write
(
"
\"\n
"
)
fo
.
write
(
"
\"\n
"
)
x
=
0
x
=
0
if
x
!=
0
:
if
x
!=
0
:
fo
.
write
(
"
\"
"
)
fo
.
write
(
"
\"
\n
"
)
if
l
!=
0
:
if
l
!=
0
:
fo
.
write
(
"
\t
);
\n
"
)
fo
.
write
(
"
\t
);
\n
"
)
fo
.
write
(
'
\t
VSB_cat(sb, "
\\
n");
\n
'
)
#######################################################################
#######################################################################
...
...
lib/libvcc/vcc_compile.c
View file @
51a5d553
...
@@ -597,7 +597,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
...
@@ -597,7 +597,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
sym
->
wildcard
=
vcc_Stv_Wildcard
;
sym
->
wildcard
=
vcc_Stv_Wildcard
;
vcl_output_lang_h
(
tl
->
fh
);
vcl_output_lang_h
(
tl
->
fh
);
Fh
(
tl
,
0
,
"
\n
/* ---===### VCC generated code ###===---*/
\n
"
);
Fh
(
tl
,
0
,
"/* ---===### VCC generated code ###===---*/
\n
"
);
Fh
(
tl
,
0
,
"
\n
extern const struct VCL_conf VCL_conf;
\n
"
);
Fh
(
tl
,
0
,
"
\n
extern const struct VCL_conf VCL_conf;
\n
"
);
/* Macro for accessing directors */
/* Macro for accessing directors */
...
...
lib/libvcc/vcc_vmod.c
View file @
51a5d553
...
@@ -104,8 +104,6 @@ vcc_ParseImport(struct vcc *tl)
...
@@ -104,8 +104,6 @@ vcc_ParseImport(struct vcc *tl)
bprintf
(
fn
,
"%s/libvmod_%.*s.so"
,
tl
->
vmod_dir
,
PF
(
mod
));
bprintf
(
fn
,
"%s/libvmod_%.*s.so"
,
tl
->
vmod_dir
,
PF
(
mod
));
}
}
Fh
(
tl
,
0
,
"static void *VGC_vmod_%.*s;
\n
"
,
PF
(
mod
));
ifp
=
New_IniFin
(
tl
);
ifp
=
New_IniFin
(
tl
);
VSB_printf
(
ifp
->
ini
,
"
\t
if (VRT_Vmod_Init(&VGC_vmod_%.*s,
\n
"
,
PF
(
mod
));
VSB_printf
(
ifp
->
ini
,
"
\t
if (VRT_Vmod_Init(&VGC_vmod_%.*s,
\n
"
,
PF
(
mod
));
...
@@ -177,7 +175,6 @@ vcc_ParseImport(struct vcc *tl)
...
@@ -177,7 +175,6 @@ vcc_ParseImport(struct vcc *tl)
vcc_ErrWhere
(
tl
,
mod
);
vcc_ErrWhere
(
tl
,
mod
);
return
;
return
;
}
}
Fh
(
tl
,
0
,
"static struct vmod_priv vmod_priv_%.*s;
\n
"
,
PF
(
mod
));
for
(;
*
spec
!=
NULL
;
spec
++
)
{
for
(;
*
spec
!=
NULL
;
spec
++
)
{
p
=
*
spec
;
p
=
*
spec
;
if
(
!
strcmp
(
p
,
"OBJ"
))
{
if
(
!
strcmp
(
p
,
"OBJ"
))
{
...
@@ -207,5 +204,10 @@ vcc_ParseImport(struct vcc *tl)
...
@@ -207,5 +204,10 @@ vcc_ParseImport(struct vcc *tl)
sym
->
kind
=
SYM_PROC
;
sym
->
kind
=
SYM_PROC
;
}
}
}
}
Fh
(
tl
,
0
,
"
\n
/* --- BEGIN VMOD %.*s --- */
\n\n
"
,
PF
(
mod
));
Fh
(
tl
,
0
,
"static void *VGC_vmod_%.*s;
\n
"
,
PF
(
mod
));
Fh
(
tl
,
0
,
"static struct vmod_priv vmod_priv_%.*s;
\n
"
,
PF
(
mod
));
Fh
(
tl
,
0
,
"
\n
%s
\n
"
,
proto
);
Fh
(
tl
,
0
,
"
\n
%s
\n
"
,
proto
);
Fh
(
tl
,
0
,
"
\n
/* --- END VMOD %.*s --- */
\n\n
"
,
PF
(
mod
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment