00001 #ifndef _PCRE_H
00002 #define _PCRE_H
00003
00004
00005
00006
00007 #define PCRE_MAJOR 5
00008 #define PCRE_MINOR 0
00009 #define PCRE_DATE 13-Sep-2004
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef PCRE_DATA_SCOPE
00028 # define PCRE_DATA_SCOPE extern
00029 #endif
00030
00031
00032
00033
00034 #include <stdlib.h>
00035
00036
00037
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041
00042
00043
00044 #define PCRE_CASELESS 0x0001
00045 #define PCRE_MULTILINE 0x0002
00046 #define PCRE_DOTALL 0x0004
00047 #define PCRE_EXTENDED 0x0008
00048 #define PCRE_ANCHORED 0x0010
00049 #define PCRE_DOLLAR_ENDONLY 0x0020
00050 #define PCRE_EXTRA 0x0040
00051 #define PCRE_NOTBOL 0x0080
00052 #define PCRE_NOTEOL 0x0100
00053 #define PCRE_UNGREEDY 0x0200
00054 #define PCRE_NOTEMPTY 0x0400
00055 #define PCRE_UTF8 0x0800
00056 #define PCRE_NO_AUTO_CAPTURE 0x1000
00057 #define PCRE_NO_UTF8_CHECK 0x2000
00058 #define PCRE_AUTO_CALLOUT 0x4000
00059 #define PCRE_PARTIAL 0x8000
00060
00061
00062
00063 #define PCRE_ERROR_NOMATCH (-1)
00064 #define PCRE_ERROR_NULL (-2)
00065 #define PCRE_ERROR_BADOPTION (-3)
00066 #define PCRE_ERROR_BADMAGIC (-4)
00067 #define PCRE_ERROR_UNKNOWN_NODE (-5)
00068 #define PCRE_ERROR_NOMEMORY (-6)
00069 #define PCRE_ERROR_NOSUBSTRING (-7)
00070 #define PCRE_ERROR_MATCHLIMIT (-8)
00071 #define PCRE_ERROR_CALLOUT (-9)
00072 #define PCRE_ERROR_BADUTF8 (-10)
00073 #define PCRE_ERROR_BADUTF8_OFFSET (-11)
00074 #define PCRE_ERROR_PARTIAL (-12)
00075 #define PCRE_ERROR_BADPARTIAL (-13)
00076 #define PCRE_ERROR_INTERNAL (-14)
00077 #define PCRE_ERROR_BADCOUNT (-15)
00078
00079
00080
00081 #define PCRE_INFO_OPTIONS 0
00082 #define PCRE_INFO_SIZE 1
00083 #define PCRE_INFO_CAPTURECOUNT 2
00084 #define PCRE_INFO_BACKREFMAX 3
00085 #define PCRE_INFO_FIRSTBYTE 4
00086 #define PCRE_INFO_FIRSTCHAR 4
00087 #define PCRE_INFO_FIRSTTABLE 5
00088 #define PCRE_INFO_LASTLITERAL 6
00089 #define PCRE_INFO_NAMEENTRYSIZE 7
00090 #define PCRE_INFO_NAMECOUNT 8
00091 #define PCRE_INFO_NAMETABLE 9
00092 #define PCRE_INFO_STUDYSIZE 10
00093 #define PCRE_INFO_DEFAULT_TABLES 11
00094
00095
00096
00097 #define PCRE_CONFIG_UTF8 0
00098 #define PCRE_CONFIG_NEWLINE 1
00099 #define PCRE_CONFIG_LINK_SIZE 2
00100 #define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3
00101 #define PCRE_CONFIG_MATCH_LIMIT 4
00102 #define PCRE_CONFIG_STACKRECURSE 5
00103 #define PCRE_CONFIG_UNICODE_PROPERTIES 6
00104
00105
00106
00107 #define PCRE_EXTRA_STUDY_DATA 0x0001
00108 #define PCRE_EXTRA_MATCH_LIMIT 0x0002
00109 #define PCRE_EXTRA_CALLOUT_DATA 0x0004
00110 #define PCRE_EXTRA_TABLES 0x0008
00111
00112
00113
00114 struct real_pcre;
00115 typedef struct real_pcre pcre;
00116
00117
00118
00119
00120
00121 typedef struct pcre_extra {
00122 unsigned long int flags;
00123 void *study_data;
00124 unsigned long int match_limit;
00125 void *callout_data;
00126 const unsigned char *tables;
00127 } pcre_extra;
00128
00129
00130
00131
00132
00133
00134 typedef struct pcre_callout_block {
00135 int version;
00136
00137 int callout_number;
00138 int *offset_vector;
00139 const char *subject;
00140 int subject_length;
00141 int start_match;
00142 int current_position;
00143 int capture_top;
00144 int capture_last;
00145 void *callout_data;
00146
00147 int pattern_position;
00148 int next_item_length;
00149
00150 } pcre_callout_block;
00151
00152
00153
00154
00155
00156
00157
00158
00159 #ifndef VPCOMPAT
00160 PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t);
00161 PCRE_DATA_SCOPE void (*pcre_free)(void *);
00162 PCRE_DATA_SCOPE void *(*pcre_stack_malloc)(size_t);
00163 PCRE_DATA_SCOPE void (*pcre_stack_free)(void *);
00164 PCRE_DATA_SCOPE int (*pcre_callout)(pcre_callout_block *);
00165 #else
00166 extern void *pcre_malloc(size_t);
00167 extern void pcre_free(void *);
00168 extern void *pcre_stack_malloc(size_t);
00169 extern void pcre_stack_free(void *);
00170 extern int pcre_callout(pcre_callout_block *);
00171 #endif
00172
00173
00174
00175 extern pcre *pcre_compile(const char *, int, const char **,
00176 int *, const unsigned char *);
00177 extern int pcre_config(int, void *);
00178 extern int pcre_copy_named_substring(const pcre *, const char *,
00179 int *, int, const char *, char *, int);
00180 extern int pcre_copy_substring(const char *, int *, int, int,
00181 char *, int);
00182 extern int pcre_exec(const pcre *, const pcre_extra *,
00183 const char *, int, int, int, int *, int);
00184 extern void pcre_free_substring(const char *);
00185 extern void pcre_free_substring_list(const char **);
00186 extern int pcre_fullinfo(const pcre *, const pcre_extra *, int,
00187 void *);
00188 extern int pcre_get_named_substring(const pcre *, const char *,
00189 int *, int, const char *, const char **);
00190 extern int pcre_get_stringnumber(const pcre *, const char *);
00191 extern int pcre_get_substring(const char *, int *, int, int,
00192 const char **);
00193 extern int pcre_get_substring_list(const char *, int *, int,
00194 const char ***);
00195 extern int pcre_info(const pcre *, int *, int *);
00196 extern const unsigned char *pcre_maketables(void);
00197 extern pcre_extra *pcre_study(const pcre *, int, const char **);
00198 extern const char *pcre_version(void);
00199
00200 #ifdef __cplusplus
00201 }
00202 #endif
00203
00204 #endif