/[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 43 by nigel, Sat Feb 24 21:39:21 2007 UTC revision 71 by nigel, Sat Feb 24 21:40:24 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 */  /* Copyright (c) 1997-2003 University of Cambridge */
6    
7  #ifndef _PCRE_H  #ifndef _PCRE_H
8  #define _PCRE_H  #define _PCRE_H
9    
10  #define PCRE_MAJOR @PCRE_MAJOR@  /* The file pcre.h is build by "configure". Do not edit it; instead
11  #define PCRE_MINOR @PCRE_MINOR@  make changes to pcre.in. */
12  #define PCRE_DATE  @PCRE_DATE@  
13    #define PCRE_MAJOR          @PCRE_MAJOR@
14    #define PCRE_MINOR          @PCRE_MINOR@
15    #define PCRE_DATE           @PCRE_DATE@
16    
17  /* Win32 uses DLL by default */  /* Win32 uses DLL by default */
18    
19  #ifdef _WIN32  #ifdef _WIN32
20  # ifdef STATIC  #  ifdef PCRE_DEFINITION
21  #  define PCRE_DL_IMPORT  #    ifdef DLL_EXPORT
22  # else  #      define PCRE_DATA_SCOPE __declspec(dllexport)
23  #  define PCRE_DL_IMPORT __declspec(dllimport)  #    endif
24  # endif  #  else
25  #else  #    ifndef PCRE_STATIC
26  # define PCRE_DL_IMPORT  #      define PCRE_DATA_SCOPE extern __declspec(dllimport)
27    #    endif
28    #  endif
29    #endif
30    #ifndef PCRE_DATA_SCOPE
31    #  define PCRE_DATA_SCOPE     extern
32  #endif  #endif
33    
34  /* 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;
35  it is needed here for malloc. */  it is needed here for malloc. */
36    
 #include <sys/types.h>  
37  #include <stdlib.h>  #include <stdlib.h>
38    
39  /* Allow for C++ users */  /* Allow for C++ users */
# Line 37  extern "C" { Line 44  extern "C" {
44    
45  /* Options */  /* Options */
46    
47  #define PCRE_CASELESS        0x0001  #define PCRE_CASELESS           0x0001
48  #define PCRE_MULTILINE       0x0002  #define PCRE_MULTILINE          0x0002
49  #define PCRE_DOTALL          0x0004  #define PCRE_DOTALL             0x0004
50  #define PCRE_EXTENDED        0x0008  #define PCRE_EXTENDED           0x0008
51  #define PCRE_ANCHORED        0x0010  #define PCRE_ANCHORED           0x0010
52  #define PCRE_DOLLAR_ENDONLY  0x0020  #define PCRE_DOLLAR_ENDONLY     0x0020
53  #define PCRE_EXTRA           0x0040  #define PCRE_EXTRA              0x0040
54  #define PCRE_NOTBOL          0x0080  #define PCRE_NOTBOL             0x0080
55  #define PCRE_NOTEOL          0x0100  #define PCRE_NOTEOL             0x0100
56  #define PCRE_UNGREEDY        0x0200  #define PCRE_UNGREEDY           0x0200
57  #define PCRE_NOTEMPTY        0x0400  #define PCRE_NOTEMPTY           0x0400
58    #define PCRE_UTF8               0x0800
59    #define PCRE_NO_AUTO_CAPTURE    0x1000
60    #define PCRE_NO_UTF8_CHECK      0x2000
61    
62  /* Exec-time and get-time error codes */  /* Exec-time and get/set-time error codes */
63    
64  #define PCRE_ERROR_NOMATCH        (-1)  #define PCRE_ERROR_NOMATCH        (-1)
65  #define PCRE_ERROR_NULL           (-2)  #define PCRE_ERROR_NULL           (-2)
# Line 58  extern "C" { Line 68  extern "C" {
68  #define PCRE_ERROR_UNKNOWN_NODE   (-5)  #define PCRE_ERROR_UNKNOWN_NODE   (-5)
69  #define PCRE_ERROR_NOMEMORY       (-6)  #define PCRE_ERROR_NOMEMORY       (-6)
70  #define PCRE_ERROR_NOSUBSTRING    (-7)  #define PCRE_ERROR_NOSUBSTRING    (-7)
71    #define PCRE_ERROR_MATCHLIMIT     (-8)
72    #define PCRE_ERROR_CALLOUT        (-9)  /* Never used by PCRE itself */
73    #define PCRE_ERROR_BADUTF8       (-10)
74    
75  /* Request types for pcre_fullinfo() */  /* Request types for pcre_fullinfo() */
76    
77  #define PCRE_INFO_OPTIONS         0  #define PCRE_INFO_OPTIONS            0
78  #define PCRE_INFO_SIZE            1  #define PCRE_INFO_SIZE               1
79  #define PCRE_INFO_CAPTURECOUNT    2  #define PCRE_INFO_CAPTURECOUNT       2
80  #define PCRE_INFO_BACKREFMAX      3  #define PCRE_INFO_BACKREFMAX         3
81  #define PCRE_INFO_FIRSTCHAR       4  #define PCRE_INFO_FIRSTBYTE          4
82  #define PCRE_INFO_FIRSTTABLE      5  #define PCRE_INFO_FIRSTCHAR          4  /* For backwards compatibility */
83  #define PCRE_INFO_LASTLITERAL     6  #define PCRE_INFO_FIRSTTABLE         5
84    #define PCRE_INFO_LASTLITERAL        6
85    #define PCRE_INFO_NAMEENTRYSIZE      7
86    #define PCRE_INFO_NAMECOUNT          8
87    #define PCRE_INFO_NAMETABLE          9
88    #define PCRE_INFO_STUDYSIZE         10
89    
90    /* Request types for pcre_config() */
91    
92    #define PCRE_CONFIG_UTF8                    0
93    #define PCRE_CONFIG_NEWLINE                 1
94    #define PCRE_CONFIG_LINK_SIZE               2
95    #define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD  3
96    #define PCRE_CONFIG_MATCH_LIMIT             4
97    
98    /* Bit flags for the pcre_extra structure */
99    
100    #define PCRE_EXTRA_STUDY_DATA          0x0001
101    #define PCRE_EXTRA_MATCH_LIMIT         0x0002
102    #define PCRE_EXTRA_CALLOUT_DATA        0x0004
103    
104  /* Types */  /* Types */
105    
106  typedef void pcre;  struct real_pcre;                 /* declaration; the definition is private  */
107  typedef void pcre_extra;  typedef struct real_pcre pcre;
108    
109    /* The structure for passing additional data to pcre_exec(). This is defined in
110    such as way as to be extensible. */
111    
112  /* Store get and free functions. These can be set to alternative malloc/free  typedef struct pcre_extra {
113  functions if required. Some magic is required for Win32 DLL; it is null on    unsigned long int flags;        /* Bits for which fields are set */
114  other OS. */    void *study_data;               /* Opaque data from pcre_study() */
115      unsigned long int match_limit;  /* Maximum number of calls to match() */
116  PCRE_DL_IMPORT extern void *(*pcre_malloc)(size_t);    void *callout_data;             /* Data passed back in callouts */
117  PCRE_DL_IMPORT extern void  (*pcre_free)(void *);  } pcre_extra;
118    
119  #undef PCRE_DL_IMPORT  /* The structure for passing out data via the pcre_callout_function. We use a
120    structure so that new fields can be added on the end in future versions,
121  /* Functions */  without changing the API of the function, thereby allowing old clients to work
122    without modification. */
123  extern pcre *pcre_compile(const char *, int, const char **, int *,  
124    const unsigned char *);  typedef struct pcre_callout_block {
125  extern int pcre_copy_substring(const char *, int *, int, int, char *, int);    int          version;           /* Identifies version of block */
126  extern int pcre_exec(const pcre *, const pcre_extra *, const char *,    /* ------------------------ Version 0 ------------------------------- */
127    int, int, int, int *, int);    int          callout_number;    /* Number compiled into pattern */
128  extern int pcre_get_substring(const char *, int *, int, int, const char **);    int         *offset_vector;     /* The offset vector */
129  extern int pcre_get_substring_list(const char *, int *, int, const char ***);    const char  *subject;           /* The subject being matched */
130  extern int pcre_info(const pcre *, int *, int *);    int          subject_length;    /* The length of the subject */
131  extern int pcre_fullinfo(const pcre *, const pcre_extra *, int, void *);    int          start_match;       /* Offset to start of this match attempt */
132  extern unsigned const char *pcre_maketables(void);    int          current_position;  /* Where we currently are */
133      int          capture_top;       /* Max current capture */
134      int          capture_last;      /* Most recently closed capture */
135      void        *callout_data;      /* Data passed in with the call */
136      /* ------------------------------------------------------------------ */
137    } pcre_callout_block;
138    
139    /* Indirection for store get and free functions. These can be set to
140    alternative malloc/free functions if required. There is also an optional
141    callout function that is triggered by the (?) regex item. Some magic is
142    required for Win32 DLL; it is null on other OS. For Virtual Pascal, these
143    have to be different again. */
144    
145    #ifndef VPCOMPAT
146    PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t);
147    PCRE_DATA_SCOPE void  (*pcre_free)(void *);
148    PCRE_DATA_SCOPE int   (*pcre_callout)(pcre_callout_block *);
149    #else   /* VPCOMPAT */
150    extern void *pcre_malloc(size_t);
151    extern void  pcre_free(void *);
152    extern int   pcre_callout(pcre_callout_block *);
153    #endif  /* VPCOMPAT */
154    
155    /* Exported PCRE functions */
156    
157    extern pcre *pcre_compile(const char *, int, const char **,
158                  int *, const unsigned char *);
159    extern int  pcre_config(int, void *);
160    extern int  pcre_copy_named_substring(const pcre *, const char *,
161                  int *, int, const char *, char *, int);
162    extern int  pcre_copy_substring(const char *, int *, int, int,
163                  char *, int);
164    extern int  pcre_exec(const pcre *, const pcre_extra *,
165                  const char *, int, int, int, int *, int);
166    extern void pcre_free_substring(const char *);
167    extern void pcre_free_substring_list(const char **);
168    extern int  pcre_fullinfo(const pcre *, const pcre_extra *, int,
169                  void *);
170    extern int  pcre_get_named_substring(const pcre *, const char *,
171                  int *, int,  const char *, const char **);
172    extern int  pcre_get_stringnumber(const pcre *, const char *);
173    extern int  pcre_get_substring(const char *, int *, int, int,
174                  const char **);
175    extern int  pcre_get_substring_list(const char *, int *, int,
176                  const char ***);
177    extern int  pcre_info(const pcre *, int *, int *);
178    extern const unsigned char *pcre_maketables(void);
179  extern pcre_extra *pcre_study(const pcre *, int, const char **);  extern pcre_extra *pcre_study(const pcre *, int, const char **);
180  extern const char *pcre_version(void);  extern const char *pcre_version(void);
181    

Legend:
Removed from v.43  
changed lines
  Added in v.71

  ViewVC Help
Powered by ViewVC 1.1.5