godot/thirdparty/pcre2/src/pcre2_internal.h

/*************************************************
*      Perl-Compatible Regular Expressions       *
*************************************************/

/* PCRE2 is a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language.

                       Written by Philip Hazel
     Original API code Copyright (c) 1997-2012 University of Cambridge
          New API code Copyright (c) 2016-2023 University of Cambridge

-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

    * Neither the name of the University of Cambridge nor the names of its
      contributors may be used to endorse or promote products derived from
      this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
*/

#ifndef PCRE2_INTERNAL_H_IDEMPOTENT_GUARD
#define PCRE2_INTERNAL_H_IDEMPOTENT_GUARD

/* We do not support both EBCDIC and Unicode at the same time. The "configure"
script prevents both being selected, but not everybody uses "configure". EBCDIC
is only supported for the 8-bit library, but the check for this has to be later
in this file, because the first part is not width-dependent, and is included by
pcre2test.c with CODE_UNIT_WIDTH == 0. */

#if defined EBCDIC && defined SUPPORT_UNICODE
#error The use of both EBCDIC and SUPPORT_UNICODE is not supported.
#endif

/* When compiling one of the libraries, the value of PCRE2_CODE_UNIT_WIDTH must
be 8, 16, or 32. AutoTools and CMake ensure that this is always the case, but
other other building methods may not, so here is a check. It is cut out when
building pcre2test, bcause that sets the value to zero. No other source should
be including this file. There is no explicit way of forcing a compile to be
abandoned, but trying to include a non-existent file seems cleanest. Otherwise
there will be many irrelevant consequential errors. */

#if (!defined PCRE2_BUILDING_PCRE2TEST && !defined PCRE2_DFTABLES) && \
  (!defined PCRE2_CODE_UNIT_WIDTH ||     \
    (PCRE2_CODE_UNIT_WIDTH != 8 &&       \
     PCRE2_CODE_UNIT_WIDTH != 16 &&      \
     PCRE2_CODE_UNIT_WIDTH != 32))
#error PCRE2_CODE_UNIT_WIDTH must be defined as 8, 16, or 32.
#include <AbandonCompile>
#endif


/* Standard C headers */

#include <ctype.h>
#include <limits.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* Macros to make boolean values more obvious. The #ifndef is to pacify
compiler warnings in environments where these macros are defined elsewhere.
Unfortunately, there is no way to do the same for the typedef. */

BOOL;
#ifndef FALSE
#define FALSE
#define TRUE
#endif

/* Valgrind (memcheck) support */

#ifdef SUPPORT_VALGRIND
#include <valgrind/memcheck.h>
#endif

/* -ftrivial-auto-var-init support supports initializing all local variables
to avoid some classes of bug, but this can cause an unacceptable slowdown
for large on-stack arrays in hot functions. This macro lets us annotate
such arrays. */

#ifdef HAVE_ATTRIBUTE_UNINITIALIZED
#define PCRE2_KEEP_UNINITIALIZED
#else
#define PCRE2_KEEP_UNINITIALIZED
#endif

/* Older versions of MSVC lack snprintf(). This define allows for
warning/error-free compilation and testing with MSVC compilers back to at least
MSVC 10/2010. Except for VC6 (which is missing some fundamentals and fails). */

#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf
#endif

/* When compiling a DLL for Windows, the exported symbols have to be declared
using some MS magic. I found some useful information on this web page:
http://msdn2.microsoft.com/en-us/library/y4h7bcy6(VS.80).aspx. According to the
information there, using __declspec(dllexport) without "extern" we have a
definition; with "extern" we have a declaration. The settings here override the
setting in pcre2.h (which is included below); it defines only PCRE2_EXP_DECL,
which is all that is needed for applications (they just import the symbols). We
use:

  PCRE2_EXP_DECL    for declarations
  PCRE2_EXP_DEFN    for definitions

The reason for wrapping this in #ifndef PCRE2_EXP_DECL is so that pcre2test,
which is an application, but needs to import this file in order to "peek" at
internals, can #include pcre2.h first to get an application's-eye view.

In principle, people compiling for non-Windows, non-Unix-like (i.e. uncommon,
special-purpose environments) might want to stick other stuff in front of
exported symbols. That's why, in the non-Windows case, we set PCRE2_EXP_DEFN
only if it is not already set. */

#ifndef PCRE2_EXP_DECL
#  ifdef _WIN32
#    ifndef PCRE2_STATIC
#define PCRE2_EXP_DECL
#define PCRE2_EXP_DEFN
#    else
#define PCRE2_EXP_DECL
#define PCRE2_EXP_DEFN
#    endif
#  else
#    ifdef __cplusplus
#define PCRE2_EXP_DECL
#    else
#define PCRE2_EXP_DECL
#    endif
#    ifndef PCRE2_EXP_DEFN
#define PCRE2_EXP_DEFN
#    endif
#  endif
#endif

/* Include the public PCRE2 header and the definitions of UCP character
property values. This must follow the setting of PCRE2_EXP_DECL above. */

#include "pcre2.h"
#include "pcre2_ucp.h"

/* When PCRE2 is compiled as a C++ library, the subject pointer can be replaced
with a custom type. This makes it possible, for example, to allow pcre2_match()
to process subject strings that are discontinuous by using a smart pointer
class. It must always be possible to inspect all of the subject string in
pcre2_match() because of the way it backtracks. */

/* WARNING: This is as yet untested for PCRE2. */

#ifdef CUSTOM_SUBJECT_PTR
#undef PCRE2_SPTR
#define PCRE2_SPTR
#endif

/* When checking for integer overflow, we need to handle large integers.
If a 64-bit integer type is available, we can use that.
Otherwise we have to cast to double, which of course requires floating point
arithmetic. Handle this by defining a macro for the appropriate type. */

#if defined INT64_MAX || defined int64_t
#define INT64_OR_DOUBLE
#else
#define INT64_OR_DOUBLE
#endif

/* External (in the C sense) functions and tables that are private to the
libraries are always referenced using the PRIV macro. This makes it possible
for pcre2test.c to include some of the source files from the libraries using a
different PRIV definition to avoid name clashes. It also makes it clear in the
code that a non-static object is being referenced. */

