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
74f3c13e
Commit
74f3c13e
authored
Sep 22, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A quick style polish
parent
6c696adb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
vre.c
lib/libvarnish/vre.c
+18
-12
No files found.
lib/libvarnish/vre.c
View file @
74f3c13e
...
@@ -38,41 +38,47 @@ struct vre {
...
@@ -38,41 +38,47 @@ struct vre {
pcre
*
re
;
pcre
*
re
;
};
};
vre_t
*
VRE_compile
(
const
char
*
pattern
,
int
options
,
vre_t
*
const
char
**
errptr
,
int
*
erroffset
)
{
VRE_compile
(
const
char
*
pattern
,
int
options
,
const
char
**
errptr
,
int
*
erroffset
)
{
vre_t
*
v
;
vre_t
*
v
;
*
errptr
=
NULL
;
*
erroffset
=
0
;
*
errptr
=
NULL
;
*
erroffset
=
0
;
ALLOC_OBJ
(
v
,
VRE_MAGIC
);
ALLOC_OBJ
(
v
,
VRE_MAGIC
);
AN
(
v
);
if
(
v
==
NULL
)
return
(
NULL
);
v
->
re
=
pcre_compile
(
pattern
,
options
,
errptr
,
erroffset
,
NULL
);
v
->
re
=
pcre_compile
(
pattern
,
options
,
errptr
,
erroffset
,
NULL
);
if
(
v
->
re
==
NULL
)
{
if
(
v
->
re
==
NULL
)
{
VRE_free
(
&
v
);
VRE_free
(
&
v
);
return
NULL
;
return
(
NULL
)
;
}
}
return
v
;
return
(
v
)
;
}
}
int
VRE_exec
(
const
vre_t
*
code
,
const
char
*
subject
,
int
length
,
int
int
startoffset
,
int
options
,
int
*
ovector
,
int
ovecsize
)
{
VRE_exec
(
const
vre_t
*
code
,
const
char
*
subject
,
int
length
,
int
startoffset
,
int
options
,
int
*
ovector
,
int
ovecsize
)
{
CHECK_OBJ_NOTNULL
(
code
,
VRE_MAGIC
);
CHECK_OBJ_NOTNULL
(
code
,
VRE_MAGIC
);
int
ov
[
30
];
int
ov
[
30
];
if
(
ovector
==
NULL
)
{
if
(
ovector
==
NULL
)
{
ovector
=
ov
;
ovector
=
ov
;
ovecsize
=
sizeof
(
ov
)
/
sizeof
(
ov
[
0
]);
ovecsize
=
sizeof
(
ov
)
/
sizeof
(
ov
[
0
]);
}
}
return
pcre_exec
(
code
->
re
,
NULL
,
subject
,
length
,
return
(
pcre_exec
(
code
->
re
,
NULL
,
subject
,
length
,
startoffset
,
options
,
ovector
,
ovecsize
);
startoffset
,
options
,
ovector
,
ovecsize
)
);
}
}
void
VRE_free
(
vre_t
**
vv
)
{
void
VRE_free
(
vre_t
**
vv
)
{
vre_t
*
v
=
*
vv
;
vre_t
*
v
=
*
vv
;
*
vv
=
NULL
;
*
vv
=
NULL
;
CHECK_OBJ
(
v
,
VRE_MAGIC
);
CHECK_OBJ
(
v
,
VRE_MAGIC
);
pcre_free
(
v
->
re
);
pcre_free
(
v
->
re
);
v
->
magic
=
0
;
FREE_OBJ
(
v
);
FREE_OBJ
(
v
);
}
}
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