#ifndef PCRE_INTERNAL_H
#define PCRE_INTERNAL_H
#if 0
#define PCRE_DEBUG
#endif
#if !defined COMPILE_PCRE16 && !defined COMPILE_PCRE32
#define COMPILE_PCRE8
#endif
#if defined SUPPORT_UCP && !(defined SUPPORT_UTF)
#define SUPPORT_UTF 1
#endif
#if defined SUPPORT_UTF8 && !(defined SUPPORT_UTF)
#define SUPPORT_UTF 1
#endif
#if defined SUPPORT_UTF && !(defined SUPPORT_UTF8)
#define SUPPORT_UTF8 1
#endif
#if defined EBCDIC && defined SUPPORT_UTF
#error The use of both EBCDIC and SUPPORT_UTF is not supported.
#endif
#undef DPRINTF
#ifdef PCRE_DEBUG
#define DPRINTF(p) printf p
#else
#define DPRINTF(p)
#endif
#include <ctype.h>
#include <limits.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef SUPPORT_VALGRIND
#include <valgrind/memcheck.h>
#endif
#ifndef PCRE_EXP_DECL
# ifdef _WIN32
# ifndef PCRE_STATIC
# define PCRE_EXP_DECL extern __declspec(dllexport)
# define PCRE_EXP_DEFN __declspec(dllexport)
# define PCRE_EXP_DATA_DEFN __declspec(dllexport)
# else
# define PCRE_EXP_DECL extern
# define PCRE_EXP_DEFN
# define PCRE_EXP_DATA_DEFN
# endif
# else
# ifdef __cplusplus
# define PCRE_EXP_DECL extern "C"
# else
# define PCRE_EXP_DECL extern
# endif
# ifndef PCRE_EXP_DEFN
# define PCRE_EXP_DEFN PCRE_EXP_DECL
# endif
# ifndef PCRE_EXP_DATA_DEFN
# define PCRE_EXP_DATA_DEFN
# endif
# endif
#endif
#ifndef PCRE_CALL_CONVENTION
#define PCRE_CALL_CONVENTION
#endif
typedef unsigned char pcre_uint8;
#if USHRT_MAX == 65535
typedef unsigned short pcre_uint16;
typedef short pcre_int16;
#define PCRE_UINT16_MAX USHRT_MAX
#define PCRE_INT16_MAX SHRT_MAX
#elif UINT_MAX == 65535
typedef unsigned int pcre_uint16;
typedef int pcre_int16;
#define PCRE_UINT16_MAX UINT_MAX
#define PCRE_INT16_MAX INT_MAX
#else
#error Cannot determine a type for 16-bit integers
#endif
#if UINT_MAX == 4294967295U
typedef unsigned int pcre_uint32;
typedef int pcre_int32;
#define PCRE_UINT32_MAX UINT_MAX
#define PCRE_INT32_MAX INT_MAX
#elif ULONG_MAX == 4294967295UL
typedef unsigned long int pcre_uint32;
typedef long int pcre_int32;
#define PCRE_UINT32_MAX ULONG_MAX
#define PCRE_INT32_MAX LONG_MAX
#else
#error Cannot determine a type for 32-bit integers
#endif
#if defined HAVE_STDINT_H
#include <stdint.h>
#elif defined HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#if defined INT64_MAX || defined int64_t
#define INT64_OR_DOUBLE int64_t
#else
#define INT64_OR_DOUBLE double
#endif
#if defined COMPILE_PCRE8
typedef unsigned char pcre_uchar;
#define IN_UCHARS(x) (x)
#define MAX_255(c) 1
#define TABLE_GET(c, table, default) ((table)[c])
#elif defined COMPILE_PCRE16
#if USHRT_MAX != 65535
#error Warning: PCRE_UCHAR16 is not a 16 bit data type.
#endif
typedef pcre_uint16 pcre_uchar;
#define UCHAR_SHIFT (1)
#define IN_UCHARS(x) ((x) << UCHAR_SHIFT)
#define MAX_255(c) ((c) <= 255u)
#define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))
#elif defined COMPILE_PCRE32
typedef pcre_uint32 pcre_uchar;
#define UCHAR_SHIFT (2)
#define IN_UCHARS(x) ((x) << UCHAR_SHIFT)
#define MAX_255(c) ((c) <= 255u)
#define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))
#else
#error Unsupported compiling mode
#endif
#define NOTACHAR 0xffffffff
#define NLTYPE_FIXED 0
#define NLTYPE_ANY 1
#define NLTYPE_ANYCRLF 2
#define IS_NEWLINE(p) \
((NLBLOCK->nltype != NLTYPE_FIXED)? \
((p) < NLBLOCK->PSEND && \
PRIV(is_newline)((p), NLBLOCK->nltype, NLBLOCK->PSEND, \
&(NLBLOCK->nllen), utf)) \
: \
((p) <= NLBLOCK->PSEND - NLBLOCK->nllen && \
UCHAR21TEST(p) == NLBLOCK->nl[0] && \
(NLBLOCK->nllen == 1 || UCHAR21TEST(p+1) == NLBLOCK->nl[1]) \
) \
)
#define WAS_NEWLINE(p) \
((NLBLOCK->nltype != NLTYPE_FIXED)? \
((p) > NLBLOCK->PSSTART && \
PRIV(was_newline)((p), NLBLOCK->nltype, NLBLOCK->PSSTART, \
&(NLBLOCK->nllen), utf)) \
: \
((p) >= NLBLOCK->PSSTART + NLBLOCK->nllen && \
UCHAR21TEST(p - NLBLOCK->nllen) == NLBLOCK->nl[0] && \
(NLBLOCK->nllen == 1 || UCHAR21TEST(p - NLBLOCK->nllen + 1) == NLBLOCK->nl[1]) \
) \
)
#ifdef CUSTOM_SUBJECT_PTR
#define PCRE_PUCHAR CUSTOM_SUBJECT_PTR
#else
#define PCRE_PUCHAR const pcre_uchar *
#endif
#include "pcre.h"
#include "ucp.h"
#ifdef COMPILE_PCRE32
typedef int __assert_pcre_uchar32_size[sizeof(PCRE_UCHAR32) == 4 ? 1 : -1];
#endif
#ifdef VPCOMPAT
#define strlen(s) _strlen(s)
#define strncmp(s1,s2,m) _strncmp(s1,s2,m)
#define memcmp(s,c,n) _memcmp(s,c,n)
#define memcpy(d,s,n) _memcpy(d,s,n)
#define memmove(d,s,n) _memmove(d,s,n)
#define memset(s,c,n) _memset(s,c,n)
#else
#ifndef HAVE_MEMMOVE
#undef memmove
#ifdef HAVE_BCOPY
#define memmove(a, b, c) bcopy(b, a, c)
#else
static void *
pcre_memmove(void *d, const void *s, size_t n)
{
size_t i;
unsigned char *dest = (unsigned char *)d;
const unsigned char *src = (const unsigned char *)s;
if (dest > src)
{
dest += n;
src += n;
for (i = 0; i < n; ++i) *(--dest) = *(--src);
return (void *)dest;
}
else
{
for (i = 0; i < n; ++i) *dest++ = *src++;
return (void *)(dest - n);
}
}
#define memmove(a, b, c) pcre_memmove(a, b, c)
#endif
#endif
#endif
#if defined COMPILE_PCRE8
#if LINK_SIZE == 2
#define PUT(a,n,d) \
(a[n] = (d) >> 8), \
(a[(n)+1] = (d) & 255)
#define GET(a,n) \
(((a)[n] << 8) | (a)[(n)+1])
#define MAX_PATTERN_SIZE (1 << 16)
#elif LINK_SIZE == 3
#define PUT(a,n,d) \
(a[n] = (d) >> 16), \
(a[(n)+1] = (d) >> 8), \
(a[(n)+2] = (d) & 255)
#define GET(a,n) \
(((a)[n] << 16) | ((a)[(n)+1] << 8) | (a)[(n)+2])
#define MAX_PATTERN_SIZE (1 << 24)
#elif LINK_SIZE == 4
#define PUT(a,n,d) \
(a[n] = (d) >> 24), \
(a[(n)+1] = (d) >> 16), \
(a[(n)+2] = (d) >> 8), \
(a[(n)+3] = (d) & 255)
#define GET(a,n) \
(((a)[n] << 24) | ((a)[(n)+1] << 16) | ((a)[(n)+2] << 8) | (a)[(n)+3])
#define MAX_PATTERN_SIZE (1 << 30)
#else
#error LINK_SIZE must be either 2, 3, or 4
#endif
#elif defined COMPILE_PCRE16
#if LINK_SIZE == 2
#undef LINK_SIZE
#define LINK_SIZE 1
#define PUT(a,n,d) \
(a[n] = (d))
#define GET(a,n) \
(a[n])
#define MAX_PATTERN_SIZE (1 << 16)
#elif LINK_SIZE == 3 || LINK_SIZE == 4
#undef LINK_SIZE
#define LINK_SIZE 2
#define PUT(a,n,d) \
(a[n] = (d) >> 16), \
(a[(n)+1] = (d) & 65535)
#define GET(a,n) \
(((a)[n] << 16) | (a)[(n)+1])
#define MAX_PATTERN_SIZE (1 << 30)
#else
#error LINK_SIZE must be either 2, 3, or 4
#endif
#elif defined COMPILE_PCRE32
#undef LINK_SIZE
#define LINK_SIZE 1
#define PUT(a,n,d) \
(a[n] = (d))
#define GET(a,n) \
(a[n])
#define MAX_PATTERN_SIZE (1 << 30)
#else
#error Unsupported compiling mode
#endif
#define PUTINC(a,n,d) PUT(a,n,d), a += LINK_SIZE
#if defined COMPILE_PCRE8
#define IMM2_SIZE 2
#define PUT2(a,n,d) \
a[n] = (d) >> 8; \
a[(n)+1] = (d) & 255
#define GET2(a,n) \
(unsigned int)(((a)[n] << 8) | (a)[(n)+1])
#elif defined COMPILE_PCRE16
#define IMM2_SIZE 1
#define PUT2(a,n,d) \
a[n] = d
#define GET2(a,n) \
a[n]
#elif defined COMPILE_PCRE32
#define IMM2_SIZE 1
#define PUT2(a,n,d) \
a[n] = d
#define GET2(a,n) \
a[n]
#else
#error Unsupported compiling mode
#endif
#define PUT2INC(a,n,d) PUT2(a,n,d), a += IMM2_SIZE
#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
#define MAX_MARK ((1u << 16) - 1)
#else
#define MAX_MARK ((1u << 8) - 1)
#endif
#define UCHAR21(eptr) (*(eptr))
#define UCHAR21TEST(eptr) (*(eptr))
#define UCHAR21INC(eptr) (*(eptr)++)
#define UCHAR21INCTEST(eptr) (*(eptr)++)
#ifndef SUPPORT_UTF
#define GETCHAR(c, eptr) c = *eptr;
#define GETCHARTEST(c, eptr) c = *eptr;
#define GETCHARINC(c, eptr) c = *eptr++;
#define GETCHARINCTEST(c, eptr) c = *eptr++;
#define GETCHARLEN(c, eptr, len) c = *eptr;
#else
#define HASUTF8EXTRALEN(c) ((c) >= 0xc0)
#define GETUTF8(c, eptr) \
{ \
if ((c & 0x20) == 0) \
c = ((c & 0x1f) << 6) | (eptr[1] & 0x3f); \
else if ((c & 0x10) == 0) \
c = ((c & 0x0f) << 12) | ((eptr[1] & 0x3f) << 6) | (eptr[2] & 0x3f); \
else if ((c & 0x08) == 0) \
c = ((c & 0x07) << 18) | ((eptr[1] & 0x3f) << 12) | \
((eptr[2] & 0x3f) << 6) | (eptr[3] & 0x3f); \
else if ((c & 0x04) == 0) \
c = ((c & 0x03) << 24) | ((eptr[1] & 0x3f) << 18) | \
((eptr[2] & 0x3f) << 12) | ((eptr[3] & 0x3f) << 6) | \
(eptr[4] & 0x3f); \
else \
c = ((c & 0x01) << 30) | ((eptr[1] & 0x3f) << 24) | \
((eptr[2] & 0x3f) << 18) | ((eptr[3] & 0x3f) << 12) | \
((eptr[4] & 0x3f) << 6) | (eptr[5] & 0x3f); \
}
#define GETUTF8INC(c, eptr) \
{ \
if ((c & 0x20) == 0) \
c = ((c & 0x1f) << 6) | (*eptr++ & 0x3f); \
else if ((c & 0x10) == 0) \
{ \
c = ((c & 0x0f) << 12) | ((*eptr & 0x3f) << 6) | (eptr[1] & 0x3f); \
eptr += 2; \
} \
else if ((c & 0x08) == 0) \
{ \
c = ((c & 0x07) << 18) | ((*eptr & 0x3f) << 12) | \
((eptr[1] & 0x3f) << 6) | (eptr[2] & 0x3f); \
eptr += 3; \
} \
else if ((c & 0x04) == 0) \
{ \
c = ((c & 0x03) << 24) | ((*eptr & 0x3f) << 18) | \
((eptr[1] & 0x3f) << 12) | ((eptr[2] & 0x3f) << 6) | \
(eptr[3] & 0x3f); \
eptr += 4; \
} \
else \
{ \
c = ((c & 0x01) << 30) | ((*eptr & 0x3f) << 24) | \
((eptr[1] & 0x3f) << 18) | ((eptr[2] & 0x3f) << 12) | \
((eptr[3] & 0x3f) << 6) | (eptr[4] & 0x3f); \
eptr += 5; \
} \
}
#if defined COMPILE_PCRE8
#define MAX_VALUE_FOR_SINGLE_CHAR 127
#define HAS_EXTRALEN(c) ((c) >= 0xc0)
#define GET_EXTRALEN(c) (PRIV(utf8_table4)[(c) & 0x3f])
#define NOT_FIRSTCHAR(c) (((c) & 0xc0) == 0x80)
#define GETCHAR(c, eptr) \
c = *eptr; \
if (c >= 0xc0) GETUTF8(c, eptr);
#define GETCHARTEST(c, eptr) \
c = *eptr; \
if (utf && c >= 0xc0) GETUTF8(c, eptr);
#define GETCHARINC(c, eptr) \
c = *eptr++; \
if (c >= 0xc0) GETUTF8INC(c, eptr);
#define GETCHARINCTEST(c, eptr) \
c = *eptr++; \
if (utf && c >= 0xc0) GETUTF8INC(c, eptr);
#define GETUTF8LEN(c, eptr, len) \
{ \
if ((c & 0x20) == 0) \
{ \
c = ((c & 0x1f) << 6) | (eptr[1] & 0x3f); \
len++; \
} \
else if ((c & 0x10) == 0) \
{ \
c = ((c & 0x0f) << 12) | ((eptr[1] & 0x3f) << 6) | (eptr[2] & 0x3f); \
len += 2; \
} \
else if ((c & 0x08) == 0) \
{\
c = ((c & 0x07) << 18) | ((eptr[1] & 0x3f) << 12) | \
((eptr[2] & 0x3f) << 6) | (eptr[3] & 0x3f); \
len += 3; \
} \
else if ((c & 0x04) == 0) \
{ \
c = ((c & 0x03) << 24) | ((eptr[1] & 0x3f) << 18) | \
((eptr[2] & 0x3f) << 12) | ((eptr[3] & 0x3f) << 6) | \
(eptr[4] & 0x3f); \
len += 4; \
} \
else \
{\
c = ((c & 0x01) << 30) | ((eptr[1] & 0x3f) << 24) | \
((eptr[2] & 0x3f) << 18) | ((eptr[3] & 0x3f) << 12) | \
((eptr[4] & 0x3f) << 6) | (eptr[5] & 0x3f); \
len += 5; \
} \
}
#define GETCHARLEN(c, eptr, len) \
c = *eptr; \
if (c >= 0xc0) GETUTF8LEN(c, eptr, len);
#define GETCHARLENTEST(c, eptr, len) \
c = *eptr; \
if (utf && c >= 0xc0) GETUTF8LEN(c, eptr, len);
#define BACKCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr--
#define FORWARDCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr++
#define ACROSSCHAR(condition, eptr, action) \
while((condition) && ((eptr) & 0xc0) == 0x80) action
#elif defined COMPILE_PCRE16
#define MAX_VALUE_FOR_SINGLE_CHAR 65535
#define HAS_EXTRALEN(c) (((c) & 0xfc00) == 0xd800)
#define GET_EXTRALEN(c) 1
#define NOT_FIRSTCHAR(c) (((c) & 0xfc00) == 0xdc00)
#define GETUTF16(c, eptr) \
{ c = (((c & 0x3ff) << 10) | (eptr[1] & 0x3ff)) + 0x10000; }
#define GETCHAR(c, eptr) \
c = *eptr; \
if ((c & 0xfc00) == 0xd800) GETUTF16(c, eptr);
#define GETCHARTEST(c, eptr) \
c = *eptr; \
if (utf && (c & 0xfc00) == 0xd800) GETUTF16(c, eptr);
#define GETUTF16INC(c, eptr) \
{ c = (((c & 0x3ff) << 10) | (*eptr++ & 0x3ff)) + 0x10000; }
#define GETCHARINC(c, eptr) \
c = *eptr++; \
if ((c & 0xfc00) == 0xd800) GETUTF16INC(c, eptr);
#define GETCHARINCTEST(c, eptr) \
c = *eptr++; \
if (utf && (c & 0xfc00) == 0xd800) GETUTF16INC(c, eptr);
#define GETUTF16LEN(c, eptr, len) \
{ c = (((c & 0x3ff) << 10) | (eptr[1] & 0x3ff)) + 0x10000; len++; }
#define GETCHARLEN(c, eptr, len) \
c = *eptr; \
if ((c & 0xfc00) == 0xd800) GETUTF16LEN(c, eptr, len);
#define GETCHARLENTEST(c, eptr, len) \
c = *eptr; \
if (utf && (c & 0xfc00) == 0xd800) GETUTF16LEN(c, eptr, len);
#define BACKCHAR(eptr) if ((*eptr & 0xfc00) == 0xdc00) eptr--
#define FORWARDCHAR(eptr) if ((*eptr & 0xfc00) == 0xdc00) eptr++
#define ACROSSCHAR(condition, eptr, action) \
if ((condition) && ((eptr) & 0xfc00) == 0xdc00) action
#elif defined COMPILE_PCRE32
#define MAX_VALUE_FOR_SINGLE_CHAR (0x10ffffu)
#define HAS_EXTRALEN(c) (0)
#define GET_EXTRALEN(c) (0)
#define NOT_FIRSTCHAR(c) (0)
#define GETCHAR(c, eptr) \
c = *(eptr);
#define GETCHARTEST(c, eptr) \
c = *(eptr);
#define GETCHARINC(c, eptr) \
c = *((eptr)++);
#define GETCHARINCTEST(c, eptr) \
c = *((eptr)++);
#define GETCHARLEN(c, eptr, len) \
GETCHAR(c, eptr)
#define GETCHARLENTEST(c, eptr, len) \
GETCHARTEST(c, eptr)
#define BACKCHAR(eptr) do { } while (0)
#define FORWARDCHAR(eptr) do { } while (0)
#define ACROSSCHAR(condition, eptr, action) do { } while (0)
#else
#error Unsupported compiling mode
#endif
#endif
#ifndef EBCDIC
#define HSPACE_LIST \
CHAR_HT, CHAR_SPACE, CHAR_NBSP, \
0x1680, 0x180e, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, \
0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202f, 0x205f, 0x3000, \
NOTACHAR
#define HSPACE_MULTIBYTE_CASES \
case 0x1680: \
case 0x180e: \
case 0x2000: \
case 0x2001: \
case 0x2002: \
case 0x2003: \
case 0x2004: \
case 0x2005: \
case 0x2006: \
case 0x2007: \
case 0x2008: \
case 0x2009: \
case 0x200A: \
case 0x202f: \
case 0x205f: \
case 0x3000
#define HSPACE_BYTE_CASES \
case CHAR_HT: \
case CHAR_SPACE: \
case CHAR_NBSP
#define HSPACE_CASES \
HSPACE_BYTE_CASES: \
HSPACE_MULTIBYTE_CASES
#define VSPACE_LIST \
CHAR_LF, CHAR_VT, CHAR_FF, CHAR_CR, CHAR_NEL, 0x2028, 0x2029, NOTACHAR
#define VSPACE_MULTIBYTE_CASES \
case 0x2028: \
case 0x2029
#define VSPACE_BYTE_CASES \
case CHAR_LF: \
case CHAR_VT: \
case CHAR_FF: \
case CHAR_CR: \
case CHAR_NEL
#define VSPACE_CASES \
VSPACE_BYTE_CASES: \
VSPACE_MULTIBYTE_CASES
#else
#define HSPACE_LIST CHAR_HT, CHAR_SPACE, CHAR_NBSP, NOTACHAR
#define HSPACE_BYTE_CASES \
case CHAR_HT: \
case CHAR_SPACE: \
case CHAR_NBSP
#define HSPACE_CASES HSPACE_BYTE_CASES
#ifdef EBCDIC_NL25
#define VSPACE_LIST \
CHAR_VT, CHAR_FF, CHAR_CR, CHAR_NEL, CHAR_LF, NOTACHAR
#else
#define VSPACE_LIST \
CHAR_VT, CHAR_FF, CHAR_CR, CHAR_LF, CHAR_NEL, NOTACHAR
#endif
#define VSPACE_BYTE_CASES \
case CHAR_LF: \
case CHAR_VT: \
case CHAR_FF: \
case CHAR_CR: \
case CHAR_NEL
#define VSPACE_CASES VSPACE_BYTE_CASES
#endif
#define PCRE_MODE8 0x00000001
#define PCRE_MODE16 0x00000002
#define PCRE_MODE32 0x00000004
#define PCRE_FIRSTSET 0x00000010
#define PCRE_FCH_CASELESS 0x00000020
#define PCRE_REQCHSET 0x00000040
#define PCRE_RCH_CASELESS 0x00000080
#define PCRE_STARTLINE 0x00000100
#define PCRE_NOPARTIAL 0x00000200
#define PCRE_JCHANGED 0x00000400
#define PCRE_HASCRORLF 0x00000800
#define PCRE_HASTHEN 0x00001000
#define PCRE_MLSET 0x00002000
#define PCRE_RLSET 0x00004000
#define PCRE_MATCH_EMPTY 0x00008000
#if defined COMPILE_PCRE8
#define PCRE_MODE PCRE_MODE8
#elif defined COMPILE_PCRE16
#define PCRE_MODE PCRE_MODE16
#elif defined COMPILE_PCRE32
#define PCRE_MODE PCRE_MODE32
#endif
#define PCRE_MODE_MASK (PCRE_MODE8 | PCRE_MODE16 | PCRE_MODE32)
#define PCRE_STUDY_MAPPED 0x0001
#define PCRE_STUDY_MINLEN 0x0002
#define PCRE_NEWLINE_BITS (PCRE_NEWLINE_CR|PCRE_NEWLINE_LF|PCRE_NEWLINE_ANY| \
PCRE_NEWLINE_ANYCRLF)
#define PUBLIC_COMPILE_OPTIONS \
(PCRE_CASELESS|PCRE_EXTENDED|PCRE_ANCHORED|PCRE_MULTILINE| \
PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY|PCRE_UTF8| \
PCRE_NO_AUTO_CAPTURE|PCRE_NO_AUTO_POSSESS| \
PCRE_NO_UTF8_CHECK|PCRE_AUTO_CALLOUT|PCRE_FIRSTLINE| \
PCRE_DUPNAMES|PCRE_NEWLINE_BITS|PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE| \
PCRE_JAVASCRIPT_COMPAT|PCRE_UCP|PCRE_NO_START_OPTIMIZE|PCRE_NEVER_UTF)
#define PUBLIC_EXEC_OPTIONS \
(PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NOTEMPTY_ATSTART| \
PCRE_NO_UTF8_CHECK|PCRE_PARTIAL_HARD|PCRE_PARTIAL_SOFT|PCRE_NEWLINE_BITS| \
PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE|PCRE_NO_START_OPTIMIZE)
#define PUBLIC_DFA_EXEC_OPTIONS \
(PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NOTEMPTY_ATSTART| \
PCRE_NO_UTF8_CHECK|PCRE_PARTIAL_HARD|PCRE_PARTIAL_SOFT|PCRE_DFA_SHORTEST| \
PCRE_DFA_RESTART|PCRE_NEWLINE_BITS|PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE| \
PCRE_NO_START_OPTIMIZE)
#define PUBLIC_STUDY_OPTIONS \
(PCRE_STUDY_JIT_COMPILE|PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE| \
PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE|PCRE_STUDY_EXTRA_NEEDED)
#define PUBLIC_JIT_EXEC_OPTIONS \
(PCRE_NO_UTF8_CHECK|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|\
PCRE_NOTEMPTY_ATSTART|PCRE_PARTIAL_SOFT|PCRE_PARTIAL_HARD)
#define MAGIC_NUMBER 0x50435245UL
#define REVERSED_MAGIC_NUMBER 0x45524350UL
#define REQ_BYTE_MAX 1000
typedef int BOOL;
#ifndef FALSE
#define FALSE 0
#define TRUE 1
#endif
#ifndef SUPPORT_UTF
#ifdef EBCDIC
#ifndef EBCDIC_NL25
#define CHAR_NL '\x15'
#define CHAR_NEL '\x25'
#define STR_NL "\x15"
#define STR_NEL "\x25"
#else
#define CHAR_NL '\x25'
#define CHAR_NEL '\x15'
#define STR_NL "\x25"
#define STR_NEL "\x15"
#endif
#define CHAR_LF CHAR_NL
#define STR_LF STR_NL
#define CHAR_ESC '\047'
#define CHAR_DEL '\007'
#define CHAR_NBSP '\x41'
#define STR_ESC "\047"
#define STR_DEL "\007"
#else
#define CHAR_LF '\n'
#define CHAR_NL CHAR_LF
#define CHAR_NEL ((unsigned char)'\x85')
#define CHAR_ESC '\033'
#define CHAR_DEL '\177'
#define CHAR_NBSP ((unsigned char)'\xa0')
#define STR_LF "\n"
#define STR_NL STR_LF
#define STR_NEL "\x85"
#define STR_ESC "\033"
#define STR_DEL "\177"
#endif
#define CHAR_NULL '\0'
#define CHAR_HT '\t'
#define CHAR_VT '\v'
#define CHAR_FF '\f'
#define CHAR_CR '\r'
#define CHAR_BS '\b'
#define CHAR_BEL '\a'
#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 '0'
#define CHAR_1 '1'
#define CHAR_2 '2'
#define CHAR_3 '3'
#define CHAR_4 '4'
#define CHAR_5 '5'
#define CHAR_6 '6'
#define CHAR_7 '7'
#define CHAR_8 '8'
#define CHAR_9 '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 'A'
#define CHAR_B 'B'
#define CHAR_C 'C'
#define CHAR_D 'D'
#define CHAR_E 'E'
#define CHAR_F 'F'
#define CHAR_G 'G'
#define CHAR_H 'H'
#define CHAR_I 'I'
#define CHAR_J 'J'
#define CHAR_K 'K'
#define CHAR_L 'L'
#define CHAR_M 'M'
#define CHAR_N 'N'
#define CHAR_O 'O'
#define CHAR_P 'P'
#define CHAR_Q 'Q'
#define CHAR_R 'R'
#define CHAR_S 'S'
#define CHAR_T 'T'
#define CHAR_U 'U'
#define CHAR_V 'V'
#define CHAR_W 'W'
#define CHAR_X 'X'
#define CHAR_Y 'Y'
#define CHAR_Z '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 'a'
#define CHAR_b 'b'
#define CHAR_c 'c'
#define CHAR_d 'd'
#define CHAR_e 'e'
#define CHAR_f 'f'
#define CHAR_g 'g'
#define CHAR_h 'h'
#define CHAR_i 'i'
#define CHAR_j 'j'
#define CHAR_k 'k'
#define CHAR_l 'l'
#define CHAR_m 'm'
#define CHAR_n 'n'
#define CHAR_o 'o'
#define CHAR_p 'p'
#define CHAR_q 'q'
#define CHAR_r 'r'
#define CHAR_s 's'
#define CHAR_t 't'
#define CHAR_u 'u'
#define CHAR_v 'v'
#define CHAR_w 'w'
#define CHAR_x 'x'
#define CHAR_y 'y'
#define CHAR_z 'z'
#define CHAR_LEFT_CURLY_BRACKET '{'
#define CHAR_VERTICAL_LINE '|'
#define CHAR_RIGHT_CURLY_BRACKET '}'
#define CHAR_TILDE '~'
#define STR_HT "\t"
#define STR_VT "\v"
#define STR_FF "\f"
#define STR_CR "\r"
#define STR_BS "\b"
#define STR_BEL "\a"
#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 "0"
#define STR_1 "1"
#define STR_2 "2"
#define STR_3 "3"
#define STR_4 "4"
#define STR_5 "5"
#define STR_6 "6"
#define STR_7 "7"
#define STR_8 "8"
#define STR_9 "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 "A"
#define STR_B "B"
#define STR_C "C"
#define STR_D "D"
#define STR_E "E"
#define STR_F "F"
#define STR_G "G"
#define STR_H "H"
#define STR_I "I"
#define STR_J "J"
#define STR_K "K"
#define STR_L "L"
#define STR_M "M"
#define STR_N "N"
#define STR_O "O"
#define STR_P "P"
#define STR_Q "Q"
#define STR_R "R"
#define STR_S "S"
#define STR_T "T"
#define STR_U "U"
#define STR_V "V"
#define STR_W "W"
#define STR_X "X"
#define STR_Y "Y"
#define STR_Z "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 "a"
#define STR_b "b"
#define STR_c "c"
#define STR_d "d"
#define STR_e "e"
#define STR_f "f"
#define STR_g "g"
#define STR_h "h"
#define STR_i "i"
#define STR_j "j"
#define STR_k "k"
#define STR_l "l"
#define STR_m "m"
#define STR_n "n"
#define STR_o "o"
#define STR_p "p"
#define STR_q "q"
#define STR_r "r"
#define STR_s "s"
#define STR_t "t"
#define STR_u "u"
#define STR_v "v"
#define STR_w "w"
#define STR_x "x"
#define STR_y "y"
#define STR_z "z"
#define STR_LEFT_CURLY_BRACKET "{"
#define STR_VERTICAL_LINE "|"
#define STR_RIGHT_CURLY_BRACKET "}"
#define STR_TILDE "~"
#define STRING_ACCEPT0 "ACCEPT\0"
#define STRING_COMMIT0 "COMMIT\0"
#define STRING_F0 "F\0"
#define STRING_FAIL0 "FAIL\0"
#define STRING_MARK0 "MARK\0"
#define STRING_PRUNE0 "PRUNE\0"
#define STRING_SKIP0 "SKIP\0"
#define STRING_THEN "THEN"
#define STRING_alpha0 "alpha\0"
#define STRING_lower0 "lower\0"
#define STRING_upper0 "upper\0"
#define STRING_alnum0 "alnum\0"
#define STRING_ascii0 "ascii\0"
#define STRING_blank0 "blank\0"
#define STRING_cntrl0 "cntrl\0"
#define STRING_digit0 "digit\0"
#define STRING_graph0 "graph\0"
#define STRING_print0 "print\0"
#define STRING_punct0 "punct\0"
#define STRING_space0 "space\0"
#define STRING_word0 "word\0"
#define STRING_xdigit "xdigit"
#define STRING_DEFINE "DEFINE"
#define STRING_WEIRD_STARTWORD "[:<:]]"
#define STRING_WEIRD_ENDWORD "[:>:]]"
#define STRING_CR_RIGHTPAR "CR)"
#define STRING_LF_RIGHTPAR "LF)"
#define STRING_CRLF_RIGHTPAR "CRLF)"
#define STRING_ANY_RIGHTPAR "ANY)"
#define STRING_ANYCRLF_RIGHTPAR "ANYCRLF)"
#define STRING_BSR_ANYCRLF_RIGHTPAR "BSR_ANYCRLF)"
#define STRING_BSR_UNICODE_RIGHTPAR "BSR_UNICODE)"
#define STRING_UTF8_RIGHTPAR "UTF8)"
#define STRING_UTF16_RIGHTPAR "UTF16)"
#define STRING_UTF32_RIGHTPAR "UTF32)"
#define STRING_UTF_RIGHTPAR "UTF)"
#define STRING_UCP_RIGHTPAR "UCP)"
#define STRING_NO_AUTO_POSSESS_RIGHTPAR "NO_AUTO_POSSESS)"
#define STRING_NO_START_OPT_RIGHTPAR "NO_START_OPT)"
#define STRING_LIMIT_MATCH_EQ "LIMIT_MATCH="
#define STRING_LIMIT_RECURSION_EQ "LIMIT_RECURSION="
#else
#define CHAR_HT '\011'
#define CHAR_VT '\013'
#define CHAR_FF '\014'
#define CHAR_CR '\015'
#define CHAR_LF '\012'
#define CHAR_NL CHAR_LF
#define CHAR_NEL ((unsigned char)'\x85')
#define CHAR_BS '\010'
#define CHAR_BEL '\007'
#define CHAR_ESC '\033'
#define CHAR_DEL '\177'
#define CHAR_NULL '\0'
#define CHAR_SPACE '\040'
#define CHAR_EXCLAMATION_MARK '\041'
#define CHAR_QUOTATION_MARK '\042'
#define CHAR_NUMBER_SIGN '\043'
#define CHAR_DOLLAR_SIGN '\044'
#define CHAR_PERCENT_SIGN '\045'
#define CHAR_AMPERSAND '\046'
#define CHAR_APOSTROPHE '\047'
#define CHAR_LEFT_PARENTHESIS '\050'
#define CHAR_RIGHT_PARENTHESIS '\051'
#define CHAR_ASTERISK '\052'
#define CHAR_PLUS '\053'
#define CHAR_COMMA '\054'
#define CHAR_MINUS '\055'
#define CHAR_DOT '\056'
#define CHAR_SLASH '\057'
#define CHAR_0 '\060'
#define CHAR_1 '\061'
#define CHAR_2 '\062'
#define CHAR_3 '\063'
#define CHAR_4 '\064'
#define CHAR_5 '\065'
#define CHAR_6 '\066'
#define CHAR_7 '\067'
#define CHAR_8 '\070'
#define CHAR_9 '\071'
#define CHAR_COLON '\072'
#define CHAR_SEMICOLON '\073'
#define CHAR_LESS_THAN_SIGN '\074'
#define CHAR_EQUALS_SIGN '\075'
#define CHAR_GREATER_THAN_SIGN '\076'
#define CHAR_QUESTION_MARK '\077'
#define CHAR_COMMERCIAL_AT '\100'
#define CHAR_A '\101'
#define CHAR_B '\102'
#define CHAR_C '\103'
#define CHAR_D '\104'
#define CHAR_E '\105'
#define CHAR_F '\106'
#define CHAR_G '\107'
#define CHAR_H '\110'
#define CHAR_I '\111'
#define CHAR_J '\112'
#define CHAR_K '\113'
#define CHAR_L '\114'
#define CHAR_M '\115'
#define CHAR_N '\116'
#define CHAR_O '\117'
#define CHAR_P '\120'
#define CHAR_Q '\121'
#define CHAR_R '\122'
#define CHAR_S '\123'
#define CHAR_T '\124'
#define CHAR_U '\125'
#define CHAR_V '\126'
#define CHAR_W '\127'
#define CHAR_X '\130'
#define CHAR_Y '\131'
#define CHAR_Z '\132'
#define CHAR_LEFT_SQUARE_BRACKET '\133'
#define CHAR_BACKSLASH '\134'
#define CHAR_RIGHT_SQUARE_BRACKET '\135'
#define CHAR_CIRCUMFLEX_ACCENT '\136'
#define CHAR_UNDERSCORE '\137'
#define CHAR_GRAVE_ACCENT '\140'
#define CHAR_a '\141'
#define CHAR_b '\142'
#define CHAR_c '\143'
#define CHAR_d '\144'
#define CHAR_e '\145'
#define CHAR_f '\146'
#define CHAR_g '\147'
#define CHAR_h '\150'
#define CHAR_i '\151'
#define CHAR_j '\152'
#define CHAR_k '\153'
#define CHAR_l '\154'
#define CHAR_m '\155'
#define CHAR_n '\156'
#define CHAR_o '\157'
#define CHAR_p '\160'
#define CHAR_q '\161'
#define CHAR_r '\162'
#define CHAR_s '\163'
#define CHAR_t '\164'
#define CHAR_u '\165'
#define CHAR_v '\166'
#define CHAR_w '\167'
#define CHAR_x '\170'
#define CHAR_y '\171'
#define CHAR_z '\172'
#define CHAR_LEFT_CURLY_BRACKET '\173'
#define CHAR_VERTICAL_LINE '\174'
#define CHAR_RIGHT_CURLY_BRACKET '\175'
#define CHAR_TILDE '\176'
#define CHAR_NBSP ((unsigned char)'\xa0')
#define STR_HT "\011"
#define STR_VT "\013"
#define STR_FF "\014"
#define STR_CR "\015"
#define STR_NL "\012"
#define STR_BS "\010"
#define STR_BEL "\007"
#define STR_ESC "\033"
#define STR_DEL "\177"
#define STR_SPACE "\040"
#define STR_EXCLAMATION_MARK "\041"
#define STR_QUOTATION_MARK "\042"
#define STR_NUMBER_SIGN "\043"
#define STR_DOLLAR_SIGN "\044"
#define STR_PERCENT_SIGN "\045"
#define STR_AMPERSAND "\046"
#define STR_APOSTROPHE "\047"
#define STR_LEFT_PARENTHESIS "\050"
#define STR_RIGHT_PARENTHESIS "\051"
#define STR_ASTERISK "\052"
#define STR_PLUS "\053"
#define STR_COMMA "\054"
#define STR_MINUS "\055"
#define STR_DOT "\056"
#define STR_SLASH "\057"
#define STR_0 "\060"
#define STR_1 "\061"
#define STR_2 "\062"
#define STR_3 "\063"
#define STR_4 "\064"
#define STR_5 "\065"
#define STR_6 "\066"
#define STR_7 "\067"
#define STR_8 "\070"
#define STR_9 "\071"
#define STR_COLON "\072"
#define STR_SEMICOLON "\073"
#define STR_LESS_THAN_SIGN "\074"
#define STR_EQUALS_SIGN "\075"
#define STR_GREATER_THAN_SIGN "\076"
#define STR_QUESTION_MARK "\077"
#define STR_COMMERCIAL_AT "\100"
#define STR_A "\101"
#define STR_B "\102"
#define STR_C "\103"
#define STR_D "\104"
#define STR_E "\105"
#define STR_F "\106"
#define STR_G "\107"
#define STR_H "\110"
#define STR_I "\111"
#define STR_J "\112"
#define STR_K "\113"
#define STR_L "\114"
#define STR_M "\115"
#define STR_N "\116"
#define STR_O "\117"
#define STR_P "\120"
#define STR_Q "\121"
#define STR_R "\122"
#define STR_S "\123"
#define STR_T "\124"
#define STR_U "\125"
#define STR_V "\126"
#define STR_W "\127"
#define STR_X "\130"
#define STR_Y "\131"
#define STR_Z "\132"
#define STR_LEFT_SQUARE_BRACKET "\133"
#define STR_BACKSLASH "\134"
#define STR_RIGHT_SQUARE_BRACKET "\135"
#define STR_CIRCUMFLEX_ACCENT "\136"
#define STR_UNDERSCORE "\137"
#define STR_GRAVE_ACCENT "\140"
#define STR_a "\141"
#define STR_b "\142"
#define STR_c "\143"
#define STR_d "\144"
#define STR_e "\145"
#define STR_f "\146"
#define STR_g "\147"
#define STR_h "\150"
#define STR_i "\151"
#define STR_j "\152"
#define STR_k "\153"
#define STR_l "\154"
#define STR_m "\155"
#define STR_n "\156"
#define STR_o "\157"
#define STR_p "\160"
#define STR_q "\161"
#define STR_r "\162"
#define STR_s "\163"
#define STR_t "\164"
#define STR_u "\165"
#define STR_v "\166"
#define STR_w "\167"
#define STR_x "\170"
#define STR_y "\171"
#define STR_z "\172"
#define STR_LEFT_CURLY_BRACKET "\173"
#define STR_VERTICAL_LINE "\174"
#define STR_RIGHT_CURLY_BRACKET "\175"
#define STR_TILDE "\176"
#define STRING_ACCEPT0 STR_A STR_C STR_C STR_E STR_P STR_T "\0"
#define STRING_COMMIT0 STR_C STR_O STR_M STR_M STR_I STR_T "\0"
#define STRING_F0 STR_F "\0"
#define STRING_FAIL0 STR_F STR_A STR_I STR_L "\0"
#define STRING_MARK0 STR_M STR_A STR_R STR_K "\0"
#define STRING_PRUNE0 STR_P STR_R STR_U STR_N STR_E "\0"
#define STRING_SKIP0 STR_S STR_K STR_I STR_P "\0"
#define STRING_THEN STR_T STR_H STR_E STR_N
#define STRING_alpha0 STR_a STR_l STR_p STR_h STR_a "\0"
#define STRING_lower0 STR_l STR_o STR_w STR_e STR_r "\0"
#define STRING_upper0 STR_u STR_p STR_p STR_e STR_r "\0"
#define STRING_alnum0 STR_a STR_l STR_n STR_u STR_m "\0"
#define STRING_ascii0 STR_a STR_s STR_c STR_i STR_i "\0"
#define STRING_blank0 STR_b STR_l STR_a STR_n STR_k "\0"
#define STRING_cntrl0 STR_c STR_n STR_t STR_r STR_l "\0"
#define STRING_digit0 STR_d STR_i STR_g STR_i STR_t "\0"
#define STRING_graph0 STR_g STR_r STR_a STR_p STR_h "\0"
#define STRING_print0 STR_p STR_r STR_i STR_n STR_t "\0"
#define STRING_punct0 STR_p STR_u STR_n STR_c STR_t "\0"
#define STRING_space0 STR_s STR_p STR_a STR_c STR_e "\0"
#define STRING_word0 STR_w STR_o STR_r STR_d "\0"
#define STRING_xdigit STR_x STR_d STR_i STR_g STR_i STR_t
#define STRING_DEFINE STR_D STR_E STR_F STR_I STR_N STR_E
#define STRING_WEIRD_STARTWORD STR_LEFT_SQUARE_BRACKET STR_COLON STR_LESS_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET
#define STRING_WEIRD_ENDWORD STR_LEFT_SQUARE_BRACKET STR_COLON STR_GREATER_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET
#define STRING_CR_RIGHTPAR STR_C STR_R STR_RIGHT_PARENTHESIS
#define STRING_LF_RIGHTPAR STR_L STR_F STR_RIGHT_PARENTHESIS
#define STRING_CRLF_RIGHTPAR STR_C STR_R STR_L STR_F STR_RIGHT_PARENTHESIS
#define STRING_ANY_RIGHTPAR STR_A STR_N STR_Y STR_RIGHT_PARENTHESIS
#define STRING_ANYCRLF_RIGHTPAR STR_A STR_N STR_Y STR_C STR_R STR_L STR_F STR_RIGHT_PARENTHESIS
#define STRING_BSR_ANYCRLF_RIGHTPAR STR_B STR_S STR_R STR_UNDERSCORE STR_A STR_N STR_Y STR_C STR_R STR_L STR_F STR_RIGHT_PARENTHESIS
#define STRING_BSR_UNICODE_RIGHTPAR STR_B STR_S STR_R STR_UNDERSCORE STR_U STR_N STR_I STR_C STR_O STR_D STR_E STR_RIGHT_PARENTHESIS
#define STRING_UTF8_RIGHTPAR STR_U STR_T STR_F STR_8 STR_RIGHT_PARENTHESIS
#define STRING_UTF16_RIGHTPAR STR_U STR_T STR_F STR_1 STR_6 STR_RIGHT_PARENTHESIS
#define STRING_UTF32_RIGHTPAR STR_U STR_T STR_F STR_3 STR_2 STR_RIGHT_PARENTHESIS
#define STRING_UTF_RIGHTPAR STR_U STR_T STR_F STR_RIGHT_PARENTHESIS
#define STRING_UCP_RIGHTPAR STR_U STR_C STR_P STR_RIGHT_PARENTHESIS
#define STRING_NO_AUTO_POSSESS_RIGHTPAR STR_N STR_O STR_UNDERSCORE STR_A STR_U STR_T STR_O STR_UNDERSCORE STR_P STR_O STR_S STR_S STR_E STR_S STR_S STR_RIGHT_PARENTHESIS
#define STRING_NO_START_OPT_RIGHTPAR STR_N STR_O STR_UNDERSCORE STR_S STR_T STR_A STR_R STR_T STR_UNDERSCORE STR_O STR_P STR_T STR_RIGHT_PARENTHESIS
#define STRING_LIMIT_MATCH_EQ STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_M STR_A STR_T STR_C STR_H STR_EQUALS_SIGN
#define STRING_LIMIT_RECURSION_EQ STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_R STR_E STR_C STR_U STR_R STR_S STR_I STR_O STR_N STR_EQUALS_SIGN
#endif
#ifndef ESC_a
#define ESC_a CHAR_BEL
#endif
#ifndef ESC_e
#define ESC_e CHAR_ESC
#endif
#ifndef ESC_f
#define ESC_f CHAR_FF
#endif
#ifndef ESC_n
#define ESC_n CHAR_LF
#endif
#ifndef ESC_r
#define ESC_r CHAR_CR
#endif
#ifndef ESC_tee
#define ESC_tee CHAR_HT
#endif
#define PT_ANY 0
#define PT_LAMP 1
#define PT_GC 2
#define PT_PC 3
#define PT_SC 4
#define PT_ALNUM 5
#define PT_SPACE 6
#define PT_PXSPACE 7
#define PT_WORD 8
#define PT_CLIST 9
#define PT_UCNC 10
#define PT_TABSIZE 11
#define PT_PXGRAPH 11
#define PT_PXPRINT 12
#define PT_PXPUNCT 13
#define XCL_NOT 0x01
#define XCL_MAP 0x02
#define XCL_HASPROP 0x04
#define XCL_END 0
#define XCL_SINGLE 1
#define XCL_RANGE 2
#define XCL_PROP 3
#define XCL_NOTPROP 4
enum { ESC_A = 1, ESC_G, ESC_K, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s,
ESC_W, ESC_w, ESC_N, ESC_dum, ESC_C, ESC_P, ESC_p, ESC_R, ESC_H,
ESC_h, ESC_V, ESC_v, ESC_X, ESC_Z, ESC_z,
ESC_E, ESC_Q, ESC_g, ESC_k,
ESC_DU, ESC_du, ESC_SU, ESC_su, ESC_WU, ESC_wu };
#define FIRST_AUTOTAB_OP OP_NOT_DIGIT
#define LAST_AUTOTAB_LEFT_OP OP_EXTUNI
#define LAST_AUTOTAB_RIGHT_OP OP_DOLLM
enum {
OP_END,
OP_SOD,
OP_SOM,
OP_SET_SOM,
OP_NOT_WORD_BOUNDARY,
OP_WORD_BOUNDARY,
OP_NOT_DIGIT,
OP_DIGIT,
OP_NOT_WHITESPACE,
OP_WHITESPACE,
OP_NOT_WORDCHAR,
OP_WORDCHAR,
OP_ANY,
OP_ALLANY,
OP_ANYBYTE,
OP_NOTPROP,
OP_PROP,
OP_ANYNL,
OP_NOT_HSPACE,
OP_HSPACE,
OP_NOT_VSPACE,
OP_VSPACE,
OP_EXTUNI,
OP_EODN,
OP_EOD,
OP_DOLL,
OP_DOLLM,
OP_CIRC,
OP_CIRCM,
OP_CHAR,
OP_CHARI,
OP_NOT,
OP_NOTI,
OP_STAR,
OP_MINSTAR,
OP_PLUS,
OP_MINPLUS,
OP_QUERY,
OP_MINQUERY,
OP_UPTO,
OP_MINUPTO,
OP_EXACT,
OP_POSSTAR,
OP_POSPLUS,
OP_POSQUERY,
OP_POSUPTO,
OP_STARI,
OP_MINSTARI,
OP_PLUSI,
OP_MINPLUSI,
OP_QUERYI,
OP_MINQUERYI,
OP_UPTOI,
OP_MINUPTOI,
OP_EXACTI,
OP_POSSTARI,
OP_POSPLUSI,
OP_POSQUERYI,
OP_POSUPTOI,
OP_NOTSTAR,
OP_NOTMINSTAR,
OP_NOTPLUS,
OP_NOTMINPLUS,
OP_NOTQUERY,
OP_NOTMINQUERY,
OP_NOTUPTO,
OP_NOTMINUPTO,
OP_NOTEXACT,
OP_NOTPOSSTAR,
OP_NOTPOSPLUS,
OP_NOTPOSQUERY,
OP_NOTPOSUPTO,
OP_NOTSTARI,
OP_NOTMINSTARI,
OP_NOTPLUSI,
OP_NOTMINPLUSI,
OP_NOTQUERYI,
OP_NOTMINQUERYI,
OP_NOTUPTOI,
OP_NOTMINUPTOI,
OP_NOTEXACTI,
OP_NOTPOSSTARI,
OP_NOTPOSPLUSI,
OP_NOTPOSQUERYI,
OP_NOTPOSUPTOI,
OP_TYPESTAR,
OP_TYPEMINSTAR,
OP_TYPEPLUS,
OP_TYPEMINPLUS,
OP_TYPEQUERY,
OP_TYPEMINQUERY,
OP_TYPEUPTO,
OP_TYPEMINUPTO,
OP_TYPEEXACT,
OP_TYPEPOSSTAR,
OP_TYPEPOSPLUS,
OP_TYPEPOSQUERY,
OP_TYPEPOSUPTO,
OP_CRSTAR,
OP_CRMINSTAR,
OP_CRPLUS,
OP_CRMINPLUS,
OP_CRQUERY,
OP_CRMINQUERY,
OP_CRRANGE,
OP_CRMINRANGE,
OP_CRPOSSTAR,
OP_CRPOSPLUS,
OP_CRPOSQUERY,
OP_CRPOSRANGE,
OP_CLASS,
OP_NCLASS,
OP_XCLASS,
OP_REF,
OP_REFI,
OP_DNREF,
OP_DNREFI,
OP_RECURSE,
OP_CALLOUT,
OP_ALT,
OP_KET,
OP_KETRMAX,
OP_KETRMIN,
OP_KETRPOS,
OP_REVERSE,
OP_ASSERT,
OP_ASSERT_NOT,
OP_ASSERTBACK,
OP_ASSERTBACK_NOT,
OP_ONCE,
OP_ONCE_NC,
OP_BRA,
OP_BRAPOS,
OP_CBRA,
OP_CBRAPOS,
OP_COND,
OP_SBRA,
OP_SBRAPOS,
OP_SCBRA,
OP_SCBRAPOS,
OP_SCOND,
OP_CREF,
OP_DNCREF,
OP_RREF,
OP_DNRREF,
OP_DEF,
OP_BRAZERO,
OP_BRAMINZERO,
OP_BRAPOSZERO,
OP_MARK,
OP_PRUNE,
OP_PRUNE_ARG,
OP_SKIP,
OP_SKIP_ARG,
OP_THEN,
OP_THEN_ARG,
OP_COMMIT,
OP_FAIL,
OP_ACCEPT,
OP_ASSERT_ACCEPT,
OP_CLOSE,
OP_SKIPZERO,
OP_TABLE_LENGTH
};
#define OP_NAME_LIST \
"End", "\\A", "\\G", "\\K", "\\B", "\\b", "\\D", "\\d", \
"\\S", "\\s", "\\W", "\\w", "Any", "AllAny", "Anybyte", \
"notprop", "prop", "\\R", "\\H", "\\h", "\\V", "\\v", \
"extuni", "\\Z", "\\z", \
"$", "$", "^", "^", "char", "chari", "not", "noti", \
"*", "*?", "+", "+?", "?", "??", \
"{", "{", "{", \
"*+","++", "?+", "{", \
"*", "*?", "+", "+?", "?", "??", \
"{", "{", "{", \
"*+","++", "?+", "{", \
"*", "*?", "+", "+?", "?", "??", \
"{", "{", "{", \
"*+","++", "?+", "{", \
"*", "*?", "+", "+?", "?", "??", \
"{", "{", "{", \
"*+","++", "?+", "{", \
"*", "*?", "+", "+?", "?", "??", "{", "{", "{", \
"*+","++", "?+", "{", \
"*", "*?", "+", "+?", "?", "??", "{", "{", \
"*+","++", "?+", "{", \
"class", "nclass", "xclass", "Ref", "Refi", "DnRef", "DnRefi", \
"Recurse", "Callout", \
"Alt", "Ket", "KetRmax", "KetRmin", "KetRpos", \
"Reverse", "Assert", "Assert not", "AssertB", "AssertB not", \
"Once", "Once_NC", \
"Bra", "BraPos", "CBra", "CBraPos", \
"Cond", \
"SBra", "SBraPos", "SCBra", "SCBraPos", \
"SCond", \
"Cond ref", "Cond dnref", "Cond rec", "Cond dnrec", "Cond def", \
"Brazero", "Braminzero", "Braposzero", \
"*MARK", "*PRUNE", "*PRUNE", "*SKIP", "*SKIP", \
"*THEN", "*THEN", "*COMMIT", "*FAIL", \
"*ACCEPT", "*ASSERT_ACCEPT", \
"Close", "Skip zero"
#define OP_LENGTHS \
1, \
1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, \
1, 1, 1, \
3, 3, \
1, 1, 1, 1, 1, \
1, \
1, 1, 1, 1, 1, 1, \
2, \
2, \
2, \
2, \
\
2, 2, 2, 2, 2, 2, \
2+IMM2_SIZE, 2+IMM2_SIZE, \
2+IMM2_SIZE, \
2, 2, 2, 2+IMM2_SIZE, \
2, 2, 2, 2, 2, 2, \
2+IMM2_SIZE, 2+IMM2_SIZE, \
2+IMM2_SIZE, \
2, 2, 2, 2+IMM2_SIZE, \
\
2, 2, 2, 2, 2, 2, \
2+IMM2_SIZE, 2+IMM2_SIZE, \
2+IMM2_SIZE, \
2, 2, 2, 2+IMM2_SIZE, \
2, 2, 2, 2, 2, 2, \
2+IMM2_SIZE, 2+IMM2_SIZE, \
2+IMM2_SIZE, \
2, 2, 2, 2+IMM2_SIZE, \
\
2, 2, 2, 2, 2, 2, \
2+IMM2_SIZE, 2+IMM2_SIZE, \
2+IMM2_SIZE, \
2, 2, 2, 2+IMM2_SIZE, \
\
1, 1, 1, 1, 1, 1, \
1+2*IMM2_SIZE, 1+2*IMM2_SIZE, \
1, 1, 1, 1+2*IMM2_SIZE, \
1+(32/sizeof(pcre_uchar)), \
1+(32/sizeof(pcre_uchar)), \
0, \
1+IMM2_SIZE, \
1+IMM2_SIZE, \
1+2*IMM2_SIZE, \
1+2*IMM2_SIZE, \
1+LINK_SIZE, \
2+2*LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE+IMM2_SIZE, \
1+LINK_SIZE+IMM2_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE, \
1+LINK_SIZE+IMM2_SIZE, \
1+LINK_SIZE+IMM2_SIZE, \
1+LINK_SIZE, \
1+IMM2_SIZE, 1+2*IMM2_SIZE, \
1+IMM2_SIZE, 1+2*IMM2_SIZE, \
1, \
1, 1, 1, \
3, 1, 3, \
1, 3, \
1, 3, \
1, 1, 1, 1, \
1+IMM2_SIZE, 1
#define RREF_ANY 0xffff
enum { ERR0, ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9,
ERR10, ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19,
ERR20, ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR28, ERR29,
ERR30, ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39,
ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,
ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,
ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69,
ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79,
ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERRCOUNT };
enum { JIT_COMPILE, JIT_PARTIAL_SOFT_COMPILE, JIT_PARTIAL_HARD_COMPILE,
JIT_NUMBER_OF_COMPILE_MODES };
typedef struct real_pcre8_or_16 {
pcre_uint32 magic_number;
pcre_uint32 size;
pcre_uint32 options;
pcre_uint32 flags;
pcre_uint32 limit_match;
pcre_uint32 limit_recursion;
pcre_uint16 first_char;
pcre_uint16 req_char;
pcre_uint16 max_lookbehind;
pcre_uint16 top_bracket;
pcre_uint16 top_backref;
pcre_uint16 name_table_offset;
pcre_uint16 name_entry_size;
pcre_uint16 name_count;
pcre_uint16 ref_count;
pcre_uint16 dummy1;
pcre_uint16 dummy2;
pcre_uint16 dummy3;
const pcre_uint8 *tables;
void *nullpad;
} real_pcre8_or_16;
typedef struct real_pcre8_or_16 real_pcre;
typedef struct real_pcre8_or_16 real_pcre16;
typedef struct real_pcre32 {
pcre_uint32 magic_number;
pcre_uint32 size;
pcre_uint32 options;
pcre_uint32 flags;
pcre_uint32 limit_match;
pcre_uint32 limit_recursion;
pcre_uint32 first_char;
pcre_uint32 req_char;
pcre_uint16 max_lookbehind;
pcre_uint16 top_bracket;
pcre_uint16 top_backref;
pcre_uint16 name_table_offset;
pcre_uint16 name_entry_size;
pcre_uint16 name_count;
pcre_uint16 ref_count;
pcre_uint16 dummy;
const pcre_uint8 *tables;
void *nullpad;
} real_pcre32;
#if defined COMPILE_PCRE8
#define REAL_PCRE real_pcre
#elif defined COMPILE_PCRE16
#define REAL_PCRE real_pcre16
#elif defined COMPILE_PCRE32
#define REAL_PCRE real_pcre32
#endif
typedef int __assert_real_pcre_size_divisible_8[(sizeof(REAL_PCRE) % 8) == 0 ? 1 : -1];
#define REAL_PCRE_MAGIC(re) (((REAL_PCRE*)re)->magic_number)
#define REAL_PCRE_SIZE(re) (((REAL_PCRE*)re)->size)
#define REAL_PCRE_OPTIONS(re) (((REAL_PCRE*)re)->options)
#define REAL_PCRE_FLAGS(re) (((REAL_PCRE*)re)->flags)
typedef struct pcre_study_data {
pcre_uint32 size;
pcre_uint32 flags;
pcre_uint8 start_bits[32];
pcre_uint32 minlength;
} pcre_study_data;
typedef struct open_capitem {
struct open_capitem *next;
pcre_uint16 number;
pcre_uint16 flag;
} open_capitem;
typedef struct named_group {
const pcre_uchar *name;
int length;
pcre_uint32 number;
} named_group;
typedef struct compile_data {
const pcre_uint8 *lcc;
const pcre_uint8 *fcc;
const pcre_uint8 *cbits;
const pcre_uint8 *ctypes;
const pcre_uchar *start_workspace;
const pcre_uchar *start_code;
const pcre_uchar *start_pattern;
const pcre_uchar *end_pattern;
pcre_uchar *hwm;
open_capitem *open_caps;
named_group *named_groups;
pcre_uchar *name_table;
int names_found;
int name_entry_size;
int named_group_list_size;
int workspace_size;
unsigned int bracount;
int final_bracount;
int max_lookbehind;
int top_backref;
unsigned int backref_map;
unsigned int namedrefcount;
int parens_depth;
int assert_depth;
pcre_uint32 external_options;
pcre_uint32 external_flags;
int req_varyopt;
BOOL had_accept;
BOOL had_pruneorskip;
BOOL check_lookbehind;
BOOL dupnames;
BOOL dupgroups;
BOOL iscondassert;
int nltype;
int nllen;
pcre_uchar nl[4];
} compile_data;
typedef struct branch_chain {
struct branch_chain *outer;
pcre_uchar *current_branch;
} branch_chain;
typedef struct recurse_check {
struct recurse_check *prev;
const pcre_uchar *group;
} recurse_check;
typedef struct recursion_info {
struct recursion_info *prevrec;
unsigned int group_num;
int *offset_save;
int saved_max;
int saved_capture_last;
PCRE_PUCHAR subject_position;
} recursion_info;
typedef struct dfa_recursion_info {
struct dfa_recursion_info *prevrec;
int group_num;
PCRE_PUCHAR subject_position;
} dfa_recursion_info;
typedef struct eptrblock {
struct eptrblock *epb_prev;
PCRE_PUCHAR epb_saved_eptr;
} eptrblock;
typedef struct match_data {
unsigned long int match_call_count;
unsigned long int match_limit;
unsigned long int match_limit_recursion;
int *offset_vector;
int offset_end;
int offset_max;
int nltype;
int nllen;
int name_count;
int name_entry_size;
unsigned int skip_arg_count;
unsigned int ignore_skip_arg;
pcre_uchar *name_table;
pcre_uchar nl[4];
const pcre_uint8 *lcc;
const pcre_uint8 *fcc;
const pcre_uint8 *ctypes;
BOOL notbol;
BOOL noteol;
BOOL utf;
BOOL jscript_compat;
BOOL use_ucp;
BOOL endonly;
BOOL notempty;
BOOL notempty_atstart;
BOOL hitend;
BOOL bsr_anycrlf;
BOOL hasthen;
const pcre_uchar *start_code;
PCRE_PUCHAR start_subject;
PCRE_PUCHAR end_subject;
PCRE_PUCHAR start_match_ptr;
PCRE_PUCHAR end_match_ptr;
PCRE_PUCHAR start_used_ptr;
int partial;
int end_offset_top;
pcre_int32 capture_last;
int start_offset;
int match_function_type;
eptrblock *eptrchain;
int eptrn;
recursion_info *recursive;
void *callout_data;
const pcre_uchar *mark;
const pcre_uchar *nomatch_mark;
const pcre_uchar *once_target;
#ifdef NO_RECURSE
void *match_frames_base;
#endif
} match_data;
typedef struct dfa_match_data {
const pcre_uchar *start_code;
const pcre_uchar *start_subject ;
const pcre_uchar *end_subject;
const pcre_uchar *start_used_ptr;
const pcre_uint8 *tables;
int start_offset;
int moptions;
int poptions;
int nltype;
int nllen;
pcre_uchar nl[4];
void *callout_data;
dfa_recursion_info *recursive;
} dfa_match_data;
#define ctype_space 0x01
#define ctype_letter 0x02
#define ctype_digit 0x04
#define ctype_xdigit 0x08
#define ctype_word 0x10
#define ctype_meta 0x80
#define cbit_space 0
#define cbit_xdigit 32
#define cbit_digit 64
#define cbit_upper 96
#define cbit_lower 128
#define cbit_word 160
#define cbit_graph 192
#define cbit_print 224
#define cbit_punct 256
#define cbit_cntrl 288
#define cbit_length 320
#define lcc_offset 0
#define fcc_offset 256
#define cbits_offset 512
#define ctypes_offset (cbits_offset + cbit_length)
#define tables_length (ctypes_offset + 256)
#if defined COMPILE_PCRE8
#ifndef PUBL
#define PUBL(name) pcre_##name
#endif
#ifndef PRIV
#define PRIV(name) _pcre_##name
#endif
#elif defined COMPILE_PCRE16
#ifndef PUBL
#define PUBL(name) pcre16_##name
#endif
#ifndef PRIV
#define PRIV(name) _pcre16_##name
#endif
#elif defined COMPILE_PCRE32
#ifndef PUBL
#define PUBL(name) pcre32_##name
#endif
#ifndef PRIV
#define PRIV(name) _pcre32_##name
#endif
#else
#error Unsupported compiling mode
#endif
typedef struct {
pcre_uint16 name_offset;
pcre_uint16 type;
pcre_uint16 value;
} ucp_type_table;
#ifdef COMPILE_PCRE8
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 pcre_uint8 PRIV(utf8_table4)[];
#endif
extern const char PRIV(utt_names)[];
extern const ucp_type_table PRIV(utt)[];
extern const int PRIV(utt_size);
extern const pcre_uint8 PRIV(OP_lengths)[];
extern const pcre_uint8 PRIV(default_tables)[];
extern const pcre_uint32 PRIV(hspace_list)[];
extern const pcre_uint32 PRIV(vspace_list)[];
#if defined COMPILE_PCRE8
#define STRCMP_UC_UC(str1, str2) \
strcmp((char *)(str1), (char *)(str2))
#define STRCMP_UC_C8(str1, str2) \
strcmp((char *)(str1), (str2))
#define STRNCMP_UC_UC(str1, str2, num) \
strncmp((char *)(str1), (char *)(str2), (num))
#define STRNCMP_UC_C8(str1, str2, num) \
strncmp((char *)(str1), (str2), (num))
#define STRLEN_UC(str) strlen((const char *)str)
#elif defined COMPILE_PCRE16 || defined COMPILE_PCRE32
extern int PRIV(strcmp_uc_uc)(const pcre_uchar *,
const pcre_uchar *);
extern int PRIV(strcmp_uc_c8)(const pcre_uchar *,
const char *);
extern int PRIV(strncmp_uc_uc)(const pcre_uchar *,
const pcre_uchar *, unsigned int num);
extern int PRIV(strncmp_uc_c8)(const pcre_uchar *,
const char *, unsigned int num);
extern unsigned int PRIV(strlen_uc)(const pcre_uchar *str);
#define STRCMP_UC_UC(str1, str2) \
PRIV(strcmp_uc_uc)((str1), (str2))
#define STRCMP_UC_C8(str1, str2) \
PRIV(strcmp_uc_c8)((str1), (str2))
#define STRNCMP_UC_UC(str1, str2, num) \
PRIV(strncmp_uc_uc)((str1), (str2), (num))
#define STRNCMP_UC_C8(str1, str2, num) \
PRIV(strncmp_uc_c8)((str1), (str2), (num))
#define STRLEN_UC(str) PRIV(strlen_uc)(str)
#endif
#if defined COMPILE_PCRE8 || defined COMPILE_PCRE16
#define STRCMP_UC_UC_TEST(str1, str2) STRCMP_UC_UC(str1, str2)
#define STRCMP_UC_C8_TEST(str1, str2) STRCMP_UC_C8(str1, str2)
#elif defined COMPILE_PCRE32
extern int PRIV(strcmp_uc_uc_utf)(const pcre_uchar *,
const pcre_uchar *);
extern int PRIV(strcmp_uc_c8_utf)(const pcre_uchar *,
const char *);
#define STRCMP_UC_UC_TEST(str1, str2) \
(utf ? PRIV(strcmp_uc_uc_utf)((str1), (str2)) : PRIV(strcmp_uc_uc)((str1), (str2)))
#define STRCMP_UC_C8_TEST(str1, str2) \
(utf ? PRIV(strcmp_uc_c8_utf)((str1), (str2)) : PRIV(strcmp_uc_c8)((str1), (str2)))
#endif
extern const pcre_uchar *PRIV(find_bracket)(const pcre_uchar *, BOOL, int);
extern BOOL PRIV(is_newline)(PCRE_PUCHAR, int, PCRE_PUCHAR,
int *, BOOL);
extern unsigned int PRIV(ord2utf)(pcre_uint32, pcre_uchar *);
extern int PRIV(valid_utf)(PCRE_PUCHAR, int, int *);
extern BOOL PRIV(was_newline)(PCRE_PUCHAR, int, PCRE_PUCHAR,
int *, BOOL);
extern BOOL PRIV(xclass)(pcre_uint32, const pcre_uchar *, BOOL);
#ifdef SUPPORT_JIT
extern void PRIV(jit_compile)(const REAL_PCRE *,
PUBL(extra) *, int);
extern int PRIV(jit_exec)(const PUBL(extra) *,
const pcre_uchar *, int, int, int, int *, int);
extern void PRIV(jit_free)(void *);
extern int PRIV(jit_get_size)(void *);
extern const char* PRIV(jit_get_target)(void);
#endif
typedef struct {
pcre_uint8 script;
pcre_uint8 chartype;
pcre_uint8 gbprop;
pcre_uint8 caseset;
pcre_int32 other_case;
} ucd_record;
extern const pcre_uint32 PRIV(ucd_caseless_sets)[];
extern const ucd_record PRIV(ucd_records)[];
extern const pcre_uint8 PRIV(ucd_stage1)[];
extern const pcre_uint16 PRIV(ucd_stage2)[];
extern const pcre_uint32 PRIV(ucp_gentype)[];
extern const pcre_uint32 PRIV(ucp_gbtable)[];
#ifdef SUPPORT_JIT
extern const int PRIV(ucp_typerange)[];
#endif
#ifdef SUPPORT_UCP
#define UCD_BLOCK_SIZE 128
#define GET_UCD(ch) (PRIV(ucd_records) + \
PRIV(ucd_stage2)[PRIV(ucd_stage1)[(int)(ch) / UCD_BLOCK_SIZE] * \
UCD_BLOCK_SIZE + (int)(ch) % UCD_BLOCK_SIZE])
#define UCD_CHARTYPE(ch) GET_UCD(ch)->chartype
#define UCD_SCRIPT(ch) GET_UCD(ch)->script
#define UCD_CATEGORY(ch) PRIV(ucp_gentype)[UCD_CHARTYPE(ch)]
#define UCD_GRAPHBREAK(ch) GET_UCD(ch)->gbprop
#define UCD_CASESET(ch) GET_UCD(ch)->caseset
#define UCD_OTHERCASE(ch) ((pcre_uint32)((int)ch + (int)(GET_UCD(ch)->other_case)))
#endif
#endif