#ifndef PRIV
#define PRIV(name)
#endif

/* When compiling for use with the Virtual Pascal compiler, these functions
need to have their names changed. PCRE2 must be compiled with the -DVPCOMPAT
option on the command line. */

#ifdef VPCOMPAT
#define strlen
#define strncmp
#define memcmp
#define memcpy
#define memmove
#define memset
#else  /* VPCOMPAT */

/* Otherwise, to cope with SunOS4 and other systems that lack memmove(), define
a macro that calls an emulating function. */

#ifndef HAVE_MEMMOVE
#undef  memmove          /* Some systems may have a macro */
#define memmove(a, b, c)
#endif   /* not HAVE_MEMMOVE */
#endif   /* not VPCOMPAT */

/* This is an unsigned int value that no UTF character can ever have, as
Unicode doesn't go beyond 0x0010ffff. */

#define NOTACHAR

/* This is the largest valid UTF/Unicode code point. */

#define MAX_UTF_CODE_POINT

/* Compile-time positive error numbers (all except UTF errors, which are
negative) start at this value. It should probably never be changed, in case
some application is checking for specific numbers. There is a copy of this
#define in pcre2posix.c (which now no longer includes this file). Ideally, a
way of having a single definition should be found, but as the number is
unlikely to change, this is not a pressing issue. The original reason for
having a base other than 0 was to keep the absolute values of compile-time and
run-time error numbers numerically different, but in the event the code does
not rely on this. */

#define COMPILE_ERROR_BASE

/* The initial frames vector for remembering pcre2_match() backtracking points
is allocated on the heap, of this size (bytes) or ten times the frame size if
larger, unless the heap limit is smaller. Typical frame sizes are a few hundred
bytes (it depends on the number of capturing parentheses) so 20KiB handles
quite a few frames. A larger vector on the heap is obtained for matches that
need more frames, subject to the heap limit. */

#define START_FRAMES_SIZE

/* For DFA matching, an initial internal workspace vector is allocated on the
stack. The heap is used only if this turns out to be too small. */

#define DFA_START_RWS_SIZE

/* Define the default BSR convention. */

#ifdef BSR_ANYCRLF
#define BSR_DEFAULT
#else
#define BSR_DEFAULT
#endif


/* ---------------- Basic UTF-8 macros ---------------- */

/* These UTF-8 macros are always defined because they are used in pcre2test for
handling wide characters in 16-bit and 32-bit modes, even if an 8-bit library
is not supported. */

/* Tests whether a UTF-8 code point needs extra bytes to decode. */

#define HASUTF8EXTRALEN(c)

/* The following macros were originally written in the form of loops that used
data from the tables whose names start with PRIV(utf8_table). They were
rewritten by a user so as not to use loops, because in some environments this
gives a significant performance advantage, and it seems never to do any harm.
*/

/* Base macro to pick up the remaining bytes of a UTF-8 character, not
advancing the pointer. */

#define GETUTF8(c, eptr)

/* Base macro to pick up the remaining bytes of a UTF-8 character, advancing
the pointer. */

#define GETUTF8INC(c, eptr)

/* Base macro to pick up the remaining bytes of a UTF-8 character, not
advancing the pointer, incrementing the length. */

#define GETUTF8LEN(c, eptr, len)

/* --------------- Whitespace macros ---------------- */

/* Tests for Unicode horizontal and vertical whitespace characters must check a
number of different values. Using a switch statement for this generates the
fastest code (no loop, no memory access), and there are several places in the
interpreter code where this happens. In order to ensure that all the case lists
remain in step, we use macros so that there is only one place where the lists
are defined.

These values are also required as lists in pcre2_compile.c when processing \h,
\H, \v and \V in a character class. The lists are defined in pcre2_tables.c,
but macros that define the values are here so that all the definitions are
together. The lists must be in ascending character order, terminated by
NOTACHAR (which is 0xffffffff).

Any changes should ensure that the various macros are kept in step with each
other. NOTE: The values also appear in pcre2_jit_compile.c. */

/* -------------- ASCII/Unicode environments -------------- */

#ifndef EBCDIC

/* Character U+180E (Mongolian Vowel Separator) is not included in the list of
spaces in the Unicode file PropList.txt, and Perl does not recognize it as a
space. However, in many other sources it is listed as a space and has been in
PCRE (both APIs) for a long time. */

#define HSPACE_LIST

#define HSPACE_MULTIBYTE_CASES

#define HSPACE_BYTE_CASES

#define HSPACE_CASES

#define VSPACE_LIST

#define VSPACE_MULTIBYTE_CASES

#define VSPACE_BYTE_CASES

#define VSPACE_CASES

/* -------------- EBCDIC environments -------------- */

#else
#define HSPACE_LIST

#define HSPACE_BYTE_CASES

#define HSPACE_CASES

#ifdef EBCDIC_NL25
#define VSPACE_LIST
#else
#define VSPACE_LIST
#endif

#define VSPACE_BYTE_CASES

#define VSPACE_CASES
#endif  /* EBCDIC */

/* -------------- End of whitespace macros -------------- */


/* PCRE2 is able to support several different kinds of newline (CR, LF, CRLF,
"any" and "anycrlf" at present). The following macros are used to package up
testing for newlines. NLBLOCK, PSSTART, and PSEND are defined in the various
modules to indicate in which datablock the parameters exist, and what the
start/end of string field names are. */

#define NLTYPE_FIXED
#define NLTYPE_ANY
#define NLTYPE_ANYCRLF

/* This macro checks for a newline at the given position */

#define IS_NEWLINE(p)

/* This macro checks for a newline immediately preceding the given position */

#define WAS_NEWLINE(p)

/* Private flags containing information about the compiled pattern. The first
three must not be changed, because whichever is set is actually the number of
bytes in a code unit in that mode. */

