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
f7d8112c
Commit
f7d8112c
authored
Apr 14, 2023
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
varnishtest: New macro_isdef() function
parent
21ec091a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
vtc.c
bin/varnishtest/vtc.c
+20
-0
vtc.h
bin/varnishtest/vtc.h
+2
-2
No files found.
bin/varnishtest/vtc.c
View file @
f7d8112c
...
@@ -201,6 +201,26 @@ macro_undef(struct vtclog *vl, const char *instance, const char *name)
...
@@ -201,6 +201,26 @@ macro_undef(struct vtclog *vl, const char *instance, const char *name)
AZ
(
pthread_mutex_unlock
(
&
macro_mtx
));
AZ
(
pthread_mutex_unlock
(
&
macro_mtx
));
}
}
unsigned
macro_isdef
(
const
char
*
instance
,
const
char
*
name
)
{
char
buf1
[
256
];
struct
macro
*
m
;
if
(
instance
!=
NULL
)
{
bprintf
(
buf1
,
"%s_%s"
,
instance
,
name
);
name
=
buf1
;
}
AZ
(
pthread_mutex_lock
(
&
macro_mtx
));
VTAILQ_FOREACH
(
m
,
&
macro_list
,
list
)
if
(
!
strcmp
(
name
,
m
->
name
))
break
;
AZ
(
pthread_mutex_unlock
(
&
macro_mtx
));
return
(
m
!=
NULL
);
}
void
void
macro_cat
(
struct
vtclog
*
vl
,
struct
vsb
*
vsb
,
const
char
*
b
,
const
char
*
e
)
macro_cat
(
struct
vtclog
*
vl
,
struct
vsb
*
vsb
,
const
char
*
b
,
const
char
*
e
)
{
{
...
...
bin/varnishtest/vtc.h
View file @
f7d8112c
...
@@ -114,8 +114,8 @@ int exec_file(const char *fn, const char *script, const char *tmpdir,
...
@@ -114,8 +114,8 @@ int exec_file(const char *fn, const char *script, const char *tmpdir,
void
macro_undef
(
struct
vtclog
*
vl
,
const
char
*
instance
,
const
char
*
name
);
void
macro_undef
(
struct
vtclog
*
vl
,
const
char
*
instance
,
const
char
*
name
);
void
macro_def
(
struct
vtclog
*
vl
,
const
char
*
instance
,
const
char
*
name
,
void
macro_def
(
struct
vtclog
*
vl
,
const
char
*
instance
,
const
char
*
name
,
const
char
*
fmt
,
...)
const
char
*
fmt
,
...)
v_printflike_
(
4
,
5
);
v_printflike_
(
4
,
5
);
unsigned
macro_isdef
(
const
char
*
instance
,
const
char
*
name
);
void
macro_cat
(
struct
vtclog
*
,
struct
vsb
*
,
const
char
*
,
const
char
*
);
void
macro_cat
(
struct
vtclog
*
,
struct
vsb
*
,
const
char
*
,
const
char
*
);
struct
vsb
*
macro_expand
(
struct
vtclog
*
vl
,
const
char
*
text
);
struct
vsb
*
macro_expand
(
struct
vtclog
*
vl
,
const
char
*
text
);
struct
vsb
*
macro_expandf
(
struct
vtclog
*
vl
,
const
char
*
,
...)
struct
vsb
*
macro_expandf
(
struct
vtclog
*
vl
,
const
char
*
,
...)
...
...
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