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