1 From: Mark Baker <mark@mnb.org.uk>
2 Date: Wed, 13 Jul 2016 21:20:13 +0100
3 Subject: PCRE6_compatible_API
9 3 files changed, 9 insertions(+), 1 deletion(-)
11 diff --git a/pcrecpp.cc b/pcrecpp.cc
12 index d09c9ab..728b074 100644
15 @@ -80,6 +80,12 @@ static const string empty_string;
16 // If the user doesn't ask for any options, we just use this one
17 static RE_Options default_options;
19 +// PCRE6.x compatible API
20 +void RE::Init(const char *c_pat, const RE_Options* options) {
21 + const string cxx_pat(c_pat);
22 + Init(cxx_pat, options);
25 void RE::Init(const string& pat, const RE_Options* options) {
27 if (options == NULL) {
28 diff --git a/pcrecpp.h b/pcrecpp.h
29 index 3e594b0..a520057 100644
32 @@ -658,6 +658,8 @@ class PCRECPP_EXP_DEFN RE {
35 void Init(const string& pattern, const RE_Options* options);
36 + // Old version from PCRE 6.x, for compatibility
37 + void Init(const char *pattern, const RE_Options* options);
40 // Match against "text", filling in "vec" (up to "vecsize" * 2/3) with
41 diff --git a/pcretest.c b/pcretest.c
42 index 78ef517..f42f0a3 100644
45 @@ -2984,7 +2984,7 @@ int main(int argc, char **argv)
50 +long int options = 0;
51 int study_options = 0;
52 int default_find_match_limit = FALSE;
53 pcre_uint32 default_options = 0;