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
3b2c6d33
Commit
3b2c6d33
authored
Jun 27, 2017
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move libvcc away from is* macros
Refs #2354
parent
56f7ff4d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
vct.h
include/vct.h
+4
-0
vct.c
lib/libvarnish/vct.c
+1
-1
vcc_token.c
lib/libvcc/vcc_token.c
+4
-5
No files found.
include/vct.h
View file @
3b2c6d33
...
...
@@ -43,6 +43,8 @@
#define VCT_TCHAR (1<<9)
#define VCT_NAME (1<<10)
#define VCT_VAR (1<<11)
#define VCT_VT (1<<12)
#define VCT_SPACE (VCT_LWS | VCT_VT)
extern
const
uint16_t
vct_typtab
[
256
];
...
...
@@ -60,8 +62,10 @@ vct_is(int x, uint16_t y)
#define vct_ishex(x) vct_is(x, VCT_HEX)
#define vct_islws(x) vct_is(x, VCT_LWS)
#define vct_isctl(x) vct_is(x, VCT_CTL)
#define vct_isspace(x) vct_is(x, VCT_SPACE)
#define vct_isdigit(x) vct_is(x, VCT_DIGIT)
#define vct_isalpha(x) vct_is(x, VCT_ALPHA)
#define vct_isalnum(x) vct_is(x, VCT_ALPHA | VCT_DIGIT)
#define vct_issep(x) vct_is(x, VCT_SEPARATOR)
#define vct_issepctl(x) vct_is(x, VCT_SEPARATOR | VCT_CTL)
#define vct_isident1(x) vct_isalpha(x)
...
...
lib/libvarnish/vct.c
View file @
3b2c6d33
...
...
@@ -54,7 +54,7 @@ const uint16_t vct_typtab[256] = {
[
0x08
]
=
VCT_CTL
,
[
0x09
]
=
VCT_CTL
|
VCT_SP
|
VCT_SEPARATOR
,
[
0x0a
]
=
VCT_CTL
|
VCT_CRLF
,
[
0x0b
]
=
VCT_CTL
,
[
0x0b
]
=
VCT_CTL
|
VCT_VT
,
[
0x0c
]
=
VCT_CTL
,
[
0x0d
]
=
VCT_CTL
|
VCT_CRLF
,
[
0x0e
]
=
VCT_CTL
,
...
...
lib/libvcc/vcc_token.c
View file @
3b2c6d33
...
...
@@ -29,7 +29,6 @@
#include "config.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
...
@@ -304,7 +303,7 @@ vcc_ExpectCid(struct vcc *tl, const char *what)
ERRCHK
(
tl
);
/* XXX: too soon to use vct_invalid_name() */
for
(
q
=
tl
->
t
->
b
;
q
<
tl
->
t
->
e
;
q
++
)
{
if
(
!
isalnum
(
*
q
)
&&
*
q
!=
'_'
)
{
if
(
!
vct_
isalnum
(
*
q
)
&&
*
q
!=
'_'
)
{
VSB_printf
(
tl
->
sb
,
"Name of %s, "
,
what
);
vcc_ErrToken
(
tl
,
tl
->
t
);
VSB_printf
(
tl
->
sb
,
...
...
@@ -371,7 +370,7 @@ vcc_Lexer(struct vcc *tl, struct source *sp)
for
(
p
=
sp
->
b
;
p
<
sp
->
e
;
)
{
/* Skip any whitespace */
if
(
isspace
(
*
p
))
{
if
(
vct_
isspace
(
*
p
))
{
p
++
;
continue
;
}
...
...
@@ -501,9 +500,9 @@ vcc_Lexer(struct vcc *tl, struct source *sp)
}
/* Match numbers { [0-9]+ } */
if
(
isdigit
(
*
p
))
{
if
(
vct_
isdigit
(
*
p
))
{
for
(
q
=
p
;
q
<
sp
->
e
;
q
++
)
if
(
!
isdigit
(
*
q
))
if
(
!
vct_
isdigit
(
*
q
))
break
;
vcc_AddToken
(
tl
,
CNUM
,
p
,
q
);
p
=
q
;
...
...
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