tools/pcre/pcre.h.in
changeset 3831 babd0eee3c5e
parent 2762 d2d467bf1b5a
     1.1 --- a/tools/pcre/pcre.h.in	Sun Mar 17 11:29:55 2013 -0400
     1.2 +++ b/tools/pcre/pcre.h.in	Sun Mar 17 11:32:03 2013 -0400
     1.3 @@ -5,7 +5,7 @@
     1.4  /* This is the public header file for the PCRE library, to be #included by
     1.5  applications that call the PCRE functions.
     1.6  
     1.7 -           Copyright (c) 1997-2009 University of Cambridge
     1.8 +           Copyright (c) 1997-2012 University of Cambridge
     1.9  
    1.10  -----------------------------------------------------------------------------
    1.11  Redistribution and use in source and binary forms, with or without
    1.12 @@ -95,66 +95,151 @@
    1.13  extern "C" {
    1.14  #endif
    1.15  
    1.16 -/* Options. Some are compile-time only, some are run-time only, and some are
    1.17 -both, so we keep them all distinct. */
    1.18 +/* Public options. Some are compile-time only, some are run-time only, and some
    1.19 +are both, so we keep them all distinct. However, almost all the bits in the
    1.20 +options word are now used. In the long run, we may have to re-use some of the
    1.21 +compile-time only bits for runtime options, or vice versa. Any of the
    1.22 +compile-time options may be inspected during studying (and therefore JIT
    1.23 +compiling).
    1.24 +
    1.25 +Some options for pcre_compile() change its behaviour but do not affect the
    1.26 +behaviour of the execution functions. Other options are passed through to the
    1.27 +execution functions and affect their behaviour, with or without affecting the
    1.28 +behaviour of pcre_compile().
    1.29 +
    1.30 +Options that can be passed to pcre_compile() are tagged Cx below, with these
    1.31 +variants:
    1.32 +
    1.33 +C1   Affects compile only
    1.34 +C2   Does not affect compile; affects exec, dfa_exec
    1.35 +C3   Affects compile, exec, dfa_exec
    1.36 +C4   Affects compile, exec, dfa_exec, study
    1.37 +C5   Affects compile, exec, study
    1.38 +
    1.39 +Options that can be set for pcre_exec() and/or pcre_dfa_exec() are flagged with
    1.40 +E and D, respectively. They take precedence over C3, C4, and C5 settings passed
    1.41 +from pcre_compile(). Those that are compatible with JIT execution are flagged
    1.42 +with J. */
    1.43  
    1.44 -#define PCRE_CASELESS           0x00000001
    1.45 -#define PCRE_MULTILINE          0x00000002
    1.46 -#define PCRE_DOTALL             0x00000004
    1.47 -#define PCRE_EXTENDED           0x00000008
    1.48 -#define PCRE_ANCHORED           0x00000010
    1.49 -#define PCRE_DOLLAR_ENDONLY     0x00000020
    1.50 -#define PCRE_EXTRA              0x00000040
    1.51 -#define PCRE_NOTBOL             0x00000080
    1.52 -#define PCRE_NOTEOL             0x00000100
    1.53 -#define PCRE_UNGREEDY           0x00000200
    1.54 -#define PCRE_NOTEMPTY           0x00000400
    1.55 -#define PCRE_UTF8               0x00000800
    1.56 -#define PCRE_NO_AUTO_CAPTURE    0x00001000
    1.57 -#define PCRE_NO_UTF8_CHECK      0x00002000
    1.58 -#define PCRE_AUTO_CALLOUT       0x00004000
    1.59 -#define PCRE_PARTIAL            0x00008000
    1.60 -#define PCRE_DFA_SHORTEST       0x00010000
    1.61 -#define PCRE_DFA_RESTART        0x00020000
    1.62 -#define PCRE_FIRSTLINE          0x00040000
    1.63 -#define PCRE_DUPNAMES           0x00080000
    1.64 -#define PCRE_NEWLINE_CR         0x00100000
    1.65 -#define PCRE_NEWLINE_LF         0x00200000
    1.66 -#define PCRE_NEWLINE_CRLF       0x00300000
    1.67 -#define PCRE_NEWLINE_ANY        0x00400000
    1.68 -#define PCRE_NEWLINE_ANYCRLF    0x00500000
    1.69 -#define PCRE_BSR_ANYCRLF        0x00800000
    1.70 -#define PCRE_BSR_UNICODE        0x01000000
    1.71 -#define PCRE_JAVASCRIPT_COMPAT  0x02000000
    1.72 -#define PCRE_NO_START_OPTIMIZE  0x04000000
    1.73 -#define PCRE_NO_START_OPTIMISE  0x04000000
    1.74 +#define PCRE_CASELESS           0x00000001  /* C1       */
    1.75 +#define PCRE_MULTILINE          0x00000002  /* C1       */
    1.76 +#define PCRE_DOTALL             0x00000004  /* C1       */
    1.77 +#define PCRE_EXTENDED           0x00000008  /* C1       */
    1.78 +#define PCRE_ANCHORED           0x00000010  /* C4 E D   */
    1.79 +#define PCRE_DOLLAR_ENDONLY     0x00000020  /* C2       */
    1.80 +#define PCRE_EXTRA              0x00000040  /* C1       */
    1.81 +#define PCRE_NOTBOL             0x00000080  /*    E D J */
    1.82 +#define PCRE_NOTEOL             0x00000100  /*    E D J */
    1.83 +#define PCRE_UNGREEDY           0x00000200  /* C1       */
    1.84 +#define PCRE_NOTEMPTY           0x00000400  /*    E D J */
    1.85 +#define PCRE_UTF8               0x00000800  /* C4        )          */
    1.86 +#define PCRE_UTF16              0x00000800  /* C4        ) Synonyms */
    1.87 +#define PCRE_UTF32              0x00000800  /* C4        )          */
    1.88 +#define PCRE_NO_AUTO_CAPTURE    0x00001000  /* C1       */
    1.89 +#define PCRE_NO_UTF8_CHECK      0x00002000  /* C1 E D J  )          */
    1.90 +#define PCRE_NO_UTF16_CHECK     0x00002000  /* C1 E D J  ) Synonyms */
    1.91 +#define PCRE_NO_UTF32_CHECK     0x00002000  /* C1 E D J  )          */
    1.92 +#define PCRE_AUTO_CALLOUT       0x00004000  /* C1       */
    1.93 +#define PCRE_PARTIAL_SOFT       0x00008000  /*    E D J  ) Synonyms */
    1.94 +#define PCRE_PARTIAL            0x00008000  /*    E D J  )          */
    1.95 +#define PCRE_DFA_SHORTEST       0x00010000  /*      D   */
    1.96 +#define PCRE_DFA_RESTART        0x00020000  /*      D   */
    1.97 +#define PCRE_FIRSTLINE          0x00040000  /* C3       */
    1.98 +#define PCRE_DUPNAMES           0x00080000  /* C1       */
    1.99 +#define PCRE_NEWLINE_CR         0x00100000  /* C3 E D   */
   1.100 +#define PCRE_NEWLINE_LF         0x00200000  /* C3 E D   */
   1.101 +#define PCRE_NEWLINE_CRLF       0x00300000  /* C3 E D   */
   1.102 +#define PCRE_NEWLINE_ANY        0x00400000  /* C3 E D   */
   1.103 +#define PCRE_NEWLINE_ANYCRLF    0x00500000  /* C3 E D   */
   1.104 +#define PCRE_BSR_ANYCRLF        0x00800000  /* C3 E D   */
   1.105 +#define PCRE_BSR_UNICODE        0x01000000  /* C3 E D   */
   1.106 +#define PCRE_JAVASCRIPT_COMPAT  0x02000000  /* C5       */
   1.107 +#define PCRE_NO_START_OPTIMIZE  0x04000000  /* C2 E D    ) Synonyms */
   1.108 +#define PCRE_NO_START_OPTIMISE  0x04000000  /* C2 E D    )          */
   1.109 +#define PCRE_PARTIAL_HARD       0x08000000  /*    E D J */
   1.110 +#define PCRE_NOTEMPTY_ATSTART   0x10000000  /*    E D J */
   1.111 +#define PCRE_UCP                0x20000000  /* C3       */
   1.112  
   1.113  /* Exec-time and get/set-time error codes */
   1.114  
   1.115 -#define PCRE_ERROR_NOMATCH         (-1)
   1.116 -#define PCRE_ERROR_NULL            (-2)
   1.117 -#define PCRE_ERROR_BADOPTION       (-3)
   1.118 -#define PCRE_ERROR_BADMAGIC        (-4)
   1.119 -#define PCRE_ERROR_UNKNOWN_OPCODE  (-5)
   1.120 -#define PCRE_ERROR_UNKNOWN_NODE    (-5)  /* For backward compatibility */
   1.121 -#define PCRE_ERROR_NOMEMORY        (-6)
   1.122 -#define PCRE_ERROR_NOSUBSTRING     (-7)
   1.123 -#define PCRE_ERROR_MATCHLIMIT      (-8)
   1.124 -#define PCRE_ERROR_CALLOUT         (-9)  /* Never used by PCRE itself */
   1.125 -#define PCRE_ERROR_BADUTF8        (-10)
   1.126 -#define PCRE_ERROR_BADUTF8_OFFSET (-11)
   1.127 -#define PCRE_ERROR_PARTIAL        (-12)
   1.128 -#define PCRE_ERROR_BADPARTIAL     (-13)
   1.129 -#define PCRE_ERROR_INTERNAL       (-14)
   1.130 -#define PCRE_ERROR_BADCOUNT       (-15)
   1.131 -#define PCRE_ERROR_DFA_UITEM      (-16)
   1.132 -#define PCRE_ERROR_DFA_UCOND      (-17)
   1.133 -#define PCRE_ERROR_DFA_UMLIMIT    (-18)
   1.134 -#define PCRE_ERROR_DFA_WSSIZE     (-19)
   1.135 -#define PCRE_ERROR_DFA_RECURSE    (-20)
   1.136 -#define PCRE_ERROR_RECURSIONLIMIT (-21)
   1.137 -#define PCRE_ERROR_NULLWSLIMIT    (-22)  /* No longer actually used */
   1.138 -#define PCRE_ERROR_BADNEWLINE     (-23)
   1.139 +#define PCRE_ERROR_NOMATCH          (-1)
   1.140 +#define PCRE_ERROR_NULL             (-2)
   1.141 +#define PCRE_ERROR_BADOPTION        (-3)
   1.142 +#define PCRE_ERROR_BADMAGIC         (-4)
   1.143 +#define PCRE_ERROR_UNKNOWN_OPCODE   (-5)
   1.144 +#define PCRE_ERROR_UNKNOWN_NODE     (-5)  /* For backward compatibility */
   1.145 +#define PCRE_ERROR_NOMEMORY         (-6)
   1.146 +#define PCRE_ERROR_NOSUBSTRING      (-7)
   1.147 +#define PCRE_ERROR_MATCHLIMIT       (-8)
   1.148 +#define PCRE_ERROR_CALLOUT          (-9)  /* Never used by PCRE itself */
   1.149 +#define PCRE_ERROR_BADUTF8         (-10)  /* Same for 8/16/32 */
   1.150 +#define PCRE_ERROR_BADUTF16        (-10)  /* Same for 8/16/32 */
   1.151 +#define PCRE_ERROR_BADUTF32        (-10)  /* Same for 8/16/32 */
   1.152 +#define PCRE_ERROR_BADUTF8_OFFSET  (-11)  /* Same for 8/16 */
   1.153 +#define PCRE_ERROR_BADUTF16_OFFSET (-11)  /* Same for 8/16 */
   1.154 +#define PCRE_ERROR_PARTIAL         (-12)
   1.155 +#define PCRE_ERROR_BADPARTIAL      (-13)
   1.156 +#define PCRE_ERROR_INTERNAL        (-14)
   1.157 +#define PCRE_ERROR_BADCOUNT        (-15)
   1.158 +#define PCRE_ERROR_DFA_UITEM       (-16)
   1.159 +#define PCRE_ERROR_DFA_UCOND       (-17)
   1.160 +#define PCRE_ERROR_DFA_UMLIMIT     (-18)
   1.161 +#define PCRE_ERROR_DFA_WSSIZE      (-19)
   1.162 +#define PCRE_ERROR_DFA_RECURSE     (-20)
   1.163 +#define PCRE_ERROR_RECURSIONLIMIT  (-21)
   1.164 +#define PCRE_ERROR_NULLWSLIMIT     (-22)  /* No longer actually used */
   1.165 +#define PCRE_ERROR_BADNEWLINE      (-23)
   1.166 +#define PCRE_ERROR_BADOFFSET       (-24)
   1.167 +#define PCRE_ERROR_SHORTUTF8       (-25)
   1.168 +#define PCRE_ERROR_SHORTUTF16      (-25)  /* Same for 8/16 */
   1.169 +#define PCRE_ERROR_RECURSELOOP     (-26)
   1.170 +#define PCRE_ERROR_JIT_STACKLIMIT  (-27)
   1.171 +#define PCRE_ERROR_BADMODE         (-28)
   1.172 +#define PCRE_ERROR_BADENDIANNESS   (-29)
   1.173 +#define PCRE_ERROR_DFA_BADRESTART  (-30)
   1.174 +#define PCRE_ERROR_JIT_BADOPTION   (-31)
   1.175 +#define PCRE_ERROR_BADLENGTH       (-32)
   1.176 +
   1.177 +/* Specific error codes for UTF-8 validity checks */
   1.178 +
   1.179 +#define PCRE_UTF8_ERR0               0
   1.180 +#define PCRE_UTF8_ERR1               1
   1.181 +#define PCRE_UTF8_ERR2               2
   1.182 +#define PCRE_UTF8_ERR3               3
   1.183 +#define PCRE_UTF8_ERR4               4
   1.184 +#define PCRE_UTF8_ERR5               5
   1.185 +#define PCRE_UTF8_ERR6               6
   1.186 +#define PCRE_UTF8_ERR7               7
   1.187 +#define PCRE_UTF8_ERR8               8
   1.188 +#define PCRE_UTF8_ERR9               9
   1.189 +#define PCRE_UTF8_ERR10             10
   1.190 +#define PCRE_UTF8_ERR11             11
   1.191 +#define PCRE_UTF8_ERR12             12
   1.192 +#define PCRE_UTF8_ERR13             13
   1.193 +#define PCRE_UTF8_ERR14             14
   1.194 +#define PCRE_UTF8_ERR15             15
   1.195 +#define PCRE_UTF8_ERR16             16
   1.196 +#define PCRE_UTF8_ERR17             17
   1.197 +#define PCRE_UTF8_ERR18             18
   1.198 +#define PCRE_UTF8_ERR19             19
   1.199 +#define PCRE_UTF8_ERR20             20
   1.200 +#define PCRE_UTF8_ERR21             21
   1.201 +#define PCRE_UTF8_ERR22             22
   1.202 +
   1.203 +/* Specific error codes for UTF-16 validity checks */
   1.204 +
   1.205 +#define PCRE_UTF16_ERR0              0
   1.206 +#define PCRE_UTF16_ERR1              1
   1.207 +#define PCRE_UTF16_ERR2              2
   1.208 +#define PCRE_UTF16_ERR3              3
   1.209 +#define PCRE_UTF16_ERR4              4
   1.210 +
   1.211 +/* Specific error codes for UTF-32 validity checks */
   1.212 +
   1.213 +#define PCRE_UTF32_ERR0              0
   1.214 +#define PCRE_UTF32_ERR1              1
   1.215 +#define PCRE_UTF32_ERR2              2
   1.216 +#define PCRE_UTF32_ERR3              3
   1.217  
   1.218  /* Request types for pcre_fullinfo() */
   1.219  
   1.220 @@ -174,6 +259,14 @@
   1.221  #define PCRE_INFO_OKPARTIAL         12
   1.222  #define PCRE_INFO_JCHANGED          13
   1.223  #define PCRE_INFO_HASCRORLF         14
   1.224 +#define PCRE_INFO_MINLENGTH         15
   1.225 +#define PCRE_INFO_JIT               16
   1.226 +#define PCRE_INFO_JITSIZE           17
   1.227 +#define PCRE_INFO_MAXLOOKBEHIND     18
   1.228 +#define PCRE_INFO_FIRSTCHARACTER      19
   1.229 +#define PCRE_INFO_FIRSTCHARACTERFLAGS   20
   1.230 +#define PCRE_INFO_REQUIREDCHAR      21
   1.231 +#define PCRE_INFO_REQUIREDCHARFLAGS   22
   1.232  
   1.233  /* Request types for pcre_config(). Do not re-arrange, in order to remain
   1.234  compatible. */
   1.235 @@ -187,8 +280,20 @@
   1.236  #define PCRE_CONFIG_UNICODE_PROPERTIES      6
   1.237  #define PCRE_CONFIG_MATCH_LIMIT_RECURSION   7
   1.238  #define PCRE_CONFIG_BSR                     8
   1.239 +#define PCRE_CONFIG_JIT                     9
   1.240 +#define PCRE_CONFIG_UTF16                  10
   1.241 +#define PCRE_CONFIG_JITTARGET              11
   1.242 +#define PCRE_CONFIG_UTF32                  12
   1.243  
   1.244 -/* Bit flags for the pcre_extra structure. Do not re-arrange or redefine
   1.245 +/* Request types for pcre_study(). Do not re-arrange, in order to remain
   1.246 +compatible. */
   1.247 +
   1.248 +#define PCRE_STUDY_JIT_COMPILE                0x0001
   1.249 +#define PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE   0x0002
   1.250 +#define PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE   0x0004
   1.251 +#define PCRE_STUDY_EXTRA_NEEDED               0x0008
   1.252 +
   1.253 +/* Bit flags for the pcre[16|32]_extra structure. Do not re-arrange or redefine
   1.254  these bits, just add new ones on the end, in order to remain compatible. */
   1.255  
   1.256  #define PCRE_EXTRA_STUDY_DATA             0x0001
   1.257 @@ -196,12 +301,51 @@
   1.258  #define PCRE_EXTRA_CALLOUT_DATA           0x0004
   1.259  #define PCRE_EXTRA_TABLES                 0x0008
   1.260  #define PCRE_EXTRA_MATCH_LIMIT_RECURSION  0x0010
   1.261 +#define PCRE_EXTRA_MARK                   0x0020
   1.262 +#define PCRE_EXTRA_EXECUTABLE_JIT         0x0040
   1.263  
   1.264  /* Types */
   1.265  
   1.266  struct real_pcre;                 /* declaration; the definition is private  */
   1.267  typedef struct real_pcre pcre;
   1.268  
   1.269 +struct real_pcre16;               /* declaration; the definition is private  */
   1.270 +typedef struct real_pcre16 pcre16;
   1.271 +
   1.272 +struct real_pcre32;               /* declaration; the definition is private  */
   1.273 +typedef struct real_pcre32 pcre32;
   1.274 +
   1.275 +struct real_pcre_jit_stack;       /* declaration; the definition is private  */
   1.276 +typedef struct real_pcre_jit_stack pcre_jit_stack;
   1.277 +
   1.278 +struct real_pcre16_jit_stack;     /* declaration; the definition is private  */
   1.279 +typedef struct real_pcre16_jit_stack pcre16_jit_stack;
   1.280 +
   1.281 +struct real_pcre32_jit_stack;     /* declaration; the definition is private  */
   1.282 +typedef struct real_pcre32_jit_stack pcre32_jit_stack;
   1.283 +
   1.284 +/* If PCRE is compiled with 16 bit character support, PCRE_UCHAR16 must contain
   1.285 +a 16 bit wide signed data type. Otherwise it can be a dummy data type since
   1.286 +pcre16 functions are not implemented. There is a check for this in pcre_internal.h. */
   1.287 +#ifndef PCRE_UCHAR16
   1.288 +#define PCRE_UCHAR16 unsigned short
   1.289 +#endif
   1.290 +
   1.291 +#ifndef PCRE_SPTR16
   1.292 +#define PCRE_SPTR16 const PCRE_UCHAR16 *
   1.293 +#endif
   1.294 +
   1.295 +/* If PCRE is compiled with 32 bit character support, PCRE_UCHAR32 must contain
   1.296 +a 32 bit wide signed data type. Otherwise it can be a dummy data type since
   1.297 +pcre32 functions are not implemented. There is a check for this in pcre_internal.h. */
   1.298 +#ifndef PCRE_UCHAR32
   1.299 +#define PCRE_UCHAR32 unsigned int
   1.300 +#endif
   1.301 +
   1.302 +#ifndef PCRE_SPTR32
   1.303 +#define PCRE_SPTR32 const PCRE_UCHAR32 *
   1.304 +#endif
   1.305 +
   1.306  /* When PCRE is compiled as a C++ library, the subject pointer type can be
   1.307  replaced with a custom type. For conventional use, the public interface is a
   1.308  const char *. */
   1.309 @@ -221,8 +365,36 @@
   1.310    void *callout_data;             /* Data passed back in callouts */
   1.311    const unsigned char *tables;    /* Pointer to character tables */
   1.312    unsigned long int match_limit_recursion; /* Max recursive calls to match() */
   1.313 +  unsigned char **mark;           /* For passing back a mark pointer */
   1.314 +  void *executable_jit;           /* Contains a pointer to a compiled jit code */
   1.315  } pcre_extra;
   1.316  
   1.317 +/* Same structure as above, but with 16 bit char pointers. */
   1.318 +
   1.319 +typedef struct pcre16_extra {
   1.320 +  unsigned long int flags;        /* Bits for which fields are set */
   1.321 +  void *study_data;               /* Opaque data from pcre_study() */
   1.322 +  unsigned long int match_limit;  /* Maximum number of calls to match() */
   1.323 +  void *callout_data;             /* Data passed back in callouts */
   1.324 +  const unsigned char *tables;    /* Pointer to character tables */
   1.325 +  unsigned long int match_limit_recursion; /* Max recursive calls to match() */
   1.326 +  PCRE_UCHAR16 **mark;            /* For passing back a mark pointer */
   1.327 +  void *executable_jit;           /* Contains a pointer to a compiled jit code */
   1.328 +} pcre16_extra;
   1.329 +
   1.330 +/* Same structure as above, but with 32 bit char pointers. */
   1.331 +
   1.332 +typedef struct pcre32_extra {
   1.333 +  unsigned long int flags;        /* Bits for which fields are set */
   1.334 +  void *study_data;               /* Opaque data from pcre_study() */
   1.335 +  unsigned long int match_limit;  /* Maximum number of calls to match() */
   1.336 +  void *callout_data;             /* Data passed back in callouts */
   1.337 +  const unsigned char *tables;    /* Pointer to character tables */
   1.338 +  unsigned long int match_limit_recursion; /* Max recursive calls to match() */
   1.339 +  PCRE_UCHAR32 **mark;            /* For passing back a mark pointer */
   1.340 +  void *executable_jit;           /* Contains a pointer to a compiled jit code */
   1.341 +} pcre32_extra;
   1.342 +
   1.343  /* The structure for passing out data via the pcre_callout_function. We use a
   1.344  structure so that new fields can be added on the end in future versions,
   1.345  without changing the API of the function, thereby allowing old clients to work
   1.346 @@ -243,9 +415,55 @@
   1.347    /* ------------------- Added for Version 1 -------------------------- */
   1.348    int          pattern_position;  /* Offset to next item in the pattern */
   1.349    int          next_item_length;  /* Length of next item in the pattern */
   1.350 +  /* ------------------- Added for Version 2 -------------------------- */
   1.351 +  const unsigned char *mark;      /* Pointer to current mark or NULL    */
   1.352    /* ------------------------------------------------------------------ */
   1.353  } pcre_callout_block;
   1.354  
   1.355 +/* Same structure as above, but with 16 bit char pointers. */
   1.356 +
   1.357 +typedef struct pcre16_callout_block {
   1.358 +  int          version;           /* Identifies version of block */
   1.359 +  /* ------------------------ Version 0 ------------------------------- */
   1.360 +  int          callout_number;    /* Number compiled into pattern */
   1.361 +  int         *offset_vector;     /* The offset vector */
   1.362 +  PCRE_SPTR16  subject;           /* The subject being matched */
   1.363 +  int          subject_length;    /* The length of the subject */
   1.364 +  int          start_match;       /* Offset to start of this match attempt */
   1.365 +  int          current_position;  /* Where we currently are in the subject */
   1.366 +  int          capture_top;       /* Max current capture */
   1.367 +  int          capture_last;      /* Most recently closed capture */
   1.368 +  void        *callout_data;      /* Data passed in with the call */
   1.369 +  /* ------------------- Added for Version 1 -------------------------- */
   1.370 +  int          pattern_position;  /* Offset to next item in the pattern */
   1.371 +  int          next_item_length;  /* Length of next item in the pattern */
   1.372 +  /* ------------------- Added for Version 2 -------------------------- */
   1.373 +  const PCRE_UCHAR16 *mark;       /* Pointer to current mark or NULL    */
   1.374 +  /* ------------------------------------------------------------------ */
   1.375 +} pcre16_callout_block;
   1.376 +
   1.377 +/* Same structure as above, but with 32 bit char pointers. */
   1.378 +
   1.379 +typedef struct pcre32_callout_block {
   1.380 +  int          version;           /* Identifies version of block */
   1.381 +  /* ------------------------ Version 0 ------------------------------- */
   1.382 +  int          callout_number;    /* Number compiled into pattern */
   1.383 +  int         *offset_vector;     /* The offset vector */
   1.384 +  PCRE_SPTR32  subject;           /* The subject being matched */
   1.385 +  int          subject_length;    /* The length of the subject */
   1.386 +  int          start_match;       /* Offset to start of this match attempt */
   1.387 +  int          current_position;  /* Where we currently are in the subject */
   1.388 +  int          capture_top;       /* Max current capture */
   1.389 +  int          capture_last;      /* Most recently closed capture */
   1.390 +  void        *callout_data;      /* Data passed in with the call */
   1.391 +  /* ------------------- Added for Version 1 -------------------------- */
   1.392 +  int          pattern_position;  /* Offset to next item in the pattern */
   1.393 +  int          next_item_length;  /* Length of next item in the pattern */
   1.394 +  /* ------------------- Added for Version 2 -------------------------- */
   1.395 +  const PCRE_UCHAR32 *mark;       /* Pointer to current mark or NULL    */
   1.396 +  /* ------------------------------------------------------------------ */
   1.397 +} pcre32_callout_block;
   1.398 +
   1.399  /* Indirection for store get and free functions. These can be set to
   1.400  alternative malloc/free functions if required. Special ones are used in the
   1.401  non-recursive case for "frames". There is also an optional callout function
   1.402 @@ -258,47 +476,175 @@
   1.403  PCRE_EXP_DECL void *(*pcre_stack_malloc)(size_t);
   1.404  PCRE_EXP_DECL void  (*pcre_stack_free)(void *);
   1.405  PCRE_EXP_DECL int   (*pcre_callout)(pcre_callout_block *);
   1.406 +
   1.407 +PCRE_EXP_DECL void *(*pcre16_malloc)(size_t);
   1.408 +PCRE_EXP_DECL void  (*pcre16_free)(void *);
   1.409 +PCRE_EXP_DECL void *(*pcre16_stack_malloc)(size_t);
   1.410 +PCRE_EXP_DECL void  (*pcre16_stack_free)(void *);
   1.411 +PCRE_EXP_DECL int   (*pcre16_callout)(pcre16_callout_block *);
   1.412 +
   1.413 +PCRE_EXP_DECL void *(*pcre32_malloc)(size_t);
   1.414 +PCRE_EXP_DECL void  (*pcre32_free)(void *);
   1.415 +PCRE_EXP_DECL void *(*pcre32_stack_malloc)(size_t);
   1.416 +PCRE_EXP_DECL void  (*pcre32_stack_free)(void *);
   1.417 +PCRE_EXP_DECL int   (*pcre32_callout)(pcre32_callout_block *);
   1.418  #else   /* VPCOMPAT */
   1.419  PCRE_EXP_DECL void *pcre_malloc(size_t);
   1.420  PCRE_EXP_DECL void  pcre_free(void *);
   1.421  PCRE_EXP_DECL void *pcre_stack_malloc(size_t);
   1.422  PCRE_EXP_DECL void  pcre_stack_free(void *);
   1.423  PCRE_EXP_DECL int   pcre_callout(pcre_callout_block *);
   1.424 +
   1.425 +PCRE_EXP_DECL void *pcre16_malloc(size_t);
   1.426 +PCRE_EXP_DECL void  pcre16_free(void *);
   1.427 +PCRE_EXP_DECL void *pcre16_stack_malloc(size_t);
   1.428 +PCRE_EXP_DECL void  pcre16_stack_free(void *);
   1.429 +PCRE_EXP_DECL int   pcre16_callout(pcre16_callout_block *);
   1.430 +
   1.431 +PCRE_EXP_DECL void *pcre32_malloc(size_t);
   1.432 +PCRE_EXP_DECL void  pcre32_free(void *);
   1.433 +PCRE_EXP_DECL void *pcre32_stack_malloc(size_t);
   1.434 +PCRE_EXP_DECL void  pcre32_stack_free(void *);
   1.435 +PCRE_EXP_DECL int   pcre32_callout(pcre32_callout_block *);
   1.436  #endif  /* VPCOMPAT */
   1.437  
   1.438 +/* User defined callback which provides a stack just before the match starts. */
   1.439 +
   1.440 +typedef pcre_jit_stack *(*pcre_jit_callback)(void *);
   1.441 +typedef pcre16_jit_stack *(*pcre16_jit_callback)(void *);
   1.442 +typedef pcre32_jit_stack *(*pcre32_jit_callback)(void *);
   1.443 +
   1.444  /* Exported PCRE functions */
   1.445  
   1.446  PCRE_EXP_DECL pcre *pcre_compile(const char *, int, const char **, int *,
   1.447                    const unsigned char *);
   1.448 +PCRE_EXP_DECL pcre16 *pcre16_compile(PCRE_SPTR16, int, const char **, int *,
   1.449 +                  const unsigned char *);
   1.450 +PCRE_EXP_DECL pcre32 *pcre32_compile(PCRE_SPTR32, int, const char **, int *,
   1.451 +                  const unsigned char *);
   1.452  PCRE_EXP_DECL pcre *pcre_compile2(const char *, int, int *, const char **,
   1.453                    int *, const unsigned char *);
   1.454 +PCRE_EXP_DECL pcre16 *pcre16_compile2(PCRE_SPTR16, int, int *, const char **,
   1.455 +                  int *, const unsigned char *);
   1.456 +PCRE_EXP_DECL pcre32 *pcre32_compile2(PCRE_SPTR32, int, int *, const char **,
   1.457 +                  int *, const unsigned char *);
   1.458  PCRE_EXP_DECL int  pcre_config(int, void *);
   1.459 +PCRE_EXP_DECL int  pcre16_config(int, void *);
   1.460 +PCRE_EXP_DECL int  pcre32_config(int, void *);
   1.461  PCRE_EXP_DECL int  pcre_copy_named_substring(const pcre *, const char *,
   1.462                    int *, int, const char *, char *, int);
   1.463 -PCRE_EXP_DECL int  pcre_copy_substring(const char *, int *, int, int, char *,
   1.464 -                  int);
   1.465 +PCRE_EXP_DECL int  pcre16_copy_named_substring(const pcre16 *, PCRE_SPTR16,
   1.466 +                  int *, int, PCRE_SPTR16, PCRE_UCHAR16 *, int);
   1.467 +PCRE_EXP_DECL int  pcre32_copy_named_substring(const pcre32 *, PCRE_SPTR32,
   1.468 +                  int *, int, PCRE_SPTR32, PCRE_UCHAR32 *, int);
   1.469 +PCRE_EXP_DECL int  pcre_copy_substring(const char *, int *, int, int,
   1.470 +                  char *, int);
   1.471 +PCRE_EXP_DECL int  pcre16_copy_substring(PCRE_SPTR16, int *, int, int,
   1.472 +                  PCRE_UCHAR16 *, int);
   1.473 +PCRE_EXP_DECL int  pcre32_copy_substring(PCRE_SPTR32, int *, int, int,
   1.474 +                  PCRE_UCHAR32 *, int);
   1.475  PCRE_EXP_DECL int  pcre_dfa_exec(const pcre *, const pcre_extra *,
   1.476                    const char *, int, int, int, int *, int , int *, int);
   1.477 +PCRE_EXP_DECL int  pcre16_dfa_exec(const pcre16 *, const pcre16_extra *,
   1.478 +                  PCRE_SPTR16, int, int, int, int *, int , int *, int);
   1.479 +PCRE_EXP_DECL int  pcre32_dfa_exec(const pcre32 *, const pcre32_extra *,
   1.480 +                  PCRE_SPTR32, int, int, int, int *, int , int *, int);
   1.481  PCRE_EXP_DECL int  pcre_exec(const pcre *, const pcre_extra *, PCRE_SPTR,
   1.482                     int, int, int, int *, int);
   1.483 +PCRE_EXP_DECL int  pcre16_exec(const pcre16 *, const pcre16_extra *,
   1.484 +                   PCRE_SPTR16, int, int, int, int *, int);
   1.485 +PCRE_EXP_DECL int  pcre32_exec(const pcre32 *, const pcre32_extra *,
   1.486 +                   PCRE_SPTR32, int, int, int, int *, int);
   1.487 +PCRE_EXP_DECL int  pcre_jit_exec(const pcre *, const pcre_extra *,
   1.488 +                   PCRE_SPTR, int, int, int, int *, int,
   1.489 +                   pcre_jit_stack *);
   1.490 +PCRE_EXP_DECL int  pcre16_jit_exec(const pcre16 *, const pcre16_extra *,
   1.491 +                   PCRE_SPTR16, int, int, int, int *, int,
   1.492 +                   pcre16_jit_stack *);
   1.493 +PCRE_EXP_DECL int  pcre32_jit_exec(const pcre32 *, const pcre32_extra *,
   1.494 +                   PCRE_SPTR32, int, int, int, int *, int,
   1.495 +                   pcre32_jit_stack *);
   1.496  PCRE_EXP_DECL void pcre_free_substring(const char *);
   1.497 +PCRE_EXP_DECL void pcre16_free_substring(PCRE_SPTR16);
   1.498 +PCRE_EXP_DECL void pcre32_free_substring(PCRE_SPTR32);
   1.499  PCRE_EXP_DECL void pcre_free_substring_list(const char **);
   1.500 +PCRE_EXP_DECL void pcre16_free_substring_list(PCRE_SPTR16 *);
   1.501 +PCRE_EXP_DECL void pcre32_free_substring_list(PCRE_SPTR32 *);
   1.502  PCRE_EXP_DECL int  pcre_fullinfo(const pcre *, const pcre_extra *, int,
   1.503                    void *);
   1.504 +PCRE_EXP_DECL int  pcre16_fullinfo(const pcre16 *, const pcre16_extra *, int,
   1.505 +                  void *);
   1.506 +PCRE_EXP_DECL int  pcre32_fullinfo(const pcre32 *, const pcre32_extra *, int,
   1.507 +                  void *);
   1.508  PCRE_EXP_DECL int  pcre_get_named_substring(const pcre *, const char *,
   1.509                    int *, int, const char *, const char **);
   1.510 +PCRE_EXP_DECL int  pcre16_get_named_substring(const pcre16 *, PCRE_SPTR16,
   1.511 +                  int *, int, PCRE_SPTR16, PCRE_SPTR16 *);
   1.512 +PCRE_EXP_DECL int  pcre32_get_named_substring(const pcre32 *, PCRE_SPTR32,
   1.513 +                  int *, int, PCRE_SPTR32, PCRE_SPTR32 *);
   1.514  PCRE_EXP_DECL int  pcre_get_stringnumber(const pcre *, const char *);
   1.515 +PCRE_EXP_DECL int  pcre16_get_stringnumber(const pcre16 *, PCRE_SPTR16);
   1.516 +PCRE_EXP_DECL int  pcre32_get_stringnumber(const pcre32 *, PCRE_SPTR32);
   1.517  PCRE_EXP_DECL int  pcre_get_stringtable_entries(const pcre *, const char *,
   1.518                    char **, char **);
   1.519 +PCRE_EXP_DECL int  pcre16_get_stringtable_entries(const pcre16 *, PCRE_SPTR16,
   1.520 +                  PCRE_UCHAR16 **, PCRE_UCHAR16 **);
   1.521 +PCRE_EXP_DECL int  pcre32_get_stringtable_entries(const pcre32 *, PCRE_SPTR32,
   1.522 +                  PCRE_UCHAR32 **, PCRE_UCHAR32 **);
   1.523  PCRE_EXP_DECL int  pcre_get_substring(const char *, int *, int, int,
   1.524                    const char **);
   1.525 +PCRE_EXP_DECL int  pcre16_get_substring(PCRE_SPTR16, int *, int, int,
   1.526 +                  PCRE_SPTR16 *);
   1.527 +PCRE_EXP_DECL int  pcre32_get_substring(PCRE_SPTR32, int *, int, int,
   1.528 +                  PCRE_SPTR32 *);
   1.529  PCRE_EXP_DECL int  pcre_get_substring_list(const char *, int *, int,
   1.530                    const char ***);
   1.531 -PCRE_EXP_DECL int  pcre_info(const pcre *, int *, int *);
   1.532 +PCRE_EXP_DECL int  pcre16_get_substring_list(PCRE_SPTR16, int *, int,
   1.533 +                  PCRE_SPTR16 **);
   1.534 +PCRE_EXP_DECL int  pcre32_get_substring_list(PCRE_SPTR32, int *, int,
   1.535 +                  PCRE_SPTR32 **);
   1.536  PCRE_EXP_DECL const unsigned char *pcre_maketables(void);
   1.537 +PCRE_EXP_DECL const unsigned char *pcre16_maketables(void);
   1.538 +PCRE_EXP_DECL const unsigned char *pcre32_maketables(void);
   1.539  PCRE_EXP_DECL int  pcre_refcount(pcre *, int);
   1.540 +PCRE_EXP_DECL int  pcre16_refcount(pcre16 *, int);
   1.541 +PCRE_EXP_DECL int  pcre32_refcount(pcre32 *, int);
   1.542  PCRE_EXP_DECL pcre_extra *pcre_study(const pcre *, int, const char **);
   1.543 +PCRE_EXP_DECL pcre16_extra *pcre16_study(const pcre16 *, int, const char **);
   1.544 +PCRE_EXP_DECL pcre32_extra *pcre32_study(const pcre32 *, int, const char **);
   1.545 +PCRE_EXP_DECL void pcre_free_study(pcre_extra *);
   1.546 +PCRE_EXP_DECL void pcre16_free_study(pcre16_extra *);
   1.547 +PCRE_EXP_DECL void pcre32_free_study(pcre32_extra *);
   1.548  PCRE_EXP_DECL const char *pcre_version(void);
   1.549 +PCRE_EXP_DECL const char *pcre16_version(void);
   1.550 +PCRE_EXP_DECL const char *pcre32_version(void);
   1.551 +
   1.552 +/* Utility functions for byte order swaps. */
   1.553 +PCRE_EXP_DECL int  pcre_pattern_to_host_byte_order(pcre *, pcre_extra *,
   1.554 +                  const unsigned char *);
   1.555 +PCRE_EXP_DECL int  pcre16_pattern_to_host_byte_order(pcre16 *, pcre16_extra *,
   1.556 +                  const unsigned char *);
   1.557 +PCRE_EXP_DECL int  pcre32_pattern_to_host_byte_order(pcre32 *, pcre32_extra *,
   1.558 +                  const unsigned char *);
   1.559 +PCRE_EXP_DECL int  pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *,
   1.560 +                  PCRE_SPTR16, int, int *, int);
   1.561 +PCRE_EXP_DECL int  pcre32_utf32_to_host_byte_order(PCRE_UCHAR32 *,
   1.562 +                  PCRE_SPTR32, int, int *, int);
   1.563 +
   1.564 +/* JIT compiler related functions. */
   1.565 +
   1.566 +PCRE_EXP_DECL pcre_jit_stack *pcre_jit_stack_alloc(int, int);
   1.567 +PCRE_EXP_DECL pcre16_jit_stack *pcre16_jit_stack_alloc(int, int);
   1.568 +PCRE_EXP_DECL pcre32_jit_stack *pcre32_jit_stack_alloc(int, int);
   1.569 +PCRE_EXP_DECL void pcre_jit_stack_free(pcre_jit_stack *);
   1.570 +PCRE_EXP_DECL void pcre16_jit_stack_free(pcre16_jit_stack *);
   1.571 +PCRE_EXP_DECL void pcre32_jit_stack_free(pcre32_jit_stack *);
   1.572 +PCRE_EXP_DECL void pcre_assign_jit_stack(pcre_extra *,
   1.573 +                  pcre_jit_callback, void *);
   1.574 +PCRE_EXP_DECL void pcre16_assign_jit_stack(pcre16_extra *,
   1.575 +                  pcre16_jit_callback, void *);
   1.576 +PCRE_EXP_DECL void pcre32_assign_jit_stack(pcre32_extra *,
   1.577 +                  pcre32_jit_callback, void *);
   1.578  
   1.579  #ifdef __cplusplus
   1.580  }  /* extern "C" */