#define PCRE2_MODE8
#define PCRE2_MODE16
#define PCRE2_MODE32
#define PCRE2_FIRSTSET
#define PCRE2_FIRSTCASELESS
#define PCRE2_FIRSTMAPSET
#define PCRE2_LASTSET
#define PCRE2_LASTCASELESS
#define PCRE2_STARTLINE
#define PCRE2_JCHANGED
#define PCRE2_HASCRORLF
#define PCRE2_HASTHEN
#define PCRE2_MATCH_EMPTY
#define PCRE2_BSR_SET
#define PCRE2_NL_SET
#define PCRE2_NOTEMPTY_SET
#define PCRE2_NE_ATST_SET
#define PCRE2_DEREF_TABLES
#define PCRE2_NOJIT
#define PCRE2_HASBKPORX
#define PCRE2_DUPCAPUSED
#define PCRE2_HASBKC
#define PCRE2_HASACCEPT

#define PCRE2_MODE_MASK

/* Values for the matchedby field in a match data block. */

enum {};           /* pcre2_jit_match() */

/* Values for the flags field in a match data block. */

#define PCRE2_MD_COPIED_SUBJECT

/* Magic number to provide a small check against being handed junk. */

#define MAGIC_NUMBER

/* The maximum remaining length of subject we are prepared to search for a
req_unit match from an anchored pattern. In 8-bit mode, memchr() is used and is
much faster than the search loop that has to be used in 16-bit and 32-bit
modes. */

#if PCRE2_CODE_UNIT_WIDTH == 8
#define REQ_CU_MAX
#else
#define REQ_CU_MAX
#endif

/* Offsets for the bitmap tables in the cbits set of tables. Each table
contains a set of bits for a class map. Some classes are built by combining
these tables. */

#define cbit_space
#define cbit_xdigit
#define cbit_digit
#define cbit_upper
#define cbit_lower
#define cbit_word
#define cbit_graph
#define cbit_print
#define cbit_punct
#define cbit_cntrl
#define cbit_length

/* Bit definitions for entries in the ctypes table. Do not change these values
without checking pcre2_jit_compile.c, which has an assertion to ensure that
ctype_word has the value 16. */

#define ctype_space
#define ctype_letter
#define ctype_lcletter
#define ctype_digit
#define ctype_word

/* Offsets of the various tables from the base tables pointer, and
total length of the tables. */

#define lcc_offset
#define fcc_offset
#define cbits_offset
#define ctypes_offset
#define TABLES_LENGTH


/* -------------------- Character and string names ------------------------ */

/* If PCRE2 is to support UTF-8 on EBCDIC platforms, we cannot use normal
character constants like '*' because the compiler would emit their EBCDIC code,
which is different from their ASCII/UTF-8 code. Instead we define macros for
the characters so that they always use the ASCII/UTF-8 code when UTF-8 support
is enabled. When UTF-8 support is not enabled, the definitions use character
literals. Both character and string versions of each character are needed, and
there are some longer strings as well.

This means that, on EBCDIC platforms, the PCRE2 library can handle either
EBCDIC, or UTF-8, but not both. To support both in the same compiled library
would need different lookups depending on whether PCRE2_UTF was set or not.
This would make it impossible to use characters in switch/case statements,
which would reduce performance. For a theoretical use (which nobody has asked
for) in a minority area (EBCDIC platforms), this is not sensible. Any
application that did need both could compile two versions of the library, using
macros to give the functions distinct names. */

#ifndef SUPPORT_UNICODE

/* UTF-8 support is not enabled; use the platform-dependent character literals
so that PCRE2 works in both ASCII and EBCDIC environments, but only in non-UTF
mode. Newline characters are problematic in EBCDIC. Though it has CR and LF
characters, a common practice has been to use its NL (0x15) character as the
line terminator in C-like processing environments. However, sometimes the LF
(0x25) character is used instead, according to this Unicode document:

http://unicode.org/standard/reports/tr13/tr13-5.html

PCRE2 defaults EBCDIC NL to 0x15, but has a build-time option to select 0x25
instead. Whichever is *not* chosen is defined as NEL.

In both ASCII and EBCDIC environments, CHAR_NL and CHAR_LF are synonyms for the
same code point. */

#ifdef EBCDIC

#ifndef EBCDIC_NL25
#define CHAR_NL
#define CHAR_NEL
#define STR_NL
#define STR_NEL
#else
#define CHAR_NL
#define CHAR_NEL
#define STR_NL
#define STR_NEL
#endif

#define CHAR_LF
#define STR_LF

#define CHAR_ESC
#define CHAR_DEL
#define CHAR_NBSP
#define STR_ESC
#define STR_DEL

#else  /* Not EBCDIC */

/* In ASCII/Unicode, linefeed is '\n' and we equate this to NL for
compatibility. NEL is the Unicode newline character; make sure it is
a positive value. */

#define CHAR_LF
#define CHAR_NL
#define CHAR_NEL
#define CHAR_ESC
#define CHAR_DEL
#define CHAR_NBSP

#define STR_LF
#define STR_NL
#define STR_NEL
#define STR_ESC
#define STR_DEL

#endif  /* EBCDIC */

/* The remaining definitions work in both environments. */

#define CHAR_NUL
#define CHAR_HT
#define CHAR_VT
#define CHAR_FF
#define CHAR_CR
#define CHAR_BS
#define CHAR_BEL

