/[pcre]/code/trunk/pcre.in
ViewVC logotype

Contents of /code/trunk/pcre.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 75 - (hide annotations) (download)
Sat Feb 24 21:40:37 2007 UTC (7 years, 8 months ago) by nigel
File size: 9530 byte(s)
Load pcre-5.0 into code/trunk.

1 nigel 43 /*************************************************
2     * Perl-Compatible Regular Expressions *
3     *************************************************/
4    
5 nigel 75 /* In its original form, this is the .in file that is transformed by
6     "configure" into pcre.h.
7 nigel 43
8 nigel 75 Copyright (c) 1997-2004 University of Cambridge
9    
10     -----------------------------------------------------------------------------
11     Redistribution and use in source and binary forms, with or without
12     modification, are permitted provided that the following conditions are met:
13    
14     * Redistributions of source code must retain the above copyright notice,
15     this list of conditions and the following disclaimer.
16    
17     * Redistributions in binary form must reproduce the above copyright
18     notice, this list of conditions and the following disclaimer in the
19     documentation and/or other materials provided with the distribution.
20    
21     * Neither the name of the University of Cambridge nor the names of its
22     contributors may be used to endorse or promote products derived from
23     this software without specific prior written permission.
24    
25     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35     POSSIBILITY OF SUCH DAMAGE.
36     -----------------------------------------------------------------------------
37     */
38    
39 nigel 43 #ifndef _PCRE_H
40     #define _PCRE_H
41    
42 nigel 47 /* The file pcre.h is build by "configure". Do not edit it; instead
43     make changes to pcre.in. */
44    
45 nigel 53 #define PCRE_MAJOR @PCRE_MAJOR@
46     #define PCRE_MINOR @PCRE_MINOR@
47     #define PCRE_DATE @PCRE_DATE@
48 nigel 43
49     /* Win32 uses DLL by default */
50    
51     #ifdef _WIN32
52 nigel 63 # ifdef PCRE_DEFINITION
53     # ifdef DLL_EXPORT
54     # define PCRE_DATA_SCOPE __declspec(dllexport)
55     # endif
56     # else
57     # ifndef PCRE_STATIC
58 nigel 71 # define PCRE_DATA_SCOPE extern __declspec(dllimport)
59 nigel 63 # endif
60     # endif
61 nigel 43 #endif
62 nigel 63 #ifndef PCRE_DATA_SCOPE
63     # define PCRE_DATA_SCOPE extern
64     #endif
65 nigel 43
66     /* Have to include stdlib.h in order to ensure that size_t is defined;
67     it is needed here for malloc. */
68    
69     #include <stdlib.h>
70    
71     /* Allow for C++ users */
72    
73     #ifdef __cplusplus
74     extern "C" {
75     #endif
76    
77     /* Options */
78    
79 nigel 63 #define PCRE_CASELESS 0x0001
80     #define PCRE_MULTILINE 0x0002
81     #define PCRE_DOTALL 0x0004
82     #define PCRE_EXTENDED 0x0008
83     #define PCRE_ANCHORED 0x0010
84     #define PCRE_DOLLAR_ENDONLY 0x0020
85     #define PCRE_EXTRA 0x0040
86     #define PCRE_NOTBOL 0x0080
87     #define PCRE_NOTEOL 0x0100
88     #define PCRE_UNGREEDY 0x0200
89     #define PCRE_NOTEMPTY 0x0400
90     #define PCRE_UTF8 0x0800
91     #define PCRE_NO_AUTO_CAPTURE 0x1000
92 nigel 71 #define PCRE_NO_UTF8_CHECK 0x2000
93 nigel 75 #define PCRE_AUTO_CALLOUT 0x4000
94     #define PCRE_PARTIAL 0x8000
95 nigel 43
96 nigel 63 /* Exec-time and get/set-time error codes */
97 nigel 43
98 nigel 73 #define PCRE_ERROR_NOMATCH (-1)
99     #define PCRE_ERROR_NULL (-2)
100     #define PCRE_ERROR_BADOPTION (-3)
101     #define PCRE_ERROR_BADMAGIC (-4)
102     #define PCRE_ERROR_UNKNOWN_NODE (-5)
103     #define PCRE_ERROR_NOMEMORY (-6)
104     #define PCRE_ERROR_NOSUBSTRING (-7)
105     #define PCRE_ERROR_MATCHLIMIT (-8)
106     #define PCRE_ERROR_CALLOUT (-9) /* Never used by PCRE itself */
107     #define PCRE_ERROR_BADUTF8 (-10)
108     #define PCRE_ERROR_BADUTF8_OFFSET (-11)
109 nigel 75 #define PCRE_ERROR_PARTIAL (-12)
110     #define PCRE_ERROR_BADPARTIAL (-13)
111     #define PCRE_ERROR_INTERNAL (-14)
112     #define PCRE_ERROR_BADCOUNT (-15)
113 nigel 43
114     /* Request types for pcre_fullinfo() */
115    
116 nigel 63 #define PCRE_INFO_OPTIONS 0
117     #define PCRE_INFO_SIZE 1
118     #define PCRE_INFO_CAPTURECOUNT 2
119     #define PCRE_INFO_BACKREFMAX 3
120     #define PCRE_INFO_FIRSTBYTE 4
121     #define PCRE_INFO_FIRSTCHAR 4 /* For backwards compatibility */
122     #define PCRE_INFO_FIRSTTABLE 5
123     #define PCRE_INFO_LASTLITERAL 6
124     #define PCRE_INFO_NAMEENTRYSIZE 7
125     #define PCRE_INFO_NAMECOUNT 8
126     #define PCRE_INFO_NAMETABLE 9
127     #define PCRE_INFO_STUDYSIZE 10
128 nigel 75 #define PCRE_INFO_DEFAULT_TABLES 11
129 nigel 43
130 nigel 63 /* Request types for pcre_config() */
131    
132     #define PCRE_CONFIG_UTF8 0
133     #define PCRE_CONFIG_NEWLINE 1
134     #define PCRE_CONFIG_LINK_SIZE 2
135     #define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3
136     #define PCRE_CONFIG_MATCH_LIMIT 4
137 nigel 73 #define PCRE_CONFIG_STACKRECURSE 5
138 nigel 75 #define PCRE_CONFIG_UNICODE_PROPERTIES 6
139 nigel 63
140     /* Bit flags for the pcre_extra structure */
141    
142     #define PCRE_EXTRA_STUDY_DATA 0x0001
143     #define PCRE_EXTRA_MATCH_LIMIT 0x0002
144     #define PCRE_EXTRA_CALLOUT_DATA 0x0004
145 nigel 75 #define PCRE_EXTRA_TABLES 0x0008
146 nigel 63
147 nigel 43 /* Types */
148    
149 nigel 63 struct real_pcre; /* declaration; the definition is private */
150 nigel 53 typedef struct real_pcre pcre;
151    
152 nigel 63 /* The structure for passing additional data to pcre_exec(). This is defined in
153 nigel 75 such as way as to be extensible. Always add new fields at the end, in order to
154     remain compatible. */
155 nigel 43
156 nigel 63 typedef struct pcre_extra {
157     unsigned long int flags; /* Bits for which fields are set */
158     void *study_data; /* Opaque data from pcre_study() */
159     unsigned long int match_limit; /* Maximum number of calls to match() */
160     void *callout_data; /* Data passed back in callouts */
161 nigel 75 const unsigned char *tables; /* Pointer to character tables */
162 nigel 63 } pcre_extra;
163 nigel 43
164 nigel 63 /* The structure for passing out data via the pcre_callout_function. We use a
165     structure so that new fields can be added on the end in future versions,
166     without changing the API of the function, thereby allowing old clients to work
167     without modification. */
168 nigel 43
169 nigel 63 typedef struct pcre_callout_block {
170     int version; /* Identifies version of block */
171     /* ------------------------ Version 0 ------------------------------- */
172     int callout_number; /* Number compiled into pattern */
173     int *offset_vector; /* The offset vector */
174     const char *subject; /* The subject being matched */
175     int subject_length; /* The length of the subject */
176     int start_match; /* Offset to start of this match attempt */
177 nigel 75 int current_position; /* Where we currently are in the subject */
178 nigel 63 int capture_top; /* Max current capture */
179     int capture_last; /* Most recently closed capture */
180     void *callout_data; /* Data passed in with the call */
181 nigel 75 /* ------------------- Added for Version 1 -------------------------- */
182     int pattern_position; /* Offset to next item in the pattern */
183     int next_item_length; /* Length of next item in the pattern */
184 nigel 63 /* ------------------------------------------------------------------ */
185     } pcre_callout_block;
186 nigel 43
187 nigel 63 /* Indirection for store get and free functions. These can be set to
188 nigel 73 alternative malloc/free functions if required. Special ones are used in the
189     non-recursive case for "frames". There is also an optional callout function
190     that is triggered by the (?) regex item. Some magic is required for Win32 DLL;
191     it is null on other OS. For Virtual Pascal, these have to be different again.
192     */
193 nigel 63
194     #ifndef VPCOMPAT
195     PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t);
196     PCRE_DATA_SCOPE void (*pcre_free)(void *);
197 nigel 73 PCRE_DATA_SCOPE void *(*pcre_stack_malloc)(size_t);
198     PCRE_DATA_SCOPE void (*pcre_stack_free)(void *);
199 nigel 63 PCRE_DATA_SCOPE int (*pcre_callout)(pcre_callout_block *);
200     #else /* VPCOMPAT */
201     extern void *pcre_malloc(size_t);
202     extern void pcre_free(void *);
203 nigel 73 extern void *pcre_stack_malloc(size_t);
204     extern void pcre_stack_free(void *);
205 nigel 63 extern int pcre_callout(pcre_callout_block *);
206     #endif /* VPCOMPAT */
207    
208     /* Exported PCRE functions */
209    
210     extern pcre *pcre_compile(const char *, int, const char **,
211     int *, const unsigned char *);
212     extern int pcre_config(int, void *);
213     extern int pcre_copy_named_substring(const pcre *, const char *,
214     int *, int, const char *, char *, int);
215     extern int pcre_copy_substring(const char *, int *, int, int,
216     char *, int);
217     extern int pcre_exec(const pcre *, const pcre_extra *,
218     const char *, int, int, int, int *, int);
219 nigel 49 extern void pcre_free_substring(const char *);
220     extern void pcre_free_substring_list(const char **);
221 nigel 63 extern int pcre_fullinfo(const pcre *, const pcre_extra *, int,
222     void *);
223     extern int pcre_get_named_substring(const pcre *, const char *,
224     int *, int, const char *, const char **);
225     extern int pcre_get_stringnumber(const pcre *, const char *);
226     extern int pcre_get_substring(const char *, int *, int, int,
227     const char **);
228     extern int pcre_get_substring_list(const char *, int *, int,
229     const char ***);
230 nigel 49 extern int pcre_info(const pcre *, int *, int *);
231 nigel 53 extern const unsigned char *pcre_maketables(void);
232 nigel 43 extern pcre_extra *pcre_study(const pcre *, int, const char **);
233     extern const char *pcre_version(void);
234    
235     #ifdef __cplusplus
236     } /* extern "C" */
237     #endif
238    
239     #endif /* End of pcre.h */

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12