Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-objvar
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
uplex-varnish
varnish-objvar
Commits
a46d462c
Unverified
Commit
a46d462c
authored
Jan 06, 2021
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
f68e5ca9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
vmod_constant.c
src/vmod_constant.c
+7
-1
vmod_globalvar.c
src/vmod_globalvar.c
+10
-3
No files found.
src/vmod_constant.c
View file @
a46d462c
...
...
@@ -62,7 +62,7 @@
#define var_code(vmod_, VMODPFX_, vmodpfx_, TYPE, type) \
struct vmodpfx_ ## type { \
uint16_t magic; \
int
defined:1; \
unsigned
defined:1; \
VCL_ ## TYPE var; \
}; \
\
...
...
@@ -108,6 +108,9 @@
vmod_ ## type ## _get(VRT_CTX, struct vmodpfx_ ## type *v, \
VCL_ ## TYPE fallback) \
{ \
\
(void) ctx; \
\
CHECK_OBJ_NOTNULL(v, VMODPFX_ ## TYPE ## _MAGIC); \
\
if (v->defined) \
...
...
@@ -119,6 +122,9 @@
VCL_BOOL \
vmod_ ## type ## _defined(VRT_CTX, struct vmodpfx_ ## type *v) \
{ \
\
(void) ctx; \
\
CHECK_OBJ_NOTNULL(v, VMODPFX_ ## TYPE ## _MAGIC); \
\
return (!!v->defined); \
...
...
src/vmod_globalvar.c
View file @
a46d462c
...
...
@@ -152,14 +152,15 @@ task_ref_var(VRT_CTX, struct vmod_globalvar_var *v, unsigned magic) {
#define immediate(vmod_, VMODPFX_, vmodpfx_, TYPE, type) \
struct vmodpfx_ ## type { \
uint16_t magic; \
int
defined:1; \
unsigned
defined:1; \
VCL_ ## TYPE var; \
}; \
\
static inline void \
init_var_ ## type(struct vmodpfx_ ## type *v) \
{ \
(void)0; \
\
(void) v; \
} \
\
static inline void \
...
...
@@ -195,7 +196,7 @@ task_ref_var(VRT_CTX, struct vmod_globalvar_var *v, unsigned magic) {
#define pointer(vmod_, VMODPFX_, vmodpfx_, TYPE, type) \
struct vmodpfx_ ## type { \
uint16_t magic; \
int
defined:1; \
unsigned
defined:1; \
pthread_mutex_t mtx; \
struct vmod_globalvar_var *var; \
}; \
...
...
@@ -218,6 +219,7 @@ task_ref_var(VRT_CTX, struct vmod_globalvar_var *v, unsigned magic) {
{ \
VCL_ ## TYPE vv = v; \
FREE_ ## TYPE(vv); \
AZ(vv); \
} \
\
static inline void \
...
...
@@ -325,6 +327,8 @@ task_ref_var(VRT_CTX, struct vmod_globalvar_var *v, unsigned magic) {
vmod_ ## type ## _set(VRT_CTX, struct vmodpfx_ ## type *v, \
VCL_ ## TYPE val) \
{ \
\
(void) ctx; \
CHECK_OBJ_NOTNULL(v, VMODPFX_ ## TYPE ## _MAGIC); \
\
set_var_ ## type(v, val); \
...
...
@@ -335,6 +339,7 @@ task_ref_var(VRT_CTX, struct vmod_globalvar_var *v, unsigned magic) {
{ \
struct vmod_globalvar_var *o; \
\
(void) ctx; \
CHECK_OBJ_NOTNULL(v, VMODPFX_ ## TYPE ## _MAGIC); \
\
if (! v->defined) \
...
...
@@ -346,6 +351,8 @@ task_ref_var(VRT_CTX, struct vmod_globalvar_var *v, unsigned magic) {
VCL_BOOL \
vmod_ ## type ## _defined(VRT_CTX, struct vmodpfx_ ## type *v) \
{ \
\
(void) ctx; \
CHECK_OBJ_NOTNULL(v, VMODPFX_ ## TYPE ## _MAGIC); \
\
return (!!v->defined); \
...
...
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