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