1 /* $Cambridge: exim/src/src/pcre/pcre_tables.c,v 1.1 2005/06/15 08:57:10 ph10 Exp $ */
3 /*************************************************
4 * Perl-Compatible Regular Expressions *
5 *************************************************/
7 /* PCRE is a library of functions to support regular expressions whose syntax
8 and semantics are as close as possible to those of the Perl 5 language.
10 Written by Philip Hazel
11 Copyright (c) 1997-2005 University of Cambridge
13 -----------------------------------------------------------------------------
14 Redistribution and use in source and binary forms, with or without
15 modification, are permitted provided that the following conditions are met:
17 * Redistributions of source code must retain the above copyright notice,
18 this list of conditions and the following disclaimer.
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.
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.
28 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
32 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
33 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 POSSIBILITY OF SUCH DAMAGE.
39 -----------------------------------------------------------------------------
43 /* This module contains some fixed tables that are used by more than one of the
47 #include "pcre_internal.h"
50 /* Table of sizes for the fixed-length opcodes. It's defined in a macro so that
51 the definition is next to the definition of the opcodes in internal.h. */
53 const uschar _pcre_OP_lengths[] = { OP_LENGTHS };
57 /*************************************************
58 * Tables for UTF-8 support *
59 *************************************************/
61 /* These are the breakpoints for different numbers of bytes in a UTF-8
64 const int _pcre_utf8_table1[] =
65 { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff};
67 const int _pcre_utf8_table1_size = sizeof(_pcre_utf8_table1)/sizeof(int);
69 /* These are the indicator bits and the mask for the data bits to set in the
70 first byte of a character, indexed by the number of additional bytes. */
72 const int _pcre_utf8_table2[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc};
73 const int _pcre_utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01};
75 /* Table of the number of extra characters, indexed by the first character
76 masked with 0x3f. The highest number for a valid UTF-8 character is in fact
79 const uschar _pcre_utf8_table4[] = {
80 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
81 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
82 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
83 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 };
85 /* This table translates Unicode property names into code values for the
86 ucp_findchar() function. It is used by pcretest as well as by the library
89 const ucp_type_table _pcre_utt[] = {
102 { "M", 128 + ucp_M },
106 { "N", 128 + ucp_N },
110 { "P", 128 + ucp_P },
118 { "S", 128 + ucp_S },
123 { "Z", 128 + ucp_Z },
129 const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table);
131 /* End of pcre_tables.c */