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
b4d08660
Commit
b4d08660
authored
Feb 10, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rearrange function order
parent
117c2bdc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
52 deletions
+52
-52
mgt_vcc.c
bin/varnishd/mgt/mgt_vcc.c
+52
-52
No files found.
bin/varnishd/mgt/mgt_vcc.c
View file @
b4d08660
...
...
@@ -83,6 +83,58 @@ static const char * const builtin_vcl =
#include "builtin_vcl.h"
""
;
/*--------------------------------------------------------------------*/
static
struct
vclprog
*
mgt_vcc_add
(
const
char
*
name
,
char
*
file
)
{
struct
vclprog
*
vp
;
vp
=
calloc
(
sizeof
*
vp
,
1
);
XXXAN
(
vp
);
vp
->
name
=
strdup
(
name
);
XXXAN
(
vp
->
name
);
vp
->
fname
=
file
;
VTAILQ_INSERT_TAIL
(
&
vclhead
,
vp
,
list
);
return
(
vp
);
}
static
void
mgt_vcc_del
(
struct
vclprog
*
vp
)
{
VTAILQ_REMOVE
(
&
vclhead
,
vp
,
list
);
printf
(
"unlink %s
\n
"
,
vp
->
fname
);
XXXAZ
(
unlink
(
vp
->
fname
));
free
(
vp
->
fname
);
free
(
vp
->
name
);
free
(
vp
);
}
static
struct
vclprog
*
mgt_vcc_byname
(
const
char
*
name
)
{
struct
vclprog
*
vp
;
VTAILQ_FOREACH
(
vp
,
&
vclhead
,
list
)
if
(
!
strcmp
(
name
,
vp
->
name
))
return
(
vp
);
return
(
NULL
);
}
static
int
mgt_vcc_delbyname
(
const
char
*
name
)
{
struct
vclprog
*
vp
;
vp
=
mgt_vcc_byname
(
name
);
if
(
vp
!=
NULL
)
{
mgt_vcc_del
(
vp
);
return
(
0
);
}
return
(
1
);
}
/*--------------------------------------------------------------------
* Prepare the compiler command line
*/
...
...
@@ -332,58 +384,6 @@ mgt_VccCompile(struct vsb **sb, const char *vclname, const char *vclsrc,
/*--------------------------------------------------------------------*/
static
struct
vclprog
*
mgt_vcc_add
(
const
char
*
name
,
char
*
file
)
{
struct
vclprog
*
vp
;
vp
=
calloc
(
sizeof
*
vp
,
1
);
XXXAN
(
vp
);
vp
->
name
=
strdup
(
name
);
XXXAN
(
vp
->
name
);
vp
->
fname
=
file
;
VTAILQ_INSERT_TAIL
(
&
vclhead
,
vp
,
list
);
return
(
vp
);
}
static
void
mgt_vcc_del
(
struct
vclprog
*
vp
)
{
VTAILQ_REMOVE
(
&
vclhead
,
vp
,
list
);
printf
(
"unlink %s
\n
"
,
vp
->
fname
);
XXXAZ
(
unlink
(
vp
->
fname
));
free
(
vp
->
fname
);
free
(
vp
->
name
);
free
(
vp
);
}
static
struct
vclprog
*
mgt_vcc_byname
(
const
char
*
name
)
{
struct
vclprog
*
vp
;
VTAILQ_FOREACH
(
vp
,
&
vclhead
,
list
)
if
(
!
strcmp
(
name
,
vp
->
name
))
return
(
vp
);
return
(
NULL
);
}
static
int
mgt_vcc_delbyname
(
const
char
*
name
)
{
struct
vclprog
*
vp
;
vp
=
mgt_vcc_byname
(
name
);
if
(
vp
!=
NULL
)
{
mgt_vcc_del
(
vp
);
return
(
0
);
}
return
(
1
);
}
/*--------------------------------------------------------------------*/
unsigned
mgt_vcc_default
(
const
char
*
b_arg
,
const
char
*
f_arg
,
char
*
vcl
,
int
C_flag
)
{
...
...
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