#define CHAR_SPACE
#define CHAR_EXCLAMATION_MARK
#define CHAR_QUOTATION_MARK
#define CHAR_NUMBER_SIGN
#define CHAR_DOLLAR_SIGN
#define CHAR_PERCENT_SIGN
#define CHAR_AMPERSAND
#define CHAR_APOSTROPHE
#define CHAR_LEFT_PARENTHESIS
#define CHAR_RIGHT_PARENTHESIS
#define CHAR_ASTERISK
#define CHAR_PLUS
#define CHAR_COMMA
#define CHAR_MINUS
#define CHAR_DOT
#define CHAR_SLASH
#define CHAR_0
#define CHAR_1
#define CHAR_2
#define CHAR_3
#define CHAR_4
#define CHAR_5
#define CHAR_6
#define CHAR_7
#define CHAR_8
#define CHAR_9
#define CHAR_COLON
#define CHAR_SEMICOLON
#define CHAR_LESS_THAN_SIGN
#define CHAR_EQUALS_SIGN
#define CHAR_GREATER_THAN_SIGN
#define CHAR_QUESTION_MARK
#define CHAR_COMMERCIAL_AT
#define CHAR_A
#define CHAR_B
#define CHAR_C
#define CHAR_D
#define CHAR_E
#define CHAR_F
#define CHAR_G
#define CHAR_H
#define CHAR_I
#define CHAR_J
#define CHAR_K
#define CHAR_L
#define CHAR_M
#define CHAR_N
#define CHAR_O
#define CHAR_P
#define CHAR_Q
#define CHAR_R
#define CHAR_S
#define CHAR_T
#define CHAR_U
#define CHAR_V
#define CHAR_W
#define CHAR_X
#define CHAR_Y
#define CHAR_Z
#define CHAR_LEFT_SQUARE_BRACKET
#define CHAR_BACKSLASH
#define CHAR_RIGHT_SQUARE_BRACKET
#define CHAR_CIRCUMFLEX_ACCENT
#define CHAR_UNDERSCORE
#define CHAR_GRAVE_ACCENT
#define CHAR_a
#define CHAR_b
#define CHAR_c
#define CHAR_d
#define CHAR_e
#define CHAR_f
#define CHAR_g
#define CHAR_h
#define CHAR_i
#define CHAR_j
#define CHAR_k
#define CHAR_l
#define CHAR_m
#define CHAR_n
#define CHAR_o
#define CHAR_p
#define CHAR_q
#define CHAR_r
#define CHAR_s
#define CHAR_t
#define CHAR_u
#define CHAR_v
#define CHAR_w
#define CHAR_x
#define CHAR_y
#define CHAR_z
#define CHAR_LEFT_CURLY_BRACKET
#define CHAR_VERTICAL_LINE
#define CHAR_RIGHT_CURLY_BRACKET
#define CHAR_TILDE

#define STR_HT
#define STR_VT
#define STR_FF
#define STR_CR
#define STR_BS
#define STR_BEL

#define STR_SPACE
#define STR_EXCLAMATION_MARK
#define STR_QUOTATION_MARK
#define STR_NUMBER_SIGN
#define STR_DOLLAR_SIGN
#define STR_PERCENT_SIGN
#define STR_AMPERSAND
#define STR_APOSTROPHE
#define STR_LEFT_PARENTHESIS
#define STR_RIGHT_PARENTHESIS
#define STR_ASTERISK
#define STR_PLUS
#define STR_COMMA
#define STR_MINUS
#define STR_DOT
#define STR_SLASH
#define STR_0
#define STR_1
#define STR_2
#define STR_3
#define STR_4
#define STR_5
#define STR_6
#define STR_7
#define STR_8
#define STR_9
#define STR_COLON
#define STR_SEMICOLON
#define STR_LESS_THAN_SIGN
#define STR_EQUALS_SIGN
#define STR_GREATER_THAN_SIGN
#define STR_QUESTION_MARK
#define STR_COMMERCIAL_AT
#define STR_A
#define STR_B
#define STR_C
#define STR_D
#define STR_E
#define STR_F
#define STR_G
#define STR_H
#define STR_I
#define STR_J
#define STR_K
#define STR_L
#define STR_M
#define STR_N
#define STR_O
#define STR_P
#define STR_Q
#define STR_R
#define STR_S
#define STR_T
#define STR_U
#define STR_V
#define STR_W
#define STR_X
#define STR_Y
#define STR_Z
#define STR_LEFT_SQUARE_BRACKET
#define STR_BACKSLASH
#define STR_RIGHT_SQUARE_BRACKET
#define STR_CIRCUMFLEX_ACCENT
#define STR_UNDERSCORE
#define STR_GRAVE_ACCENT
#define STR_a
#define STR_b
#define STR_c
#define STR_d
#define STR_e
#define STR_f
#define STR_g
#define STR_h
#define STR_i
#define STR_j
#define STR_k
#define STR_l
#define STR_m
#define STR_n
#define STR_o
#define STR_p
#define STR_q
#define STR_r
#define STR_s
#define STR_t
#define STR_u
#define STR_v
#define STR_w
#define STR_x
#define STR_y
#define STR_z
#define STR_LEFT_CURLY_BRACKET
#define STR_VERTICAL_LINE
#define STR_RIGHT_CURLY_BRACKET
#define STR_TILDE

#define STRING_ACCEPT0
#define STRING_COMMIT0
#define STRING_F0
#define STRING_FAIL0
#define STRING_MARK0
#define STRING_PRUNE0
#define STRING_SKIP0
#define STRING_THEN

#define STRING_atomic0
#define STRING_pla0
#define STRING_plb0
#define STRING_napla0
#define STRING_naplb0
#define STRING_nla0
#define STRING_nlb0
#define STRING_sr0
#define STRING_asr0
#define STRING_positive_lookahead0
#define STRING_positive_lookbehind0
#define STRING_non_atomic_positive_lookahead0
#define STRING_non_atomic_positive_lookbehind0
#define STRING_negative_lookahead0
#define STRING_negative_lookbehind0
#define STRING_script_run0
#define STRING_atomic_script_run

#define STRING_alpha0
#define STRING_lower0
#define STRING_upper0
#define STRING_alnum0
#define STRING_ascii0
#define STRING_blank0
#define STRING_cntrl0
#define STRING_digit0
#define STRING_graph0
#define STRING_print0
#define STRING_punct0
#define STRING_space0
#define STRING_word0
#define STRING_xdigit

#define STRING_DEFINE
#define STRING_VERSION
#define STRING_WEIRD_STARTWORD
#define STRING_WEIRD_ENDWORD

