/[pcre]/code/tags/pcre-5.0/pcre.in
ViewVC logotype

Diff of /code/tags/pcre-5.0/pcre.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 47 by nigel, Sat Feb 24 21:39:29 2007 UTC revision 75 by nigel, Sat Feb 24 21:40:37 2007 UTC
# Line 2  Line 2 
2  *       Perl-Compatible Regular Expressions      *  *       Perl-Compatible Regular Expressions      *
3  *************************************************/  *************************************************/
4    
5  /* Copyright (c) 1997-2000 University of Cambridge */  /* In its original form, this is the .in file that is transformed by
6    "configure" into pcre.h.
7    
8               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  #ifndef _PCRE_H  #ifndef _PCRE_H
40  #define _PCRE_H  #define _PCRE_H
# Line 10  Line 42 
42  /* The file pcre.h is build by "configure". Do not edit it; instead  /* The file pcre.h is build by "configure". Do not edit it; instead
43  make changes to pcre.in. */  make changes to pcre.in. */
44    
45  #define PCRE_MAJOR @PCRE_MAJOR@  #define PCRE_MAJOR          @PCRE_MAJOR@
46  #define PCRE_MINOR @PCRE_MINOR@  #define PCRE_MINOR          @PCRE_MINOR@
47  #define PCRE_DATE  @PCRE_DATE@  #define PCRE_DATE           @PCRE_DATE@
48    
49  /* Win32 uses DLL by default */  /* Win32 uses DLL by default */
50    
51  #ifdef _WIN32  #ifdef _WIN32
52  # ifdef STATIC  #  ifdef PCRE_DEFINITION
53  #  define PCRE_DL_IMPORT  #    ifdef DLL_EXPORT
54  # else  #      define PCRE_DATA_SCOPE __declspec(dllexport)
55  #  define PCRE_DL_IMPORT __declspec(dllimport)  #    endif
56  # endif  #  else
57  #else  #    ifndef PCRE_STATIC
58  # define PCRE_DL_IMPORT  #      define PCRE_DATA_SCOPE extern __declspec(dllimport)
59    #    endif
60    #  endif
61    #endif
62    #ifndef PCRE_DATA_SCOPE
63    #  define PCRE_DATA_SCOPE     extern
64  #endif  #endif
65    
66  /* Have to include stdlib.h in order to ensure that size_t is defined;  /* Have to include stdlib.h in order to ensure that size_t is defined;
# Line 39  extern "C" { Line 76  extern "C" {
76    
77  /* Options */  /* Options */
78    
79  #define PCRE_CASELESS        0x0001  #define PCRE_CASELESS           0x0001
80  #define PCRE_MULTILINE       0x0002  #define PCRE_MULTILINE          0x0002
81  #define PCRE_DOTALL          0x0004  #define PCRE_DOTALL             0x0004
82  #define PCRE_EXTENDED        0x0008  #define PCRE_EXTENDED           0x0008
83  #define PCRE_ANCHORED        0x0010  #define PCRE_ANCHORED           0x0010
84  #define PCRE_DOLLAR_ENDONLY  0x0020  #define PCRE_DOLLAR_ENDONLY     0x0020
85  #define PCRE_EXTRA           0x0040  #define PCRE_EXTRA              0x0040
86  #define PCRE_NOTBOL          0x0080  #define PCRE_NOTBOL             0x0080
87  #define PCRE_NOTEOL          0x0100  #define PCRE_NOTEOL             0x0100
88  #define PCRE_UNGREEDY        0x0200  #define PCRE_UNGREEDY           0x0200
89  #define PCRE_NOTEMPTY        0x0400  #define PCRE_NOTEMPTY           0x0400
90    #define PCRE_UTF8               0x0800
91  /* Exec-time and get-time error codes */  #define PCRE_NO_AUTO_CAPTURE    0x1000
92    #define PCRE_NO_UTF8_CHECK      0x2000
93  #define PCRE_ERROR_NOMATCH        (-1)  #define PCRE_AUTO_CALLOUT       0x4000
94  #define PCRE_ERROR_NULL           (-2)  #define PCRE_PARTIAL            0x8000
95  #define PCRE_ERROR_BADOPTION      (-3)  
96  #define PCRE_ERROR_BADMAGIC       (-4)  /* Exec-time and get/set-time error codes */
97  #define PCRE_ERROR_UNKNOWN_NODE   (-5)  
98  #define PCRE_ERROR_NOMEMORY       (-6)  #define PCRE_ERROR_NOMATCH         (-1)
99  #define PCRE_ERROR_NOSUBSTRING    (-7)  #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    #define PCRE_ERROR_PARTIAL        (-12)
110    #define PCRE_ERROR_BADPARTIAL     (-13)
111    #define PCRE_ERROR_INTERNAL       (-14)
112    #define PCRE_ERROR_BADCOUNT       (-15)
113    
114  /* Request types for pcre_fullinfo() */  /* Request types for pcre_fullinfo() */
115    
116  #define PCRE_INFO_OPTIONS         0  #define PCRE_INFO_OPTIONS            0
117  #define PCRE_INFO_SIZE            1  #define PCRE_INFO_SIZE               1
118  #define PCRE_INFO_CAPTURECOUNT    2  #define PCRE_INFO_CAPTURECOUNT       2
119  #define PCRE_INFO_BACKREFMAX      3  #define PCRE_INFO_BACKREFMAX         3
120  #define PCRE_INFO_FIRSTCHAR       4  #define PCRE_INFO_FIRSTBYTE          4
121  #define PCRE_INFO_FIRSTTABLE      5  #define PCRE_INFO_FIRSTCHAR          4  /* For backwards compatibility */
122  #define PCRE_INFO_LASTLITERAL     6  #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    #define PCRE_INFO_DEFAULT_TABLES    11
129    
130    /* 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    #define PCRE_CONFIG_STACKRECURSE            5
138    #define PCRE_CONFIG_UNICODE_PROPERTIES      6
139    
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    #define PCRE_EXTRA_TABLES              0x0008
146    
147  /* Types */  /* Types */
148    
149  typedef void pcre;  struct real_pcre;                 /* declaration; the definition is private  */
150  typedef void pcre_extra;  typedef struct real_pcre pcre;
151    
152  /* Store get and free functions. These can be set to alternative malloc/free  /* The structure for passing additional data to pcre_exec(). This is defined in
153  functions if required. Some magic is required for Win32 DLL; it is null on  such as way as to be extensible. Always add new fields at the end, in order to
154  other OS. */  remain compatible. */
155    
156  PCRE_DL_IMPORT extern void *(*pcre_malloc)(size_t);  typedef struct pcre_extra {
157  PCRE_DL_IMPORT extern void  (*pcre_free)(void *);    unsigned long int flags;        /* Bits for which fields are set */
158      void *study_data;               /* Opaque data from pcre_study() */
159  #undef PCRE_DL_IMPORT    unsigned long int match_limit;  /* Maximum number of calls to match() */
160      void *callout_data;             /* Data passed back in callouts */
161  /* Functions */    const unsigned char *tables;    /* Pointer to character tables */
162    } pcre_extra;
163  extern pcre *pcre_compile(const char *, int, const char **, int *,  
164    const unsigned char *);  /* The structure for passing out data via the pcre_callout_function. We use a
165  extern int pcre_copy_substring(const char *, int *, int, int, char *, int);  structure so that new fields can be added on the end in future versions,
166  extern int pcre_exec(const pcre *, const pcre_extra *, const char *,  without changing the API of the function, thereby allowing old clients to work
167    int, int, int, int *, int);  without modification. */
168  extern int pcre_get_substring(const char *, int *, int, int, const char **);  
169  extern int pcre_get_substring_list(const char *, int *, int, const char ***);  typedef struct pcre_callout_block {
170  extern int pcre_info(const pcre *, int *, int *);    int          version;           /* Identifies version of block */
171  extern int pcre_fullinfo(const pcre *, const pcre_extra *, int, void *);    /* ------------------------ Version 0 ------------------------------- */
172  extern unsigned const char *pcre_maketables(void);    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      int          current_position;  /* Where we currently are in the subject */
178      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      /* ------------------- 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      /* ------------------------------------------------------------------ */
185    } pcre_callout_block;
186    
187    /* Indirection for store get and free functions. These can be set to
188    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    
194    #ifndef VPCOMPAT
195    PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t);
196    PCRE_DATA_SCOPE void  (*pcre_free)(void *);
197    PCRE_DATA_SCOPE void *(*pcre_stack_malloc)(size_t);
198    PCRE_DATA_SCOPE void  (*pcre_stack_free)(void *);
199    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    extern void *pcre_stack_malloc(size_t);
204    extern void  pcre_stack_free(void *);
205    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    extern void pcre_free_substring(const char *);
220    extern void pcre_free_substring_list(const char **);
221    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    extern int  pcre_info(const pcre *, int *, int *);
231    extern const unsigned char *pcre_maketables(void);
232  extern pcre_extra *pcre_study(const pcre *, int, const char **);  extern pcre_extra *pcre_study(const pcre *, int, const char **);
233  extern const char *pcre_version(void);  extern const char *pcre_version(void);
234    

Legend:
Removed from v.47  
changed lines
  Added in v.75

  ViewVC Help
Powered by ViewVC 1.1.5