Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-05-18 08:30:10

0001 /*************************************************
0002 *       Perl-Compatible Regular Expressions      *
0003 *************************************************/
0004 
0005 /* This is the public header file for the PCRE library, to be #included by
0006 applications that call the PCRE functions.
0007 
0008            Copyright (c) 1997-2014 University of Cambridge
0009 
0010 -----------------------------------------------------------------------------
0011 Redistribution and use in source and binary forms, with or without
0012 modification, are permitted provided that the following conditions are met:
0013 
0014     * Redistributions of source code must retain the above copyright notice,
0015       this list of conditions and the following disclaimer.
0016 
0017     * Redistributions in binary form must reproduce the above copyright
0018       notice, this list of conditions and the following disclaimer in the
0019       documentation and/or other materials provided with the distribution.
0020 
0021     * Neither the name of the University of Cambridge nor the names of its
0022       contributors may be used to endorse or promote products derived from
0023       this software without specific prior written permission.
0024 
0025 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0026 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0027 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0028 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0029 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0030 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0031 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0032 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0033 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0034 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0035 POSSIBILITY OF SUCH DAMAGE.
0036 -----------------------------------------------------------------------------
0037 */
0038 
0039 #ifndef _PCRE_H
0040 #define _PCRE_H
0041 
0042 /* The current PCRE version information. */
0043 
0044 #define PCRE_MAJOR          8
0045 #define PCRE_MINOR          45
0046 #define PCRE_PRERELEASE     
0047 #define PCRE_DATE           2021-06-15
0048 
0049 /* When an application links to a PCRE DLL in Windows, the symbols that are
0050 imported have to be identified as such. When building PCRE, the appropriate
0051 export setting is defined in pcre_internal.h, which includes this file. So we
0052 don't change existing definitions of PCRE_EXP_DECL and PCRECPP_EXP_DECL. */
0053 
0054 #if defined(_WIN32) && !defined(PCRE_STATIC)
0055 #  ifndef PCRE_EXP_DECL
0056 #    define PCRE_EXP_DECL  extern __declspec(dllimport)
0057 #  endif
0058 #  ifdef __cplusplus
0059 #    ifndef PCRECPP_EXP_DECL
0060 #      define PCRECPP_EXP_DECL  extern __declspec(dllimport)
0061 #    endif
0062 #    ifndef PCRECPP_EXP_DEFN
0063 #      define PCRECPP_EXP_DEFN  __declspec(dllimport)
0064 #    endif
0065 #  endif
0066 #endif
0067 
0068 /* By default, we use the standard "extern" declarations. */
0069 
0070 #ifndef PCRE_EXP_DECL
0071 #  ifdef __cplusplus
0072 #    define PCRE_EXP_DECL  extern "C"
0073 #  else
0074 #    define PCRE_EXP_DECL  extern
0075 #  endif
0076 #endif
0077 
0078 #ifdef __cplusplus
0079 #  ifndef PCRECPP_EXP_DECL
0080 #    define PCRECPP_EXP_DECL  extern
0081 #  endif
0082 #  ifndef PCRECPP_EXP_DEFN
0083 #    define PCRECPP_EXP_DEFN
0084 #  endif
0085 #endif
0086 
0087 /* Have to include stdlib.h in order to ensure that size_t is defined;
0088 it is needed here for malloc. */
0089 
0090 #include <stdlib.h>
0091 
0092 /* Allow for C++ users */
0093 
0094 #ifdef __cplusplus
0095 extern "C" {
0096 #endif
0097 
0098 /* Public options. Some are compile-time only, some are run-time only, and some
0099 are both. Most of the compile-time options are saved with the compiled regex so
0100 that they can be inspected during studying (and therefore JIT compiling). Note
0101 that pcre_study() has its own set of options. Originally, all the options
0102 defined here used distinct bits. However, almost all the bits in a 32-bit word
0103 are now used, so in order to conserve them, option bits that were previously
0104 only recognized at matching time (i.e. by pcre_exec() or pcre_dfa_exec()) may
0105 also be used for compile-time options that affect only compiling and are not
0106 relevant for studying or JIT compiling.
0107 
0108 Some options for pcre_compile() change its behaviour but do not affect the
0109 behaviour of the execution functions. Other options are passed through to the
0110 execution functions and affect their behaviour, with or without affecting the
0111 behaviour of pcre_compile().
0112 
0113 Options that can be passed to pcre_compile() are tagged Cx below, with these
0114 variants:
0115 
0116 C1   Affects compile only
0117 C2   Does not affect compile; affects exec, dfa_exec
0118 C3   Affects compile, exec, dfa_exec
0119 C4   Affects compile, exec, dfa_exec, study
0120 C5   Affects compile, exec, study
0121 
0122 Options that can be set for pcre_exec() and/or pcre_dfa_exec() are flagged with
0123 E and D, respectively. They take precedence over C3, C4, and C5 settings passed
0124 from pcre_compile(). Those that are compatible with JIT execution are flagged
0125 with J. */
0126 
0127 #define PCRE_CASELESS           0x00000001  /* C1       */
0128 #define PCRE_MULTILINE          0x00000002  /* C1       */
0129 #define PCRE_DOTALL             0x00000004  /* C1       */
0130 #define PCRE_EXTENDED           0x00000008  /* C1       */
0131 #define PCRE_ANCHORED           0x00000010  /* C4 E D   */
0132 #define PCRE_DOLLAR_ENDONLY     0x00000020  /* C2       */
0133 #define PCRE_EXTRA              0x00000040  /* C1       */
0134 #define PCRE_NOTBOL             0x00000080  /*    E D J */
0135 #define PCRE_NOTEOL             0x00000100  /*    E D J */
0136 #define PCRE_UNGREEDY           0x00000200  /* C1       */
0137 #define PCRE_NOTEMPTY           0x00000400  /*    E D J */
0138 #define PCRE_UTF8               0x00000800  /* C4        )          */
0139 #define PCRE_UTF16              0x00000800  /* C4        ) Synonyms */
0140 #define PCRE_UTF32              0x00000800  /* C4        )          */
0141 #define PCRE_NO_AUTO_CAPTURE    0x00001000  /* C1       */
0142 #define PCRE_NO_UTF8_CHECK      0x00002000  /* C1 E D J  )          */
0143 #define PCRE_NO_UTF16_CHECK     0x00002000  /* C1 E D J  ) Synonyms */
0144 #define PCRE_NO_UTF32_CHECK     0x00002000  /* C1 E D J  )          */
0145 #define PCRE_AUTO_CALLOUT       0x00004000  /* C1       */
0146 #define PCRE_PARTIAL_SOFT       0x00008000  /*    E D J  ) Synonyms */
0147 #define PCRE_PARTIAL            0x00008000  /*    E D J  )          */
0148 
0149 /* This pair use the same bit. */
0150 #define PCRE_NEVER_UTF          0x00010000  /* C1        ) Overlaid */
0151 #define PCRE_DFA_SHORTEST       0x00010000  /*      D    ) Overlaid */
0152 
0153 /* This pair use the same bit. */
0154 #define PCRE_NO_AUTO_POSSESS    0x00020000  /* C1        ) Overlaid */
0155 #define PCRE_DFA_RESTART        0x00020000  /*      D    ) Overlaid */
0156 
0157 #define PCRE_FIRSTLINE          0x00040000  /* C3       */
0158 #define PCRE_DUPNAMES           0x00080000  /* C1       */
0159 #define PCRE_NEWLINE_CR         0x00100000  /* C3 E D   */
0160 #define PCRE_NEWLINE_LF         0x00200000  /* C3 E D   */
0161 #define PCRE_NEWLINE_CRLF       0x00300000  /* C3 E D   */
0162 #define PCRE_NEWLINE_ANY        0x00400000  /* C3 E D   */
0163 #define PCRE_NEWLINE_ANYCRLF    0x00500000  /* C3 E D   */
0164 #define PCRE_BSR_ANYCRLF        0x00800000  /* C3 E D   */
0165 #define PCRE_BSR_UNICODE        0x01000000  /* C3 E D   */
0166 #define PCRE_JAVASCRIPT_COMPAT  0x02000000  /* C5       */
0167 #define PCRE_NO_START_OPTIMIZE  0x04000000  /* C2 E D    ) Synonyms */
0168 #define PCRE_NO_START_OPTIMISE  0x04000000  /* C2 E D    )          */
0169 #define PCRE_PARTIAL_HARD       0x08000000  /*    E D J */
0170 #define PCRE_NOTEMPTY_ATSTART   0x10000000  /*    E D J */
0171 #define PCRE_UCP                0x20000000  /* C3       */
0172 
0173 /* Exec-time and get/set-time error codes */
0174 
0175 #define PCRE_ERROR_NOMATCH          (-1)
0176 #define PCRE_ERROR_NULL             (-2)
0177 #define PCRE_ERROR_BADOPTION        (-3)
0178 #define PCRE_ERROR_BADMAGIC         (-4)
0179 #define PCRE_ERROR_UNKNOWN_OPCODE   (-5)
0180 #define PCRE_ERROR_UNKNOWN_NODE     (-5)  /* For backward compatibility */
0181 #define PCRE_ERROR_NOMEMORY         (-6)
0182 #define PCRE_ERROR_NOSUBSTRING      (-7)
0183 #define PCRE_ERROR_MATCHLIMIT       (-8)
0184 #define PCRE_ERROR_CALLOUT          (-9)  /* Never used by PCRE itself */
0185 #define PCRE_ERROR_BADUTF8         (-10)  /* Same for 8/16/32 */
0186 #define PCRE_ERROR_BADUTF16        (-10)  /* Same for 8/16/32 */
0187 #define PCRE_ERROR_BADUTF32        (-10)  /* Same for 8/16/32 */
0188 #define PCRE_ERROR_BADUTF8_OFFSET  (-11)  /* Same for 8/16 */
0189 #define PCRE_ERROR_BADUTF16_OFFSET (-11)  /* Same for 8/16 */
0190 #define PCRE_ERROR_PARTIAL         (-12)
0191 #define PCRE_ERROR_BADPARTIAL      (-13)
0192 #define PCRE_ERROR_INTERNAL        (-14)
0193 #define PCRE_ERROR_BADCOUNT        (-15)
0194 #define PCRE_ERROR_DFA_UITEM       (-16)
0195 #define PCRE_ERROR_DFA_UCOND       (-17)
0196 #define PCRE_ERROR_DFA_UMLIMIT     (-18)
0197 #define PCRE_ERROR_DFA_WSSIZE      (-19)
0198 #define PCRE_ERROR_DFA_RECURSE     (-20)
0199 #define PCRE_ERROR_RECURSIONLIMIT  (-21)
0200 #define PCRE_ERROR_NULLWSLIMIT     (-22)  /* No longer actually used */
0201 #define PCRE_ERROR_BADNEWLINE      (-23)
0202 #define PCRE_ERROR_BADOFFSET       (-24)
0203 #define PCRE_ERROR_SHORTUTF8       (-25)
0204 #define PCRE_ERROR_SHORTUTF16      (-25)  /* Same for 8/16 */
0205 #define PCRE_ERROR_RECURSELOOP     (-26)
0206 #define PCRE_ERROR_JIT_STACKLIMIT  (-27)
0207 #define PCRE_ERROR_BADMODE         (-28)
0208 #define PCRE_ERROR_BADENDIANNESS   (-29)
0209 #define PCRE_ERROR_DFA_BADRESTART  (-30)
0210 #define PCRE_ERROR_JIT_BADOPTION   (-31)
0211 #define PCRE_ERROR_BADLENGTH       (-32)
0212 #define PCRE_ERROR_UNSET           (-33)
0213 
0214 /* Specific error codes for UTF-8 validity checks */
0215 
0216 #define PCRE_UTF8_ERR0               0
0217 #define PCRE_UTF8_ERR1               1
0218 #define PCRE_UTF8_ERR2               2
0219 #define PCRE_UTF8_ERR3               3
0220 #define PCRE_UTF8_ERR4               4
0221 #define PCRE_UTF8_ERR5               5
0222 #define PCRE_UTF8_ERR6               6
0223 #define PCRE_UTF8_ERR7               7
0224 #define PCRE_UTF8_ERR8               8
0225 #define PCRE_UTF8_ERR9               9
0226 #define PCRE_UTF8_ERR10             10
0227 #define PCRE_UTF8_ERR11             11
0228 #define PCRE_UTF8_ERR12             12
0229 #define PCRE_UTF8_ERR13             13
0230 #define PCRE_UTF8_ERR14             14
0231 #define PCRE_UTF8_ERR15             15
0232 #define PCRE_UTF8_ERR16             16
0233 #define PCRE_UTF8_ERR17             17
0234 #define PCRE_UTF8_ERR18             18
0235 #define PCRE_UTF8_ERR19             19
0236 #define PCRE_UTF8_ERR20             20
0237 #define PCRE_UTF8_ERR21             21
0238 #define PCRE_UTF8_ERR22             22  /* Unused (was non-character) */
0239 
0240 /* Specific error codes for UTF-16 validity checks */
0241 
0242 #define PCRE_UTF16_ERR0              0
0243 #define PCRE_UTF16_ERR1              1
0244 #define PCRE_UTF16_ERR2              2
0245 #define PCRE_UTF16_ERR3              3
0246 #define PCRE_UTF16_ERR4              4  /* Unused (was non-character) */
0247 
0248 /* Specific error codes for UTF-32 validity checks */
0249 
0250 #define PCRE_UTF32_ERR0              0
0251 #define PCRE_UTF32_ERR1              1
0252 #define PCRE_UTF32_ERR2              2  /* Unused (was non-character) */
0253 #define PCRE_UTF32_ERR3              3
0254 
0255 /* Request types for pcre_fullinfo() */
0256 
0257 #define PCRE_INFO_OPTIONS            0
0258 #define PCRE_INFO_SIZE               1
0259 #define PCRE_INFO_CAPTURECOUNT       2
0260 #define PCRE_INFO_BACKREFMAX         3
0261 #define PCRE_INFO_FIRSTBYTE          4
0262 #define PCRE_INFO_FIRSTCHAR          4  /* For backwards compatibility */
0263 #define PCRE_INFO_FIRSTTABLE         5
0264 #define PCRE_INFO_LASTLITERAL        6
0265 #define PCRE_INFO_NAMEENTRYSIZE      7
0266 #define PCRE_INFO_NAMECOUNT          8
0267 #define PCRE_INFO_NAMETABLE          9
0268 #define PCRE_INFO_STUDYSIZE         10
0269 #define PCRE_INFO_DEFAULT_TABLES    11
0270 #define PCRE_INFO_OKPARTIAL         12
0271 #define PCRE_INFO_JCHANGED          13
0272 #define PCRE_INFO_HASCRORLF         14
0273 #define PCRE_INFO_MINLENGTH         15
0274 #define PCRE_INFO_JIT               16
0275 #define PCRE_INFO_JITSIZE           17
0276 #define PCRE_INFO_MAXLOOKBEHIND     18
0277 #define PCRE_INFO_FIRSTCHARACTER    19
0278 #define PCRE_INFO_FIRSTCHARACTERFLAGS 20
0279 #define PCRE_INFO_REQUIREDCHAR      21
0280 #define PCRE_INFO_REQUIREDCHARFLAGS 22
0281 #define PCRE_INFO_MATCHLIMIT        23
0282 #define PCRE_INFO_RECURSIONLIMIT    24
0283 #define PCRE_INFO_MATCH_EMPTY       25
0284 
0285 /* Request types for pcre_config(). Do not re-arrange, in order to remain
0286 compatible. */
0287 
0288 #define PCRE_CONFIG_UTF8                    0
0289 #define PCRE_CONFIG_NEWLINE                 1
0290 #define PCRE_CONFIG_LINK_SIZE               2
0291 #define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD  3
0292 #define PCRE_CONFIG_MATCH_LIMIT             4
0293 #define PCRE_CONFIG_STACKRECURSE            5
0294 #define PCRE_CONFIG_UNICODE_PROPERTIES      6
0295 #define PCRE_CONFIG_MATCH_LIMIT_RECURSION   7
0296 #define PCRE_CONFIG_BSR                     8
0297 #define PCRE_CONFIG_JIT                     9
0298 #define PCRE_CONFIG_UTF16                  10
0299 #define PCRE_CONFIG_JITTARGET              11
0300 #define PCRE_CONFIG_UTF32                  12
0301 #define PCRE_CONFIG_PARENS_LIMIT           13
0302 
0303 /* Request types for pcre_study(). Do not re-arrange, in order to remain
0304 compatible. */
0305 
0306 #define PCRE_STUDY_JIT_COMPILE                0x0001
0307 #define PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE   0x0002
0308 #define PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE   0x0004
0309 #define PCRE_STUDY_EXTRA_NEEDED               0x0008
0310 
0311 /* Bit flags for the pcre[16|32]_extra structure. Do not re-arrange or redefine
0312 these bits, just add new ones on the end, in order to remain compatible. */
0313 
0314 #define PCRE_EXTRA_STUDY_DATA             0x0001
0315 #define PCRE_EXTRA_MATCH_LIMIT            0x0002
0316 #define PCRE_EXTRA_CALLOUT_DATA           0x0004
0317 #define PCRE_EXTRA_TABLES                 0x0008
0318 #define PCRE_EXTRA_MATCH_LIMIT_RECURSION  0x0010
0319 #define PCRE_EXTRA_MARK                   0x0020
0320 #define PCRE_EXTRA_EXECUTABLE_JIT         0x0040
0321 
0322 /* Types */
0323 
0324 struct real_pcre8_or_16;          /* declaration; the definition is private  */
0325 typedef struct real_pcre8_or_16 pcre;
0326 
0327 struct real_pcre8_or_16;          /* declaration; the definition is private  */
0328 typedef struct real_pcre8_or_16 pcre16;
0329 
0330 struct real_pcre32;               /* declaration; the definition is private  */
0331 typedef struct real_pcre32 pcre32;
0332 
0333 struct real_pcre_jit_stack;       /* declaration; the definition is private  */
0334 typedef struct real_pcre_jit_stack pcre_jit_stack;
0335 
0336 struct real_pcre16_jit_stack;     /* declaration; the definition is private  */
0337 typedef struct real_pcre16_jit_stack pcre16_jit_stack;
0338 
0339 struct real_pcre32_jit_stack;     /* declaration; the definition is private  */
0340 typedef struct real_pcre32_jit_stack pcre32_jit_stack;
0341 
0342 /* If PCRE is compiled with 16 bit character support, PCRE_UCHAR16 must contain
0343 a 16 bit wide signed data type. Otherwise it can be a dummy data type since
0344 pcre16 functions are not implemented. There is a check for this in pcre_internal.h. */
0345 #ifndef PCRE_UCHAR16
0346 #define PCRE_UCHAR16 unsigned short
0347 #endif
0348 
0349 #ifndef PCRE_SPTR16
0350 #define PCRE_SPTR16 const PCRE_UCHAR16 *
0351 #endif
0352 
0353 /* If PCRE is compiled with 32 bit character support, PCRE_UCHAR32 must contain
0354 a 32 bit wide signed data type. Otherwise it can be a dummy data type since
0355 pcre32 functions are not implemented. There is a check for this in pcre_internal.h. */
0356 #ifndef PCRE_UCHAR32
0357 #define PCRE_UCHAR32 unsigned int
0358 #endif
0359 
0360 #ifndef PCRE_SPTR32
0361 #define PCRE_SPTR32 const PCRE_UCHAR32 *
0362 #endif
0363 
0364 /* When PCRE is compiled as a C++ library, the subject pointer type can be
0365 replaced with a custom type. For conventional use, the public interface is a
0366 const char *. */
0367 
0368 #ifndef PCRE_SPTR
0369 #define PCRE_SPTR const char *
0370 #endif
0371 
0372 /* The structure for passing additional data to pcre_exec(). This is defined in
0373 such as way as to be extensible. Always add new fields at the end, in order to
0374 remain compatible. */
0375 
0376 typedef struct pcre_extra {
0377   unsigned long int flags;        /* Bits for which fields are set */
0378   void *study_data;               /* Opaque data from pcre_study() */
0379   unsigned long int match_limit;  /* Maximum number of calls to match() */
0380   void *callout_data;             /* Data passed back in callouts */
0381   const unsigned char *tables;    /* Pointer to character tables */
0382   unsigned long int match_limit_recursion; /* Max recursive calls to match() */
0383   unsigned char **mark;           /* For passing back a mark pointer */
0384   void *executable_jit;           /* Contains a pointer to a compiled jit code */
0385 } pcre_extra;
0386 
0387 /* Same structure as above, but with 16 bit char pointers. */
0388 
0389 typedef struct pcre16_extra {
0390   unsigned long int flags;        /* Bits for which fields are set */
0391   void *study_data;               /* Opaque data from pcre_study() */
0392   unsigned long int match_limit;  /* Maximum number of calls to match() */
0393   void *callout_data;             /* Data passed back in callouts */
0394   const unsigned char *tables;    /* Pointer to character tables */
0395   unsigned long int match_limit_recursion; /* Max recursive calls to match() */
0396   PCRE_UCHAR16 **mark;            /* For passing back a mark pointer */
0397   void *executable_jit;           /* Contains a pointer to a compiled jit code */
0398 } pcre16_extra;
0399 
0400 /* Same structure as above, but with 32 bit char pointers. */
0401 
0402 typedef struct pcre32_extra {
0403   unsigned long int flags;        /* Bits for which fields are set */
0404   void *study_data;               /* Opaque data from pcre_study() */
0405   unsigned long int match_limit;  /* Maximum number of calls to match() */
0406   void *callout_data;             /* Data passed back in callouts */
0407   const unsigned char *tables;    /* Pointer to character tables */
0408   unsigned long int match_limit_recursion; /* Max recursive calls to match() */
0409   PCRE_UCHAR32 **mark;            /* For passing back a mark pointer */
0410   void *executable_jit;           /* Contains a pointer to a compiled jit code */
0411 } pcre32_extra;
0412 
0413 /* The structure for passing out data via the pcre_callout_function. We use a
0414 structure so that new fields can be added on the end in future versions,
0415 without changing the API of the function, thereby allowing old clients to work
0416 without modification. */
0417 
0418 typedef struct pcre_callout_block {
0419   int          version;           /* Identifies version of block */
0420   /* ------------------------ Version 0 ------------------------------- */
0421   int          callout_number;    /* Number compiled into pattern */
0422   int         *offset_vector;     /* The offset vector */
0423   PCRE_SPTR    subject;           /* The subject being matched */
0424   int          subject_length;    /* The length of the subject */
0425   int          start_match;       /* Offset to start of this match attempt */
0426   int          current_position;  /* Where we currently are in the subject */
0427   int          capture_top;       /* Max current capture */
0428   int          capture_last;      /* Most recently closed capture */
0429   void        *callout_data;      /* Data passed in with the call */
0430   /* ------------------- Added for Version 1 -------------------------- */
0431   int          pattern_position;  /* Offset to next item in the pattern */
0432   int          next_item_length;  /* Length of next item in the pattern */
0433   /* ------------------- Added for Version 2 -------------------------- */
0434   const unsigned char *mark;      /* Pointer to current mark or NULL    */
0435   /* ------------------------------------------------------------------ */
0436 } pcre_callout_block;
0437 
0438 /* Same structure as above, but with 16 bit char pointers. */
0439 
0440 typedef struct pcre16_callout_block {
0441   int          version;           /* Identifies version of block */
0442   /* ------------------------ Version 0 ------------------------------- */
0443   int          callout_number;    /* Number compiled into pattern */
0444   int         *offset_vector;     /* The offset vector */
0445   PCRE_SPTR16  subject;           /* The subject being matched */
0446   int          subject_length;    /* The length of the subject */
0447   int          start_match;       /* Offset to start of this match attempt */
0448   int          current_position;  /* Where we currently are in the subject */
0449   int          capture_top;       /* Max current capture */
0450   int          capture_last;      /* Most recently closed capture */
0451   void        *callout_data;      /* Data passed in with the call */
0452   /* ------------------- Added for Version 1 -------------------------- */
0453   int          pattern_position;  /* Offset to next item in the pattern */
0454   int          next_item_length;  /* Length of next item in the pattern */
0455   /* ------------------- Added for Version 2 -------------------------- */
0456   const PCRE_UCHAR16 *mark;       /* Pointer to current mark or NULL    */
0457   /* ------------------------------------------------------------------ */
0458 } pcre16_callout_block;
0459 
0460 /* Same structure as above, but with 32 bit char pointers. */
0461 
0462 typedef struct pcre32_callout_block {
0463   int          version;           /* Identifies version of block */
0464   /* ------------------------ Version 0 ------------------------------- */
0465   int          callout_number;    /* Number compiled into pattern */
0466   int         *offset_vector;     /* The offset vector */
0467   PCRE_SPTR32  subject;           /* The subject being matched */
0468   int          subject_length;    /* The length of the subject */
0469   int          start_match;       /* Offset to start of this match attempt */
0470   int          current_position;  /* Where we currently are in the subject */
0471   int          capture_top;       /* Max current capture */
0472   int          capture_last;      /* Most recently closed capture */
0473   void        *callout_data;      /* Data passed in with the call */
0474   /* ------------------- Added for Version 1 -------------------------- */
0475   int          pattern_position;  /* Offset to next item in the pattern */
0476   int          next_item_length;  /* Length of next item in the pattern */
0477   /* ------------------- Added for Version 2 -------------------------- */
0478   const PCRE_UCHAR32 *mark;       /* Pointer to current mark or NULL    */
0479   /* ------------------------------------------------------------------ */
0480 } pcre32_callout_block;
0481 
0482 /* Indirection for store get and free functions. These can be set to
0483 alternative malloc/free functions if required. Special ones are used in the
0484 non-recursive case for "frames". There is also an optional callout function
0485 that is triggered by the (?) regex item. For Virtual Pascal, these definitions
0486 have to take another form. */
0487 
0488 #ifndef VPCOMPAT
0489 PCRE_EXP_DECL void *(*pcre_malloc)(size_t);
0490 PCRE_EXP_DECL void  (*pcre_free)(void *);
0491 PCRE_EXP_DECL void *(*pcre_stack_malloc)(size_t);
0492 PCRE_EXP_DECL void  (*pcre_stack_free)(void *);
0493 PCRE_EXP_DECL int   (*pcre_callout)(pcre_callout_block *);
0494 PCRE_EXP_DECL int   (*pcre_stack_guard)(void);
0495 
0496 PCRE_EXP_DECL void *(*pcre16_malloc)(size_t);
0497 PCRE_EXP_DECL void  (*pcre16_free)(void *);
0498 PCRE_EXP_DECL void *(*pcre16_stack_malloc)(size_t);
0499 PCRE_EXP_DECL void  (*pcre16_stack_free)(void *);
0500 PCRE_EXP_DECL int   (*pcre16_callout)(pcre16_callout_block *);
0501 PCRE_EXP_DECL int   (*pcre16_stack_guard)(void);
0502 
0503 PCRE_EXP_DECL void *(*pcre32_malloc)(size_t);
0504 PCRE_EXP_DECL void  (*pcre32_free)(void *);
0505 PCRE_EXP_DECL void *(*pcre32_stack_malloc)(size_t);
0506 PCRE_EXP_DECL void  (*pcre32_stack_free)(void *);
0507 PCRE_EXP_DECL int   (*pcre32_callout)(pcre32_callout_block *);
0508 PCRE_EXP_DECL int   (*pcre32_stack_guard)(void);
0509 #else   /* VPCOMPAT */
0510 PCRE_EXP_DECL void *pcre_malloc(size_t);
0511 PCRE_EXP_DECL void  pcre_free(void *);
0512 PCRE_EXP_DECL void *pcre_stack_malloc(size_t);
0513 PCRE_EXP_DECL void  pcre_stack_free(void *);
0514 PCRE_EXP_DECL int   pcre_callout(pcre_callout_block *);
0515 PCRE_EXP_DECL int   pcre_stack_guard(void);
0516 
0517 PCRE_EXP_DECL void *pcre16_malloc(size_t);
0518 PCRE_EXP_DECL void  pcre16_free(void *);
0519 PCRE_EXP_DECL void *pcre16_stack_malloc(size_t);
0520 PCRE_EXP_DECL void  pcre16_stack_free(void *);
0521 PCRE_EXP_DECL int   pcre16_callout(pcre16_callout_block *);
0522 PCRE_EXP_DECL int   pcre16_stack_guard(void);
0523 
0524 PCRE_EXP_DECL void *pcre32_malloc(size_t);
0525 PCRE_EXP_DECL void  pcre32_free(void *);
0526 PCRE_EXP_DECL void *pcre32_stack_malloc(size_t);
0527 PCRE_EXP_DECL void  pcre32_stack_free(void *);
0528 PCRE_EXP_DECL int   pcre32_callout(pcre32_callout_block *);
0529 PCRE_EXP_DECL int   pcre32_stack_guard(void);
0530 #endif  /* VPCOMPAT */
0531 
0532 /* User defined callback which provides a stack just before the match starts. */
0533 
0534 typedef pcre_jit_stack *(*pcre_jit_callback)(void *);
0535 typedef pcre16_jit_stack *(*pcre16_jit_callback)(void *);
0536 typedef pcre32_jit_stack *(*pcre32_jit_callback)(void *);
0537 
0538 /* Exported PCRE functions */
0539 
0540 PCRE_EXP_DECL pcre *pcre_compile(const char *, int, const char **, int *,
0541                   const unsigned char *);
0542 PCRE_EXP_DECL pcre16 *pcre16_compile(PCRE_SPTR16, int, const char **, int *,
0543                   const unsigned char *);
0544 PCRE_EXP_DECL pcre32 *pcre32_compile(PCRE_SPTR32, int, const char **, int *,
0545                   const unsigned char *);
0546 PCRE_EXP_DECL pcre *pcre_compile2(const char *, int, int *, const char **,
0547                   int *, const unsigned char *);
0548 PCRE_EXP_DECL pcre16 *pcre16_compile2(PCRE_SPTR16, int, int *, const char **,
0549                   int *, const unsigned char *);
0550 PCRE_EXP_DECL pcre32 *pcre32_compile2(PCRE_SPTR32, int, int *, const char **,
0551                   int *, const unsigned char *);
0552 PCRE_EXP_DECL int  pcre_config(int, void *);
0553 PCRE_EXP_DECL int  pcre16_config(int, void *);
0554 PCRE_EXP_DECL int  pcre32_config(int, void *);
0555 PCRE_EXP_DECL int  pcre_copy_named_substring(const pcre *, const char *,
0556                   int *, int, const char *, char *, int);
0557 PCRE_EXP_DECL int  pcre16_copy_named_substring(const pcre16 *, PCRE_SPTR16,
0558                   int *, int, PCRE_SPTR16, PCRE_UCHAR16 *, int);
0559 PCRE_EXP_DECL int  pcre32_copy_named_substring(const pcre32 *, PCRE_SPTR32,
0560                   int *, int, PCRE_SPTR32, PCRE_UCHAR32 *, int);
0561 PCRE_EXP_DECL int  pcre_copy_substring(const char *, int *, int, int,
0562                   char *, int);
0563 PCRE_EXP_DECL int  pcre16_copy_substring(PCRE_SPTR16, int *, int, int,
0564                   PCRE_UCHAR16 *, int);
0565 PCRE_EXP_DECL int  pcre32_copy_substring(PCRE_SPTR32, int *, int, int,
0566                   PCRE_UCHAR32 *, int);
0567 PCRE_EXP_DECL int  pcre_dfa_exec(const pcre *, const pcre_extra *,
0568                   const char *, int, int, int, int *, int , int *, int);
0569 PCRE_EXP_DECL int  pcre16_dfa_exec(const pcre16 *, const pcre16_extra *,
0570                   PCRE_SPTR16, int, int, int, int *, int , int *, int);
0571 PCRE_EXP_DECL int  pcre32_dfa_exec(const pcre32 *, const pcre32_extra *,
0572                   PCRE_SPTR32, int, int, int, int *, int , int *, int);
0573 PCRE_EXP_DECL int  pcre_exec(const pcre *, const pcre_extra *, PCRE_SPTR,
0574                    int, int, int, int *, int);
0575 PCRE_EXP_DECL int  pcre16_exec(const pcre16 *, const pcre16_extra *,
0576                    PCRE_SPTR16, int, int, int, int *, int);
0577 PCRE_EXP_DECL int  pcre32_exec(const pcre32 *, const pcre32_extra *,
0578                    PCRE_SPTR32, int, int, int, int *, int);
0579 PCRE_EXP_DECL int  pcre_jit_exec(const pcre *, const pcre_extra *,
0580                    PCRE_SPTR, int, int, int, int *, int,
0581                    pcre_jit_stack *);
0582 PCRE_EXP_DECL int  pcre16_jit_exec(const pcre16 *, const pcre16_extra *,
0583                    PCRE_SPTR16, int, int, int, int *, int,
0584                    pcre16_jit_stack *);
0585 PCRE_EXP_DECL int  pcre32_jit_exec(const pcre32 *, const pcre32_extra *,
0586                    PCRE_SPTR32, int, int, int, int *, int,
0587                    pcre32_jit_stack *);
0588 PCRE_EXP_DECL void pcre_free_substring(const char *);
0589 PCRE_EXP_DECL void pcre16_free_substring(PCRE_SPTR16);
0590 PCRE_EXP_DECL void pcre32_free_substring(PCRE_SPTR32);
0591 PCRE_EXP_DECL void pcre_free_substring_list(const char **);
0592 PCRE_EXP_DECL void pcre16_free_substring_list(PCRE_SPTR16 *);
0593 PCRE_EXP_DECL void pcre32_free_substring_list(PCRE_SPTR32 *);
0594 PCRE_EXP_DECL int  pcre_fullinfo(const pcre *, const pcre_extra *, int,
0595                   void *);
0596 PCRE_EXP_DECL int  pcre16_fullinfo(const pcre16 *, const pcre16_extra *, int,
0597                   void *);
0598 PCRE_EXP_DECL int  pcre32_fullinfo(const pcre32 *, const pcre32_extra *, int,
0599                   void *);
0600 PCRE_EXP_DECL int  pcre_get_named_substring(const pcre *, const char *,
0601                   int *, int, const char *, const char **);
0602 PCRE_EXP_DECL int  pcre16_get_named_substring(const pcre16 *, PCRE_SPTR16,
0603                   int *, int, PCRE_SPTR16, PCRE_SPTR16 *);
0604 PCRE_EXP_DECL int  pcre32_get_named_substring(const pcre32 *, PCRE_SPTR32,
0605                   int *, int, PCRE_SPTR32, PCRE_SPTR32 *);
0606 PCRE_EXP_DECL int  pcre_get_stringnumber(const pcre *, const char *);
0607 PCRE_EXP_DECL int  pcre16_get_stringnumber(const pcre16 *, PCRE_SPTR16);
0608 PCRE_EXP_DECL int  pcre32_get_stringnumber(const pcre32 *, PCRE_SPTR32);
0609 PCRE_EXP_DECL int  pcre_get_stringtable_entries(const pcre *, const char *,
0610                   char **, char **);
0611 PCRE_EXP_DECL int  pcre16_get_stringtable_entries(const pcre16 *, PCRE_SPTR16,
0612                   PCRE_UCHAR16 **, PCRE_UCHAR16 **);
0613 PCRE_EXP_DECL int  pcre32_get_stringtable_entries(const pcre32 *, PCRE_SPTR32,
0614                   PCRE_UCHAR32 **, PCRE_UCHAR32 **);
0615 PCRE_EXP_DECL int  pcre_get_substring(const char *, int *, int, int,
0616                   const char **);
0617 PCRE_EXP_DECL int  pcre16_get_substring(PCRE_SPTR16, int *, int, int,
0618                   PCRE_SPTR16 *);
0619 PCRE_EXP_DECL int  pcre32_get_substring(PCRE_SPTR32, int *, int, int,
0620                   PCRE_SPTR32 *);
0621 PCRE_EXP_DECL int  pcre_get_substring_list(const char *, int *, int,
0622                   const char ***);
0623 PCRE_EXP_DECL int  pcre16_get_substring_list(PCRE_SPTR16, int *, int,
0624                   PCRE_SPTR16 **);
0625 PCRE_EXP_DECL int  pcre32_get_substring_list(PCRE_SPTR32, int *, int,
0626                   PCRE_SPTR32 **);
0627 PCRE_EXP_DECL const unsigned char *pcre_maketables(void);
0628 PCRE_EXP_DECL const unsigned char *pcre16_maketables(void);
0629 PCRE_EXP_DECL const unsigned char *pcre32_maketables(void);
0630 PCRE_EXP_DECL int  pcre_refcount(pcre *, int);
0631 PCRE_EXP_DECL int  pcre16_refcount(pcre16 *, int);
0632 PCRE_EXP_DECL int  pcre32_refcount(pcre32 *, int);
0633 PCRE_EXP_DECL pcre_extra *pcre_study(const pcre *, int, const char **);
0634 PCRE_EXP_DECL pcre16_extra *pcre16_study(const pcre16 *, int, const char **);
0635 PCRE_EXP_DECL pcre32_extra *pcre32_study(const pcre32 *, int, const char **);
0636 PCRE_EXP_DECL void pcre_free_study(pcre_extra *);
0637 PCRE_EXP_DECL void pcre16_free_study(pcre16_extra *);
0638 PCRE_EXP_DECL void pcre32_free_study(pcre32_extra *);
0639 PCRE_EXP_DECL const char *pcre_version(void);
0640 PCRE_EXP_DECL const char *pcre16_version(void);
0641 PCRE_EXP_DECL const char *pcre32_version(void);
0642 
0643 /* Utility functions for byte order swaps. */
0644 PCRE_EXP_DECL int  pcre_pattern_to_host_byte_order(pcre *, pcre_extra *,
0645                   const unsigned char *);
0646 PCRE_EXP_DECL int  pcre16_pattern_to_host_byte_order(pcre16 *, pcre16_extra *,
0647                   const unsigned char *);
0648 PCRE_EXP_DECL int  pcre32_pattern_to_host_byte_order(pcre32 *, pcre32_extra *,
0649                   const unsigned char *);
0650 PCRE_EXP_DECL int  pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *,
0651                   PCRE_SPTR16, int, int *, int);
0652 PCRE_EXP_DECL int  pcre32_utf32_to_host_byte_order(PCRE_UCHAR32 *,
0653                   PCRE_SPTR32, int, int *, int);
0654 
0655 /* JIT compiler related functions. */
0656 
0657 PCRE_EXP_DECL pcre_jit_stack *pcre_jit_stack_alloc(int, int);
0658 PCRE_EXP_DECL pcre16_jit_stack *pcre16_jit_stack_alloc(int, int);
0659 PCRE_EXP_DECL pcre32_jit_stack *pcre32_jit_stack_alloc(int, int);
0660 PCRE_EXP_DECL void pcre_jit_stack_free(pcre_jit_stack *);
0661 PCRE_EXP_DECL void pcre16_jit_stack_free(pcre16_jit_stack *);
0662 PCRE_EXP_DECL void pcre32_jit_stack_free(pcre32_jit_stack *);
0663 PCRE_EXP_DECL void pcre_assign_jit_stack(pcre_extra *,
0664                   pcre_jit_callback, void *);
0665 PCRE_EXP_DECL void pcre16_assign_jit_stack(pcre16_extra *,
0666                   pcre16_jit_callback, void *);
0667 PCRE_EXP_DECL void pcre32_assign_jit_stack(pcre32_extra *,
0668                   pcre32_jit_callback, void *);
0669 PCRE_EXP_DECL void pcre_jit_free_unused_memory(void);
0670 PCRE_EXP_DECL void pcre16_jit_free_unused_memory(void);
0671 PCRE_EXP_DECL void pcre32_jit_free_unused_memory(void);
0672 
0673 #ifdef __cplusplus
0674 }  /* extern "C" */
0675 #endif
0676 
0677 #endif /* End of pcre.h */