#define STRING_CR_RIGHTPAR
#define STRING_LF_RIGHTPAR
#define STRING_CRLF_RIGHTPAR
#define STRING_ANY_RIGHTPAR
#define STRING_ANYCRLF_RIGHTPAR
#define STRING_NUL_RIGHTPAR
#define STRING_BSR_ANYCRLF_RIGHTPAR
#define STRING_BSR_UNICODE_RIGHTPAR
#define STRING_UTF8_RIGHTPAR
#define STRING_UTF16_RIGHTPAR
#define STRING_UTF32_RIGHTPAR
#define STRING_UTF_RIGHTPAR
#define STRING_UCP_RIGHTPAR
#define STRING_NO_AUTO_POSSESS_RIGHTPAR
#define STRING_NO_DOTSTAR_ANCHOR_RIGHTPAR
#define STRING_NO_JIT_RIGHTPAR
#define STRING_NO_START_OPT_RIGHTPAR
#define STRING_NOTEMPTY_RIGHTPAR
#define STRING_NOTEMPTY_ATSTART_RIGHTPAR
#define STRING_LIMIT_HEAP_EQ
#define STRING_LIMIT_MATCH_EQ
#define STRING_LIMIT_DEPTH_EQ
#define STRING_LIMIT_RECURSION_EQ
#define STRING_MARK

#define STRING_bc
#define STRING_bidiclass
#define STRING_sc
#define STRING_script
#define STRING_scriptextensions
#define STRING_scx

#else  /* SUPPORT_UNICODE */

/* UTF-8 support is enabled; always use UTF-8 (=ASCII) character codes. This
works in both modes non-EBCDIC platforms, and on EBCDIC platforms in UTF-8 mode
only. */

#define CHAR_HT
#define CHAR_VT
#define CHAR_FF
#define CHAR_CR
#define CHAR_LF
#define CHAR_NL
#define CHAR_NEL
#define CHAR_BS
#define CHAR_BEL
#define CHAR_ESC
#define CHAR_DEL

#define CHAR_NUL
#define CHAR_SPACE
#define CHAR_EXCLAMATION_MARK
#define CHAR_QUOTATION_MARK
#define CHAR_NUMBER_SIGN
#define CHAR_DOLLAR_SIGN
#define CHAR_PERCENT_SIGN
#define CHAR_AMPERSAND
#define CHAR_APOSTROPHE
#define CHAR_LEFT_PARENTHESIS
#define CHAR_RIGHT_PARENTHESIS
#define CHAR_ASTERISK
#define CHAR_PLUS
#define CHAR_COMMA
#define CHAR_MINUS
#define CHAR_DOT
#define CHAR_SLASH
#define CHAR_0
#define CHAR_1
#define CHAR_2
#define CHAR_3
#define CHAR_4
#define CHAR_5
#define CHAR_6
#define CHAR_7
#define CHAR_8
#define CHAR_9
#define CHAR_COLON
#define CHAR_SEMICOLON
#define CHAR_LESS_THAN_SIGN
#define CHAR_EQUALS_SIGN
#define CHAR_GREATER_THAN_SIGN
#define CHAR_QUESTION_MARK
#define CHAR_COMMERCIAL_AT
#define CHAR_A
#define CHAR_B
#define CHAR_C
#define CHAR_D
#define CHAR_E
#define CHAR_F
#define CHAR_G
#define CHAR_H
#define CHAR_I
#define CHAR_J
#define CHAR_K
#define CHAR_L
#define CHAR_M
#define CHAR_N
#define CHAR_O
#define CHAR_P
#define CHAR_Q
#define CHAR_R
#define CHAR_S
#define CHAR_T
#define CHAR_U
#define CHAR_V
#define CHAR_W
#define CHAR_X
#define CHAR_Y
#define CHAR_Z
#define CHAR_LEFT_SQUARE_BRACKET
#define CHAR_BACKSLASH
#define CHAR_RIGHT_SQUARE_BRACKET
#define CHAR_CIRCUMFLEX_ACCENT
#define CHAR_UNDERSCORE
#define CHAR_GRAVE_ACCENT
#define CHAR_a
#define CHAR_b
#define CHAR_c
#define CHAR_d
#define CHAR_e
#define CHAR_f
#define CHAR_g
#define CHAR_h
#define CHAR_i
#define CHAR_j
#define CHAR_k
#define CHAR_l
#define CHAR_m
#define CHAR_n
#define CHAR_o
#define CHAR_p
#define CHAR_q
#define CHAR_r
#define CHAR_s
#define CHAR_t
#define CHAR_u
#define CHAR_v
#define CHAR_w
#define CHAR_x
#define CHAR_y
#define CHAR_z
#define CHAR_LEFT_CURLY_BRACKET
#define CHAR_VERTICAL_LINE
#define CHAR_RIGHT_CURLY_BRACKET
#define CHAR_TILDE
#define CHAR_NBSP

#define STR_HT
#define STR_VT
#define STR_FF
#define STR_CR
#define STR_NL
#define STR_BS
#define STR_BEL
#define STR_ESC
#define STR_DEL

#define STR_SPACE
#define STR_EXCLAMATION_MARK
#define STR_QUOTATION_MARK
#define STR_NUMBER_SIGN
#define STR_DOLLAR_SIGN
#define STR_PERCENT_SIGN
#define STR_AMPERSAND
#define STR_APOSTROPHE
#define STR_LEFT_PARENTHESIS
#define STR_RIGHT_PARENTHESIS
#define STR_ASTERISK
#define STR_PLUS
#define STR_COMMA
#define STR_MINUS
#define STR_DOT
#define STR_SLASH
#define STR_0
#define STR_1
#define STR_2
#define STR_3
#define STR_4
#define STR_5
#define STR_6
#define STR_7
#define STR_8
#define STR_9
#define STR_COLON
#define STR_SEMICOLON
#define STR_LESS_THAN_SIGN
#define STR_EQUALS_SIGN
#define STR_GREATER_THAN_SIGN
#define STR_QUESTION_MARK
#define STR_COMMERCIAL_AT
#define STR_A
#define STR_B
#define STR_C
#define STR_D
#define STR_E
#define STR_F
#define STR_G
#define STR_H
#define STR_I
#define STR_J
#define STR_K
#define STR_L
#define STR_M
#define STR_N
#define STR_O
#define STR_P
#define STR_Q
#define STR_R
#define STR_S
#define STR_T
#define STR_U
#define STR_V
#define STR_W
#define STR_X
#define STR_Y
#define STR_Z
#define STR_LEFT_SQUARE_BRACKET
#define STR_BACKSLASH
#define STR_RIGHT_SQUARE_BRACKET
#define STR_CIRCUMFLEX_ACCENT
#define STR_UNDERSCORE
#define STR_GRAVE_ACCENT
#define STR_a
#define STR_b
#define STR_c
#define STR_d
#define STR_e
#define STR_f
#define STR_g
#define STR_h
#define STR_i
#define STR_j
#define STR_k
#define STR_l
#define STR_m
#define STR_n
#define STR_o
#define STR_p
#define STR_q
#define STR_r
#define STR_s
#define STR_t
#define STR_u
#define STR_v
#define STR_w
#define STR_x
#define STR_y
#define STR_z
#define STR_LEFT_CURLY_BRACKET
#define STR_VERTICAL_LINE
#define STR_RIGHT_CURLY_BRACKET
#define STR_TILDE

