00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef _PCRE_H
00040 #define _PCRE_H
00041
00042
00043
00044 #define PCRE_MAJOR 7
00045 #define PCRE_MINOR 8
00046 #define PCRE_PRERELEASE
00047 #define PCRE_DATE 2008-09-05
00048
00049
00050
00051
00052
00053
00054 #if defined(_WIN32) && !defined(PCRE_STATIC)
00055 # ifndef PCRE_EXP_DECL
00056 # define PCRE_EXP_DECL extern __declspec(dllimport)
00057 # endif
00058 # ifdef __cplusplus
00059 # ifndef PCRECPP_EXP_DECL
00060 # define PCRECPP_EXP_DECL extern __declspec(dllimport)
00061 # endif
00062 # ifndef PCRECPP_EXP_DEFN
00063 # define PCRECPP_EXP_DEFN __declspec(dllimport)
00064 # endif
00065 # endif
00066 #endif
00067
00068
00069
00070 #ifndef PCRE_EXP_DECL
00071 # ifdef __cplusplus
00072 # define PCRE_EXP_DECL extern "C"
00073 # else
00074 # define PCRE_EXP_DECL extern
00075 # endif
00076 #endif
00077
00078 #ifdef __cplusplus
00079 # ifndef PCRECPP_EXP_DECL
00080 # define PCRECPP_EXP_DECL extern
00081 # endif
00082 # ifndef PCRECPP_EXP_DEFN
00083 # define PCRECPP_EXP_DEFN
00084 # endif
00085 #endif
00086
00087
00088
00089
00090 #include <stdlib.h>
00091
00092
00093
00094 #ifdef __cplusplus
00095 extern "C" {
00096 #endif
00097
00098
00099
00100 #define PCRE_CASELESS 0x00000001
00101 #define PCRE_MULTILINE 0x00000002
00102 #define PCRE_DOTALL 0x00000004
00103 #define PCRE_EXTENDED 0x00000008
00104 #define PCRE_ANCHORED 0x00000010
00105 #define PCRE_DOLLAR_ENDONLY 0x00000020
00106 #define PCRE_EXTRA 0x00000040
00107 #define PCRE_NOTBOL 0x00000080
00108 #define PCRE_NOTEOL 0x00000100
00109 #define PCRE_UNGREEDY 0x00000200
00110 #define PCRE_NOTEMPTY 0x00000400
00111 #define PCRE_UTF8 0x00000800
00112 #define PCRE_NO_AUTO_CAPTURE 0x00001000
00113 #define PCRE_NO_UTF8_CHECK 0x00002000
00114 #define PCRE_AUTO_CALLOUT 0x00004000
00115 #define PCRE_PARTIAL 0x00008000
00116 #define PCRE_DFA_SHORTEST 0x00010000
00117 #define PCRE_DFA_RESTART 0x00020000
00118 #define PCRE_FIRSTLINE 0x00040000
00119 #define PCRE_DUPNAMES 0x00080000
00120 #define PCRE_NEWLINE_CR 0x00100000
00121 #define PCRE_NEWLINE_LF 0x00200000
00122 #define PCRE_NEWLINE_CRLF 0x00300000
00123 #define PCRE_NEWLINE_ANY 0x00400000
00124 #define PCRE_NEWLINE_ANYCRLF 0x00500000
00125 #define PCRE_BSR_ANYCRLF 0x00800000
00126 #define PCRE_BSR_UNICODE 0x01000000
00127 #define PCRE_JAVASCRIPT_COMPAT 0x02000000
00128
00129
00130
00131 #define PCRE_ERROR_NOMATCH (-1)
00132 #define PCRE_ERROR_NULL (-2)
00133 #define PCRE_ERROR_BADOPTION (-3)
00134 #define PCRE_ERROR_BADMAGIC (-4)
00135 #define PCRE_ERROR_UNKNOWN_OPCODE (-5)
00136 #define PCRE_ERROR_UNKNOWN_NODE (-5)
00137 #define PCRE_ERROR_NOMEMORY (-6)
00138 #define PCRE_ERROR_NOSUBSTRING (-7)
00139 #define PCRE_ERROR_MATCHLIMIT (-8)
00140 #define PCRE_ERROR_CALLOUT (-9)
00141 #define PCRE_ERROR_BADUTF8 (-10)
00142 #define PCRE_ERROR_BADUTF8_OFFSET (-11)
00143 #define PCRE_ERROR_PARTIAL (-12)
00144 #define PCRE_ERROR_BADPARTIAL (-13)
00145 #define PCRE_ERROR_INTERNAL (-14)
00146 #define PCRE_ERROR_BADCOUNT (-15)
00147 #define PCRE_ERROR_DFA_UITEM (-16)
00148 #define PCRE_ERROR_DFA_UCOND (-17)
00149 #define PCRE_ERROR_DFA_UMLIMIT (-18)
00150 #define PCRE_ERROR_DFA_WSSIZE (-19)
00151 #define PCRE_ERROR_DFA_RECURSE (-20)
00152 #define PCRE_ERROR_RECURSIONLIMIT (-21)
00153 #define PCRE_ERROR_NULLWSLIMIT (-22)
00154 #define PCRE_ERROR_BADNEWLINE (-23)
00155
00156
00157
00158 #define PCRE_INFO_OPTIONS 0
00159 #define PCRE_INFO_SIZE 1
00160 #define PCRE_INFO_CAPTURECOUNT 2
00161 #define PCRE_INFO_BACKREFMAX 3
00162 #define PCRE_INFO_FIRSTBYTE 4
00163 #define PCRE_INFO_FIRSTCHAR 4
00164 #define PCRE_INFO_FIRSTTABLE 5
00165 #define PCRE_INFO_LASTLITERAL 6
00166 #define PCRE_INFO_NAMEENTRYSIZE 7
00167 #define PCRE_INFO_NAMECOUNT 8
00168 #define PCRE_INFO_NAMETABLE 9
00169 #define PCRE_INFO_STUDYSIZE 10
00170 #define PCRE_INFO_DEFAULT_TABLES 11
00171 #define PCRE_INFO_OKPARTIAL 12
00172 #define PCRE_INFO_JCHANGED 13
00173 #define PCRE_INFO_HASCRORLF 14
00174
00175
00176
00177
00178 #define PCRE_CONFIG_UTF8 0
00179 #define PCRE_CONFIG_NEWLINE 1
00180 #define PCRE_CONFIG_LINK_SIZE 2
00181 #define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3
00182 #define PCRE_CONFIG_MATCH_LIMIT 4
00183 #define PCRE_CONFIG_STACKRECURSE 5
00184 #define PCRE_CONFIG_UNICODE_PROPERTIES 6
00185 #define PCRE_CONFIG_MATCH_LIMIT_RECURSION 7
00186 #define PCRE_CONFIG_BSR 8
00187
00188
00189
00190
00191 #define PCRE_EXTRA_STUDY_DATA 0x0001
00192 #define PCRE_EXTRA_MATCH_LIMIT 0x0002
00193 #define PCRE_EXTRA_CALLOUT_DATA 0x0004
00194 #define PCRE_EXTRA_TABLES 0x0008
00195 #define PCRE_EXTRA_MATCH_LIMIT_RECURSION 0x0010
00196
00197
00198
00199 struct real_pcre;
00200 typedef struct real_pcre pcre;
00201
00202
00203
00204
00205
00206 #ifndef PCRE_SPTR
00207 #define PCRE_SPTR const char *
00208 #endif
00209
00210
00211
00212
00213
00214 typedef struct pcre_extra {
00215 unsigned long int flags;
00216 void *study_data;
00217 unsigned long int match_limit;
00218 void *callout_data;
00219 const unsigned char *tables;
00220 unsigned long int match_limit_recursion;
00221 } pcre_extra;
00222
00223
00224
00225
00226
00227
00228 typedef struct pcre_callout_block {
00229 int version;
00230
00231 int callout_number;
00232 int *offset_vector;
00233 PCRE_SPTR subject;
00234 int subject_length;
00235 int start_match;
00236 int current_position;
00237 int capture_top;
00238 int capture_last;
00239 void *callout_data;
00240
00241 int pattern_position;
00242 int next_item_length;
00243
00244 } pcre_callout_block;
00245
00246
00247
00248
00249
00250
00251
00252 #ifndef VPCOMPAT
00253 PCRE_EXP_DECL void *(*pcre_malloc)(size_t);
00254 PCRE_EXP_DECL void (*pcre_free)(void *);
00255 PCRE_EXP_DECL void *(*pcre_stack_malloc)(size_t);
00256 PCRE_EXP_DECL void (*pcre_stack_free)(void *);
00257 PCRE_EXP_DECL int (*pcre_callout)(pcre_callout_block *);
00258 #else
00259 PCRE_EXP_DECL void *pcre_malloc(size_t);
00260 PCRE_EXP_DECL void pcre_free(void *);
00261 PCRE_EXP_DECL void *pcre_stack_malloc(size_t);
00262 PCRE_EXP_DECL void pcre_stack_free(void *);
00263 PCRE_EXP_DECL int pcre_callout(pcre_callout_block *);
00264 #endif
00265
00266
00267
00268 PCRE_EXP_DECL pcre *pcre_compile(const char *, int, const char **, int *,
00269 const unsigned char *);
00270 PCRE_EXP_DECL pcre *pcre_compile2(const char *, int, int *, const char **,
00271 int *, const unsigned char *);
00272 PCRE_EXP_DECL int pcre_config(int, void *);
00273 PCRE_EXP_DECL int pcre_copy_named_substring(const pcre *, const char *,
00274 int *, int, const char *, char *, int);
00275 PCRE_EXP_DECL int pcre_copy_substring(const char *, int *, int, int, char *,
00276 int);
00277 PCRE_EXP_DECL int pcre_dfa_exec(const pcre *, const pcre_extra *,
00278 const char *, int, int, int, int *, int , int *, int);
00279 PCRE_EXP_DECL int pcre_exec(const pcre *, const pcre_extra *, PCRE_SPTR,
00280 int, int, int, int *, int);
00281 PCRE_EXP_DECL void pcre_free_substring(const char *);
00282 PCRE_EXP_DECL void pcre_free_substring_list(const char **);
00283 PCRE_EXP_DECL int pcre_fullinfo(const pcre *, const pcre_extra *, int,
00284 void *);
00285 PCRE_EXP_DECL int pcre_get_named_substring(const pcre *, const char *,
00286 int *, int, const char *, const char **);
00287 PCRE_EXP_DECL int pcre_get_stringnumber(const pcre *, const char *);
00288 PCRE_EXP_DECL int pcre_get_stringtable_entries(const pcre *, const char *,
00289 char **, char **);
00290 PCRE_EXP_DECL int pcre_get_substring(const char *, int *, int, int,
00291 const char **);
00292 PCRE_EXP_DECL int pcre_get_substring_list(const char *, int *, int,
00293 const char ***);
00294 PCRE_EXP_DECL int pcre_info(const pcre *, int *, int *);
00295 PCRE_EXP_DECL const unsigned char *pcre_maketables(void);
00296 PCRE_EXP_DECL int pcre_refcount(pcre *, int);
00297 PCRE_EXP_DECL pcre_extra *pcre_study(const pcre *, int, const char **);
00298 PCRE_EXP_DECL const char *pcre_version(void);
00299
00300 #ifdef __cplusplus
00301 }
00302 #endif
00303
00304 #endif