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
1a02b474
Commit
1a02b474
authored
Apr 13, 2021
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a vcc_IsFlagRaw() for when the tokens are not on tl->tokens.
parent
a1c936c8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
vcc_compile.h
lib/libvcc/vcc_compile.h
+1
-0
vcc_utils.c
lib/libvcc/vcc_utils.c
+17
-8
No files found.
lib/libvcc/vcc_compile.h
View file @
1a02b474
...
...
@@ -432,6 +432,7 @@ void vcc_ByteVal(struct vcc *, double *);
void
vcc_Duration
(
struct
vcc
*
tl
,
double
*
);
unsigned
vcc_UintVal
(
struct
vcc
*
tl
);
int
vcc_IsFlag
(
struct
vcc
*
tl
);
int
vcc_IsFlagRaw
(
struct
vcc
*
,
const
struct
token
*
,
const
struct
token
*
);
/* vcc_var.c */
sym_wildcard_t
vcc_Var_Wildcard
;
...
...
lib/libvcc/vcc_utils.c
View file @
1a02b474
...
...
@@ -361,18 +361,27 @@ vcc_ByteVal(struct vcc *tl, double *d)
/*--------------------------------------------------------------------*/
int
vcc_IsFlag
(
struct
vcc
*
tl
)
vcc_IsFlag
Raw
(
struct
vcc
*
tl
,
const
struct
token
*
t1
,
const
struct
token
*
t2
)
{
struct
token
*
sign
;
if
(
t
l
->
t
->
tok
!=
'-'
&&
tl
->
t
->
tok
!=
'+'
)
if
(
t
1
->
tok
!=
'-'
&&
t1
->
tok
!=
'+'
)
return
(
-
1
);
sign
=
tl
->
t
;
vcc_NextToken
(
tl
);
if
(
tl
->
t
->
b
!=
sign
->
e
)
{
if
(
t2
->
b
!=
t1
->
e
)
{
VSB_cat
(
tl
->
sb
,
"Expected a flag at:
\n
"
);
vcc_ErrWhere
(
tl
,
sign
);
vcc_ErrWhere
(
tl
,
t1
);
return
(
-
1
);
}
return
(
sign
->
tok
==
'+'
?
1
:
0
);
return
(
t1
->
tok
==
'+'
?
1
:
0
);
}
int
vcc_IsFlag
(
struct
vcc
*
tl
)
{
int
retval
;
retval
=
vcc_IsFlagRaw
(
tl
,
tl
->
t
,
VTAILQ_NEXT
(
tl
->
t
,
list
));
if
(
retval
>=
0
)
vcc_NextToken
(
tl
);
return
(
retval
);
}
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