#define STRING_ACCEPT0
#define STRING_COMMIT0
#define STRING_F0
#define STRING_FAIL0
#define STRING_MARK0
#define STRING_PRUNE0
#define STRING_SKIP0
#define STRING_THEN

#define STRING_atomic0
#define STRING_pla0
#define STRING_plb0
#define STRING_napla0
#define STRING_naplb0
#define STRING_nla0
#define STRING_nlb0
#define STRING_sr0
#define STRING_asr0
#define STRING_positive_lookahead0
#define STRING_positive_lookbehind0
#define STRING_non_atomic_positive_lookahead0
#define STRING_non_atomic_positive_lookbehind0
#define STRING_negative_lookahead0
#define STRING_negative_lookbehind0
#define STRING_script_run0
#define STRING_atomic_script_run

#define STRING_alpha0
#define STRING_lower0
#define STRING_upper0
#define STRING_alnum0
#define STRING_ascii0
#define STRING_blank0
#define STRING_cntrl0
#define STRING_digit0
#define STRING_graph0
#define STRING_print0
#define STRING_punct0
#define STRING_space0
#define STRING_word0
#define STRING_xdigit

#define STRING_DEFINE
#define STRING_VERSION
#define STRING_WEIRD_STARTWORD
#define STRING_WEIRD_ENDWORD

#define STRING_CR_RIGHTPAR
#define STRING_LF_RIGHTPAR
#define STRING_CRLF_RIGHTPAR
#define STRING_ANY_RIGHTPAR
#define STRING_ANYCRLF_RIGHTPAR
#define STRING_NUL_RIGHTPAR
#define STRING_BSR_ANYCRLF_RIGHTPAR
#define STRING_BSR_UNICODE_RIGHTPAR
#define STRING_UTF8_RIGHTPAR
#define STRING_UTF16_RIGHTPAR
#define STRING_UTF32_RIGHTPAR
#define STRING_UTF_RIGHTPAR
#define STRING_UCP_RIGHTPAR
#define STRING_NO_AUTO_POSSESS_RIGHTPAR
#define STRING_NO_DOTSTAR_ANCHOR_RIGHTPAR
#define STRING_NO_JIT_RIGHTPAR
#define STRING_NO_START_OPT_RIGHTPAR
#define STRING_NOTEMPTY_RIGHTPAR
#define STRING_NOTEMPTY_ATSTART_RIGHTPAR
#define STRING_LIMIT_HEAP_EQ
#define STRING_LIMIT_MATCH_EQ
#define STRING_LIMIT_DEPTH_EQ
#define STRING_LIMIT_RECURSION_EQ
#define STRING_MARK

#define STRING_bc
#define STRING_bidiclass
#define STRING_sc
#define STRING_script
#define STRING_scriptextensions
#define STRING_scx


#endif  /* SUPPORT_UNICODE */

/* -------------------- End of character and string names -------------------*/

/* -------------------- Definitions for compiled patterns -------------------*/

/* Codes for different types of Unicode property. If these definitions are
changed, the autopossessifying table in pcre2_auto_possess.c must be updated to
match. */

#define PT_ANY
#define PT_LAMP
#define PT_GC
#define PT_PC
#define PT_SC
#define PT_SCX
#define PT_ALNUM
#define PT_SPACE
#define PT_PXSPACE
#define PT_WORD
#define PT_CLIST
#define PT_UCNC
#define PT_BIDICL
#define PT_BOOL
#define PT_TABSIZE

/* The following special properties are used only in XCLASS items, when POSIX
classes are specified and PCRE2_UCP is set - in other words, for Unicode
handling of these classes. They are not available via the \p or \P escapes like
those in the above list, and so they do not take part in the autopossessifying
table. */

#define PT_PXGRAPH
#define PT_PXPRINT
#define PT_PXPUNCT
#define PT_PXXDIGIT

/* This value is used when parsing \p and \P escapes to indicate that neither
\p{script:...} nor \p{scx:...} has been encountered. */

#define PT_NOTSCRIPT

/* Flag bits and data types for the extended class (OP_XCLASS) for classes that
contain characters with values greater than 255. */

#define XCL_NOT
#define XCL_MAP
#define XCL_HASPROP

#define XCL_END
#define XCL_SINGLE
#define XCL_RANGE
#define XCL_PROP
#define XCL_NOTPROP

/* These are escaped items that aren't just an encoding of a particular data
value such as \n. They must have non-zero values, as check_escape() returns 0
for a data character. In the escapes[] table in pcre2_compile.c their values
are negated in order to distinguish them from data values.

They must appear here in the same order as in the opcode definitions below, up
to ESC_z. There's a dummy for OP_ALLANY because it corresponds to "." in DOTALL
mode rather than an escape sequence. It is also used for [^] in JavaScript
compatibility mode, and for \C in non-utf mode. In non-DOTALL mode, "." behaves
like \N.

ESC_ub is a special return from check_escape() when, in BSUX mode, \u{ is not
followed by hex digits and }, in which case it should mean a literal "u"
followed by a literal "{". This hack is necessary for cases like \u{ 12}
because without it, this is interpreted as u{12} now that spaces are allowed in
quantifiers.

Negative numbers are used to encode a backreference (\1, \2, \3, etc.) in
check_escape(). There are tests in the code for an escape greater than ESC_b
and less than ESC_Z to detect the types that may be repeated. These are the
types that consume characters. If any new escapes are put in between that don't
consume a character, that code will have to change. */

