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, second API, to be
0006 #included by applications that call PCRE2 functions.
0007 
0008            Copyright (c) 2016-2021 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 PCRE2_H_IDEMPOTENT_GUARD
0040 #define PCRE2_H_IDEMPOTENT_GUARD
0041 
0042 /* The current PCRE version information. */
0043 
0044 #define PCRE2_MAJOR           10
0045 #define PCRE2_MINOR           42
0046 #define PCRE2_PRERELEASE      
0047 #define PCRE2_DATE            2022-12-11
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 PCRE2, the appropriate
0051 export setting is defined in pcre2_internal.h, which includes this file. So we
0052 don't change existing definitions of PCRE2_EXP_DECL. */
0053 
0054 #if defined(_WIN32) && !defined(PCRE2_STATIC)
0055 #  ifndef PCRE2_EXP_DECL
0056 #    define PCRE2_EXP_DECL  extern __declspec(dllimport)
0057 #  endif
0058 #endif
0059 
0060 /* By default, we use the standard "extern" declarations. */
0061 
0062 #ifndef PCRE2_EXP_DECL
0063 #  ifdef __cplusplus
0064 #    define PCRE2_EXP_DECL  extern "C"
0065 #  else
0066 #    define PCRE2_EXP_DECL  extern
0067 #  endif
0068 #endif
0069 
0070 /* When compiling with the MSVC compiler, it is sometimes necessary to include
0071 a "calling convention" before exported function names. (This is secondhand
0072 information; I know nothing about MSVC myself). For example, something like
0073 
0074   void __cdecl function(....)
0075 
0076 might be needed. In order so make this easy, all the exported functions have
0077 PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not
0078 set, we ensure here that it has no effect. */
0079 
0080 #ifndef PCRE2_CALL_CONVENTION
0081 #define PCRE2_CALL_CONVENTION
0082 #endif
0083 
0084 /* Have to include limits.h, stdlib.h, and inttypes.h to ensure that size_t and
0085 uint8_t, UCHAR_MAX, etc are defined. Some systems that do have inttypes.h do
0086 not have stdint.h, which is why we use inttypes.h, which according to the C
0087 standard is a superset of stdint.h. If inttypes.h is not available the build
0088 will break and the relevant values must be provided by some other means. */
0089 
0090 #include <limits.h>
0091 #include <stdlib.h>
0092 #include <inttypes.h>
0093 
0094 /* Allow for C++ users compiling this directly. */
0095 
0096 #ifdef __cplusplus
0097 extern "C" {
0098 #endif
0099 
0100 /* The following option bits can be passed to pcre2_compile(), pcre2_match(),
0101 or pcre2_dfa_match(). PCRE2_NO_UTF_CHECK affects only the function to which it
0102 is passed. Put these bits at the most significant end of the options word so
0103 others can be added next to them */
0104 
0105 #define PCRE2_ANCHORED            0x80000000u
0106 #define PCRE2_NO_UTF_CHECK        0x40000000u
0107 #define PCRE2_ENDANCHORED         0x20000000u
0108 
0109 /* The following option bits can be passed only to pcre2_compile(). However,
0110 they may affect compilation, JIT compilation, and/or interpretive execution.
0111 The following tags indicate which:
0112 
0113 C   alters what is compiled by pcre2_compile()
0114 J   alters what is compiled by pcre2_jit_compile()
0115 M   is inspected during pcre2_match() execution
0116 D   is inspected during pcre2_dfa_match() execution
0117 */
0118 
0119 #define PCRE2_ALLOW_EMPTY_CLASS   0x00000001u  /* C       */
0120 #define PCRE2_ALT_BSUX            0x00000002u  /* C       */
0121 #define PCRE2_AUTO_CALLOUT        0x00000004u  /* C       */
0122 #define PCRE2_CASELESS            0x00000008u  /* C       */
0123 #define PCRE2_DOLLAR_ENDONLY      0x00000010u  /*   J M D */
0124 #define PCRE2_DOTALL              0x00000020u  /* C       */
0125 #define PCRE2_DUPNAMES            0x00000040u  /* C       */
0126 #define PCRE2_EXTENDED            0x00000080u  /* C       */
0127 #define PCRE2_FIRSTLINE           0x00000100u  /*   J M D */
0128 #define PCRE2_MATCH_UNSET_BACKREF 0x00000200u  /* C J M   */
0129 #define PCRE2_MULTILINE           0x00000400u  /* C       */
0130 #define PCRE2_NEVER_UCP           0x00000800u  /* C       */
0131 #define PCRE2_NEVER_UTF           0x00001000u  /* C       */
0132 #define PCRE2_NO_AUTO_CAPTURE     0x00002000u  /* C       */
0133 #define PCRE2_NO_AUTO_POSSESS     0x00004000u  /* C       */
0134 #define PCRE2_NO_DOTSTAR_ANCHOR   0x00008000u  /* C       */
0135 #define PCRE2_NO_START_OPTIMIZE   0x00010000u  /*   J M D */
0136 #define PCRE2_UCP                 0x00020000u  /* C J M D */
0137 #define PCRE2_UNGREEDY            0x00040000u  /* C       */
0138 #define PCRE2_UTF                 0x00080000u  /* C J M D */
0139 #define PCRE2_NEVER_BACKSLASH_C   0x00100000u  /* C       */
0140 #define PCRE2_ALT_CIRCUMFLEX      0x00200000u  /*   J M D */
0141 #define PCRE2_ALT_VERBNAMES       0x00400000u  /* C       */
0142 #define PCRE2_USE_OFFSET_LIMIT    0x00800000u  /*   J M D */
0143 #define PCRE2_EXTENDED_MORE       0x01000000u  /* C       */
0144 #define PCRE2_LITERAL             0x02000000u  /* C       */
0145 #define PCRE2_MATCH_INVALID_UTF   0x04000000u  /*   J M D */
0146 
0147 /* An additional compile options word is available in the compile context. */
0148 
0149 #define PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES  0x00000001u  /* C */
0150 #define PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL    0x00000002u  /* C */
0151 #define PCRE2_EXTRA_MATCH_WORD               0x00000004u  /* C */
0152 #define PCRE2_EXTRA_MATCH_LINE               0x00000008u  /* C */
0153 #define PCRE2_EXTRA_ESCAPED_CR_IS_LF         0x00000010u  /* C */
0154 #define PCRE2_EXTRA_ALT_BSUX                 0x00000020u  /* C */
0155 #define PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK     0x00000040u  /* C */
0156 
0157 /* These are for pcre2_jit_compile(). */
0158 
0159 #define PCRE2_JIT_COMPLETE        0x00000001u  /* For full matching */
0160 #define PCRE2_JIT_PARTIAL_SOFT    0x00000002u
0161 #define PCRE2_JIT_PARTIAL_HARD    0x00000004u
0162 #define PCRE2_JIT_INVALID_UTF     0x00000100u
0163 
0164 /* These are for pcre2_match(), pcre2_dfa_match(), pcre2_jit_match(), and
0165 pcre2_substitute(). Some are allowed only for one of the functions, and in
0166 these cases it is noted below. Note that PCRE2_ANCHORED, PCRE2_ENDANCHORED and
0167 PCRE2_NO_UTF_CHECK can also be passed to these functions (though
0168 pcre2_jit_match() ignores the latter since it bypasses all sanity checks). */
0169 
0170 #define PCRE2_NOTBOL                      0x00000001u
0171 #define PCRE2_NOTEOL                      0x00000002u
0172 #define PCRE2_NOTEMPTY                    0x00000004u  /* ) These two must be kept */
0173 #define PCRE2_NOTEMPTY_ATSTART            0x00000008u  /* ) adjacent to each other. */
0174 #define PCRE2_PARTIAL_SOFT                0x00000010u
0175 #define PCRE2_PARTIAL_HARD                0x00000020u
0176 #define PCRE2_DFA_RESTART                 0x00000040u  /* pcre2_dfa_match() only */
0177 #define PCRE2_DFA_SHORTEST                0x00000080u  /* pcre2_dfa_match() only */
0178 #define PCRE2_SUBSTITUTE_GLOBAL           0x00000100u  /* pcre2_substitute() only */
0179 #define PCRE2_SUBSTITUTE_EXTENDED         0x00000200u  /* pcre2_substitute() only */
0180 #define PCRE2_SUBSTITUTE_UNSET_EMPTY      0x00000400u  /* pcre2_substitute() only */
0181 #define PCRE2_SUBSTITUTE_UNKNOWN_UNSET    0x00000800u  /* pcre2_substitute() only */
0182 #define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH  0x00001000u  /* pcre2_substitute() only */
0183 #define PCRE2_NO_JIT                      0x00002000u  /* Not for pcre2_dfa_match() */
0184 #define PCRE2_COPY_MATCHED_SUBJECT        0x00004000u
0185 #define PCRE2_SUBSTITUTE_LITERAL          0x00008000u  /* pcre2_substitute() only */
0186 #define PCRE2_SUBSTITUTE_MATCHED          0x00010000u  /* pcre2_substitute() only */
0187 #define PCRE2_SUBSTITUTE_REPLACEMENT_ONLY 0x00020000u  /* pcre2_substitute() only */
0188 
0189 /* Options for pcre2_pattern_convert(). */
0190 
0191 #define PCRE2_CONVERT_UTF                    0x00000001u
0192 #define PCRE2_CONVERT_NO_UTF_CHECK           0x00000002u
0193 #define PCRE2_CONVERT_POSIX_BASIC            0x00000004u
0194 #define PCRE2_CONVERT_POSIX_EXTENDED         0x00000008u
0195 #define PCRE2_CONVERT_GLOB                   0x00000010u
0196 #define PCRE2_CONVERT_GLOB_NO_WILD_SEPARATOR 0x00000030u
0197 #define PCRE2_CONVERT_GLOB_NO_STARSTAR       0x00000050u
0198 
0199 /* Newline and \R settings, for use in compile contexts. The newline values
0200 must be kept in step with values set in config.h and both sets must all be
0201 greater than zero. */
0202 
0203 #define PCRE2_NEWLINE_CR          1
0204 #define PCRE2_NEWLINE_LF          2
0205 #define PCRE2_NEWLINE_CRLF        3
0206 #define PCRE2_NEWLINE_ANY         4
0207 #define PCRE2_NEWLINE_ANYCRLF     5
0208 #define PCRE2_NEWLINE_NUL         6
0209 
0210 #define PCRE2_BSR_UNICODE         1
0211 #define PCRE2_BSR_ANYCRLF         2
0212 
0213 /* Error codes for pcre2_compile(). Some of these are also used by
0214 pcre2_pattern_convert(). */
0215 
0216 #define PCRE2_ERROR_END_BACKSLASH                  101
0217 #define PCRE2_ERROR_END_BACKSLASH_C                102
0218 #define PCRE2_ERROR_UNKNOWN_ESCAPE                 103
0219 #define PCRE2_ERROR_QUANTIFIER_OUT_OF_ORDER        104
0220 #define PCRE2_ERROR_QUANTIFIER_TOO_BIG             105
0221 #define PCRE2_ERROR_MISSING_SQUARE_BRACKET         106
0222 #define PCRE2_ERROR_ESCAPE_INVALID_IN_CLASS        107
0223 #define PCRE2_ERROR_CLASS_RANGE_ORDER              108
0224 #define PCRE2_ERROR_QUANTIFIER_INVALID             109
0225 #define PCRE2_ERROR_INTERNAL_UNEXPECTED_REPEAT     110
0226 #define PCRE2_ERROR_INVALID_AFTER_PARENS_QUERY     111
0227 #define PCRE2_ERROR_POSIX_CLASS_NOT_IN_CLASS       112
0228 #define PCRE2_ERROR_POSIX_NO_SUPPORT_COLLATING     113
0229 #define PCRE2_ERROR_MISSING_CLOSING_PARENTHESIS    114
0230 #define PCRE2_ERROR_BAD_SUBPATTERN_REFERENCE       115
0231 #define PCRE2_ERROR_NULL_PATTERN                   116
0232 #define PCRE2_ERROR_BAD_OPTIONS                    117
0233 #define PCRE2_ERROR_MISSING_COMMENT_CLOSING        118
0234 #define PCRE2_ERROR_PARENTHESES_NEST_TOO_DEEP      119
0235 #define PCRE2_ERROR_PATTERN_TOO_LARGE              120
0236 #define PCRE2_ERROR_HEAP_FAILED                    121
0237 #define PCRE2_ERROR_UNMATCHED_CLOSING_PARENTHESIS  122
0238 #define PCRE2_ERROR_INTERNAL_CODE_OVERFLOW         123
0239 #define PCRE2_ERROR_MISSING_CONDITION_CLOSING      124
0240 #define PCRE2_ERROR_LOOKBEHIND_NOT_FIXED_LENGTH    125
0241 #define PCRE2_ERROR_ZERO_RELATIVE_REFERENCE        126
0242 #define PCRE2_ERROR_TOO_MANY_CONDITION_BRANCHES    127
0243 #define PCRE2_ERROR_CONDITION_ASSERTION_EXPECTED   128
0244 #define PCRE2_ERROR_BAD_RELATIVE_REFERENCE         129
0245 #define PCRE2_ERROR_UNKNOWN_POSIX_CLASS            130
0246 #define PCRE2_ERROR_INTERNAL_STUDY_ERROR           131
0247 #define PCRE2_ERROR_UNICODE_NOT_SUPPORTED          132
0248 #define PCRE2_ERROR_PARENTHESES_STACK_CHECK        133
0249 #define PCRE2_ERROR_CODE_POINT_TOO_BIG             134
0250 #define PCRE2_ERROR_LOOKBEHIND_TOO_COMPLICATED     135
0251 #define PCRE2_ERROR_LOOKBEHIND_INVALID_BACKSLASH_C 136
0252 #define PCRE2_ERROR_UNSUPPORTED_ESCAPE_SEQUENCE    137
0253 #define PCRE2_ERROR_CALLOUT_NUMBER_TOO_BIG         138
0254 #define PCRE2_ERROR_MISSING_CALLOUT_CLOSING        139
0255 #define PCRE2_ERROR_ESCAPE_INVALID_IN_VERB         140
0256 #define PCRE2_ERROR_UNRECOGNIZED_AFTER_QUERY_P     141
0257 #define PCRE2_ERROR_MISSING_NAME_TERMINATOR        142
0258 #define PCRE2_ERROR_DUPLICATE_SUBPATTERN_NAME      143
0259 #define PCRE2_ERROR_INVALID_SUBPATTERN_NAME        144
0260 #define PCRE2_ERROR_UNICODE_PROPERTIES_UNAVAILABLE 145
0261 #define PCRE2_ERROR_MALFORMED_UNICODE_PROPERTY     146
0262 #define PCRE2_ERROR_UNKNOWN_UNICODE_PROPERTY       147
0263 #define PCRE2_ERROR_SUBPATTERN_NAME_TOO_LONG       148
0264 #define PCRE2_ERROR_TOO_MANY_NAMED_SUBPATTERNS     149
0265 #define PCRE2_ERROR_CLASS_INVALID_RANGE            150
0266 #define PCRE2_ERROR_OCTAL_BYTE_TOO_BIG             151
0267 #define PCRE2_ERROR_INTERNAL_OVERRAN_WORKSPACE     152
0268 #define PCRE2_ERROR_INTERNAL_MISSING_SUBPATTERN    153
0269 #define PCRE2_ERROR_DEFINE_TOO_MANY_BRANCHES       154
0270 #define PCRE2_ERROR_BACKSLASH_O_MISSING_BRACE      155
0271 #define PCRE2_ERROR_INTERNAL_UNKNOWN_NEWLINE       156
0272 #define PCRE2_ERROR_BACKSLASH_G_SYNTAX             157
0273 #define PCRE2_ERROR_PARENS_QUERY_R_MISSING_CLOSING 158
0274 /* Error 159 is obsolete and should now never occur */
0275 #define PCRE2_ERROR_VERB_ARGUMENT_NOT_ALLOWED      159
0276 #define PCRE2_ERROR_VERB_UNKNOWN                   160
0277 #define PCRE2_ERROR_SUBPATTERN_NUMBER_TOO_BIG      161
0278 #define PCRE2_ERROR_SUBPATTERN_NAME_EXPECTED       162
0279 #define PCRE2_ERROR_INTERNAL_PARSED_OVERFLOW       163
0280 #define PCRE2_ERROR_INVALID_OCTAL                  164
0281 #define PCRE2_ERROR_SUBPATTERN_NAMES_MISMATCH      165
0282 #define PCRE2_ERROR_MARK_MISSING_ARGUMENT          166
0283 #define PCRE2_ERROR_INVALID_HEXADECIMAL            167
0284 #define PCRE2_ERROR_BACKSLASH_C_SYNTAX             168
0285 #define PCRE2_ERROR_BACKSLASH_K_SYNTAX             169
0286 #define PCRE2_ERROR_INTERNAL_BAD_CODE_LOOKBEHINDS  170
0287 #define PCRE2_ERROR_BACKSLASH_N_IN_CLASS           171
0288 #define PCRE2_ERROR_CALLOUT_STRING_TOO_LONG        172
0289 #define PCRE2_ERROR_UNICODE_DISALLOWED_CODE_POINT  173
0290 #define PCRE2_ERROR_UTF_IS_DISABLED                174
0291 #define PCRE2_ERROR_UCP_IS_DISABLED                175
0292 #define PCRE2_ERROR_VERB_NAME_TOO_LONG             176
0293 #define PCRE2_ERROR_BACKSLASH_U_CODE_POINT_TOO_BIG 177
0294 #define PCRE2_ERROR_MISSING_OCTAL_OR_HEX_DIGITS    178
0295 #define PCRE2_ERROR_VERSION_CONDITION_SYNTAX       179
0296 #define PCRE2_ERROR_INTERNAL_BAD_CODE_AUTO_POSSESS 180
0297 #define PCRE2_ERROR_CALLOUT_NO_STRING_DELIMITER    181
0298 #define PCRE2_ERROR_CALLOUT_BAD_STRING_DELIMITER   182
0299 #define PCRE2_ERROR_BACKSLASH_C_CALLER_DISABLED    183
0300 #define PCRE2_ERROR_QUERY_BARJX_NEST_TOO_DEEP      184
0301 #define PCRE2_ERROR_BACKSLASH_C_LIBRARY_DISABLED   185
0302 #define PCRE2_ERROR_PATTERN_TOO_COMPLICATED        186
0303 #define PCRE2_ERROR_LOOKBEHIND_TOO_LONG            187
0304 #define PCRE2_ERROR_PATTERN_STRING_TOO_LONG        188
0305 #define PCRE2_ERROR_INTERNAL_BAD_CODE              189
0306 #define PCRE2_ERROR_INTERNAL_BAD_CODE_IN_SKIP      190
0307 #define PCRE2_ERROR_NO_SURROGATES_IN_UTF16         191
0308 #define PCRE2_ERROR_BAD_LITERAL_OPTIONS            192
0309 #define PCRE2_ERROR_SUPPORTED_ONLY_IN_UNICODE      193
0310 #define PCRE2_ERROR_INVALID_HYPHEN_IN_OPTIONS      194
0311 #define PCRE2_ERROR_ALPHA_ASSERTION_UNKNOWN        195
0312 #define PCRE2_ERROR_SCRIPT_RUN_NOT_AVAILABLE       196
0313 #define PCRE2_ERROR_TOO_MANY_CAPTURES              197
0314 #define PCRE2_ERROR_CONDITION_ATOMIC_ASSERTION_EXPECTED  198
0315 #define PCRE2_ERROR_BACKSLASH_K_IN_LOOKAROUND      199
0316 
0317 
0318 /* "Expected" matching error codes: no match and partial match. */
0319 
0320 #define PCRE2_ERROR_NOMATCH          (-1)
0321 #define PCRE2_ERROR_PARTIAL          (-2)
0322 
0323 /* Error codes for UTF-8 validity checks */
0324 
0325 #define PCRE2_ERROR_UTF8_ERR1        (-3)
0326 #define PCRE2_ERROR_UTF8_ERR2        (-4)
0327 #define PCRE2_ERROR_UTF8_ERR3        (-5)
0328 #define PCRE2_ERROR_UTF8_ERR4        (-6)
0329 #define PCRE2_ERROR_UTF8_ERR5        (-7)
0330 #define PCRE2_ERROR_UTF8_ERR6        (-8)
0331 #define PCRE2_ERROR_UTF8_ERR7        (-9)
0332 #define PCRE2_ERROR_UTF8_ERR8       (-10)
0333 #define PCRE2_ERROR_UTF8_ERR9       (-11)
0334 #define PCRE2_ERROR_UTF8_ERR10      (-12)
0335 #define PCRE2_ERROR_UTF8_ERR11      (-13)
0336 #define PCRE2_ERROR_UTF8_ERR12      (-14)
0337 #define PCRE2_ERROR_UTF8_ERR13      (-15)
0338 #define PCRE2_ERROR_UTF8_ERR14      (-16)
0339 #define PCRE2_ERROR_UTF8_ERR15      (-17)
0340 #define PCRE2_ERROR_UTF8_ERR16      (-18)
0341 #define PCRE2_ERROR_UTF8_ERR17      (-19)
0342 #define PCRE2_ERROR_UTF8_ERR18      (-20)
0343 #define PCRE2_ERROR_UTF8_ERR19      (-21)
0344 #define PCRE2_ERROR_UTF8_ERR20      (-22)
0345 #define PCRE2_ERROR_UTF8_ERR21      (-23)
0346 
0347 /* Error codes for UTF-16 validity checks */
0348 
0349 #define PCRE2_ERROR_UTF16_ERR1      (-24)
0350 #define PCRE2_ERROR_UTF16_ERR2      (-25)
0351 #define PCRE2_ERROR_UTF16_ERR3      (-26)
0352 
0353 /* Error codes for UTF-32 validity checks */
0354 
0355 #define PCRE2_ERROR_UTF32_ERR1      (-27)
0356 #define PCRE2_ERROR_UTF32_ERR2      (-28)
0357 
0358 /* Miscellaneous error codes for pcre2[_dfa]_match(), substring extraction
0359 functions, context functions, and serializing functions. They are in numerical
0360 order. Originally they were in alphabetical order too, but now that PCRE2 is
0361 released, the numbers must not be changed. */
0362 
0363 #define PCRE2_ERROR_BADDATA           (-29)
0364 #define PCRE2_ERROR_MIXEDTABLES       (-30)  /* Name was changed */
0365 #define PCRE2_ERROR_BADMAGIC          (-31)
0366 #define PCRE2_ERROR_BADMODE           (-32)
0367 #define PCRE2_ERROR_BADOFFSET         (-33)
0368 #define PCRE2_ERROR_BADOPTION         (-34)
0369 #define PCRE2_ERROR_BADREPLACEMENT    (-35)
0370 #define PCRE2_ERROR_BADUTFOFFSET      (-36)
0371 #define PCRE2_ERROR_CALLOUT           (-37)  /* Never used by PCRE2 itself */
0372 #define PCRE2_ERROR_DFA_BADRESTART    (-38)
0373 #define PCRE2_ERROR_DFA_RECURSE       (-39)
0374 #define PCRE2_ERROR_DFA_UCOND         (-40)
0375 #define PCRE2_ERROR_DFA_UFUNC         (-41)
0376 #define PCRE2_ERROR_DFA_UITEM         (-42)
0377 #define PCRE2_ERROR_DFA_WSSIZE        (-43)
0378 #define PCRE2_ERROR_INTERNAL          (-44)
0379 #define PCRE2_ERROR_JIT_BADOPTION     (-45)
0380 #define PCRE2_ERROR_JIT_STACKLIMIT    (-46)
0381 #define PCRE2_ERROR_MATCHLIMIT        (-47)
0382 #define PCRE2_ERROR_NOMEMORY          (-48)
0383 #define PCRE2_ERROR_NOSUBSTRING       (-49)
0384 #define PCRE2_ERROR_NOUNIQUESUBSTRING (-50)
0385 #define PCRE2_ERROR_NULL              (-51)
0386 #define PCRE2_ERROR_RECURSELOOP       (-52)
0387 #define PCRE2_ERROR_DEPTHLIMIT        (-53)
0388 #define PCRE2_ERROR_RECURSIONLIMIT    (-53)  /* Obsolete synonym */
0389 #define PCRE2_ERROR_UNAVAILABLE       (-54)
0390 #define PCRE2_ERROR_UNSET             (-55)
0391 #define PCRE2_ERROR_BADOFFSETLIMIT    (-56)
0392 #define PCRE2_ERROR_BADREPESCAPE      (-57)
0393 #define PCRE2_ERROR_REPMISSINGBRACE   (-58)
0394 #define PCRE2_ERROR_BADSUBSTITUTION   (-59)
0395 #define PCRE2_ERROR_BADSUBSPATTERN    (-60)
0396 #define PCRE2_ERROR_TOOMANYREPLACE    (-61)
0397 #define PCRE2_ERROR_BADSERIALIZEDDATA (-62)
0398 #define PCRE2_ERROR_HEAPLIMIT         (-63)
0399 #define PCRE2_ERROR_CONVERT_SYNTAX    (-64)
0400 #define PCRE2_ERROR_INTERNAL_DUPMATCH (-65)
0401 #define PCRE2_ERROR_DFA_UINVALID_UTF  (-66)
0402 
0403 
0404 /* Request types for pcre2_pattern_info() */
0405 
0406 #define PCRE2_INFO_ALLOPTIONS            0
0407 #define PCRE2_INFO_ARGOPTIONS            1
0408 #define PCRE2_INFO_BACKREFMAX            2
0409 #define PCRE2_INFO_BSR                   3
0410 #define PCRE2_INFO_CAPTURECOUNT          4
0411 #define PCRE2_INFO_FIRSTCODEUNIT         5
0412 #define PCRE2_INFO_FIRSTCODETYPE         6
0413 #define PCRE2_INFO_FIRSTBITMAP           7
0414 #define PCRE2_INFO_HASCRORLF             8
0415 #define PCRE2_INFO_JCHANGED              9
0416 #define PCRE2_INFO_JITSIZE              10
0417 #define PCRE2_INFO_LASTCODEUNIT         11
0418 #define PCRE2_INFO_LASTCODETYPE         12
0419 #define PCRE2_INFO_MATCHEMPTY           13
0420 #define PCRE2_INFO_MATCHLIMIT           14
0421 #define PCRE2_INFO_MAXLOOKBEHIND        15
0422 #define PCRE2_INFO_MINLENGTH            16
0423 #define PCRE2_INFO_NAMECOUNT            17
0424 #define PCRE2_INFO_NAMEENTRYSIZE        18
0425 #define PCRE2_INFO_NAMETABLE            19
0426 #define PCRE2_INFO_NEWLINE              20
0427 #define PCRE2_INFO_DEPTHLIMIT           21
0428 #define PCRE2_INFO_RECURSIONLIMIT       21  /* Obsolete synonym */
0429 #define PCRE2_INFO_SIZE                 22
0430 #define PCRE2_INFO_HASBACKSLASHC        23
0431 #define PCRE2_INFO_FRAMESIZE            24
0432 #define PCRE2_INFO_HEAPLIMIT            25
0433 #define PCRE2_INFO_EXTRAOPTIONS         26
0434 
0435 /* Request types for pcre2_config(). */
0436 
0437 #define PCRE2_CONFIG_BSR                     0
0438 #define PCRE2_CONFIG_JIT                     1
0439 #define PCRE2_CONFIG_JITTARGET               2
0440 #define PCRE2_CONFIG_LINKSIZE                3
0441 #define PCRE2_CONFIG_MATCHLIMIT              4
0442 #define PCRE2_CONFIG_NEWLINE                 5
0443 #define PCRE2_CONFIG_PARENSLIMIT             6
0444 #define PCRE2_CONFIG_DEPTHLIMIT              7
0445 #define PCRE2_CONFIG_RECURSIONLIMIT          7  /* Obsolete synonym */
0446 #define PCRE2_CONFIG_STACKRECURSE            8  /* Obsolete */
0447 #define PCRE2_CONFIG_UNICODE                 9
0448 #define PCRE2_CONFIG_UNICODE_VERSION        10
0449 #define PCRE2_CONFIG_VERSION                11
0450 #define PCRE2_CONFIG_HEAPLIMIT              12
0451 #define PCRE2_CONFIG_NEVER_BACKSLASH_C      13
0452 #define PCRE2_CONFIG_COMPILED_WIDTHS        14
0453 #define PCRE2_CONFIG_TABLES_LENGTH          15
0454 
0455 
0456 /* Types for code units in patterns and subject strings. */
0457 
0458 typedef uint8_t  PCRE2_UCHAR8;
0459 typedef uint16_t PCRE2_UCHAR16;
0460 typedef uint32_t PCRE2_UCHAR32;
0461 
0462 typedef const PCRE2_UCHAR8  *PCRE2_SPTR8;
0463 typedef const PCRE2_UCHAR16 *PCRE2_SPTR16;
0464 typedef const PCRE2_UCHAR32 *PCRE2_SPTR32;
0465 
0466 /* The PCRE2_SIZE type is used for all string lengths and offsets in PCRE2,
0467 including pattern offsets for errors and subject offsets after a match. We
0468 define special values to indicate zero-terminated strings and unset offsets in
0469 the offset vector (ovector). */
0470 
0471 #define PCRE2_SIZE            size_t
0472 #define PCRE2_SIZE_MAX        SIZE_MAX
0473 #define PCRE2_ZERO_TERMINATED (~(PCRE2_SIZE)0)
0474 #define PCRE2_UNSET           (~(PCRE2_SIZE)0)
0475 
0476 /* Generic types for opaque structures and JIT callback functions. These
0477 declarations are defined in a macro that is expanded for each width later. */
0478 
0479 #define PCRE2_TYPES_LIST \
0480 struct pcre2_real_general_context; \
0481 typedef struct pcre2_real_general_context pcre2_general_context; \
0482 \
0483 struct pcre2_real_compile_context; \
0484 typedef struct pcre2_real_compile_context pcre2_compile_context; \
0485 \
0486 struct pcre2_real_match_context; \
0487 typedef struct pcre2_real_match_context pcre2_match_context; \
0488 \
0489 struct pcre2_real_convert_context; \
0490 typedef struct pcre2_real_convert_context pcre2_convert_context; \
0491 \
0492 struct pcre2_real_code; \
0493 typedef struct pcre2_real_code pcre2_code; \
0494 \
0495 struct pcre2_real_match_data; \
0496 typedef struct pcre2_real_match_data pcre2_match_data; \
0497 \
0498 struct pcre2_real_jit_stack; \
0499 typedef struct pcre2_real_jit_stack pcre2_jit_stack; \
0500 \
0501 typedef pcre2_jit_stack *(*pcre2_jit_callback)(void *);
0502 
0503 
0504 /* The structures for passing out data via callout functions. We use structures
0505 so that new fields can be added on the end in future versions, without changing
0506 the API of the function, thereby allowing old clients to work without
0507 modification. Define the generic versions in a macro; the width-specific
0508 versions are generated from this macro below. */
0509 
0510 /* Flags for the callout_flags field. These are cleared after a callout. */
0511 
0512 #define PCRE2_CALLOUT_STARTMATCH    0x00000001u  /* Set for each bumpalong */
0513 #define PCRE2_CALLOUT_BACKTRACK     0x00000002u  /* Set after a backtrack */
0514 
0515 #define PCRE2_STRUCTURE_LIST \
0516 typedef struct pcre2_callout_block { \
0517   uint32_t      version;           /* Identifies version of block */ \
0518   /* ------------------------ Version 0 ------------------------------- */ \
0519   uint32_t      callout_number;    /* Number compiled into pattern */ \
0520   uint32_t      capture_top;       /* Max current capture */ \
0521   uint32_t      capture_last;      /* Most recently closed capture */ \
0522   PCRE2_SIZE   *offset_vector;     /* The offset vector */ \
0523   PCRE2_SPTR    mark;              /* Pointer to current mark or NULL */ \
0524   PCRE2_SPTR    subject;           /* The subject being matched */ \
0525   PCRE2_SIZE    subject_length;    /* The length of the subject */ \
0526   PCRE2_SIZE    start_match;       /* Offset to start of this match attempt */ \
0527   PCRE2_SIZE    current_position;  /* Where we currently are in the subject */ \
0528   PCRE2_SIZE    pattern_position;  /* Offset to next item in the pattern */ \
0529   PCRE2_SIZE    next_item_length;  /* Length of next item in the pattern */ \
0530   /* ------------------- Added for Version 1 -------------------------- */ \
0531   PCRE2_SIZE    callout_string_offset; /* Offset to string within pattern */ \
0532   PCRE2_SIZE    callout_string_length; /* Length of string compiled into pattern */ \
0533   PCRE2_SPTR    callout_string;    /* String compiled into pattern */ \
0534   /* ------------------- Added for Version 2 -------------------------- */ \
0535   uint32_t      callout_flags;     /* See above for list */ \
0536   /* ------------------------------------------------------------------ */ \
0537 } pcre2_callout_block; \
0538 \
0539 typedef struct pcre2_callout_enumerate_block { \
0540   uint32_t      version;           /* Identifies version of block */ \
0541   /* ------------------------ Version 0 ------------------------------- */ \
0542   PCRE2_SIZE    pattern_position;  /* Offset to next item in the pattern */ \
0543   PCRE2_SIZE    next_item_length;  /* Length of next item in the pattern */ \
0544   uint32_t      callout_number;    /* Number compiled into pattern */ \
0545   PCRE2_SIZE    callout_string_offset; /* Offset to string within pattern */ \
0546   PCRE2_SIZE    callout_string_length; /* Length of string compiled into pattern */ \
0547   PCRE2_SPTR    callout_string;    /* String compiled into pattern */ \
0548   /* ------------------------------------------------------------------ */ \
0549 } pcre2_callout_enumerate_block; \
0550 \
0551 typedef struct pcre2_substitute_callout_block { \
0552   uint32_t      version;           /* Identifies version of block */ \
0553   /* ------------------------ Version 0 ------------------------------- */ \
0554   PCRE2_SPTR    input;             /* Pointer to input subject string */ \
0555   PCRE2_SPTR    output;            /* Pointer to output buffer */ \
0556   PCRE2_SIZE    output_offsets[2]; /* Changed portion of the output */ \
0557   PCRE2_SIZE   *ovector;           /* Pointer to current ovector */ \
0558   uint32_t      oveccount;         /* Count of pairs set in ovector */ \
0559   uint32_t      subscount;         /* Substitution number */ \
0560   /* ------------------------------------------------------------------ */ \
0561 } pcre2_substitute_callout_block;
0562 
0563 
0564 /* List the generic forms of all other functions in macros, which will be
0565 expanded for each width below. Start with functions that give general
0566 information. */
0567 
0568 #define PCRE2_GENERAL_INFO_FUNCTIONS \
0569 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION pcre2_config(uint32_t, void *);
0570 
0571 
0572 /* Functions for manipulating contexts. */
0573 
0574 #define PCRE2_GENERAL_CONTEXT_FUNCTIONS \
0575 PCRE2_EXP_DECL pcre2_general_context *PCRE2_CALL_CONVENTION \
0576   pcre2_general_context_copy(pcre2_general_context *); \
0577 PCRE2_EXP_DECL pcre2_general_context *PCRE2_CALL_CONVENTION \
0578   pcre2_general_context_create(void *(*)(PCRE2_SIZE, void *), \
0579     void (*)(void *, void *), void *); \
0580 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0581   pcre2_general_context_free(pcre2_general_context *);
0582 
0583 #define PCRE2_COMPILE_CONTEXT_FUNCTIONS \
0584 PCRE2_EXP_DECL pcre2_compile_context *PCRE2_CALL_CONVENTION \
0585   pcre2_compile_context_copy(pcre2_compile_context *); \
0586 PCRE2_EXP_DECL pcre2_compile_context *PCRE2_CALL_CONVENTION \
0587   pcre2_compile_context_create(pcre2_general_context *);\
0588 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0589   pcre2_compile_context_free(pcre2_compile_context *); \
0590 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0591   pcre2_set_bsr(pcre2_compile_context *, uint32_t); \
0592 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0593   pcre2_set_character_tables(pcre2_compile_context *, const uint8_t *); \
0594 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0595   pcre2_set_compile_extra_options(pcre2_compile_context *, uint32_t); \
0596 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0597   pcre2_set_max_pattern_length(pcre2_compile_context *, PCRE2_SIZE); \
0598 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0599   pcre2_set_newline(pcre2_compile_context *, uint32_t); \
0600 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0601   pcre2_set_parens_nest_limit(pcre2_compile_context *, uint32_t); \
0602 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0603   pcre2_set_compile_recursion_guard(pcre2_compile_context *, \
0604     int (*)(uint32_t, void *), void *);
0605 
0606 #define PCRE2_MATCH_CONTEXT_FUNCTIONS \
0607 PCRE2_EXP_DECL pcre2_match_context *PCRE2_CALL_CONVENTION \
0608   pcre2_match_context_copy(pcre2_match_context *); \
0609 PCRE2_EXP_DECL pcre2_match_context *PCRE2_CALL_CONVENTION \
0610   pcre2_match_context_create(pcre2_general_context *); \
0611 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0612   pcre2_match_context_free(pcre2_match_context *); \
0613 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0614   pcre2_set_callout(pcre2_match_context *, \
0615     int (*)(pcre2_callout_block *, void *), void *); \
0616 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0617   pcre2_set_substitute_callout(pcre2_match_context *, \
0618     int (*)(pcre2_substitute_callout_block *, void *), void *); \
0619 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0620   pcre2_set_depth_limit(pcre2_match_context *, uint32_t); \
0621 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0622   pcre2_set_heap_limit(pcre2_match_context *, uint32_t); \
0623 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0624   pcre2_set_match_limit(pcre2_match_context *, uint32_t); \
0625 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0626   pcre2_set_offset_limit(pcre2_match_context *, PCRE2_SIZE); \
0627 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0628   pcre2_set_recursion_limit(pcre2_match_context *, uint32_t); \
0629 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0630   pcre2_set_recursion_memory_management(pcre2_match_context *, \
0631     void *(*)(PCRE2_SIZE, void *), void (*)(void *, void *), void *);
0632 
0633 #define PCRE2_CONVERT_CONTEXT_FUNCTIONS \
0634 PCRE2_EXP_DECL pcre2_convert_context *PCRE2_CALL_CONVENTION \
0635   pcre2_convert_context_copy(pcre2_convert_context *); \
0636 PCRE2_EXP_DECL pcre2_convert_context *PCRE2_CALL_CONVENTION \
0637   pcre2_convert_context_create(pcre2_general_context *); \
0638 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0639   pcre2_convert_context_free(pcre2_convert_context *); \
0640 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0641   pcre2_set_glob_escape(pcre2_convert_context *, uint32_t); \
0642 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0643   pcre2_set_glob_separator(pcre2_convert_context *, uint32_t);
0644 
0645 
0646 /* Functions concerned with compiling a pattern to PCRE internal code. */
0647 
0648 #define PCRE2_COMPILE_FUNCTIONS \
0649 PCRE2_EXP_DECL pcre2_code *PCRE2_CALL_CONVENTION \
0650   pcre2_compile(PCRE2_SPTR, PCRE2_SIZE, uint32_t, int *, PCRE2_SIZE *, \
0651     pcre2_compile_context *); \
0652 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0653   pcre2_code_free(pcre2_code *); \
0654 PCRE2_EXP_DECL pcre2_code *PCRE2_CALL_CONVENTION \
0655   pcre2_code_copy(const pcre2_code *); \
0656 PCRE2_EXP_DECL pcre2_code *PCRE2_CALL_CONVENTION \
0657   pcre2_code_copy_with_tables(const pcre2_code *);
0658 
0659 
0660 /* Functions that give information about a compiled pattern. */
0661 
0662 #define PCRE2_PATTERN_INFO_FUNCTIONS \
0663 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0664   pcre2_pattern_info(const pcre2_code *, uint32_t, void *); \
0665 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0666   pcre2_callout_enumerate(const pcre2_code *, \
0667     int (*)(pcre2_callout_enumerate_block *, void *), void *);
0668 
0669 
0670 /* Functions for running a match and inspecting the result. */
0671 
0672 #define PCRE2_MATCH_FUNCTIONS \
0673 PCRE2_EXP_DECL pcre2_match_data *PCRE2_CALL_CONVENTION \
0674   pcre2_match_data_create(uint32_t, pcre2_general_context *); \
0675 PCRE2_EXP_DECL pcre2_match_data *PCRE2_CALL_CONVENTION \
0676   pcre2_match_data_create_from_pattern(const pcre2_code *, \
0677     pcre2_general_context *); \
0678 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0679   pcre2_dfa_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
0680     uint32_t, pcre2_match_data *, pcre2_match_context *, int *, PCRE2_SIZE); \
0681 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0682   pcre2_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
0683     uint32_t, pcre2_match_data *, pcre2_match_context *); \
0684 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0685   pcre2_match_data_free(pcre2_match_data *); \
0686 PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \
0687   pcre2_get_mark(pcre2_match_data *); \
0688 PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
0689   pcre2_get_match_data_size(pcre2_match_data *); \
0690 PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \
0691   pcre2_get_ovector_count(pcre2_match_data *); \
0692 PCRE2_EXP_DECL PCRE2_SIZE *PCRE2_CALL_CONVENTION \
0693   pcre2_get_ovector_pointer(pcre2_match_data *); \
0694 PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
0695   pcre2_get_startchar(pcre2_match_data *);
0696 
0697 
0698 /* Convenience functions for handling matched substrings. */
0699 
0700 #define PCRE2_SUBSTRING_FUNCTIONS \
0701 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0702   pcre2_substring_copy_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_UCHAR *, \
0703     PCRE2_SIZE *); \
0704 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0705   pcre2_substring_copy_bynumber(pcre2_match_data *, uint32_t, PCRE2_UCHAR *, \
0706     PCRE2_SIZE *); \
0707 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0708   pcre2_substring_free(PCRE2_UCHAR *); \
0709 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0710   pcre2_substring_get_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_UCHAR **, \
0711     PCRE2_SIZE *); \
0712 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0713   pcre2_substring_get_bynumber(pcre2_match_data *, uint32_t, PCRE2_UCHAR **, \
0714     PCRE2_SIZE *); \
0715 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0716   pcre2_substring_length_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_SIZE *); \
0717 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0718   pcre2_substring_length_bynumber(pcre2_match_data *, uint32_t, PCRE2_SIZE *); \
0719 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0720   pcre2_substring_nametable_scan(const pcre2_code *, PCRE2_SPTR, PCRE2_SPTR *, \
0721     PCRE2_SPTR *); \
0722 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0723   pcre2_substring_number_from_name(const pcre2_code *, PCRE2_SPTR); \
0724 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0725   pcre2_substring_list_free(PCRE2_SPTR *); \
0726 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0727   pcre2_substring_list_get(pcre2_match_data *, PCRE2_UCHAR ***, PCRE2_SIZE **);
0728 
0729 /* Functions for serializing / deserializing compiled patterns. */
0730 
0731 #define PCRE2_SERIALIZE_FUNCTIONS \
0732 PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \
0733   pcre2_serialize_encode(const pcre2_code **, int32_t, uint8_t **, \
0734     PCRE2_SIZE *, pcre2_general_context *); \
0735 PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \
0736   pcre2_serialize_decode(pcre2_code **, int32_t, const uint8_t *, \
0737     pcre2_general_context *); \
0738 PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \
0739   pcre2_serialize_get_number_of_codes(const uint8_t *); \
0740 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0741   pcre2_serialize_free(uint8_t *);
0742 
0743 
0744 /* Convenience function for match + substitute. */
0745 
0746 #define PCRE2_SUBSTITUTE_FUNCTION \
0747 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0748   pcre2_substitute(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
0749     uint32_t, pcre2_match_data *, pcre2_match_context *, PCRE2_SPTR, \
0750     PCRE2_SIZE, PCRE2_UCHAR *, PCRE2_SIZE *);
0751 
0752 
0753 /* Functions for converting pattern source strings. */
0754 
0755 #define PCRE2_CONVERT_FUNCTIONS \
0756 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0757   pcre2_pattern_convert(PCRE2_SPTR, PCRE2_SIZE, uint32_t, PCRE2_UCHAR **, \
0758     PCRE2_SIZE *, pcre2_convert_context *); \
0759 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0760   pcre2_converted_pattern_free(PCRE2_UCHAR *);
0761 
0762 
0763 /* Functions for JIT processing */
0764 
0765 #define PCRE2_JIT_FUNCTIONS \
0766 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0767   pcre2_jit_compile(pcre2_code *, uint32_t); \
0768 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0769   pcre2_jit_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
0770     uint32_t, pcre2_match_data *, pcre2_match_context *); \
0771 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0772   pcre2_jit_free_unused_memory(pcre2_general_context *); \
0773 PCRE2_EXP_DECL pcre2_jit_stack *PCRE2_CALL_CONVENTION \
0774   pcre2_jit_stack_create(PCRE2_SIZE, PCRE2_SIZE, pcre2_general_context *); \
0775 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0776   pcre2_jit_stack_assign(pcre2_match_context *, pcre2_jit_callback, void *); \
0777 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0778   pcre2_jit_stack_free(pcre2_jit_stack *);
0779 
0780 
0781 /* Other miscellaneous functions. */
0782 
0783 #define PCRE2_OTHER_FUNCTIONS \
0784 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
0785   pcre2_get_error_message(int, PCRE2_UCHAR *, PCRE2_SIZE); \
0786 PCRE2_EXP_DECL const uint8_t *PCRE2_CALL_CONVENTION \
0787   pcre2_maketables(pcre2_general_context *); \
0788 PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
0789   pcre2_maketables_free(pcre2_general_context *, const uint8_t *);
0790 
0791 /* Define macros that generate width-specific names from generic versions. The
0792 three-level macro scheme is necessary to get the macros expanded when we want
0793 them to be. First we get the width from PCRE2_LOCAL_WIDTH, which is used for
0794 generating three versions of everything below. After that, PCRE2_SUFFIX will be
0795 re-defined to use PCRE2_CODE_UNIT_WIDTH, for use when macros such as
0796 pcre2_compile are called by application code. */
0797 
0798 #define PCRE2_JOIN(a,b) a ## b
0799 #define PCRE2_GLUE(a,b) PCRE2_JOIN(a,b)
0800 #define PCRE2_SUFFIX(a) PCRE2_GLUE(a,PCRE2_LOCAL_WIDTH)
0801 
0802 
0803 /* Data types */
0804 
0805 #define PCRE2_UCHAR                 PCRE2_SUFFIX(PCRE2_UCHAR)
0806 #define PCRE2_SPTR                  PCRE2_SUFFIX(PCRE2_SPTR)
0807 
0808 #define pcre2_code                  PCRE2_SUFFIX(pcre2_code_)
0809 #define pcre2_jit_callback          PCRE2_SUFFIX(pcre2_jit_callback_)
0810 #define pcre2_jit_stack             PCRE2_SUFFIX(pcre2_jit_stack_)
0811 
0812 #define pcre2_real_code             PCRE2_SUFFIX(pcre2_real_code_)
0813 #define pcre2_real_general_context  PCRE2_SUFFIX(pcre2_real_general_context_)
0814 #define pcre2_real_compile_context  PCRE2_SUFFIX(pcre2_real_compile_context_)
0815 #define pcre2_real_convert_context  PCRE2_SUFFIX(pcre2_real_convert_context_)
0816 #define pcre2_real_match_context    PCRE2_SUFFIX(pcre2_real_match_context_)
0817 #define pcre2_real_jit_stack        PCRE2_SUFFIX(pcre2_real_jit_stack_)
0818 #define pcre2_real_match_data       PCRE2_SUFFIX(pcre2_real_match_data_)
0819 
0820 
0821 /* Data blocks */
0822 
0823 #define pcre2_callout_block            PCRE2_SUFFIX(pcre2_callout_block_)
0824 #define pcre2_callout_enumerate_block  PCRE2_SUFFIX(pcre2_callout_enumerate_block_)
0825 #define pcre2_substitute_callout_block PCRE2_SUFFIX(pcre2_substitute_callout_block_)
0826 #define pcre2_general_context          PCRE2_SUFFIX(pcre2_general_context_)
0827 #define pcre2_compile_context          PCRE2_SUFFIX(pcre2_compile_context_)
0828 #define pcre2_convert_context          PCRE2_SUFFIX(pcre2_convert_context_)
0829 #define pcre2_match_context            PCRE2_SUFFIX(pcre2_match_context_)
0830 #define pcre2_match_data               PCRE2_SUFFIX(pcre2_match_data_)
0831 
0832 
0833 /* Functions: the complete list in alphabetical order */
0834 
0835 #define pcre2_callout_enumerate               PCRE2_SUFFIX(pcre2_callout_enumerate_)
0836 #define pcre2_code_copy                       PCRE2_SUFFIX(pcre2_code_copy_)
0837 #define pcre2_code_copy_with_tables           PCRE2_SUFFIX(pcre2_code_copy_with_tables_)
0838 #define pcre2_code_free                       PCRE2_SUFFIX(pcre2_code_free_)
0839 #define pcre2_compile                         PCRE2_SUFFIX(pcre2_compile_)
0840 #define pcre2_compile_context_copy            PCRE2_SUFFIX(pcre2_compile_context_copy_)
0841 #define pcre2_compile_context_create          PCRE2_SUFFIX(pcre2_compile_context_create_)
0842 #define pcre2_compile_context_free            PCRE2_SUFFIX(pcre2_compile_context_free_)
0843 #define pcre2_config                          PCRE2_SUFFIX(pcre2_config_)
0844 #define pcre2_convert_context_copy            PCRE2_SUFFIX(pcre2_convert_context_copy_)
0845 #define pcre2_convert_context_create          PCRE2_SUFFIX(pcre2_convert_context_create_)
0846 #define pcre2_convert_context_free            PCRE2_SUFFIX(pcre2_convert_context_free_)
0847 #define pcre2_converted_pattern_free          PCRE2_SUFFIX(pcre2_converted_pattern_free_)
0848 #define pcre2_dfa_match                       PCRE2_SUFFIX(pcre2_dfa_match_)
0849 #define pcre2_general_context_copy            PCRE2_SUFFIX(pcre2_general_context_copy_)
0850 #define pcre2_general_context_create          PCRE2_SUFFIX(pcre2_general_context_create_)
0851 #define pcre2_general_context_free            PCRE2_SUFFIX(pcre2_general_context_free_)
0852 #define pcre2_get_error_message               PCRE2_SUFFIX(pcre2_get_error_message_)
0853 #define pcre2_get_mark                        PCRE2_SUFFIX(pcre2_get_mark_)
0854 #define pcre2_get_match_data_size             PCRE2_SUFFIX(pcre2_get_match_data_size_)
0855 #define pcre2_get_ovector_pointer             PCRE2_SUFFIX(pcre2_get_ovector_pointer_)
0856 #define pcre2_get_ovector_count               PCRE2_SUFFIX(pcre2_get_ovector_count_)
0857 #define pcre2_get_startchar                   PCRE2_SUFFIX(pcre2_get_startchar_)
0858 #define pcre2_jit_compile                     PCRE2_SUFFIX(pcre2_jit_compile_)
0859 #define pcre2_jit_match                       PCRE2_SUFFIX(pcre2_jit_match_)
0860 #define pcre2_jit_free_unused_memory          PCRE2_SUFFIX(pcre2_jit_free_unused_memory_)
0861 #define pcre2_jit_stack_assign                PCRE2_SUFFIX(pcre2_jit_stack_assign_)
0862 #define pcre2_jit_stack_create                PCRE2_SUFFIX(pcre2_jit_stack_create_)
0863 #define pcre2_jit_stack_free                  PCRE2_SUFFIX(pcre2_jit_stack_free_)
0864 #define pcre2_maketables                      PCRE2_SUFFIX(pcre2_maketables_)
0865 #define pcre2_maketables_free                 PCRE2_SUFFIX(pcre2_maketables_free_)
0866 #define pcre2_match                           PCRE2_SUFFIX(pcre2_match_)
0867 #define pcre2_match_context_copy              PCRE2_SUFFIX(pcre2_match_context_copy_)
0868 #define pcre2_match_context_create            PCRE2_SUFFIX(pcre2_match_context_create_)
0869 #define pcre2_match_context_free              PCRE2_SUFFIX(pcre2_match_context_free_)
0870 #define pcre2_match_data_create               PCRE2_SUFFIX(pcre2_match_data_create_)
0871 #define pcre2_match_data_create_from_pattern  PCRE2_SUFFIX(pcre2_match_data_create_from_pattern_)
0872 #define pcre2_match_data_free                 PCRE2_SUFFIX(pcre2_match_data_free_)
0873 #define pcre2_pattern_convert                 PCRE2_SUFFIX(pcre2_pattern_convert_)
0874 #define pcre2_pattern_info                    PCRE2_SUFFIX(pcre2_pattern_info_)
0875 #define pcre2_serialize_decode                PCRE2_SUFFIX(pcre2_serialize_decode_)
0876 #define pcre2_serialize_encode                PCRE2_SUFFIX(pcre2_serialize_encode_)
0877 #define pcre2_serialize_free                  PCRE2_SUFFIX(pcre2_serialize_free_)
0878 #define pcre2_serialize_get_number_of_codes   PCRE2_SUFFIX(pcre2_serialize_get_number_of_codes_)
0879 #define pcre2_set_bsr                         PCRE2_SUFFIX(pcre2_set_bsr_)
0880 #define pcre2_set_callout                     PCRE2_SUFFIX(pcre2_set_callout_)
0881 #define pcre2_set_character_tables            PCRE2_SUFFIX(pcre2_set_character_tables_)
0882 #define pcre2_set_compile_extra_options       PCRE2_SUFFIX(pcre2_set_compile_extra_options_)
0883 #define pcre2_set_compile_recursion_guard     PCRE2_SUFFIX(pcre2_set_compile_recursion_guard_)
0884 #define pcre2_set_depth_limit                 PCRE2_SUFFIX(pcre2_set_depth_limit_)
0885 #define pcre2_set_glob_escape                 PCRE2_SUFFIX(pcre2_set_glob_escape_)
0886 #define pcre2_set_glob_separator              PCRE2_SUFFIX(pcre2_set_glob_separator_)
0887 #define pcre2_set_heap_limit                  PCRE2_SUFFIX(pcre2_set_heap_limit_)
0888 #define pcre2_set_match_limit                 PCRE2_SUFFIX(pcre2_set_match_limit_)
0889 #define pcre2_set_max_pattern_length          PCRE2_SUFFIX(pcre2_set_max_pattern_length_)
0890 #define pcre2_set_newline                     PCRE2_SUFFIX(pcre2_set_newline_)
0891 #define pcre2_set_parens_nest_limit           PCRE2_SUFFIX(pcre2_set_parens_nest_limit_)
0892 #define pcre2_set_offset_limit                PCRE2_SUFFIX(pcre2_set_offset_limit_)
0893 #define pcre2_set_substitute_callout          PCRE2_SUFFIX(pcre2_set_substitute_callout_)
0894 #define pcre2_substitute                      PCRE2_SUFFIX(pcre2_substitute_)
0895 #define pcre2_substring_copy_byname           PCRE2_SUFFIX(pcre2_substring_copy_byname_)
0896 #define pcre2_substring_copy_bynumber         PCRE2_SUFFIX(pcre2_substring_copy_bynumber_)
0897 #define pcre2_substring_free                  PCRE2_SUFFIX(pcre2_substring_free_)
0898 #define pcre2_substring_get_byname            PCRE2_SUFFIX(pcre2_substring_get_byname_)
0899 #define pcre2_substring_get_bynumber          PCRE2_SUFFIX(pcre2_substring_get_bynumber_)
0900 #define pcre2_substring_length_byname         PCRE2_SUFFIX(pcre2_substring_length_byname_)
0901 #define pcre2_substring_length_bynumber       PCRE2_SUFFIX(pcre2_substring_length_bynumber_)
0902 #define pcre2_substring_list_get              PCRE2_SUFFIX(pcre2_substring_list_get_)
0903 #define pcre2_substring_list_free             PCRE2_SUFFIX(pcre2_substring_list_free_)
0904 #define pcre2_substring_nametable_scan        PCRE2_SUFFIX(pcre2_substring_nametable_scan_)
0905 #define pcre2_substring_number_from_name      PCRE2_SUFFIX(pcre2_substring_number_from_name_)
0906 
0907 /* Keep this old function name for backwards compatibility */
0908 #define pcre2_set_recursion_limit PCRE2_SUFFIX(pcre2_set_recursion_limit_)
0909 
0910 /* Keep this obsolete function for backwards compatibility: it is now a noop. */
0911 #define pcre2_set_recursion_memory_management PCRE2_SUFFIX(pcre2_set_recursion_memory_management_)
0912 
0913 /* Now generate all three sets of width-specific structures and function
0914 prototypes. */
0915 
0916 #define PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS \
0917 PCRE2_TYPES_LIST \
0918 PCRE2_STRUCTURE_LIST \
0919 PCRE2_GENERAL_INFO_FUNCTIONS \
0920 PCRE2_GENERAL_CONTEXT_FUNCTIONS \
0921 PCRE2_COMPILE_CONTEXT_FUNCTIONS \
0922 PCRE2_CONVERT_CONTEXT_FUNCTIONS \
0923 PCRE2_CONVERT_FUNCTIONS \
0924 PCRE2_MATCH_CONTEXT_FUNCTIONS \
0925 PCRE2_COMPILE_FUNCTIONS \
0926 PCRE2_PATTERN_INFO_FUNCTIONS \
0927 PCRE2_MATCH_FUNCTIONS \
0928 PCRE2_SUBSTRING_FUNCTIONS \
0929 PCRE2_SERIALIZE_FUNCTIONS \
0930 PCRE2_SUBSTITUTE_FUNCTION \
0931 PCRE2_JIT_FUNCTIONS \
0932 PCRE2_OTHER_FUNCTIONS
0933 
0934 #define PCRE2_LOCAL_WIDTH 8
0935 PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS
0936 #undef PCRE2_LOCAL_WIDTH
0937 
0938 #define PCRE2_LOCAL_WIDTH 16
0939 PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS
0940 #undef PCRE2_LOCAL_WIDTH
0941 
0942 #define PCRE2_LOCAL_WIDTH 32
0943 PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS
0944 #undef PCRE2_LOCAL_WIDTH
0945 
0946 /* Undefine the list macros; they are no longer needed. */
0947 
0948 #undef PCRE2_TYPES_LIST
0949 #undef PCRE2_STRUCTURE_LIST
0950 #undef PCRE2_GENERAL_INFO_FUNCTIONS
0951 #undef PCRE2_GENERAL_CONTEXT_FUNCTIONS
0952 #undef PCRE2_COMPILE_CONTEXT_FUNCTIONS
0953 #undef PCRE2_CONVERT_CONTEXT_FUNCTIONS
0954 #undef PCRE2_MATCH_CONTEXT_FUNCTIONS
0955 #undef PCRE2_COMPILE_FUNCTIONS
0956 #undef PCRE2_PATTERN_INFO_FUNCTIONS
0957 #undef PCRE2_MATCH_FUNCTIONS
0958 #undef PCRE2_SUBSTRING_FUNCTIONS
0959 #undef PCRE2_SERIALIZE_FUNCTIONS
0960 #undef PCRE2_SUBSTITUTE_FUNCTION
0961 #undef PCRE2_JIT_FUNCTIONS
0962 #undef PCRE2_OTHER_FUNCTIONS
0963 #undef PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS
0964 
0965 /* PCRE2_CODE_UNIT_WIDTH must be defined. If it is 8, 16, or 32, redefine
0966 PCRE2_SUFFIX to use it. If it is 0, undefine the other macros and make
0967 PCRE2_SUFFIX a no-op. Otherwise, generate an error. */
0968 
0969 #undef PCRE2_SUFFIX
0970 #ifndef PCRE2_CODE_UNIT_WIDTH
0971 #error PCRE2_CODE_UNIT_WIDTH must be defined before including pcre2.h.
0972 #error Use 8, 16, or 32; or 0 for a multi-width application.
0973 #else  /* PCRE2_CODE_UNIT_WIDTH is defined */
0974 #if PCRE2_CODE_UNIT_WIDTH == 8 || \
0975     PCRE2_CODE_UNIT_WIDTH == 16 || \
0976     PCRE2_CODE_UNIT_WIDTH == 32
0977 #define PCRE2_SUFFIX(a) PCRE2_GLUE(a, PCRE2_CODE_UNIT_WIDTH)
0978 #elif PCRE2_CODE_UNIT_WIDTH == 0
0979 #undef PCRE2_JOIN
0980 #undef PCRE2_GLUE
0981 #define PCRE2_SUFFIX(a) a
0982 #else
0983 #error PCRE2_CODE_UNIT_WIDTH must be 0, 8, 16, or 32.
0984 #endif
0985 #endif  /* PCRE2_CODE_UNIT_WIDTH is defined */
0986 
0987 #ifdef __cplusplus
0988 }  /* extern "C" */
0989 #endif
0990 
0991 #endif  /* PCRE2_H_IDEMPOTENT_GUARD */
0992 
0993 /* End of pcre2.h */