| 1 |
#ifndef _MYPCRE_H |
|---|
| 2 |
#define _MYPCRE_H |
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
#define PENN_MATCH_LIMIT 100000 |
|---|
| 47 |
struct pcre_extra; |
|---|
| 48 |
void set_match_limit(struct pcre_extra *); |
|---|
| 49 |
struct pcre_extra *default_match_limit(void); |
|---|
| 50 |
|
|---|
| 51 |
#ifdef HAVE_PCRE |
|---|
| 52 |
#include <pcre.h> |
|---|
| 53 |
#else |
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
#define PCRE_MAJOR 6 |
|---|
| 57 |
#define PCRE_MINOR 4 |
|---|
| 58 |
#define PCRE_DATE 05-Sep-2005 |
|---|
| 59 |
|
|---|
| 60 |
#ifndef PCRE_DATA_SCOPE |
|---|
| 61 |
# define PCRE_DATA_SCOPE extern |
|---|
| 62 |
#endif |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
#include <stdlib.h> |
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
#ifdef __cplusplus |
|---|
| 72 |
extern "C" { |
|---|
| 73 |
#endif |
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
#define PCRE_CASELESS 0x00000001 |
|---|
| 78 |
#define PCRE_MULTILINE 0x00000002 |
|---|
| 79 |
#define PCRE_DOTALL 0x00000004 |
|---|
| 80 |
#define PCRE_EXTENDED 0x00000008 |
|---|
| 81 |
#define PCRE_ANCHORED 0x00000010 |
|---|
| 82 |
#define PCRE_DOLLAR_ENDONLY 0x00000020 |
|---|
| 83 |
#define PCRE_EXTRA 0x00000040 |
|---|
| 84 |
#define PCRE_NOTBOL 0x00000080 |
|---|
| 85 |
#define PCRE_NOTEOL 0x00000100 |
|---|
| 86 |
#define PCRE_UNGREEDY 0x00000200 |
|---|
| 87 |
#define PCRE_NOTEMPTY 0x00000400 |
|---|
| 88 |
#define PCRE_UTF8 0x00000800 |
|---|
| 89 |
#define PCRE_NO_AUTO_CAPTURE 0x00001000 |
|---|
| 90 |
#define PCRE_NO_UTF8_CHECK 0x00002000 |
|---|
| 91 |
#define PCRE_AUTO_CALLOUT 0x00004000 |
|---|
| 92 |
#define PCRE_PARTIAL 0x00008000 |
|---|
| 93 |
#define PCRE_DFA_SHORTEST 0x00010000 |
|---|
| 94 |
#define PCRE_DFA_RESTART 0x00020000 |
|---|
| 95 |
#define PCRE_FIRSTLINE 0x00040000 |
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
#define PCRE_ERROR_NOMATCH (-1) |
|---|
| 101 |
#define PCRE_ERROR_NULL (-2) |
|---|
| 102 |
#define PCRE_ERROR_BADOPTION (-3) |
|---|
| 103 |
#define PCRE_ERROR_BADMAGIC (-4) |
|---|
| 104 |
#define PCRE_ERROR_UNKNOWN_NODE (-5) |
|---|
| 105 |
#define PCRE_ERROR_NOMEMORY (-6) |
|---|
| 106 |
#define PCRE_ERROR_NOSUBSTRING (-7) |
|---|
| 107 |
#define PCRE_ERROR_MATCHLIMIT (-8) |
|---|
| 108 |
#define PCRE_ERROR_CALLOUT (-9) |
|---|
| 109 |
#define PCRE_ERROR_BADUTF8 (-10) |
|---|
| 110 |
#define PCRE_ERROR_BADUTF8_OFFSET (-11) |
|---|
| 111 |
#define PCRE_ERROR_PARTIAL (-12) |
|---|
| 112 |
#define PCRE_ERROR_BADPARTIAL (-13) |
|---|
| 113 |
#define PCRE_ERROR_INTERNAL (-14) |
|---|
| 114 |
#define PCRE_ERROR_BADCOUNT (-15) |
|---|
| 115 |
#define PCRE_ERROR_DFA_UITEM (-16) |
|---|
| 116 |
#define PCRE_ERROR_DFA_UCOND (-17) |
|---|
| 117 |
#define PCRE_ERROR_DFA_UMLIMIT (-18) |
|---|
| 118 |
#define PCRE_ERROR_DFA_WSSIZE (-19) |
|---|
| 119 |
#define PCRE_ERROR_DFA_RECURSE (-20) |
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
#define PCRE_INFO_OPTIONS 0 |
|---|
| 124 |
#define PCRE_INFO_SIZE 1 |
|---|
| 125 |
#define PCRE_INFO_CAPTURECOUNT 2 |
|---|
| 126 |
#define PCRE_INFO_BACKREFMAX 3 |
|---|
| 127 |
#define PCRE_INFO_FIRSTBYTE 4 |
|---|
| 128 |
#define PCRE_INFO_FIRSTCHAR 4 |
|---|
| 129 |
#define PCRE_INFO_FIRSTTABLE 5 |
|---|
| 130 |
#define PCRE_INFO_LASTLITERAL 6 |
|---|
| 131 |
#define PCRE_INFO_NAMEENTRYSIZE 7 |
|---|
| 132 |
#define PCRE_INFO_NAMECOUNT 8 |
|---|
| 133 |
#define PCRE_INFO_NAMETABLE 9 |
|---|
| 134 |
#define PCRE_INFO_STUDYSIZE 10 |
|---|
| 135 |
#define PCRE_INFO_DEFAULT_TABLES 11 |
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 |
#define PCRE_CONFIG_UTF8 0 |
|---|
| 140 |
#define PCRE_CONFIG_NEWLINE 1 |
|---|
| 141 |
#define PCRE_CONFIG_LINK_SIZE 2 |
|---|
| 142 |
#define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3 |
|---|
| 143 |
#define PCRE_CONFIG_MATCH_LIMIT 4 |
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 |
#define PCRE_EXTRA_STUDY_DATA 0x0001 |
|---|
| 148 |
#define PCRE_EXTRA_MATCH_LIMIT 0x0002 |
|---|
| 149 |
#define PCRE_EXTRA_CALLOUT_DATA 0x0004 |
|---|
| 150 |
#define PCRE_EXTRA_TABLES 0x0008 |
|---|
| 151 |
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 |
struct real_pcre; |
|---|
| 155 |
typedef struct real_pcre pcre; |
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
typedef struct pcre_extra { |
|---|
| 161 |
unsigned long int flags; |
|---|
| 162 |
void *study_data; |
|---|
| 163 |
unsigned long int match_limit; |
|---|
| 164 |
void *callout_data; |
|---|
| 165 |
const unsigned char *tables; |
|---|
| 166 |
} pcre_extra; |
|---|
| 167 |
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
typedef struct pcre_callout_block { |
|---|
| 174 |
int version; |
|---|
| 175 |
|
|---|
| 176 |
int callout_number; |
|---|
| 177 |
int *offset_vector; |
|---|
| 178 |
const char *subject; |
|---|
| 179 |
int subject_length; |
|---|
| 180 |
int start_match; |
|---|
| 181 |
int current_position; |
|---|
| 182 |
int capture_top; |
|---|
| 183 |
int capture_last; |
|---|
| 184 |
void *callout_data; |
|---|
| 185 |
|
|---|
| 186 |
int pattern_position; |
|---|
| 187 |
int next_item_length; |
|---|
| 188 |
|
|---|
| 189 |
} pcre_callout_block; |
|---|
| 190 |
|
|---|
| 191 |
|
|---|
| 192 |
|
|---|
| 193 |
|
|---|
| 194 |
extern pcre *pcre_compile(const char *, int, const char **, |
|---|
| 195 |
int *, const unsigned char *); |
|---|
| 196 |
extern int pcre_copy_substring(const char *, int *, int, int, char *, int); |
|---|
| 197 |
int pcre_get_substring(const char *, int *, int, int, const char **); |
|---|
| 198 |
extern int pcre_exec(const pcre *, const pcre_extra *, |
|---|
| 199 |
const char *, int, int, int, int *, int); |
|---|
| 200 |
extern const unsigned char *pcre_maketables(void); |
|---|
| 201 |
extern pcre_extra *pcre_study(const pcre *, int, const char **); |
|---|
| 202 |
extern int pcre_fullinfo(const pcre * argument_re, |
|---|
| 203 |
const pcre_extra * extra_data, int what, |
|---|
| 204 |
void *where); |
|---|
| 205 |
extern int pcre_get_stringnumber(const pcre * code, const char *stringname); |
|---|
| 206 |
extern int |
|---|
| 207 |
pcre_copy_named_substring(const pcre * code, const char *subject, |
|---|
| 208 |
int *ovector, int stringcount, |
|---|
| 209 |
const char *stringname, char *buffer, int size); |
|---|
| 210 |
|
|---|
| 211 |
#ifdef __cplusplus |
|---|
| 212 |
} |
|---|
| 213 |
#endif |
|---|
| 214 |
#endif |
|---|
| 215 |
#endif |
|---|