enum {};


/********************** Opcode definitions ******************/

/****** NOTE NOTE NOTE ******

Starting from 1 (i.e. after OP_END), the values up to OP_EOD must correspond in
order to the list of escapes immediately above. Furthermore, values up to
OP_DOLLM must not be changed without adjusting the table called autoposstab in
pcre2_auto_possess.c.

Whenever this list is updated, the two macro definitions that follow must be
updated to match. The possessification table called "opcode_possessify" in
pcre2_compile.c must also be updated, and also the tables called "coptable"
and "poptable" in pcre2_dfa_match.c.

****** NOTE NOTE NOTE ******/


/* The values between FIRST_AUTOTAB_OP and LAST_AUTOTAB_RIGHT_OP, inclusive,
are used in a table for deciding whether a repeated character type can be
auto-possessified. */

#define FIRST_AUTOTAB_OP
#define LAST_AUTOTAB_LEFT_OP
#define LAST_AUTOTAB_RIGHT_OP

enum {};

/* *** NOTE NOTE NOTE *** Whenever the list above is updated, the two macro
definitions that follow must also be updated to match. There are also tables
called "opcode_possessify" in pcre2_compile.c and "coptable" and "poptable" in
pcre2_dfa_match.c that must be updated. */


/* This macro defines textual names for all the opcodes. These are used only
for debugging, and some of them are only partial names. The macro is referenced
only in pcre2_printint.c, which fills out the full names in many cases (and in
some cases doesn't actually use these names at all). */

#define OP_NAME_LIST


/* This macro defines the length of fixed length operations in the compiled
regex. The lengths are used when searching for specific things, and also in the
debugging printing of a compiled regex. We use a macro so that it can be
defined close to the definitions of the opcodes themselves.

As things have been extended, some of these are no longer fixed lenths, but are
minima instead. For example, the length of a single-character repeat may vary
in UTF-8 mode. The code that uses this table must know about such things. */

#define OP_LENGTHS

/* A magic value for OP_RREF to indicate the "any recursion" condition. */

#define RREF_ANY


/* ---------- Private structures that are mode-independent. ---------- */

/* Structure to hold data for custom memory management. */

pcre2_memctl;

/* Structure for building a chain of open capturing subpatterns during
compiling, so that instructions to close them can be compiled when (*ACCEPT) is
encountered. */

open_capitem;

/* Layout of the UCP type table that translates property names into types and
codes. Each entry used to point directly to a name, but to reduce the number of
relocations in shared libraries, it now has an offset into a single string
instead. */

ucp_type_table;

/* Unicode character database (UCD) record format */

ucd_record;

/* UCD access macros */

#define UCD_BLOCK_SIZE
#define REAL_GET_UCD(ch)

#if PCRE2_CODE_UNIT_WIDTH == 32
#define GET_UCD
#else
#define GET_UCD(ch)
#endif

#define UCD_SCRIPTX_MASK
#define UCD_BIDICLASS_SHIFT
#define UCD_BPROPS_MASK

#define UCD_SCRIPTX_PROP(prop)
#define UCD_BIDICLASS_PROP(prop)
#define UCD_BPROPS_PROP(prop)

#define UCD_CHARTYPE(ch)
#define UCD_SCRIPT(ch)
#define UCD_CATEGORY(ch)
#define UCD_GRAPHBREAK(ch)
#define UCD_CASESET(ch)
#define UCD_OTHERCASE(ch)
#define UCD_SCRIPTX(ch)
#define UCD_BPROPS(ch)
#define UCD_BIDICLASS(ch)

/* The "scriptx" and bprops fields contain offsets into vectors of 32-bit words
that form a bitmap representing a list of scripts or boolean properties. These
macros test or set a bit in the map by number. */

#define MAPBIT(map,n)
#define MAPSET(map,n)

/* Header for serialized pcre2 codes. */

pcre2_serialized_data;



/* ----------------- Items that need PCRE2_CODE_UNIT_WIDTH ----------------- */

/* When this file is included by pcre2test, PCRE2_CODE_UNIT_WIDTH is defined as
0, so the following items are omitted. */

#if defined PCRE2_CODE_UNIT_WIDTH && PCRE2_CODE_UNIT_WIDTH != 0

/* EBCDIC is supported only for the 8-bit library. */

#if defined EBCDIC && PCRE2_CODE_UNIT_WIDTH != 8
#error EBCDIC is not supported for the 16-bit or 32-bit libraries
#endif

/* This is the largest non-UTF code point. */

#define MAX_NON_UTF_CHAR

/* Internal shared data tables and variables. These are used by more than one
of the exported public functions. They have to be "external" in the C sense,
but are not part of the PCRE2 public API. Although the data for some of them is
identical in all libraries, they must have different names so that multiple
libraries can be simultaneously linked to a single application. However, UTF-8
tables are needed only when compiling the 8-bit library. */

#if PCRE2_CODE_UNIT_WIDTH == 8
extern const int              PRIV(utf8_table1)[];
extern const int              PRIV(utf8_table1_size);
extern const int              PRIV(utf8_table2)[];
extern const int              PRIV(utf8_table3)[];
extern const uint8_t          PRIV(utf8_table4)[];
#endif

#define _pcre2_OP_lengths
#define _pcre2_callout_end_delims
#define _pcre2_callout_start_delims
#define _pcre2_default_compile_context
#define _pcre2_default_convert_context
#define _pcre2_default_match_context
#define _pcre2_default_tables
#if PCRE2_CODE_UNIT_WIDTH == 32
#define _pcre2_dummy_ucd_record
#endif
#define _pcre2_hspace_list
#define _pcre2_vspace_list
#define _pcre2_ucd_boolprop_sets
#define _pcre2_ucd_caseless_sets
#define _pcre2_ucd_digit_sets
#define _pcre2_ucd_script_sets
#define _pcre2_ucd_records
#define _pcre2_ucd_stage1
#define _pcre2_ucd_stage2
#define _pcre2_ucp_gbtable
#define _pcre2_ucp_gentype
#define _pcre2_ucp_typerange
#define _pcre2_unicode_version
#define _pcre2_utt
#define _pcre2_utt_names
#define _pcre2_utt_size

