chiark / gitweb /
Rebase patch queue onto upstream 8.39:
[pcre3.git] / debian / patches / PCRE6_compatible_API.patch
1 From: Mark Baker <mark@mnb.org.uk>
2 Date: Wed, 13 Jul 2016 21:20:13 +0100
3 Subject: PCRE6_compatible_API
4
5 ---
6  pcrecpp.cc | 6 ++++++
7  pcrecpp.h  | 2 ++
8  pcretest.c | 2 +-
9  3 files changed, 9 insertions(+), 1 deletion(-)
10
11 diff --git a/pcrecpp.cc b/pcrecpp.cc
12 index d09c9ab..728b074 100644
13 --- a/pcrecpp.cc
14 +++ b/pcrecpp.cc
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;
18  
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);
23 +}
24 +
25  void RE::Init(const string& pat, const RE_Options* options) {
26    pattern_ = pat;
27    if (options == NULL) {
28 diff --git a/pcrecpp.h b/pcrecpp.h
29 index 3e594b0..a520057 100644
30 --- a/pcrecpp.h
31 +++ b/pcrecpp.h
32 @@ -658,6 +658,8 @@ class PCRECPP_EXP_DEFN RE {
33   private:
34  
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);
38    void Cleanup();
39  
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
43 --- a/pcretest.c
44 +++ b/pcretest.c
45 @@ -2984,7 +2984,7 @@ int main(int argc, char **argv)
46  {
47  FILE *infile = stdin;
48  const char *version;
49 -int options = 0;
50 +long int options = 0;
51  int study_options = 0;
52  int default_find_match_limit = FALSE;
53  pcre_uint32 default_options = 0;