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
ac6cf0fd
Commit
ac6cf0fd
authored
Jan 08, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split the parameters for the VCC compiler into a separate structure
for more clarity, before we start hacking VCC further.
parent
17190673
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
76 additions
and
77 deletions
+76
-77
mgt_vcc.c
bin/varnishd/mgt/mgt_vcc.c
+10
-10
libvcc.h
include/libvcc.h
+8
-8
vcc_acl.c
lib/libvcc/vcc_acl.c
+1
-1
vcc_compile.c
lib/libvcc/vcc_compile.c
+38
-46
vcc_compile.h
lib/libvcc/vcc_compile.h
+13
-6
vcc_parse.c
lib/libvcc/vcc_parse.c
+2
-2
vcc_vmod.c
lib/libvcc/vcc_vmod.c
+2
-2
vcc_xref.c
lib/libvcc/vcc_xref.c
+2
-2
No files found.
bin/varnishd/mgt/mgt_vcc.c
View file @
ac6cf0fd
...
@@ -64,7 +64,7 @@ unsigned mgt_vcc_err_unref;
...
@@ -64,7 +64,7 @@ unsigned mgt_vcc_err_unref;
unsigned
mgt_vcc_allow_inline_c
;
unsigned
mgt_vcc_allow_inline_c
;
unsigned
mgt_vcc_unsafe_path
;
unsigned
mgt_vcc_unsafe_path
;
static
struct
vc
c
*
vcc
;
static
struct
vc
p
*
vcp
;
#define VGC_SRC "vgc.c"
#define VGC_SRC "vgc.c"
#define VGC_LIB "vgc.so"
#define VGC_LIB "vgc.so"
...
@@ -94,12 +94,12 @@ run_vcc(void *priv)
...
@@ -94,12 +94,12 @@ run_vcc(void *priv)
sb
=
VSB_new_auto
();
sb
=
VSB_new_auto
();
XXXAN
(
sb
);
XXXAN
(
sb
);
VC
C_VCL_dir
(
vcc
,
mgt_vcl_dir
);
VC
P_VCL_dir
(
vcp
,
mgt_vcl_dir
);
VC
C_VMOD_dir
(
vcc
,
mgt_vmod_dir
);
VC
P_VMOD_dir
(
vcp
,
mgt_vmod_dir
);
VC
C_Err_Unref
(
vcc
,
mgt_vcc_err_unref
);
VC
P_Err_Unref
(
vcp
,
mgt_vcc_err_unref
);
VC
C_Allow_InlineC
(
vcc
,
mgt_vcc_allow_inline_c
);
VC
P_Allow_InlineC
(
vcp
,
mgt_vcc_allow_inline_c
);
VC
C_Unsafe_Path
(
vcc
,
mgt_vcc_unsafe_path
);
VC
P_Unsafe_Path
(
vcp
,
mgt_vcc_unsafe_path
);
csrc
=
VCC_Compile
(
vc
c
,
sb
,
vp
->
src
);
csrc
=
VCC_Compile
(
vc
p
,
sb
,
vp
->
src
);
AZ
(
VSB_finish
(
sb
));
AZ
(
VSB_finish
(
sb
));
if
(
VSB_len
(
sb
))
if
(
VSB_len
(
sb
))
printf
(
"%s"
,
VSB_data
(
sb
));
printf
(
"%s"
,
VSB_data
(
sb
));
...
@@ -318,7 +318,7 @@ void
...
@@ -318,7 +318,7 @@ void
mgt_vcc_init
(
void
)
mgt_vcc_init
(
void
)
{
{
vc
c
=
VCC
_New
();
vc
p
=
VCP
_New
();
AN
(
vc
c
);
AN
(
vc
p
);
VC
C_Builtin_VCL
(
vcc
,
builtin_vcl
);
VC
P_Builtin_VCL
(
vcp
,
builtin_vcl
);
}
}
include/libvcc.h
View file @
ac6cf0fd
...
@@ -30,12 +30,12 @@
...
@@ -30,12 +30,12 @@
struct
vcc
;
struct
vcc
;
struct
vc
c
*
VCC
_New
(
void
);
struct
vc
p
*
VCP
_New
(
void
);
void
VC
C_Builtin_VCL
(
struct
vcc
*
,
const
char
*
str
);
void
VC
P_Builtin_VCL
(
struct
vcp
*
,
const
char
*
str
);
void
VC
C_VCL_dir
(
struct
vcc
*
,
const
char
*
str
);
void
VC
P_VCL_dir
(
struct
vcp
*
,
const
char
*
str
);
void
VC
C_VMOD_dir
(
struct
vcc
*
,
const
char
*
str
);
void
VC
P_VMOD_dir
(
struct
vcp
*
,
const
char
*
str
);
void
VC
C_Err_Unref
(
struct
vcc
*
tl
,
unsigned
u
);
void
VC
P_Err_Unref
(
struct
vcp
*
tl
,
unsigned
u
);
void
VC
C_Allow_InlineC
(
struct
vcc
*
tl
,
unsigned
u
);
void
VC
P_Allow_InlineC
(
struct
vcp
*
tl
,
unsigned
u
);
void
VC
C_Unsafe_Path
(
struct
vcc
*
tl
,
unsigned
u
);
void
VC
P_Unsafe_Path
(
struct
vcp
*
tl
,
unsigned
u
);
char
*
VCC_Compile
(
const
struct
vc
c
*
,
struct
vsb
*
sb
,
const
char
*
b
);
char
*
VCC_Compile
(
const
struct
vc
p
*
,
struct
vsb
*
sb
,
const
char
*
b
);
lib/libvcc/vcc_acl.c
View file @
ac6cf0fd
...
@@ -364,7 +364,7 @@ vcc_acl_emit(struct vcc *tl, const char *acln, int anon)
...
@@ -364,7 +364,7 @@ vcc_acl_emit(struct vcc *tl, const char *acln, int anon)
Fh
(
tl
,
0
,
"
\t\t
VRT_acl_log(ctx,
\"
NO_FAM %s
\"
);
\n
"
,
acln
);
Fh
(
tl
,
0
,
"
\t\t
VRT_acl_log(ctx,
\"
NO_FAM %s
\"
);
\n
"
,
acln
);
Fh
(
tl
,
0
,
"
\t\t
return(0);
\n
"
);
Fh
(
tl
,
0
,
"
\t\t
return(0);
\n
"
);
Fh
(
tl
,
0
,
"
\t
}
\n\n
"
);
Fh
(
tl
,
0
,
"
\t
}
\n\n
"
);
if
(
!
tl
->
err_unref
&&
!
anon
)
{
if
(
!
tl
->
param
->
err_unref
&&
!
anon
)
{
ifp
=
New_IniFin
(
tl
);
ifp
=
New_IniFin
(
tl
);
VSB_printf
(
ifp
->
ini
,
VSB_printf
(
ifp
->
ini
,
"
\t
if (0) match_acl_named_%s(0, 0);
\n
"
,
acln
);
"
\t
if (0) match_acl_named_%s(0, 0);
\n
"
,
acln
);
...
...
lib/libvcc/vcc_compile.c
View file @
ac6cf0fd
...
@@ -450,16 +450,16 @@ vcc_destroy_source(struct source *sp)
...
@@ -450,16 +450,16 @@ vcc_destroy_source(struct source *sp)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
static
struct
source
*
static
struct
source
*
vcc_file_source
(
const
struct
vc
c
*
tl
,
struct
vsb
*
sb
,
const
char
*
fn
)
vcc_file_source
(
const
struct
vc
p
*
const
vcp
,
struct
vsb
*
sb
,
const
char
*
fn
)
{
{
char
*
f
;
char
*
f
;
struct
source
*
sp
;
struct
source
*
sp
;
if
(
!
tl
->
unsafe_path
&&
strchr
(
fn
,
'/'
)
!=
NULL
)
{
if
(
!
vcp
->
unsafe_path
&&
strchr
(
fn
,
'/'
)
!=
NULL
)
{
VSB_printf
(
sb
,
"Include path is unsafe '%s'
\n
"
,
fn
);
VSB_printf
(
sb
,
"Include path is unsafe '%s'
\n
"
,
fn
);
return
(
NULL
);
return
(
NULL
);
}
}
f
=
VFIL_readfile
(
tl
->
vcl_dir
,
fn
,
NULL
);
f
=
VFIL_readfile
(
vcp
->
vcl_dir
,
fn
,
NULL
);
if
(
f
==
NULL
)
{
if
(
f
==
NULL
)
{
VSB_printf
(
sb
,
"Cannot read file '%s': %s
\n
"
,
VSB_printf
(
sb
,
"Cannot read file '%s': %s
\n
"
,
fn
,
strerror
(
errno
));
fn
,
strerror
(
errno
));
...
@@ -500,7 +500,7 @@ vcc_resolve_includes(struct vcc *tl)
...
@@ -500,7 +500,7 @@ vcc_resolve_includes(struct vcc *tl)
return
;
return
;
}
}
sp
=
vcc_file_source
(
tl
,
tl
->
sb
,
t1
->
dec
);
sp
=
vcc_file_source
(
tl
->
param
,
tl
->
sb
,
t1
->
dec
);
if
(
sp
==
NULL
)
{
if
(
sp
==
NULL
)
{
vcc_ErrWhere
(
tl
,
t1
);
vcc_ErrWhere
(
tl
,
t1
);
return
;
return
;
...
@@ -522,24 +522,16 @@ vcc_resolve_includes(struct vcc *tl)
...
@@ -522,24 +522,16 @@ vcc_resolve_includes(struct vcc *tl)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
static
struct
vcc
*
static
struct
vcc
*
vcc_NewVcc
(
const
struct
vc
c
*
tl0
)
vcc_NewVcc
(
const
struct
vc
p
*
vcp
)
{
{
struct
vcc
*
tl
;
struct
vcc
*
tl
;
int
i
;
int
i
;
CHECK_OBJ_NOTNULL
(
vcp
,
VCP_MAGIC
);
ALLOC_OBJ
(
tl
,
VCC_MAGIC
);
ALLOC_OBJ
(
tl
,
VCC_MAGIC
);
AN
(
tl
);
AN
(
tl
);
if
(
tl0
!=
NULL
)
{
tl
->
param
=
vcp
;
REPLACE
(
tl
->
builtin_vcl
,
tl0
->
builtin_vcl
);
tl
->
vars
=
vcc_vars
;
REPLACE
(
tl
->
vcl_dir
,
tl0
->
vcl_dir
);
REPLACE
(
tl
->
vmod_dir
,
tl0
->
vmod_dir
);
tl
->
vars
=
tl0
->
vars
;
tl
->
err_unref
=
tl0
->
err_unref
;
tl
->
allow_inline_c
=
tl0
->
allow_inline_c
;
tl
->
unsafe_path
=
tl0
->
unsafe_path
;
}
else
{
tl
->
err_unref
=
1
;
}
VTAILQ_INIT
(
&
tl
->
symbols
);
VTAILQ_INIT
(
&
tl
->
symbols
);
VTAILQ_INIT
(
&
tl
->
inifin
);
VTAILQ_INIT
(
&
tl
->
inifin
);
VTAILQ_INIT
(
&
tl
->
membits
);
VTAILQ_INIT
(
&
tl
->
membits
);
...
@@ -606,7 +598,8 @@ vcc_DestroyTokenList(struct vcc *tl, char *ret)
...
@@ -606,7 +598,8 @@ vcc_DestroyTokenList(struct vcc *tl, char *ret)
*/
*/
static
char
*
static
char
*
vcc_CompileSource
(
const
struct
vcc
*
tl0
,
struct
vsb
*
sb
,
struct
source
*
sp
)
vcc_CompileSource
(
const
struct
vcp
*
const
vcp
,
struct
vsb
*
sb
,
struct
source
*
sp
)
{
{
struct
vcc
*
tl
;
struct
vcc
*
tl
;
struct
symbol
*
sym
;
struct
symbol
*
sym
;
...
@@ -616,7 +609,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
...
@@ -616,7 +609,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
char
*
of
;
char
*
of
;
int
i
;
int
i
;
tl
=
vcc_NewVcc
(
tl0
);
tl
=
vcc_NewVcc
(
vcp
);
tl
->
sb
=
sb
;
tl
->
sb
=
sb
;
vcc_Expr_Init
(
tl
);
vcc_Expr_Init
(
tl
);
...
@@ -649,7 +642,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
...
@@ -649,7 +642,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
return
(
vcc_DestroyTokenList
(
tl
,
NULL
));
return
(
vcc_DestroyTokenList
(
tl
,
NULL
));
/* Register and lex the builtin VCL */
/* Register and lex the builtin VCL */
sp
=
vcc_new_source
(
tl
->
builtin_vcl
,
NULL
,
"Builtin"
);
sp
=
vcc_new_source
(
tl
->
param
->
builtin_vcl
,
NULL
,
"Builtin"
);
assert
(
sp
!=
NULL
);
assert
(
sp
!=
NULL
);
VTAILQ_INSERT_TAIL
(
&
tl
->
sources
,
sp
,
list
);
VTAILQ_INSERT_TAIL
(
&
tl
->
sources
,
sp
,
list
);
sp
->
idx
=
tl
->
nsources
++
;
sp
->
idx
=
tl
->
nsources
++
;
...
@@ -759,7 +752,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
...
@@ -759,7 +752,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
*/
*/
char
*
char
*
VCC_Compile
(
const
struct
vc
c
*
tl
,
struct
vsb
*
sb
,
const
char
*
b
)
VCC_Compile
(
const
struct
vc
p
*
vcp
,
struct
vsb
*
sb
,
const
char
*
b
)
{
{
struct
source
*
sp
;
struct
source
*
sp
;
char
*
r
;
char
*
r
;
...
@@ -767,7 +760,7 @@ VCC_Compile(const struct vcc *tl, struct vsb *sb, const char *b)
...
@@ -767,7 +760,7 @@ VCC_Compile(const struct vcc *tl, struct vsb *sb, const char *b)
sp
=
vcc_new_source
(
b
,
NULL
,
"input"
);
sp
=
vcc_new_source
(
b
,
NULL
,
"input"
);
if
(
sp
==
NULL
)
if
(
sp
==
NULL
)
return
(
NULL
);
return
(
NULL
);
r
=
vcc_CompileSource
(
tl
,
sb
,
sp
);
r
=
vcc_CompileSource
(
vcp
,
sb
,
sp
);
return
(
r
);
return
(
r
);
}
}
...
@@ -775,16 +768,15 @@ VCC_Compile(const struct vcc *tl, struct vsb *sb, const char *b)
...
@@ -775,16 +768,15 @@ VCC_Compile(const struct vcc *tl, struct vsb *sb, const char *b)
* Allocate a compiler instance
* Allocate a compiler instance
*/
*/
struct
vc
c
*
struct
vc
p
*
VC
C
_New
(
void
)
VC
P
_New
(
void
)
{
{
struct
vc
c
*
tl
;
struct
vc
p
*
vcp
;
tl
=
vcc_NewVcc
(
NULL
);
ALLOC_OBJ
(
vcp
,
VCP_MAGIC
);
AN
(
vcp
);
tl
->
vars
=
vcc_vars
;
return
(
vcp
);
return
(
tl
);
}
}
/*--------------------------------------------------------------------
/*--------------------------------------------------------------------
...
@@ -792,11 +784,11 @@ VCC_New(void)
...
@@ -792,11 +784,11 @@ VCC_New(void)
*/
*/
void
void
VC
C_Builtin_VCL
(
struct
vcc
*
tl
,
const
char
*
str
)
VC
P_Builtin_VCL
(
struct
vcp
*
vcp
,
const
char
*
str
)
{
{
CHECK_OBJ_NOTNULL
(
tl
,
VCC
_MAGIC
);
CHECK_OBJ_NOTNULL
(
vcp
,
VCP
_MAGIC
);
REPLACE
(
tl
->
builtin_vcl
,
str
);
REPLACE
(
vcp
->
builtin_vcl
,
str
);
}
}
/*--------------------------------------------------------------------
/*--------------------------------------------------------------------
...
@@ -804,11 +796,11 @@ VCC_Builtin_VCL(struct vcc *tl, const char *str)
...
@@ -804,11 +796,11 @@ VCC_Builtin_VCL(struct vcc *tl, const char *str)
*/
*/
void
void
VC
C_VCL_dir
(
struct
vcc
*
tl
,
const
char
*
str
)
VC
P_VCL_dir
(
struct
vcp
*
vcp
,
const
char
*
str
)
{
{
CHECK_OBJ_NOTNULL
(
tl
,
VCC
_MAGIC
);
CHECK_OBJ_NOTNULL
(
vcp
,
VCP
_MAGIC
);
REPLACE
(
tl
->
vcl_dir
,
str
);
REPLACE
(
vcp
->
vcl_dir
,
str
);
}
}
/*--------------------------------------------------------------------
/*--------------------------------------------------------------------
...
@@ -816,11 +808,11 @@ VCC_VCL_dir(struct vcc *tl, const char *str)
...
@@ -816,11 +808,11 @@ VCC_VCL_dir(struct vcc *tl, const char *str)
*/
*/
void
void
VC
C_VMOD_dir
(
struct
vcc
*
tl
,
const
char
*
str
)
VC
P_VMOD_dir
(
struct
vcp
*
vcp
,
const
char
*
str
)
{
{
CHECK_OBJ_NOTNULL
(
tl
,
VCC
_MAGIC
);
CHECK_OBJ_NOTNULL
(
vcp
,
VCP
_MAGIC
);
REPLACE
(
tl
->
vmod_dir
,
str
);
REPLACE
(
vcp
->
vmod_dir
,
str
);
}
}
/*--------------------------------------------------------------------
/*--------------------------------------------------------------------
...
@@ -828,25 +820,25 @@ VCC_VMOD_dir(struct vcc *tl, const char *str)
...
@@ -828,25 +820,25 @@ VCC_VMOD_dir(struct vcc *tl, const char *str)
*/
*/
void
void
VC
C_Err_Unref
(
struct
vcc
*
tl
,
unsigned
u
)
VC
P_Err_Unref
(
struct
vcp
*
vcp
,
unsigned
u
)
{
{
CHECK_OBJ_NOTNULL
(
tl
,
VCC
_MAGIC
);
CHECK_OBJ_NOTNULL
(
vcp
,
VCP
_MAGIC
);
tl
->
err_unref
=
u
;
vcp
->
err_unref
=
u
;
}
}
void
void
VC
C_Allow_InlineC
(
struct
vcc
*
tl
,
unsigned
u
)
VC
P_Allow_InlineC
(
struct
vcp
*
vcp
,
unsigned
u
)
{
{
CHECK_OBJ_NOTNULL
(
tl
,
VCC
_MAGIC
);
CHECK_OBJ_NOTNULL
(
vcp
,
VCP
_MAGIC
);
tl
->
allow_inline_c
=
u
;
vcp
->
allow_inline_c
=
u
;
}
}
void
void
VC
C_Unsafe_Path
(
struct
vcc
*
tl
,
unsigned
u
)
VC
P_Unsafe_Path
(
struct
vcp
*
vcp
,
unsigned
u
)
{
{
CHECK_OBJ_NOTNULL
(
tl
,
VCC
_MAGIC
);
CHECK_OBJ_NOTNULL
(
vcp
,
VCP
_MAGIC
);
tl
->
unsafe_path
=
u
;
vcp
->
unsafe_path
=
u
;
}
}
lib/libvcc/vcc_compile.h
View file @
ac6cf0fd
...
@@ -155,14 +155,24 @@ struct inifin {
...
@@ -155,14 +155,24 @@ struct inifin {
VTAILQ_HEAD
(
inifinhead
,
inifin
);
VTAILQ_HEAD
(
inifinhead
,
inifin
);
struct
vc
c
{
struct
vc
p
{
unsigned
magic
;
unsigned
magic
;
#define VC
C_MAGIC 0x24ad719d
#define VC
P_MAGIC 0xd90acfbc
/* Parameter/Template section */
char
*
builtin_vcl
;
char
*
builtin_vcl
;
char
*
vcl_dir
;
char
*
vcl_dir
;
char
*
vmod_dir
;
char
*
vmod_dir
;
unsigned
err_unref
;
unsigned
allow_inline_c
;
unsigned
unsafe_path
;
};
struct
vcc
{
unsigned
magic
;
#define VCC_MAGIC 0x24ad719d
/* Parameter/Template section */
const
struct
vcp
*
param
;
const
struct
var
*
vars
;
const
struct
var
*
vars
;
VTAILQ_HEAD
(,
symbol
)
symbols
;
VTAILQ_HEAD
(,
symbol
)
symbols
;
...
@@ -202,9 +212,6 @@ struct vcc {
...
@@ -202,9 +212,6 @@ struct vcc {
unsigned
unique
;
unsigned
unique
;
unsigned
err_unref
;
unsigned
allow_inline_c
;
unsigned
unsafe_path
;
};
};
struct
var
{
struct
var
{
...
...
lib/libvcc/vcc_parse.c
View file @
ac6cf0fd
...
@@ -160,7 +160,7 @@ vcc_Compound(struct vcc *tl)
...
@@ -160,7 +160,7 @@ vcc_Compound(struct vcc *tl)
Fb
(
tl
,
1
,
"}
\n
"
);
Fb
(
tl
,
1
,
"}
\n
"
);
return
;
return
;
case
CSRC
:
case
CSRC
:
if
(
tl
->
allow_inline_c
)
{
if
(
tl
->
param
->
allow_inline_c
)
{
Fb
(
tl
,
1
,
"%.*s
\n
"
,
Fb
(
tl
,
1
,
"%.*s
\n
"
,
(
int
)
(
tl
->
t
->
e
-
(
tl
->
t
->
b
+
2
)),
(
int
)
(
tl
->
t
->
e
-
(
tl
->
t
->
b
+
2
)),
tl
->
t
->
b
+
1
);
tl
->
t
->
b
+
1
);
...
@@ -357,7 +357,7 @@ vcc_Parse(struct vcc *tl)
...
@@ -357,7 +357,7 @@ vcc_Parse(struct vcc *tl)
ERRCHK
(
tl
);
ERRCHK
(
tl
);
switch
(
tl
->
t
->
tok
)
{
switch
(
tl
->
t
->
tok
)
{
case
CSRC
:
case
CSRC
:
if
(
tl
->
allow_inline_c
)
{
if
(
tl
->
param
->
allow_inline_c
)
{
Fc
(
tl
,
0
,
"%.*s
\n
"
,
Fc
(
tl
,
0
,
"%.*s
\n
"
,
(
int
)
(
tl
->
t
->
e
-
(
tl
->
t
->
b
+
4
)),
(
int
)
(
tl
->
t
->
e
-
(
tl
->
t
->
b
+
4
)),
tl
->
t
->
b
+
2
);
tl
->
t
->
b
+
2
);
...
...
lib/libvcc/vcc_vmod.c
View file @
ac6cf0fd
...
@@ -85,7 +85,7 @@ vcc_ParseImport(struct vcc *tl)
...
@@ -85,7 +85,7 @@ vcc_ParseImport(struct vcc *tl)
sym
->
def_e
=
tl
->
t
;
sym
->
def_e
=
tl
->
t
;
if
(
tl
->
t
->
tok
==
ID
)
{
if
(
tl
->
t
->
tok
==
ID
)
{
if
(
!
tl
->
unsafe_path
)
{
if
(
!
tl
->
param
->
unsafe_path
)
{
VSB_printf
(
tl
->
sb
,
VSB_printf
(
tl
->
sb
,
"'import ... from path ...' not allowed.
\n
At:"
);
"'import ... from path ...' not allowed.
\n
At:"
);
vcc_ErrToken
(
tl
,
tl
->
t
);
vcc_ErrToken
(
tl
,
tl
->
t
);
...
@@ -102,7 +102,7 @@ vcc_ParseImport(struct vcc *tl)
...
@@ -102,7 +102,7 @@ vcc_ParseImport(struct vcc *tl)
bprintf
(
fn
,
"%s"
,
tl
->
t
->
dec
);
bprintf
(
fn
,
"%s"
,
tl
->
t
->
dec
);
vcc_NextToken
(
tl
);
vcc_NextToken
(
tl
);
}
else
{
}
else
{
bprintf
(
fn
,
"%s/libvmod_%.*s.so"
,
tl
->
vmod_dir
,
PF
(
mod
));
bprintf
(
fn
,
"%s/libvmod_%.*s.so"
,
tl
->
param
->
vmod_dir
,
PF
(
mod
));
}
}
SkipToken
(
tl
,
';'
);
SkipToken
(
tl
,
';'
);
...
...
lib/libvcc/vcc_xref.c
View file @
ac6cf0fd
...
@@ -108,7 +108,7 @@ vcc_checkref(struct vcc *tl, const struct symbol *sym)
...
@@ -108,7 +108,7 @@ vcc_checkref(struct vcc *tl, const struct symbol *sym)
VSB_printf
(
tl
->
sb
,
"Unused %s %.*s, defined:
\n
"
,
VSB_printf
(
tl
->
sb
,
"Unused %s %.*s, defined:
\n
"
,
VCC_SymKind
(
tl
,
sym
),
PF
(
sym
->
def_b
));
VCC_SymKind
(
tl
,
sym
),
PF
(
sym
->
def_b
));
vcc_ErrWhere
(
tl
,
sym
->
def_b
);
vcc_ErrWhere
(
tl
,
sym
->
def_b
);
if
(
!
tl
->
err_unref
)
{
if
(
!
tl
->
param
->
err_unref
)
{
VSB_printf
(
tl
->
sb
,
"(That was just a warning)
\n
"
);
VSB_printf
(
tl
->
sb
,
"(That was just a warning)
\n
"
);
tl
->
err
=
0
;
tl
->
err
=
0
;
}
}
...
@@ -289,7 +289,7 @@ vcc_checkaction2(struct vcc *tl, const struct symbol *sym)
...
@@ -289,7 +289,7 @@ vcc_checkaction2(struct vcc *tl, const struct symbol *sym)
return
;
return
;
VSB_printf
(
tl
->
sb
,
"Function unused
\n
"
);
VSB_printf
(
tl
->
sb
,
"Function unused
\n
"
);
vcc_ErrWhere
(
tl
,
p
->
name
);
vcc_ErrWhere
(
tl
,
p
->
name
);
if
(
!
tl
->
err_unref
)
{
if
(
!
tl
->
param
->
err_unref
)
{
VSB_printf
(
tl
->
sb
,
"(That was just a warning)
\n
"
);
VSB_printf
(
tl
->
sb
,
"(That was just a warning)
\n
"
);
tl
->
err
=
0
;
tl
->
err
=
0
;
}
}
...
...
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