extern const uint8_t                   PRIV(OP_lengths)[];
extern const uint32_t                  PRIV(callout_end_delims)[];
extern const uint32_t                  PRIV(callout_start_delims)[];
extern const pcre2_compile_context     PRIV(default_compile_context);
extern const pcre2_convert_context     PRIV(default_convert_context);
extern const pcre2_match_context       PRIV(default_match_context);
extern const uint8_t                   PRIV(default_tables)[];
extern const uint32_t                  PRIV(hspace_list)[];
extern const uint32_t                  PRIV(vspace_list)[];
extern const uint32_t                  PRIV(ucd_boolprop_sets)[];
extern const uint32_t                  PRIV(ucd_caseless_sets)[];
extern const uint32_t                  PRIV(ucd_digit_sets)[];
extern const uint32_t                  PRIV(ucd_script_sets)[];
extern const ucd_record                PRIV(ucd_records)[];
#if PCRE2_CODE_UNIT_WIDTH == 32
extern const ucd_record                PRIV(dummy_ucd_record)[];
#endif
extern const uint16_t                  PRIV(ucd_stage1)[];
extern const uint16_t                  PRIV(ucd_stage2)[];
extern const uint32_t                  PRIV(ucp_gbtable)[];
extern const uint32_t                  PRIV(ucp_gentype)[];
#ifdef SUPPORT_JIT
extern const int                       PRIV(ucp_typerange)[];
#endif
extern const char                     *PRIV(unicode_version);
extern const ucp_type_table            PRIV(utt)[];
extern const char                      PRIV(utt_names)[];
extern const size_t                    PRIV(utt_size);

/* Mode-dependent macros and hidden and private structures are defined in a
separate file so that pcre2test can include them at all supported widths. When
compiling the library, PCRE2_CODE_UNIT_WIDTH will be defined, and we can
include them at the appropriate width, after setting up suffix macros for the
private structures. */

#define branch_chain
#define compile_block
#define dfa_match_block
#define match_block
#define named_group

#include "pcre2_intmodedep.h"

/* Private "external" functions. These are internal functions that are called
from modules other than the one in which they are defined. They have to be
"external" in the C sense, but are not part of the PCRE2 public API. They are
not referenced from pcre2test, and must not be defined when no code unit width
is available. */

#define _pcre2_auto_possessify
#define _pcre2_check_escape
#define _pcre2_extuni
#define _pcre2_find_bracket
#define _pcre2_is_newline
#define _pcre2_jit_free_rodata
#define _pcre2_jit_free
#define _pcre2_jit_get_size
#define _pcre2_jit_get_target
#define _pcre2_memctl_malloc
#define _pcre2_ord2utf
#define _pcre2_script_run
#define _pcre2_strcmp
#define _pcre2_strcmp_c8
#define _pcre2_strcpy_c8
#define _pcre2_strlen
#define _pcre2_strncmp
#define _pcre2_strncmp_c8
#define _pcre2_study
#define _pcre2_valid_utf
#define _pcre2_was_newline
#define _pcre2_xclass

extern int          _pcre2_auto_possessify(PCRE2_UCHAR *,
                      const compile_block *);
extern int          _pcre2_check_escape(PCRE2_SPTR *, PCRE2_SPTR, uint32_t *,
                      int *, uint32_t, uint32_t, BOOL, compile_block *);
extern PCRE2_SPTR   _pcre2_extuni(uint32_t, PCRE2_SPTR, PCRE2_SPTR, PCRE2_SPTR,
                      BOOL, int *);
extern PCRE2_SPTR   _pcre2_find_bracket(PCRE2_SPTR, BOOL, int);
extern BOOL         _pcre2_is_newline(PCRE2_SPTR, uint32_t, PCRE2_SPTR,
                      uint32_t *, BOOL);
extern void         _pcre2_jit_free_rodata(void *, void *);
extern void         _pcre2_jit_free(void *, pcre2_memctl *);
extern size_t       _pcre2_jit_get_size(void *);
const char *        _pcre2_jit_get_target(void);
extern void *       _pcre2_memctl_malloc(size_t, pcre2_memctl *);
extern unsigned int _pcre2_ord2utf(uint32_t, PCRE2_UCHAR *);
extern BOOL         _pcre2_script_run(PCRE2_SPTR, PCRE2_SPTR, BOOL);
extern int          _pcre2_strcmp(PCRE2_SPTR, PCRE2_SPTR);
extern int          _pcre2_strcmp_c8(PCRE2_SPTR, const char *);
extern PCRE2_SIZE   _pcre2_strcpy_c8(PCRE2_UCHAR *, const char *);
extern PCRE2_SIZE   _pcre2_strlen(PCRE2_SPTR);
extern int          _pcre2_strncmp(PCRE2_SPTR, PCRE2_SPTR, size_t);
extern int          _pcre2_strncmp_c8(PCRE2_SPTR, const char *, size_t);
extern int          _pcre2_study(pcre2_real_code *);
extern int          _pcre2_valid_utf(PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE *);
extern BOOL         _pcre2_was_newline(PCRE2_SPTR, uint32_t, PCRE2_SPTR,
                      uint32_t *, BOOL);
extern BOOL         _pcre2_xclass(uint32_t, PCRE2_SPTR, BOOL);

/* This function is needed only when memmove() is not available. */

#if !defined(VPCOMPAT) && !defined(HAVE_MEMMOVE)
#define _pcre2_memmove
extern void *       _pcre2_memmove(void *, const void *, size_t);
#endif

#endif  /* PCRE2_CODE_UNIT_WIDTH */

extern BOOL         PRIV(ckd_smul)(PCRE2_SIZE *, int, int);

#endif  /* PCRE2_INTERNAL_H_IDEMPOTENT_GUARD */

/* End of pcre2_internal.h */