Annotation of parser3/src/lib/pcre/pa_pcre_internal.h, revision 1.4
1.1 moko 1: /* Some internal stuff from PCRE library */
2: /* Author: Sergey B Kirpichev <skirpichev@gmail.com> */
3:
1.4 ! moko 4: #include "pa_config_includes.h"
! 5:
1.1 moko 6: /* Bit definitions for entries in the pcre_ctypes table. */
7:
8: #define ctype_space 0x01
9: #define ctype_letter 0x02
10: #define ctype_digit 0x04
11: #define ctype_xdigit 0x08
12: #define ctype_word 0x10 /* alphanumeric or '_' */
13: #define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */
14:
15: /* Offsets for the bitmap tables in pcre_cbits. Each table contains a set
16: of bits for a class map. Some classes are built by combining these tables. */
17:
18: #define cbit_space 0 /* [:space:] or \s */
19: #define cbit_xdigit 32 /* [:xdigit:] */
20: #define cbit_digit 64 /* [:digit:] or \d */
21: #define cbit_upper 96 /* [:upper:] */
22: #define cbit_lower 128 /* [:lower:] */
23: #define cbit_word 160 /* [:word:] or \w */
24: #define cbit_graph 192 /* [:graph:] */
25: #define cbit_print 224 /* [:print:] */
26: #define cbit_punct 256 /* [:punct:] */
27: #define cbit_cntrl 288 /* [:cntrl:] */
28: #define cbit_length 320 /* Length of the cbits table */
29:
30: /* Offsets of the various tables from the base tables pointer, and total length. */
31:
32: #define lcc_offset 0
33: #define fcc_offset 256
34: #define cbits_offset 512
35: #define ctypes_offset (cbits_offset + cbit_length)
36: #define tables_length (ctypes_offset + 256)
37:
1.2 moko 38: /* Internal shared data tables. The data for these tables is in the
1.3 moko 39: pa_pcre_chartables.c module. */
1.1 moko 40:
41: #ifdef __cplusplus
1.3 moko 42: extern "C" const unsigned char pa_pcre_default_tables[];
1.1 moko 43: #else
1.3 moko 44: extern const unsigned char pa_pcre_default_tables[];
1.1 moko 45: #endif
1.2 moko 46:
47: /* Internal function for validating UTF-8 character strings. The code
48: for this function is in the pcre_valid_utf8.c module. */
49:
50: #ifdef __cplusplus
1.3 moko 51: extern "C" int pa_pcre_valid_utf(unsigned char *string, int length, int *erroroffset);
1.2 moko 52: #else
1.3 moko 53: extern int pa_pcre_valid_utf(unsigned char *string, int length, int *erroroffset);
1.2 moko 54: #endif
55:
1.4 ! moko 56: #ifdef HAVE_PCRE2
! 57: #define PCRE_UTF8_ERR0 0
! 58: #define PCRE_UTF8_ERR6 PCRE2_ERROR_UTF8_ERR6
! 59: #define PCRE_UTF8_ERR7 PCRE2_ERROR_UTF8_ERR7
! 60: #define PCRE_UTF8_ERR8 PCRE2_ERROR_UTF8_ERR8
! 61: #define PCRE_UTF8_ERR9 PCRE2_ERROR_UTF8_ERR9
! 62: #define PCRE_UTF8_ERR10 PCRE2_ERROR_UTF8_ERR10
! 63: #define PCRE_UTF8_ERR11 PCRE2_ERROR_UTF8_ERR11
! 64: #define PCRE_UTF8_ERR12 PCRE2_ERROR_UTF8_ERR12
! 65: #define PCRE_UTF8_ERR13 PCRE2_ERROR_UTF8_ERR13
! 66: #define PCRE_UTF8_ERR14 PCRE2_ERROR_UTF8_ERR14
! 67: #define PCRE_UTF8_ERR15 PCRE2_ERROR_UTF8_ERR15
! 68: #define PCRE_UTF8_ERR16 PCRE2_ERROR_UTF8_ERR16
! 69: #define PCRE_UTF8_ERR17 PCRE2_ERROR_UTF8_ERR17
! 70: #define PCRE_UTF8_ERR18 PCRE2_ERROR_UTF8_ERR18
! 71: #define PCRE_UTF8_ERR19 PCRE2_ERROR_UTF8_ERR19
! 72: #define PCRE_UTF8_ERR20 PCRE2_ERROR_UTF8_ERR20
! 73: #define PCRE_UTF8_ERR21 PCRE2_ERROR_UTF8_ERR21
! 74:
! 75: #define PCRE_ERROR_BADUTF8_OFFSET PCRE2_ERROR_BADUTFOFFSET
! 76:
! 77: #define PCRE_UTF8 PCRE2_UTF
! 78: #define PCRE_UCP PCRE2_UCP
! 79: #define PCRE_EXTENDED PCRE2_EXTENDED
! 80: #define PCRE_ERROR_NOMATCH PCRE2_ERROR_NOMATCH
! 81:
! 82: #define PCRE_INFO_SIZE PCRE2_INFO_SIZE
! 83:
! 84: #define PCRE_CASELESS PCRE2_CASELESS
! 85: #define PCRE_DOTALL PCRE2_DOTALL
! 86: #define PCRE_MULTILINE PCRE2_MULTILINE
! 87: #define PCRE_UNGREEDY PCRE2_UNGREEDY
! 88: #define PCRE_DOLLAR_ENDONLY PCRE2_DOLLAR_ENDONLY
! 89: #define PCRE_EXTRA 0
! 90:
! 91: #define pcre_fullinfo(fcode, fextra, type, result) pcre2_pattern_info(fcode, type, result)
! 92:
! 93: #endif
E-mail: