Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
0cfc7187
Commit
0cfc7187
authored
May 31, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Namespace cleanup FooArgv -> VAV_Foo
parent
a5f11476
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
38 additions
and
38 deletions
+38
-38
cache_hash.c
bin/varnishd/cache_hash.c
+1
-1
cache_vrt.c
bin/varnishd/cache_vrt.c
+3
-3
mgt_param.c
bin/varnishd/mgt_param.c
+4
-4
mgt_shmem.c
bin/varnishd/mgt_shmem.c
+2
-2
stevedore.c
bin/varnishd/stevedore.c
+2
-2
varnishd.c
bin/varnishd/varnishd.c
+2
-2
vtc.c
bin/varnishtest/vtc.c
+1
-1
argv.h
include/argv.h
+4
-4
argv.c
lib/libvarnish/argv.c
+13
-13
cli_serve.c
lib/libvarnish/cli_serve.c
+4
-4
vsc.c
lib/libvarnishapi/vsc.c
+2
-2
No files found.
bin/varnishd/cache_hash.c
View file @
0cfc7187
...
...
@@ -738,7 +738,7 @@ HSH_config(const char *h_arg)
const
struct
hash_slinger
*
hp
;
ASSERT_MGT
();
av
=
ParseArgv
(
h_arg
,
NULL
,
ARGV_COMMA
);
av
=
VAV_Parse
(
h_arg
,
NULL
,
ARGV_COMMA
);
AN
(
av
);
if
(
av
[
0
]
!=
NULL
)
...
...
bin/varnishd/cache_vrt.c
View file @
0cfc7187
...
...
@@ -467,10 +467,10 @@ VRT_ban_string(struct sess *sp, const char *str)
int
i
;
(
void
)
sp
;
av
=
ParseArgv
(
str
,
NULL
,
ARGV_NOESC
);
av
=
VAV_Parse
(
str
,
NULL
,
ARGV_NOESC
);
if
(
av
[
0
]
!=
NULL
)
{
/* XXX: report error how ? */
FreeArgv
(
av
);
VAV_Free
(
av
);
return
;
}
b
=
BAN_New
();
...
...
@@ -500,7 +500,7 @@ VRT_ban_string(struct sess *sp, const char *str)
BAN_Free
(
b
);
else
BAN_Insert
(
b
);
FreeArgv
(
av
);
VAV_Free
(
av
);
}
/*--------------------------------------------------------------------
...
...
bin/varnishd/mgt_param.c
View file @
0cfc7187
...
...
@@ -354,7 +354,7 @@ tweak_listen_address(struct cli *cli, const struct parspec *par,
return
;
}
av
=
ParseArgv
(
arg
,
NULL
,
ARGV_COMMA
);
av
=
VAV_Parse
(
arg
,
NULL
,
ARGV_COMMA
);
if
(
av
==
NULL
)
{
cli_out
(
cli
,
"Parse error: out of memory"
);
cli_result
(
cli
,
CLIS_PARAM
);
...
...
@@ -363,13 +363,13 @@ tweak_listen_address(struct cli *cli, const struct parspec *par,
if
(
av
[
0
]
!=
NULL
)
{
cli_out
(
cli
,
"Parse error: %s"
,
av
[
0
]);
cli_result
(
cli
,
CLIS_PARAM
);
FreeArgv
(
av
);
VAV_Free
(
av
);
return
;
}
if
(
av
[
1
]
==
NULL
)
{
cli_out
(
cli
,
"Empty listen address"
);
cli_result
(
cli
,
CLIS_PARAM
);
FreeArgv
(
av
);
VAV_Free
(
av
);
return
;
}
VTAILQ_INIT
(
&
lsh
);
...
...
@@ -395,7 +395,7 @@ tweak_listen_address(struct cli *cli, const struct parspec *par,
}
free
(
ta
);
}
FreeArgv
(
av
);
VAV_Free
(
av
);
if
(
cli
!=
NULL
&&
cli
->
result
!=
CLIS_OK
)
{
clean_listen_sock_head
(
&
lsh
);
return
;
...
...
bin/varnishd/mgt_shmem.c
View file @
0cfc7187
...
...
@@ -206,7 +206,7 @@ mgt_SHM_Init(const char *l_arg)
if
(
l_arg
==
NULL
)
l_arg
=
""
;
av
=
ParseArgv
(
l_arg
,
NULL
,
ARGV_COMMA
);
av
=
VAV_Parse
(
l_arg
,
NULL
,
ARGV_COMMA
);
AN
(
av
);
if
(
av
[
0
]
!=
NULL
)
ARGV_ERR
(
"
\t
-l ...: %s"
,
av
[
0
]);
...
...
@@ -253,7 +253,7 @@ mgt_SHM_Init(const char *l_arg)
if
(
*
ap
!=
NULL
)
ARGV_ERR
(
"
\t
-l ...: Too many sub-args
\n
"
);
FreeArgv
(
av
);
VAV_Free
(
av
);
size
=
s1
+
s2
;
ps
=
getpagesize
();
...
...
bin/varnishd/stevedore.c
View file @
0cfc7187
...
...
@@ -438,9 +438,9 @@ STV_Config(const char *spec)
p
=
strchr
(
spec
,
'='
);
q
=
strchr
(
spec
,
','
);
if
(
p
!=
NULL
&&
(
q
==
NULL
||
q
>
p
))
{
av
=
ParseArgv
(
p
+
1
,
NULL
,
ARGV_COMMA
);
av
=
VAV_Parse
(
p
+
1
,
NULL
,
ARGV_COMMA
);
}
else
{
av
=
ParseArgv
(
spec
,
NULL
,
ARGV_COMMA
);
av
=
VAV_Parse
(
spec
,
NULL
,
ARGV_COMMA
);
p
=
NULL
;
}
AN
(
av
);
...
...
bin/varnishd/varnishd.c
View file @
0cfc7187
...
...
@@ -185,7 +185,7 @@ tackle_warg(const char *argv)
char
**
av
;
unsigned
int
u
;
av
=
ParseArgv
(
argv
,
NULL
,
ARGV_COMMA
);
av
=
VAV_Parse
(
argv
,
NULL
,
ARGV_COMMA
);
AN
(
av
);
if
(
av
[
0
]
!=
NULL
)
...
...
@@ -210,7 +210,7 @@ tackle_warg(const char *argv)
params
->
wthread_timeout
=
u
;
}
}
FreeArgv
(
av
);
VAV_Free
(
av
);
}
/*--------------------------------------------------------------------*/
...
...
bin/varnishtest/vtc.c
View file @
0cfc7187
...
...
@@ -244,7 +244,7 @@ parse_string(char *buf, const struct cmds *cmd, void *priv, struct vtclog *vl)
if
(
*
p
==
'"'
)
break
;
if
(
*
p
==
'\\'
)
{
p
+=
BackSlash
(
p
,
q
)
-
1
;
p
+=
VAV_
BackSlash
(
p
,
q
)
-
1
;
q
++
;
}
else
{
if
(
*
p
==
'\n'
)
...
...
include/argv.h
View file @
0cfc7187
...
...
@@ -28,10 +28,10 @@
*
*/
void
FreeArgv
(
char
**
argv
);
char
**
ParseArgv
(
const
char
*
s
,
int
*
argc
,
int
flag
);
char
*
BackSlashDecode
(
const
char
*
s
,
const
char
*
e
);
int
BackSlash
(
const
char
*
s
,
char
*
res
);
void
VAV_Free
(
char
**
argv
);
char
**
VAV_Parse
(
const
char
*
s
,
int
*
argc
,
int
flag
);
char
*
VAV_
BackSlashDecode
(
const
char
*
s
,
const
char
*
e
);
int
VAV_
BackSlash
(
const
char
*
s
,
char
*
res
);
#define ARGV_COMMENT (1 << 0)
#define ARGV_COMMA (1 << 1)
#define ARGV_NOESC (1 << 2)
lib/libvarnish/argv.c
View file @
0cfc7187
...
...
@@ -26,13 +26,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* const char **
ParseArgv
(const char *s, int comment)
* const char **
VAV_Parse
(const char *s, int comment)
* Parse a command like line into an argv[]
* Index zero contains NULL or an error message
* "double quotes" and backslash substitution is handled.
*
* void
FreeArgv
(const char **argv)
* Free the result of
ParseArgv
()
* void
VAV_Free
(const char **argv)
* Free the result of
VAV_Parse
()
*
*/
...
...
@@ -46,7 +46,7 @@
#include "libvarnish.h"
int
BackSlash
(
const
char
*
s
,
char
*
res
)
VAV_
BackSlash
(
const
char
*
s
,
char
*
res
)
{
int
r
;
char
c
;
...
...
@@ -102,7 +102,7 @@ BackSlash(const char *s, char *res)
}
char
*
BackSlashDecode
(
const
char
*
s
,
const
char
*
e
)
VAV_
BackSlashDecode
(
const
char
*
s
,
const
char
*
e
)
{
const
char
*
q
;
char
*
p
,
*
r
;
...
...
@@ -119,7 +119,7 @@ BackSlashDecode(const char *s, const char *e)
*
r
++
=
*
q
++
;
continue
;
}
i
=
BackSlash
(
q
,
r
);
i
=
VAV_
BackSlash
(
q
,
r
);
q
+=
i
;
r
++
;
}
...
...
@@ -131,7 +131,7 @@ static char err_invalid_backslash[] = "Invalid backslash sequence";
static
char
err_missing_quote
[]
=
"Missing '
\"
'"
;
char
**
ParseArgv
(
const
char
*
s
,
int
*
argc
,
int
flag
)
VAV_Parse
(
const
char
*
s
,
int
*
argc
,
int
flag
)
{
char
**
argv
;
const
char
*
p
;
...
...
@@ -163,7 +163,7 @@ ParseArgv(const char *s, int *argc, int flag)
}
while
(
1
)
{
if
(
*
s
==
'\\'
&&
!
(
flag
&
ARGV_NOESC
))
{
i
=
BackSlash
(
s
,
NULL
);
i
=
VAV_
BackSlash
(
s
,
NULL
);
if
(
i
==
0
)
{
argv
[
0
]
=
err_invalid_backslash
;
return
(
argv
);
...
...
@@ -198,7 +198,7 @@ ParseArgv(const char *s, int *argc, int flag)
argv
[
nargv
][
s
-
p
]
=
'\0'
;
nargv
++
;
}
else
{
argv
[
nargv
++
]
=
BackSlashDecode
(
p
,
s
);
argv
[
nargv
++
]
=
VAV_
BackSlashDecode
(
p
,
s
);
}
if
(
*
s
!=
'\0'
)
s
++
;
...
...
@@ -210,7 +210,7 @@ ParseArgv(const char *s, int *argc, int flag)
}
void
FreeArgv
(
char
**
argv
)
VAV_Free
(
char
**
argv
)
{
int
i
;
...
...
@@ -224,7 +224,7 @@ FreeArgv(char **argv)
#include <printf.h>
static
void
PrintArgv
(
char
**
argv
)
VAV_Print
(
char
**
argv
)
{
int
i
;
...
...
@@ -241,8 +241,8 @@ Test(const char *str)
char
**
av
;
printf
(
"Test: <%V>
\n
"
,
str
);
av
=
ParseArgv
(
str
,
0
);
PrintArgv
(
av
);
av
=
VAV_Parse
(
str
,
0
);
VAV_Print
(
av
);
}
int
...
...
lib/libvarnish/cli_serve.c
View file @
0cfc7187
...
...
@@ -323,11 +323,11 @@ cls_vlu(void *priv, const char *p)
return
(
0
);
REPLACE
(
cli
->
cmd
,
p
);
av
=
ParseArgv
(
p
,
NULL
,
0
);
av
=
VAV_Parse
(
p
,
NULL
,
0
);
AN
(
av
);
if
(
av
[
0
]
!=
NULL
)
{
i
=
cls_vlu2
(
priv
,
av
);
FreeArgv
(
av
);
VAV_Free
(
av
);
free
(
cli
->
cmd
);
cli
->
cmd
=
NULL
;
return
(
i
);
...
...
@@ -336,7 +336,7 @@ cls_vlu(void *priv, const char *p)
continue
;
if
(
i
<
3
||
cli
->
auth
==
0
||
strcmp
(
av
[
i
-
2
],
"<<"
))
{
i
=
cls_vlu2
(
priv
,
av
);
FreeArgv
(
av
);
VAV_Free
(
av
);
free
(
cli
->
cmd
);
cli
->
cmd
=
NULL
;
return
(
i
);
...
...
@@ -363,7 +363,7 @@ cls_vlu(void *priv, const char *p)
cfd
->
argv
[
cfd
->
last_idx
]
=
VSB_data
(
cfd
->
last_arg
);
i
=
cls_vlu2
(
priv
,
cfd
->
argv
);
cfd
->
argv
[
cfd
->
last_idx
]
=
NULL
;
FreeArgv
(
cfd
->
argv
);
VAV_Free
(
cfd
->
argv
);
cfd
->
argv
=
NULL
;
free
(
cli
->
cmd
);
cli
->
cmd
=
NULL
;
...
...
lib/libvarnishapi/vsc.c
View file @
0cfc7187
...
...
@@ -123,7 +123,7 @@ vsc_sf_arg(const struct VSM_data *vd, const char *opt)
vsc
->
sf_init
=
1
;
}
av
=
ParseArgv
(
opt
,
NULL
,
ARGV_COMMA
);
av
=
VAV_Parse
(
opt
,
NULL
,
ARGV_COMMA
);
AN
(
av
);
if
(
av
[
0
]
!=
NULL
)
{
vd
->
diag
(
vd
->
priv
,
"Parse error: %s"
,
av
[
0
]);
...
...
@@ -183,7 +183,7 @@ vsc_sf_arg(const struct VSM_data *vd, const char *opt)
}
}
}
FreeArgv
(
av
);
VAV_Free
(
av
);
return
(
1
);
}
...
...
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