| 30 |
// Author: Sanjay Ghemawat |
// Author: Sanjay Ghemawat |
| 31 |
|
|
| 32 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
| 33 |
# include <config.h> |
#include "config.h" |
| 34 |
|
#endif |
| 35 |
|
|
| 36 |
|
#ifdef _WIN32 |
| 37 |
|
#define HAVE_STRTOQ 1 |
| 38 |
|
#define strtoll _strtoui64 |
| 39 |
|
#define strtoull _strtoi64 |
| 40 |
#endif |
#endif |
| 41 |
|
|
| 42 |
#include <stdlib.h> |
#include <stdlib.h> |
| 47 |
#include <errno.h> |
#include <errno.h> |
| 48 |
#include <string> |
#include <string> |
| 49 |
#include <algorithm> |
#include <algorithm> |
| 50 |
// We need this to compile the proper dll on windows/msys. This is copied |
|
| 51 |
// from pcre_internal.h. It would probably be better just to include that. |
#include "pcrecpp_internal.h" |
| 52 |
#define PCRE_DEFINITION /* Win32 __declspec(export) trigger for .dll */ |
#include "pcre.h" |
|
#include <pcre.h> |
|
|
#include "pcre_stringpiece.h" |
|
| 53 |
#include "pcrecpp.h" |
#include "pcrecpp.h" |
| 54 |
|
#include "pcre_stringpiece.h" |
| 55 |
|
|
| 56 |
|
|
| 57 |
namespace pcrecpp { |
namespace pcrecpp { |
| 61 |
static const int kVecSize = (1 + kMaxArgs) * 3; // results + PCRE workspace |
static const int kVecSize = (1 + kMaxArgs) * 3; // results + PCRE workspace |
| 62 |
|
|
| 63 |
// Special object that stands-in for no argument |
// Special object that stands-in for no argument |
| 64 |
Arg no_arg((void*)NULL); |
PCRECPP_EXP_DEFN Arg no_arg((void*)NULL); |
| 65 |
|
|
| 66 |
// If a regular expression has no error, its error_ field points here |
// If a regular expression has no error, its error_ field points here |
| 67 |
static const string empty_string; |
static const string empty_string; |
| 468 |
return 0; |
return 0; |
| 469 |
} |
} |
| 470 |
|
|
| 471 |
pcre_extra extra = { 0 }; |
pcre_extra extra = { 0, 0, 0, 0, 0, 0 }; |
| 472 |
if (options_.match_limit() > 0) { |
if (options_.match_limit() > 0) { |
| 473 |
extra.flags |= PCRE_EXTRA_MATCH_LIMIT; |
extra.flags |= PCRE_EXTRA_MATCH_LIMIT; |
| 474 |
extra.match_limit = options_.match_limit(); |
extra.match_limit = options_.match_limit(); |