Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-re2
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
Nils Goroll
libvmod-re2
Commits
917c66d3
Commit
917c66d3
authored
Mar 15, 2016
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add some consts
parent
72c8d31d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
15 deletions
+17
-15
vre2.cpp
src/vre2/vre2.cpp
+8
-7
vre2.h
src/vre2/vre2.h
+9
-8
No files found.
src/vre2/vre2.cpp
View file @
917c66d3
...
...
@@ -56,14 +56,14 @@ vre2::~vre2() {
}
inline
bool
vre2
::
match
(
const
char
*
subject
,
int
ngroups
,
StringPiece
*
groups
)
vre2
::
match
(
const
char
*
subject
,
const
int
ngroups
,
StringPiece
*
groups
)
const
{
return
re_
->
Match
(
subject
,
0
,
strlen
(
subject
),
RE2
::
UNANCHORED
,
groups
,
ngroups
+
1
);
}
inline
int
vre2
::
ngroups
()
inline
const
int
vre2
::
ngroups
()
const
{
return
re_
->
NumberOfCapturingGroups
();
}
...
...
@@ -85,8 +85,8 @@ vre2_matchsz(void)
}
const
char
*
vre2_match
(
vre2
*
vre2
,
const
char
*
subject
,
int
*
match
,
int
ngroups
,
void
*
group
)
vre2_match
(
vre2
*
vre2
,
const
char
*
const
subject
,
int
*
const
match
,
const
int
ngroups
,
void
*
const
group
)
{
try
{
StringPiece
*
g
=
reinterpret_cast
<
StringPiece
*>
(
group
);
...
...
@@ -97,7 +97,8 @@ vre2_match(vre2 *vre2, const char *subject, int *match, int ngroups,
}
const
char
*
vre2_capture
(
void
*
group
,
int
refnum
,
const
char
**
capture
,
int
*
len
)
vre2_capture
(
void
*
group
,
const
int
refnum
,
const
char
**
const
capture
,
int
*
const
len
)
{
try
{
StringPiece
*
g
=
reinterpret_cast
<
StringPiece
*>
(
group
);
...
...
@@ -110,7 +111,7 @@ vre2_capture(void *group, int refnum, const char **capture, int *len)
}
const
char
*
vre2_ngroups
(
vre2
*
vre2
,
int
*
ngroups
)
vre2_ngroups
(
vre2
*
vre2
,
int
*
const
ngroups
)
{
try
{
*
ngroups
=
vre2
->
ngroups
();
...
...
src/vre2/vre2.h
View file @
917c66d3
...
...
@@ -43,8 +43,8 @@ private:
public
:
vre2
(
const
char
*
pattern
);
virtual
~
vre2
();
bool
match
(
const
char
*
subject
,
int
ngroups
,
StringPiece
*
groups
);
int
ngroups
()
;
bool
match
(
const
char
*
subject
,
int
ngroups
,
StringPiece
*
groups
)
const
;
const
int
ngroups
()
const
;
};
#else
typedef
struct
vre2
vre2
;
...
...
@@ -54,14 +54,15 @@ typedef struct vre2 vre2;
extern
"C"
{
#endif
const
char
*
vre2_init
(
vre2
**
vre2
,
const
char
*
pattern
);
const
char
*
vre2_init
(
vre2
**
vre2
,
const
char
*
pattern
);
const
char
*
vre2_fini
(
vre2
**
vre2
);
const
size_t
vre2_matchsz
(
void
);
const
char
*
vre2_ngroups
(
vre2
*
vre2
,
int
*
ngroups
);
const
char
*
vre2_match
(
vre2
*
vre2
,
const
char
*
subject
,
int
*
match
,
int
ngroups
,
void
*
group
);
const
char
*
vre2_capture
(
void
*
group
,
int
refnum
,
const
char
**
capture
,
int
*
len
);
const
char
*
vre2_ngroups
(
vre2
*
vre2
,
int
*
const
ngroups
);
const
char
*
vre2_match
(
vre2
*
vre2
,
const
char
*
const
subject
,
int
*
const
match
,
int
ngroups
,
void
*
const
group
);
const
char
*
vre2_capture
(
void
*
group
,
int
refnum
,
const
char
**
const
capture
,
int
*
const
len
);
#ifdef __cplusplus
}
...
...
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