| 1 |
/************************************************* |
|---|
| 2 |
* Perl-Compatible Regular Expressions * |
|---|
| 3 |
*************************************************/ |
|---|
| 4 |
|
|---|
| 5 |
/* PCRE is a library of functions to support regular expressions whose syntax |
|---|
| 6 |
and semantics are as close as possible to those of the Perl 5 language. |
|---|
| 7 |
|
|---|
| 8 |
Written by Philip Hazel |
|---|
| 9 |
Copyright (c) 1997-2007 University of Cambridge |
|---|
| 10 |
|
|---|
| 11 |
----------------------------------------------------------------------------- |
|---|
| 12 |
Redistribution and use in source and binary forms, with or without |
|---|
| 13 |
modification, are permitted provided that the following conditions are met: |
|---|
| 14 |
|
|---|
| 15 |
* Redistributions of source code must retain the above copyright notice, |
|---|
| 16 |
this list of conditions and the following disclaimer. |
|---|
| 17 |
|
|---|
| 18 |
* Redistributions in binary form must reproduce the above copyright |
|---|
| 19 |
notice, this list of conditions and the following disclaimer in the |
|---|
| 20 |
documentation and/or other materials provided with the distribution. |
|---|
| 21 |
|
|---|
| 22 |
* Neither the name of the University of Cambridge nor the names of its |
|---|
| 23 |
contributors may be used to endorse or promote products derived from |
|---|
| 24 |
this software without specific prior written permission. |
|---|
| 25 |
|
|---|
| 26 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|---|
| 27 |
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|---|
| 28 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|---|
| 29 |
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
|---|
| 30 |
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|---|
| 31 |
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|---|
| 32 |
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|---|
| 33 |
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|---|
| 34 |
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|---|
| 35 |
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|---|
| 36 |
POSSIBILITY OF SUCH DAMAGE. |
|---|
| 37 |
----------------------------------------------------------------------------- |
|---|
| 38 |
*/ |
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
/* This module contains some fixed tables that are used by more than one of the |
|---|
| 42 |
PCRE code modules. The tables are also #included by the pcretest program, which |
|---|
| 43 |
uses macros to change their names from _pcre_xxx to xxxx, thereby avoiding name |
|---|
| 44 |
clashes with the library. */ |
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
#include "local_config.h" |
|---|
| 48 |
#include "pcre_internal.h" |
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
/* Table of sizes for the fixed-length opcodes. It's defined in a macro so that |
|---|
| 52 |
the definition is next to the definition of the opcodes in pcre_internal.h. */ |
|---|
| 53 |
|
|---|
| 54 |
const uschar _pcre_OP_lengths[] = { OP_LENGTHS }; |
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
/************************************************* |
|---|
| 59 |
* Tables for UTF-8 support * |
|---|
| 60 |
*************************************************/ |
|---|
| 61 |
|
|---|
| 62 |
/* These are the breakpoints for different numbers of bytes in a UTF-8 |
|---|
| 63 |
character. */ |
|---|
| 64 |
|
|---|
| 65 |
#ifdef SUPPORT_UTF8 |
|---|
| 66 |
|
|---|
| 67 |
const int _pcre_utf8_table1[] = |
|---|
| 68 |
{ 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff}; |
|---|
| 69 |
|
|---|
| 70 |
const int _pcre_utf8_table1_size = sizeof(_pcre_utf8_table1)/sizeof(int); |
|---|
| 71 |
|
|---|
| 72 |
/* These are the indicator bits and the mask for the data bits to set in the |
|---|
| 73 |
first byte of a character, indexed by the number of additional bytes. */ |
|---|
| 74 |
|
|---|
| 75 |
const int _pcre_utf8_table2[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc}; |
|---|
| 76 |
const int _pcre_utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01}; |
|---|
| 77 |
|
|---|
| 78 |
/* Table of the number of extra bytes, indexed by the first byte masked with |
|---|
| 79 |
0x3f. The highest number for a valid UTF-8 first byte is in fact 0x3d. */ |
|---|
| 80 |
|
|---|
| 81 |
const uschar _pcre_utf8_table4[] = { |
|---|
| 82 |
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, |
|---|
| 83 |
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, |
|---|
| 84 |
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, |
|---|
| 85 |
3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; |
|---|
| 86 |
|
|---|
| 87 |
/* This table translates Unicode property names into type and code values. It |
|---|
| 88 |
is searched by binary chop, so must be in collating sequence of name. */ |
|---|
| 89 |
|
|---|
| 90 |
const ucp_type_table _pcre_utt[] = { |
|---|
| 91 |
{ "Any", PT_ANY, 0 }, |
|---|
| 92 |
{ "Arabic", PT_SC, ucp_Arabic }, |
|---|
| 93 |
{ "Armenian", PT_SC, ucp_Armenian }, |
|---|
| 94 |
{ "Balinese", PT_SC, ucp_Balinese }, |
|---|
| 95 |
{ "Bengali", PT_SC, ucp_Bengali }, |
|---|
| 96 |
{ "Bopomofo", PT_SC, ucp_Bopomofo }, |
|---|
| 97 |
{ "Braille", PT_SC, ucp_Braille }, |
|---|
| 98 |
{ "Buginese", PT_SC, ucp_Buginese }, |
|---|
| 99 |
{ "Buhid", PT_SC, ucp_Buhid }, |
|---|
| 100 |
{ "C", PT_GC, ucp_C }, |
|---|
| 101 |
{ "Canadian_Aboriginal", PT_SC, ucp_Canadian_Aboriginal }, |
|---|
| 102 |
{ "Cc", PT_PC, ucp_Cc }, |
|---|
| 103 |
{ "Cf", PT_PC, ucp_Cf }, |
|---|
| 104 |
{ "Cherokee", PT_SC, ucp_Cherokee }, |
|---|
| 105 |
{ "Cn", PT_PC, ucp_Cn }, |
|---|
| 106 |
{ "Co", PT_PC, ucp_Co }, |
|---|
| 107 |
{ "Common", PT_SC, ucp_Common }, |
|---|
| 108 |
{ "Coptic", PT_SC, ucp_Coptic }, |
|---|
| 109 |
{ "Cs", PT_PC, ucp_Cs }, |
|---|
| 110 |
{ "Cuneiform", PT_SC, ucp_Cuneiform }, |
|---|
| 111 |
{ "Cypriot", PT_SC, ucp_Cypriot }, |
|---|
| 112 |
{ "Cyrillic", PT_SC, ucp_Cyrillic }, |
|---|
| 113 |
{ "Deseret", PT_SC, ucp_Deseret }, |
|---|
| 114 |
{ "Devanagari", PT_SC, ucp_Devanagari }, |
|---|
| 115 |
{ "Ethiopic", PT_SC, ucp_Ethiopic }, |
|---|
| 116 |
{ "Georgian", PT_SC, ucp_Georgian }, |
|---|
| 117 |
{ "Glagolitic", PT_SC, ucp_Glagolitic }, |
|---|
| 118 |
{ "Gothic", PT_SC, ucp_Gothic }, |
|---|
| 119 |
{ "Greek", PT_SC, ucp_Greek }, |
|---|
| 120 |
{ "Gujarati", PT_SC, ucp_Gujarati }, |
|---|
| 121 |
{ "Gurmukhi", PT_SC, ucp_Gurmukhi }, |
|---|
| 122 |
{ "Han", PT_SC, ucp_Han }, |
|---|
| 123 |
{ "Hangul", PT_SC, ucp_Hangul }, |
|---|
| 124 |
{ "Hanunoo", PT_SC, ucp_Hanunoo }, |
|---|
| 125 |
{ "Hebrew", PT_SC, ucp_Hebrew }, |
|---|
| 126 |
{ "Hiragana", PT_SC, ucp_Hiragana }, |
|---|
| 127 |
{ "Inherited", PT_SC, ucp_Inherited }, |
|---|
| 128 |
{ "Kannada", PT_SC, ucp_Kannada }, |
|---|
| 129 |
{ "Katakana", PT_SC, ucp_Katakana }, |
|---|
| 130 |
{ "Kharoshthi", PT_SC, ucp_Kharoshthi }, |
|---|
| 131 |
{ "Khmer", PT_SC, ucp_Khmer }, |
|---|
| 132 |
{ "L", PT_GC, ucp_L }, |
|---|
| 133 |
{ "L&", PT_LAMP, 0 }, |
|---|
| 134 |
{ "Lao", PT_SC, ucp_Lao }, |
|---|
| 135 |
{ "Latin", PT_SC, ucp_Latin }, |
|---|
| 136 |
{ "Limbu", PT_SC, ucp_Limbu }, |
|---|
| 137 |
{ "Linear_B", PT_SC, ucp_Linear_B }, |
|---|
| 138 |
{ "Ll", PT_PC, ucp_Ll }, |
|---|
| 139 |
{ "Lm", PT_PC, ucp_Lm }, |
|---|
| 140 |
{ "Lo", PT_PC, ucp_Lo }, |
|---|
| 141 |
{ "Lt", PT_PC, ucp_Lt }, |
|---|
| 142 |
{ "Lu", PT_PC, ucp_Lu }, |
|---|
| 143 |
{ "M", PT_GC, ucp_M }, |
|---|
| 144 |
{ "Malayalam", PT_SC, ucp_Malayalam }, |
|---|
| 145 |
{ "Mc", PT_PC, ucp_Mc }, |
|---|
| 146 |
{ "Me", PT_PC, ucp_Me }, |
|---|
| 147 |
{ "Mn", PT_PC, ucp_Mn }, |
|---|
| 148 |
{ "Mongolian", PT_SC, ucp_Mongolian }, |
|---|
| 149 |
{ "Myanmar", PT_SC, ucp_Myanmar }, |
|---|
| 150 |
{ "N", PT_GC, ucp_N }, |
|---|
| 151 |
{ "Nd", PT_PC, ucp_Nd }, |
|---|
| 152 |
{ "New_Tai_Lue", PT_SC, ucp_New_Tai_Lue }, |
|---|
| 153 |
{ "Nko", PT_SC, ucp_Nko }, |
|---|
| 154 |
{ "Nl", PT_PC, ucp_Nl }, |
|---|
| 155 |
{ "No", PT_PC, ucp_No }, |
|---|
| 156 |
{ "Ogham", PT_SC, ucp_Ogham }, |
|---|
| 157 |
{ "Old_Italic", PT_SC, ucp_Old_Italic }, |
|---|
| 158 |
{ "Old_Persian", PT_SC, ucp_Old_Persian }, |
|---|
| 159 |
{ "Oriya", PT_SC, ucp_Oriya }, |
|---|
| 160 |
{ "Osmanya", PT_SC, ucp_Osmanya }, |
|---|
| 161 |
{ "P", PT_GC, ucp_P }, |
|---|
| 162 |
{ "Pc", PT_PC, ucp_Pc }, |
|---|
| 163 |
{ "Pd", PT_PC, ucp_Pd }, |
|---|
| 164 |
{ "Pe", PT_PC, ucp_Pe }, |
|---|
| 165 |
{ "Pf", PT_PC, ucp_Pf }, |
|---|
| 166 |
{ "Phags_Pa", PT_SC, ucp_Phags_Pa }, |
|---|
| 167 |
{ "Phoenician", PT_SC, ucp_Phoenician }, |
|---|
| 168 |
{ "Pi", PT_PC, ucp_Pi }, |
|---|
| 169 |
{ "Po", PT_PC, ucp_Po }, |
|---|
| 170 |
{ "Ps", PT_PC, ucp_Ps }, |
|---|
| 171 |
{ "Runic", PT_SC, ucp_Runic }, |
|---|
| 172 |
{ "S", PT_GC, ucp_S }, |
|---|
| 173 |
{ "Sc", PT_PC, ucp_Sc }, |
|---|
| 174 |
{ "Shavian", PT_SC, ucp_Shavian }, |
|---|
| 175 |
{ "Sinhala", PT_SC, ucp_Sinhala }, |
|---|
| 176 |
{ "Sk", PT_PC, ucp_Sk }, |
|---|
| 177 |
{ "Sm", PT_PC, ucp_Sm }, |
|---|
| 178 |
{ "So", PT_PC, ucp_So }, |
|---|
| 179 |
{ "Syloti_Nagri", PT_SC, ucp_Syloti_Nagri }, |
|---|
| 180 |
{ "Syriac", PT_SC, ucp_Syriac }, |
|---|
| 181 |
{ "Tagalog", PT_SC, ucp_Tagalog }, |
|---|
| 182 |
{ "Tagbanwa", PT_SC, ucp_Tagbanwa }, |
|---|
| 183 |
{ "Tai_Le", PT_SC, ucp_Tai_Le }, |
|---|
| 184 |
{ "Tamil", PT_SC, ucp_Tamil }, |
|---|
| 185 |
{ "Telugu", PT_SC, ucp_Telugu }, |
|---|
| 186 |
{ "Thaana", PT_SC, ucp_Thaana }, |
|---|
| 187 |
{ "Thai", PT_SC, ucp_Thai }, |
|---|
| 188 |
{ "Tibetan", PT_SC, ucp_Tibetan }, |
|---|
| 189 |
{ "Tifinagh", PT_SC, ucp_Tifinagh }, |
|---|
| 190 |
{ "Ugaritic", PT_SC, ucp_Ugaritic }, |
|---|
| 191 |
{ "Yi", PT_SC, ucp_Yi }, |
|---|
| 192 |
{ "Z", PT_GC, ucp_Z }, |
|---|
| 193 |
{ "Zl", PT_PC, ucp_Zl }, |
|---|
| 194 |
{ "Zp", PT_PC, ucp_Zp }, |
|---|
| 195 |
{ "Zs", PT_PC, ucp_Zs } |
|---|
| 196 |
}; |
|---|
| 197 |
|
|---|
| 198 |
const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table); |
|---|
| 199 |
|
|---|
| 200 |
#endif /* SUPPORT_UTF8 */ |
|---|
| 201 |
|
|---|
| 202 |
/* End of pcre_tables.c */ |
|---|