00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _PCRE_H
00011 #define _PCRE_H
00012
00013 #define PCRE_MAJOR 4
00014 #define PCRE_MINOR 5
00015 #define PCRE_DATE 01-December-2003
00016
00017 #ifndef PCRE_DATA_SCOPE
00018 # define PCRE_DATA_SCOPE extern
00019 #endif
00020
00021
00022
00023
00024 #include <stdlib.h>
00025
00026
00027
00028 #define PCRE_CASELESS 0x0001
00029 #define PCRE_MULTILINE 0x0002
00030 #define PCRE_DOTALL 0x0004
00031 #define PCRE_EXTENDED 0x0008
00032 #define PCRE_ANCHORED 0x0010
00033 #define PCRE_DOLLAR_ENDONLY 0x0020
00034 #define PCRE_EXTRA 0x0040
00035 #define PCRE_NOTBOL 0x0080
00036 #define PCRE_NOTEOL 0x0100
00037 #define PCRE_UNGREEDY 0x0200
00038 #define PCRE_NOTEMPTY 0x0400
00039 #define PCRE_UTF8 0x0800
00040 #define PCRE_NO_AUTO_CAPTURE 0x1000
00041 #define PCRE_NO_UTF8_CHECK 0x2000
00042
00043
00044
00045 #define PCRE_ERROR_NOMATCH (-1)
00046 #define PCRE_ERROR_NULL (-2)
00047 #define PCRE_ERROR_BADOPTION (-3)
00048 #define PCRE_ERROR_BADMAGIC (-4)
00049 #define PCRE_ERROR_UNKNOWN_NODE (-5)
00050 #define PCRE_ERROR_NOMEMORY (-6)
00051 #define PCRE_ERROR_NOSUBSTRING (-7)
00052 #define PCRE_ERROR_MATCHLIMIT (-8)
00053 #define PCRE_ERROR_CALLOUT (-9)
00054 #define PCRE_ERROR_BADUTF8 (-10)
00055 #define PCRE_ERROR_BADUTF8_OFFSET (-11)
00056
00057
00058
00059 #define PCRE_INFO_OPTIONS 0
00060 #define PCRE_INFO_SIZE 1
00061 #define PCRE_INFO_CAPTURECOUNT 2
00062 #define PCRE_INFO_BACKREFMAX 3
00063 #define PCRE_INFO_FIRSTBYTE 4
00064 #define PCRE_INFO_FIRSTCHAR 4
00065 #define PCRE_INFO_FIRSTTABLE 5
00066 #define PCRE_INFO_LASTLITERAL 6
00067 #define PCRE_INFO_NAMEENTRYSIZE 7
00068 #define PCRE_INFO_NAMECOUNT 8
00069 #define PCRE_INFO_NAMETABLE 9
00070 #define PCRE_INFO_STUDYSIZE 10
00071
00072
00073
00074 #define PCRE_CONFIG_UTF8 0
00075 #define PCRE_CONFIG_NEWLINE 1
00076 #define PCRE_CONFIG_LINK_SIZE 2
00077 #define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3
00078 #define PCRE_CONFIG_MATCH_LIMIT 4
00079 #define PCRE_CONFIG_STACKRECURSE 5
00080
00081
00082
00083 #define PCRE_EXTRA_STUDY_DATA 0x0001
00084 #define PCRE_EXTRA_MATCH_LIMIT 0x0002
00085 #define PCRE_EXTRA_CALLOUT_DATA 0x0004
00086
00087
00088
00089 struct real_pcre;
00090 typedef struct real_pcre pcre;
00091
00092
00093
00094
00095 typedef struct pcre_extra {
00096 unsigned long int flags;
00097 void *study_data;
00098 unsigned long int match_limit;
00099 void *callout_data;
00100 } pcre_extra;
00101
00102
00103
00104
00105
00106
00107 typedef struct pcre_callout_block {
00108 int version;
00109
00110 int callout_number;
00111 int *offset_vector;
00112 const char *subject;
00113 int subject_length;
00114 int start_match;
00115 int current_position;
00116 int capture_top;
00117 int capture_last;
00118 void *callout_data;
00119
00120 } pcre_callout_block;
00121
00122
00123
00124
00125 extern pcre *pcre_compile(const char *, int, const char **,
00126 int *, const unsigned char *);
00127 extern int pcre_copy_substring(const char *, int *, int, int,
00128 char *, int);
00129 extern int pcre_exec(const pcre *, const pcre_extra *,
00130 const char *, int, int, int, int *, int);
00131 extern const unsigned char *pcre_maketables(void);
00132 extern pcre_extra *pcre_study(const pcre *, int, const char **);
00133
00134 #endif