mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 19:10:20 +01:00
fixed newlines
This commit is contained in:
@@ -1,194 +1,194 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* This file contains character tables that are used when no external tables
|
/* This file contains character tables that are used when no external tables
|
||||||
are passed to PCRE by the application that calls it. The tables are used only
|
are passed to PCRE by the application that calls it. The tables are used only
|
||||||
for characters whose code values are less than 256.
|
for characters whose code values are less than 256.
|
||||||
|
|
||||||
This is a default version of the tables that assumes ASCII encoding. A program
|
This is a default version of the tables that assumes ASCII encoding. A program
|
||||||
called dftables (which is distributed with PCRE) can be used to build
|
called dftables (which is distributed with PCRE) can be used to build
|
||||||
alternative versions of this file. This is necessary if you are running in an
|
alternative versions of this file. This is necessary if you are running in an
|
||||||
EBCDIC environment, or if you want to default to a different encoding, for
|
EBCDIC environment, or if you want to default to a different encoding, for
|
||||||
example ISO-8859-1. When dftables is run, it creates these tables in the
|
example ISO-8859-1. When dftables is run, it creates these tables in the
|
||||||
current locale. If PCRE is configured with --enable-rebuild-chartables, this
|
current locale. If PCRE is configured with --enable-rebuild-chartables, this
|
||||||
happens automatically.
|
happens automatically.
|
||||||
|
|
||||||
The following #include is present because without it gcc 4.x may remove the
|
The following #include is present because without it gcc 4.x may remove the
|
||||||
array definition from the final binary if PCRE is built into a static library
|
array definition from the final binary if PCRE is built into a static library
|
||||||
and dead code stripping is activated. This leads to link errors. Pulling in the
|
and dead code stripping is activated. This leads to link errors. Pulling in the
|
||||||
header ensures that the array gets flagged as "someone outside this compilation
|
header ensures that the array gets flagged as "someone outside this compilation
|
||||||
unit might reference this" and so it will always be supplied to the linker. */
|
unit might reference this" and so it will always be supplied to the linker. */
|
||||||
|
|
||||||
#include "pcre_internal.h"
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
const unsigned char _pcre_default_tables[] = {
|
const unsigned char _pcre_default_tables[] = {
|
||||||
|
|
||||||
/* This table is a lower casing table. */
|
/* This table is a lower casing table. */
|
||||||
|
|
||||||
0, 1, 2, 3, 4, 5, 6, 7,
|
0, 1, 2, 3, 4, 5, 6, 7,
|
||||||
8, 9, 10, 11, 12, 13, 14, 15,
|
8, 9, 10, 11, 12, 13, 14, 15,
|
||||||
16, 17, 18, 19, 20, 21, 22, 23,
|
16, 17, 18, 19, 20, 21, 22, 23,
|
||||||
24, 25, 26, 27, 28, 29, 30, 31,
|
24, 25, 26, 27, 28, 29, 30, 31,
|
||||||
32, 33, 34, 35, 36, 37, 38, 39,
|
32, 33, 34, 35, 36, 37, 38, 39,
|
||||||
40, 41, 42, 43, 44, 45, 46, 47,
|
40, 41, 42, 43, 44, 45, 46, 47,
|
||||||
48, 49, 50, 51, 52, 53, 54, 55,
|
48, 49, 50, 51, 52, 53, 54, 55,
|
||||||
56, 57, 58, 59, 60, 61, 62, 63,
|
56, 57, 58, 59, 60, 61, 62, 63,
|
||||||
64, 97, 98, 99,100,101,102,103,
|
64, 97, 98, 99,100,101,102,103,
|
||||||
104,105,106,107,108,109,110,111,
|
104,105,106,107,108,109,110,111,
|
||||||
112,113,114,115,116,117,118,119,
|
112,113,114,115,116,117,118,119,
|
||||||
120,121,122, 91, 92, 93, 94, 95,
|
120,121,122, 91, 92, 93, 94, 95,
|
||||||
96, 97, 98, 99,100,101,102,103,
|
96, 97, 98, 99,100,101,102,103,
|
||||||
104,105,106,107,108,109,110,111,
|
104,105,106,107,108,109,110,111,
|
||||||
112,113,114,115,116,117,118,119,
|
112,113,114,115,116,117,118,119,
|
||||||
120,121,122,123,124,125,126,127,
|
120,121,122,123,124,125,126,127,
|
||||||
128,129,130,131,132,133,134,135,
|
128,129,130,131,132,133,134,135,
|
||||||
136,137,138,139,140,141,142,143,
|
136,137,138,139,140,141,142,143,
|
||||||
144,145,146,147,148,149,150,151,
|
144,145,146,147,148,149,150,151,
|
||||||
152,153,154,155,156,157,158,159,
|
152,153,154,155,156,157,158,159,
|
||||||
160,161,162,163,164,165,166,167,
|
160,161,162,163,164,165,166,167,
|
||||||
168,169,170,171,172,173,174,175,
|
168,169,170,171,172,173,174,175,
|
||||||
176,177,178,179,180,181,182,183,
|
176,177,178,179,180,181,182,183,
|
||||||
184,185,186,187,188,189,190,191,
|
184,185,186,187,188,189,190,191,
|
||||||
192,193,194,195,196,197,198,199,
|
192,193,194,195,196,197,198,199,
|
||||||
200,201,202,203,204,205,206,207,
|
200,201,202,203,204,205,206,207,
|
||||||
208,209,210,211,212,213,214,215,
|
208,209,210,211,212,213,214,215,
|
||||||
216,217,218,219,220,221,222,223,
|
216,217,218,219,220,221,222,223,
|
||||||
224,225,226,227,228,229,230,231,
|
224,225,226,227,228,229,230,231,
|
||||||
232,233,234,235,236,237,238,239,
|
232,233,234,235,236,237,238,239,
|
||||||
240,241,242,243,244,245,246,247,
|
240,241,242,243,244,245,246,247,
|
||||||
248,249,250,251,252,253,254,255,
|
248,249,250,251,252,253,254,255,
|
||||||
|
|
||||||
/* This table is a case flipping table. */
|
/* This table is a case flipping table. */
|
||||||
|
|
||||||
0, 1, 2, 3, 4, 5, 6, 7,
|
0, 1, 2, 3, 4, 5, 6, 7,
|
||||||
8, 9, 10, 11, 12, 13, 14, 15,
|
8, 9, 10, 11, 12, 13, 14, 15,
|
||||||
16, 17, 18, 19, 20, 21, 22, 23,
|
16, 17, 18, 19, 20, 21, 22, 23,
|
||||||
24, 25, 26, 27, 28, 29, 30, 31,
|
24, 25, 26, 27, 28, 29, 30, 31,
|
||||||
32, 33, 34, 35, 36, 37, 38, 39,
|
32, 33, 34, 35, 36, 37, 38, 39,
|
||||||
40, 41, 42, 43, 44, 45, 46, 47,
|
40, 41, 42, 43, 44, 45, 46, 47,
|
||||||
48, 49, 50, 51, 52, 53, 54, 55,
|
48, 49, 50, 51, 52, 53, 54, 55,
|
||||||
56, 57, 58, 59, 60, 61, 62, 63,
|
56, 57, 58, 59, 60, 61, 62, 63,
|
||||||
64, 97, 98, 99,100,101,102,103,
|
64, 97, 98, 99,100,101,102,103,
|
||||||
104,105,106,107,108,109,110,111,
|
104,105,106,107,108,109,110,111,
|
||||||
112,113,114,115,116,117,118,119,
|
112,113,114,115,116,117,118,119,
|
||||||
120,121,122, 91, 92, 93, 94, 95,
|
120,121,122, 91, 92, 93, 94, 95,
|
||||||
96, 65, 66, 67, 68, 69, 70, 71,
|
96, 65, 66, 67, 68, 69, 70, 71,
|
||||||
72, 73, 74, 75, 76, 77, 78, 79,
|
72, 73, 74, 75, 76, 77, 78, 79,
|
||||||
80, 81, 82, 83, 84, 85, 86, 87,
|
80, 81, 82, 83, 84, 85, 86, 87,
|
||||||
88, 89, 90,123,124,125,126,127,
|
88, 89, 90,123,124,125,126,127,
|
||||||
128,129,130,131,132,133,134,135,
|
128,129,130,131,132,133,134,135,
|
||||||
136,137,138,139,140,141,142,143,
|
136,137,138,139,140,141,142,143,
|
||||||
144,145,146,147,148,149,150,151,
|
144,145,146,147,148,149,150,151,
|
||||||
152,153,154,155,156,157,158,159,
|
152,153,154,155,156,157,158,159,
|
||||||
160,161,162,163,164,165,166,167,
|
160,161,162,163,164,165,166,167,
|
||||||
168,169,170,171,172,173,174,175,
|
168,169,170,171,172,173,174,175,
|
||||||
176,177,178,179,180,181,182,183,
|
176,177,178,179,180,181,182,183,
|
||||||
184,185,186,187,188,189,190,191,
|
184,185,186,187,188,189,190,191,
|
||||||
192,193,194,195,196,197,198,199,
|
192,193,194,195,196,197,198,199,
|
||||||
200,201,202,203,204,205,206,207,
|
200,201,202,203,204,205,206,207,
|
||||||
208,209,210,211,212,213,214,215,
|
208,209,210,211,212,213,214,215,
|
||||||
216,217,218,219,220,221,222,223,
|
216,217,218,219,220,221,222,223,
|
||||||
224,225,226,227,228,229,230,231,
|
224,225,226,227,228,229,230,231,
|
||||||
232,233,234,235,236,237,238,239,
|
232,233,234,235,236,237,238,239,
|
||||||
240,241,242,243,244,245,246,247,
|
240,241,242,243,244,245,246,247,
|
||||||
248,249,250,251,252,253,254,255,
|
248,249,250,251,252,253,254,255,
|
||||||
|
|
||||||
/* This table contains bit maps for various character classes. Each map is 32
|
/* This table contains bit maps for various character classes. Each map is 32
|
||||||
bytes long and the bits run from the least significant end of each byte. The
|
bytes long and the bits run from the least significant end of each byte. The
|
||||||
classes that have their own maps are: space, xdigit, digit, upper, lower, word,
|
classes that have their own maps are: space, xdigit, digit, upper, lower, word,
|
||||||
graph, print, punct, and cntrl. Other classes are built from combinations. */
|
graph, print, punct, and cntrl. Other classes are built from combinations. */
|
||||||
|
|
||||||
0x00,0x3e,0x00,0x00,0x01,0x00,0x00,0x00,
|
0x00,0x3e,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
|
0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
|
||||||
0x7e,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,
|
0x7e,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
|
0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0xfe,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
|
0xfe,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07,
|
0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
|
0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
|
||||||
0xfe,0xff,0xff,0x87,0xfe,0xff,0xff,0x07,
|
0xfe,0xff,0xff,0x87,0xfe,0xff,0xff,0x07,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
|
||||||
0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
|
0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
|
||||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
|
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
|
||||||
0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
|
0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
|
||||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
|
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
|
||||||
0x00,0x00,0x00,0x00,0xfe,0xff,0x00,0xfc,
|
0x00,0x00,0x00,0x00,0xfe,0xff,0x00,0xfc,
|
||||||
0x01,0x00,0x00,0xf8,0x01,0x00,0x00,0x78,
|
0x01,0x00,0x00,0xf8,0x01,0x00,0x00,0x78,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
|
||||||
0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
|
0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
|
||||||
/* This table identifies various classes of character by individual bits:
|
/* This table identifies various classes of character by individual bits:
|
||||||
0x01 white space character
|
0x01 white space character
|
||||||
0x02 letter
|
0x02 letter
|
||||||
0x04 decimal digit
|
0x04 decimal digit
|
||||||
0x08 hexadecimal digit
|
0x08 hexadecimal digit
|
||||||
0x10 alphanumeric or '_'
|
0x10 alphanumeric or '_'
|
||||||
0x80 regular expression metacharacter or binary zero
|
0x80 regular expression metacharacter or binary zero
|
||||||
*/
|
*/
|
||||||
|
|
||||||
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */
|
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */
|
||||||
0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */
|
0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
|
||||||
0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* - ' */
|
0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* - ' */
|
||||||
0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x00, /* ( - / */
|
0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x00, /* ( - / */
|
||||||
0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */
|
0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */
|
||||||
0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x80, /* 8 - ? */
|
0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x80, /* 8 - ? */
|
||||||
0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* @ - G */
|
0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* @ - G */
|
||||||
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* H - O */
|
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* H - O */
|
||||||
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* P - W */
|
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* P - W */
|
||||||
0x12,0x12,0x12,0x80,0x80,0x00,0x80,0x10, /* X - _ */
|
0x12,0x12,0x12,0x80,0x80,0x00,0x80,0x10, /* X - _ */
|
||||||
0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* ` - g */
|
0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* ` - g */
|
||||||
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* h - o */
|
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* h - o */
|
||||||
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* p - w */
|
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* p - w */
|
||||||
0x12,0x12,0x12,0x80,0x80,0x00,0x00,0x00, /* x -127 */
|
0x12,0x12,0x12,0x80,0x80,0x00,0x00,0x00, /* x -127 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */
|
||||||
|
|
||||||
/* End of pcre_chartables.c */
|
/* End of pcre_chartables.c */
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,275 +1,275 @@
|
|||||||
/* config.h. Generated from config.h.in by configure. */
|
/* config.h. Generated from config.h.in by configure. */
|
||||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||||
|
|
||||||
|
|
||||||
/* On Unix-like systems config.h.in is converted by "configure" into config.h.
|
/* On Unix-like systems config.h.in is converted by "configure" into config.h.
|
||||||
Some other environments also support the use of "configure". PCRE is written in
|
Some other environments also support the use of "configure". PCRE is written in
|
||||||
Standard C, but there are a few non-standard things it can cope with, allowing
|
Standard C, but there are a few non-standard things it can cope with, allowing
|
||||||
it to run on SunOS4 and other "close to standard" systems.
|
it to run on SunOS4 and other "close to standard" systems.
|
||||||
|
|
||||||
If you are going to build PCRE "by hand" on a system without "configure" you
|
If you are going to build PCRE "by hand" on a system without "configure" you
|
||||||
should copy the distributed config.h.generic to config.h, and then set up the
|
should copy the distributed config.h.generic to config.h, and then set up the
|
||||||
macros the way you need them. Alternatively, you can avoid editing by using -D
|
macros the way you need them. Alternatively, you can avoid editing by using -D
|
||||||
on the compiler command line to set the macro values.
|
on the compiler command line to set the macro values.
|
||||||
|
|
||||||
PCRE uses memmove() if HAVE_MEMMOVE is set to 1; otherwise it uses bcopy() if
|
PCRE uses memmove() if HAVE_MEMMOVE is set to 1; otherwise it uses bcopy() if
|
||||||
HAVE_BCOPY is set to 1. If your system has neither bcopy() nor memmove(), set
|
HAVE_BCOPY is set to 1. If your system has neither bcopy() nor memmove(), set
|
||||||
them both to 0; an emulation function will be used. */
|
them both to 0; an emulation function will be used. */
|
||||||
|
|
||||||
/* If you are compiling for a system that uses EBCDIC instead of ASCII
|
/* If you are compiling for a system that uses EBCDIC instead of ASCII
|
||||||
character codes, define this macro as 1. On systems that can use
|
character codes, define this macro as 1. On systems that can use
|
||||||
"configure", this can be done via --enable-ebcdic. */
|
"configure", this can be done via --enable-ebcdic. */
|
||||||
/* #undef EBCDIC */
|
/* #undef EBCDIC */
|
||||||
|
|
||||||
/* Define to 1 if you have the `bcopy' function. */
|
/* Define to 1 if you have the `bcopy' function. */
|
||||||
|
|
||||||
/* Define to 1 if you have the <bits/type_traits.h> header file. */
|
/* Define to 1 if you have the <bits/type_traits.h> header file. */
|
||||||
/* #undef HAVE_BITS_TYPE_TRAITS_H */
|
/* #undef HAVE_BITS_TYPE_TRAITS_H */
|
||||||
|
|
||||||
/* Define to 1 if you have the <dirent.h> header file. */
|
/* Define to 1 if you have the <dirent.h> header file. */
|
||||||
#ifndef HAVE_DIRENT_H
|
#ifndef HAVE_DIRENT_H
|
||||||
#define HAVE_DIRENT_H 0
|
#define HAVE_DIRENT_H 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||||
#ifndef HAVE_DLFCN_H
|
#ifndef HAVE_DLFCN_H
|
||||||
#define HAVE_DLFCN_H 0
|
#define HAVE_DLFCN_H 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
#ifndef HAVE_INTTYPES_H
|
#ifndef HAVE_INTTYPES_H
|
||||||
#define HAVE_INTTYPES_H 0
|
#define HAVE_INTTYPES_H 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the <limits.h> header file. */
|
/* Define to 1 if you have the <limits.h> header file. */
|
||||||
#ifndef HAVE_LIMITS_H
|
#ifndef HAVE_LIMITS_H
|
||||||
#define HAVE_LIMITS_H 1
|
#define HAVE_LIMITS_H 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if the system has the type `long long'. */
|
/* Define to 1 if the system has the type `long long'. */
|
||||||
#ifndef HAVE_LONG_LONG
|
#ifndef HAVE_LONG_LONG
|
||||||
#define HAVE_LONG_LONG 0
|
#define HAVE_LONG_LONG 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the `memmove' function. */
|
/* Define to 1 if you have the `memmove' function. */
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
#ifndef HAVE_MEMORY_H
|
#ifndef HAVE_MEMORY_H
|
||||||
#define HAVE_MEMORY_H 1
|
#define HAVE_MEMORY_H 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
#ifndef HAVE_STDINT_H
|
#ifndef HAVE_STDINT_H
|
||||||
#define HAVE_STDINT_H 0
|
#define HAVE_STDINT_H 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||||
#ifndef HAVE_STDLIB_H
|
#ifndef HAVE_STDLIB_H
|
||||||
#define HAVE_STDLIB_H 1
|
#define HAVE_STDLIB_H 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the `strerror' function. */
|
/* Define to 1 if you have the `strerror' function. */
|
||||||
#ifndef HAVE_STRERROR
|
#ifndef HAVE_STRERROR
|
||||||
#define HAVE_STRERROR 0
|
#define HAVE_STRERROR 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the <string> header file. */
|
/* Define to 1 if you have the <string> header file. */
|
||||||
#ifndef HAVE_STRING
|
#ifndef HAVE_STRING
|
||||||
#define HAVE_STRING 0
|
#define HAVE_STRING 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
/* Define to 1 if you have the <strings.h> header file. */
|
||||||
#ifndef HAVE_STRINGS_H
|
#ifndef HAVE_STRINGS_H
|
||||||
#define HAVE_STRINGS_H 0
|
#define HAVE_STRINGS_H 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
/* Define to 1 if you have the <string.h> header file. */
|
||||||
#ifndef HAVE_STRING_H
|
#ifndef HAVE_STRING_H
|
||||||
#define HAVE_STRING_H 1
|
#define HAVE_STRING_H 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the `strtoll' function. */
|
/* Define to 1 if you have the `strtoll' function. */
|
||||||
#ifndef HAVE_STRTOLL
|
#ifndef HAVE_STRTOLL
|
||||||
#define HAVE_STRTOLL 0
|
#define HAVE_STRTOLL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the `strtoq' function. */
|
/* Define to 1 if you have the `strtoq' function. */
|
||||||
#ifndef HAVE_STRTOQ
|
#ifndef HAVE_STRTOQ
|
||||||
#define HAVE_STRTOQ 0
|
#define HAVE_STRTOQ 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||||
#ifndef HAVE_SYS_STAT_H
|
#ifndef HAVE_SYS_STAT_H
|
||||||
#define HAVE_SYS_STAT_H 0
|
#define HAVE_SYS_STAT_H 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||||
#ifndef HAVE_SYS_TYPES_H
|
#ifndef HAVE_SYS_TYPES_H
|
||||||
#define HAVE_SYS_TYPES_H 0
|
#define HAVE_SYS_TYPES_H 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the <type_traits.h> header file. */
|
/* Define to 1 if you have the <type_traits.h> header file. */
|
||||||
/* #undef HAVE_TYPE_TRAITS_H */
|
/* #undef HAVE_TYPE_TRAITS_H */
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
#ifndef HAVE_UNISTD_H
|
#ifndef HAVE_UNISTD_H
|
||||||
#define HAVE_UNISTD_H 0
|
#define HAVE_UNISTD_H 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if the system has the type `unsigned long long'. */
|
/* Define to 1 if the system has the type `unsigned long long'. */
|
||||||
#ifndef HAVE_UNSIGNED_LONG_LONG
|
#ifndef HAVE_UNSIGNED_LONG_LONG
|
||||||
#define HAVE_UNSIGNED_LONG_LONG 0
|
#define HAVE_UNSIGNED_LONG_LONG 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the "Poco/UnWindows.h" header file. */
|
/* Define to 1 if you have the "Poco/UnWindows.h" header file. */
|
||||||
/* #undef HAVE_WINDOWS_H */
|
/* #undef HAVE_WINDOWS_H */
|
||||||
|
|
||||||
/* The value of LINK_SIZE determines the number of bytes used to store links
|
/* The value of LINK_SIZE determines the number of bytes used to store links
|
||||||
as offsets within the compiled regex. The default is 2, which allows for
|
as offsets within the compiled regex. The default is 2, which allows for
|
||||||
compiled patterns up to 64K long. This covers the vast majority of cases.
|
compiled patterns up to 64K long. This covers the vast majority of cases.
|
||||||
However, PCRE can also be compiled to use 3 or 4 bytes instead. This allows
|
However, PCRE can also be compiled to use 3 or 4 bytes instead. This allows
|
||||||
for longer patterns in extreme cases. On systems that support it,
|
for longer patterns in extreme cases. On systems that support it,
|
||||||
"configure" can be used to override this default. */
|
"configure" can be used to override this default. */
|
||||||
#ifndef LINK_SIZE
|
#ifndef LINK_SIZE
|
||||||
#define LINK_SIZE 2
|
#define LINK_SIZE 2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The value of MATCH_LIMIT determines the default number of times the
|
/* The value of MATCH_LIMIT determines the default number of times the
|
||||||
internal match() function can be called during a single execution of
|
internal match() function can be called during a single execution of
|
||||||
pcre_exec(). There is a runtime interface for setting a different limit.
|
pcre_exec(). There is a runtime interface for setting a different limit.
|
||||||
The limit exists in order to catch runaway regular expressions that take
|
The limit exists in order to catch runaway regular expressions that take
|
||||||
for ever to determine that they do not match. The default is set very large
|
for ever to determine that they do not match. The default is set very large
|
||||||
so that it does not accidentally catch legitimate cases. On systems that
|
so that it does not accidentally catch legitimate cases. On systems that
|
||||||
support it, "configure" can be used to override this default default. */
|
support it, "configure" can be used to override this default default. */
|
||||||
#ifndef MATCH_LIMIT
|
#ifndef MATCH_LIMIT
|
||||||
#define MATCH_LIMIT 10000000
|
#define MATCH_LIMIT 10000000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The above limit applies to all calls of match(), whether or not they
|
/* The above limit applies to all calls of match(), whether or not they
|
||||||
increase the recursion depth. In some environments it is desirable to limit
|
increase the recursion depth. In some environments it is desirable to limit
|
||||||
the depth of recursive calls of match() more strictly, in order to restrict
|
the depth of recursive calls of match() more strictly, in order to restrict
|
||||||
the maximum amount of stack (or heap, if NO_RECURSE is defined) that is
|
the maximum amount of stack (or heap, if NO_RECURSE is defined) that is
|
||||||
used. The value of MATCH_LIMIT_RECURSION applies only to recursive calls of
|
used. The value of MATCH_LIMIT_RECURSION applies only to recursive calls of
|
||||||
match(). To have any useful effect, it must be less than the value of
|
match(). To have any useful effect, it must be less than the value of
|
||||||
MATCH_LIMIT. The default is to use the same value as MATCH_LIMIT. There is
|
MATCH_LIMIT. The default is to use the same value as MATCH_LIMIT. There is
|
||||||
a runtime method for setting a different limit. On systems that support it,
|
a runtime method for setting a different limit. On systems that support it,
|
||||||
"configure" can be used to override the default. */
|
"configure" can be used to override the default. */
|
||||||
#ifndef MATCH_LIMIT_RECURSION
|
#ifndef MATCH_LIMIT_RECURSION
|
||||||
#define MATCH_LIMIT_RECURSION MATCH_LIMIT
|
#define MATCH_LIMIT_RECURSION MATCH_LIMIT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This limit is parameterized just in case anybody ever wants to change it.
|
/* This limit is parameterized just in case anybody ever wants to change it.
|
||||||
Care must be taken if it is increased, because it guards against integer
|
Care must be taken if it is increased, because it guards against integer
|
||||||
overflow caused by enormously large patterns. */
|
overflow caused by enormously large patterns. */
|
||||||
#ifndef MAX_DUPLENGTH
|
#ifndef MAX_DUPLENGTH
|
||||||
#define MAX_DUPLENGTH 30000
|
#define MAX_DUPLENGTH 30000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This limit is parameterized just in case anybody ever wants to change it.
|
/* This limit is parameterized just in case anybody ever wants to change it.
|
||||||
Care must be taken if it is increased, because it guards against integer
|
Care must be taken if it is increased, because it guards against integer
|
||||||
overflow caused by enormously large patterns. */
|
overflow caused by enormously large patterns. */
|
||||||
#ifndef MAX_NAME_COUNT
|
#ifndef MAX_NAME_COUNT
|
||||||
#define MAX_NAME_COUNT 10000
|
#define MAX_NAME_COUNT 10000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This limit is parameterized just in case anybody ever wants to change it.
|
/* This limit is parameterized just in case anybody ever wants to change it.
|
||||||
Care must be taken if it is increased, because it guards against integer
|
Care must be taken if it is increased, because it guards against integer
|
||||||
overflow caused by enormously large patterns. */
|
overflow caused by enormously large patterns. */
|
||||||
#ifndef MAX_NAME_SIZE
|
#ifndef MAX_NAME_SIZE
|
||||||
#define MAX_NAME_SIZE 32
|
#define MAX_NAME_SIZE 32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The value of NEWLINE determines the newline character sequence. On
|
/* The value of NEWLINE determines the newline character sequence. On
|
||||||
Unix-like systems, "configure" can be used to override the default, which
|
Unix-like systems, "configure" can be used to override the default, which
|
||||||
is 10. The possible values are 10 (LF), 13 (CR), 3338 (CRLF), -1 (ANY), or
|
is 10. The possible values are 10 (LF), 13 (CR), 3338 (CRLF), -1 (ANY), or
|
||||||
-2 (ANYCRLF). */
|
-2 (ANYCRLF). */
|
||||||
#ifndef NEWLINE
|
#ifndef NEWLINE
|
||||||
#define NEWLINE 10
|
#define NEWLINE 10
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* PCRE uses recursive function calls to handle backtracking while matching.
|
/* PCRE uses recursive function calls to handle backtracking while matching.
|
||||||
This can sometimes be a problem on systems that have stacks of limited
|
This can sometimes be a problem on systems that have stacks of limited
|
||||||
size. Define NO_RECURSE to get a version that doesn't use recursion in the
|
size. Define NO_RECURSE to get a version that doesn't use recursion in the
|
||||||
match() function; instead it creates its own stack by steam using
|
match() function; instead it creates its own stack by steam using
|
||||||
pcre_recurse_malloc() to obtain memory from the heap. For more detail, see
|
pcre_recurse_malloc() to obtain memory from the heap. For more detail, see
|
||||||
the comments and other stuff just above the match() function. On systems
|
the comments and other stuff just above the match() function. On systems
|
||||||
that support it, "configure" can be used to set this in the Makefile (use
|
that support it, "configure" can be used to set this in the Makefile (use
|
||||||
--disable-stack-for-recursion). */
|
--disable-stack-for-recursion). */
|
||||||
/* #undef NO_RECURSE */
|
/* #undef NO_RECURSE */
|
||||||
|
|
||||||
/* Name of package */
|
/* Name of package */
|
||||||
#define PACKAGE "pcre"
|
#define PACKAGE "pcre"
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
/* Define to the address where bug reports for this package should be sent. */
|
||||||
#define PACKAGE_BUGREPORT ""
|
#define PACKAGE_BUGREPORT ""
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
/* Define to the full name of this package. */
|
||||||
#define PACKAGE_NAME "PCRE"
|
#define PACKAGE_NAME "PCRE"
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
/* Define to the full name and version of this package. */
|
||||||
#define PACKAGE_STRING "PCRE 7.1"
|
#define PACKAGE_STRING "PCRE 7.1"
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
/* Define to the one symbol short name of this package. */
|
||||||
#define PACKAGE_TARNAME "pcre"
|
#define PACKAGE_TARNAME "pcre"
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
/* Define to the version of this package. */
|
||||||
#define PACKAGE_VERSION "7.1"
|
#define PACKAGE_VERSION "7.1"
|
||||||
|
|
||||||
|
|
||||||
/* If you are compiling for a system other than a Unix-like system or
|
/* If you are compiling for a system other than a Unix-like system or
|
||||||
Win32, and it needs some magic to be inserted before the definition
|
Win32, and it needs some magic to be inserted before the definition
|
||||||
of a function that is exported by the library, define this macro to
|
of a function that is exported by the library, define this macro to
|
||||||
contain the relevant magic. If you do not define this macro, it
|
contain the relevant magic. If you do not define this macro, it
|
||||||
defaults to "extern" for a C compiler and "extern C" for a C++
|
defaults to "extern" for a C compiler and "extern C" for a C++
|
||||||
compiler on non-Win32 systems. This macro apears at the start of
|
compiler on non-Win32 systems. This macro apears at the start of
|
||||||
every exported function that is part of the external API. It does
|
every exported function that is part of the external API. It does
|
||||||
not appear on functions that are "external" in the C sense, but
|
not appear on functions that are "external" in the C sense, but
|
||||||
which are internal to the library. */
|
which are internal to the library. */
|
||||||
/* #undef PCRE_EXP_DEFN */
|
/* #undef PCRE_EXP_DEFN */
|
||||||
|
|
||||||
/* Define if linking statically (TODO: make nice with Libtool) */
|
/* Define if linking statically (TODO: make nice with Libtool) */
|
||||||
#ifndef PCRE_STATIC
|
#ifndef PCRE_STATIC
|
||||||
#define PCRE_STATIC 1
|
#define PCRE_STATIC 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* When calling PCRE via the POSIX interface, additional working storage is
|
/* When calling PCRE via the POSIX interface, additional working storage is
|
||||||
required for holding the pointers to capturing substrings because PCRE
|
required for holding the pointers to capturing substrings because PCRE
|
||||||
requires three integers per substring, whereas the POSIX interface provides
|
requires three integers per substring, whereas the POSIX interface provides
|
||||||
only two. If the number of expected substrings is small, the wrapper
|
only two. If the number of expected substrings is small, the wrapper
|
||||||
function uses space on the stack, because this is faster than using
|
function uses space on the stack, because this is faster than using
|
||||||
malloc() for each call. The threshold above which the stack is no longer
|
malloc() for each call. The threshold above which the stack is no longer
|
||||||
used is defined by POSIX_MALLOC_THRESHOLD. On systems that support it,
|
used is defined by POSIX_MALLOC_THRESHOLD. On systems that support it,
|
||||||
"configure" can be used to override this default. */
|
"configure" can be used to override this default. */
|
||||||
#ifndef POSIX_MALLOC_THRESHOLD
|
#ifndef POSIX_MALLOC_THRESHOLD
|
||||||
#define POSIX_MALLOC_THRESHOLD 10
|
#define POSIX_MALLOC_THRESHOLD 10
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
/* Define to 1 if you have the ANSI C header files. */
|
||||||
#ifndef STDC_HEADERS
|
#ifndef STDC_HEADERS
|
||||||
#define STDC_HEADERS 1
|
#define STDC_HEADERS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to enable support for Unicode properties */
|
/* Define to enable support for Unicode properties */
|
||||||
#ifndef SUPPORT_UCP
|
#ifndef SUPPORT_UCP
|
||||||
#define SUPPORT_UCP
|
#define SUPPORT_UCP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to enable support for the UTF-8 Unicode encoding. */
|
/* Define to enable support for the UTF-8 Unicode encoding. */
|
||||||
#ifndef SUPPORT_UTF8
|
#ifndef SUPPORT_UTF8
|
||||||
#define SUPPORT_UTF8
|
#define SUPPORT_UTF8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Version number of package */
|
/* Version number of package */
|
||||||
#ifndef VERSION
|
#ifndef VERSION
|
||||||
#define VERSION "7.1"
|
#define VERSION "7.1"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to empty if `const' does not conform to ANSI C. */
|
/* Define to empty if `const' does not conform to ANSI C. */
|
||||||
/* #undef const */
|
/* #undef const */
|
||||||
|
|
||||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||||
/* #undef size_t */
|
/* #undef size_t */
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#pragma warning(disable:4018) // signed/unsigned comparison
|
#pragma warning(disable:4018) // signed/unsigned comparison
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,149 +1,149 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/*PCRE is a library of functions to support regular expressions whose syntax
|
/*PCRE is a library of functions to support regular expressions whose syntax
|
||||||
and semantics are as close as possible to those of the Perl 5 language.
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
Written by Philip Hazel
|
Written by Philip Hazel
|
||||||
Copyright (c) 1997-2007 University of Cambridge
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
contributors may be used to endorse or promote products derived from
|
contributors may be used to endorse or promote products derived from
|
||||||
this software without specific prior written permission.
|
this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* This module contains the external function pcre_fullinfo(), which returns
|
/* This module contains the external function pcre_fullinfo(), which returns
|
||||||
information about a compiled pattern. */
|
information about a compiled pattern. */
|
||||||
|
|
||||||
|
|
||||||
#include "pcre_internal.h"
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
* Return info about compiled pattern *
|
* Return info about compiled pattern *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* This is a newer "info" function which has an extensible interface so
|
/* This is a newer "info" function which has an extensible interface so
|
||||||
that additional items can be added compatibly.
|
that additional items can be added compatibly.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
argument_re points to compiled code
|
argument_re points to compiled code
|
||||||
extra_data points extra data, or NULL
|
extra_data points extra data, or NULL
|
||||||
what what information is required
|
what what information is required
|
||||||
where where to put the information
|
where where to put the information
|
||||||
|
|
||||||
Returns: 0 if data returned, negative on error
|
Returns: 0 if data returned, negative on error
|
||||||
*/
|
*/
|
||||||
|
|
||||||
PCRE_EXP_DEFN int
|
PCRE_EXP_DEFN int
|
||||||
pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, int what,
|
pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, int what,
|
||||||
void *where)
|
void *where)
|
||||||
{
|
{
|
||||||
real_pcre internal_re;
|
real_pcre internal_re;
|
||||||
pcre_study_data internal_study;
|
pcre_study_data internal_study;
|
||||||
const real_pcre *re = (const real_pcre *)argument_re;
|
const real_pcre *re = (const real_pcre *)argument_re;
|
||||||
const pcre_study_data *study = NULL;
|
const pcre_study_data *study = NULL;
|
||||||
|
|
||||||
if (re == NULL || where == NULL) return PCRE_ERROR_NULL;
|
if (re == NULL || where == NULL) return PCRE_ERROR_NULL;
|
||||||
|
|
||||||
if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_STUDY_DATA) != 0)
|
if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_STUDY_DATA) != 0)
|
||||||
study = (const pcre_study_data *)extra_data->study_data;
|
study = (const pcre_study_data *)extra_data->study_data;
|
||||||
|
|
||||||
if (re->magic_number != MAGIC_NUMBER)
|
if (re->magic_number != MAGIC_NUMBER)
|
||||||
{
|
{
|
||||||
re = _pcre_try_flipped(re, &internal_re, study, &internal_study);
|
re = _pcre_try_flipped(re, &internal_re, study, &internal_study);
|
||||||
if (re == NULL) return PCRE_ERROR_BADMAGIC;
|
if (re == NULL) return PCRE_ERROR_BADMAGIC;
|
||||||
if (study != NULL) study = &internal_study;
|
if (study != NULL) study = &internal_study;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (what)
|
switch (what)
|
||||||
{
|
{
|
||||||
case PCRE_INFO_OPTIONS:
|
case PCRE_INFO_OPTIONS:
|
||||||
*((unsigned long int *)where) = re->options & PUBLIC_OPTIONS;
|
*((unsigned long int *)where) = re->options & PUBLIC_OPTIONS;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCRE_INFO_SIZE:
|
case PCRE_INFO_SIZE:
|
||||||
*((size_t *)where) = re->size;
|
*((size_t *)where) = re->size;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCRE_INFO_STUDYSIZE:
|
case PCRE_INFO_STUDYSIZE:
|
||||||
*((size_t *)where) = (study == NULL)? 0 : study->size;
|
*((size_t *)where) = (study == NULL)? 0 : study->size;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCRE_INFO_CAPTURECOUNT:
|
case PCRE_INFO_CAPTURECOUNT:
|
||||||
*((int *)where) = re->top_bracket;
|
*((int *)where) = re->top_bracket;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCRE_INFO_BACKREFMAX:
|
case PCRE_INFO_BACKREFMAX:
|
||||||
*((int *)where) = re->top_backref;
|
*((int *)where) = re->top_backref;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCRE_INFO_FIRSTBYTE:
|
case PCRE_INFO_FIRSTBYTE:
|
||||||
*((int *)where) =
|
*((int *)where) =
|
||||||
((re->options & PCRE_FIRSTSET) != 0)? re->first_byte :
|
((re->options & PCRE_FIRSTSET) != 0)? re->first_byte :
|
||||||
((re->options & PCRE_STARTLINE) != 0)? -1 : -2;
|
((re->options & PCRE_STARTLINE) != 0)? -1 : -2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Make sure we pass back the pointer to the bit vector in the external
|
/* Make sure we pass back the pointer to the bit vector in the external
|
||||||
block, not the internal copy (with flipped integer fields). */
|
block, not the internal copy (with flipped integer fields). */
|
||||||
|
|
||||||
case PCRE_INFO_FIRSTTABLE:
|
case PCRE_INFO_FIRSTTABLE:
|
||||||
*((const uschar **)where) =
|
*((const uschar **)where) =
|
||||||
(study != NULL && (study->options & PCRE_STUDY_MAPPED) != 0)?
|
(study != NULL && (study->options & PCRE_STUDY_MAPPED) != 0)?
|
||||||
((const pcre_study_data *)extra_data->study_data)->start_bits : NULL;
|
((const pcre_study_data *)extra_data->study_data)->start_bits : NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCRE_INFO_LASTLITERAL:
|
case PCRE_INFO_LASTLITERAL:
|
||||||
*((int *)where) =
|
*((int *)where) =
|
||||||
((re->options & PCRE_REQCHSET) != 0)? re->req_byte : -1;
|
((re->options & PCRE_REQCHSET) != 0)? re->req_byte : -1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCRE_INFO_NAMEENTRYSIZE:
|
case PCRE_INFO_NAMEENTRYSIZE:
|
||||||
*((int *)where) = re->name_entry_size;
|
*((int *)where) = re->name_entry_size;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCRE_INFO_NAMECOUNT:
|
case PCRE_INFO_NAMECOUNT:
|
||||||
*((int *)where) = re->name_count;
|
*((int *)where) = re->name_count;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCRE_INFO_NAMETABLE:
|
case PCRE_INFO_NAMETABLE:
|
||||||
*((const uschar **)where) = (const uschar *)re + re->name_table_offset;
|
*((const uschar **)where) = (const uschar *)re + re->name_table_offset;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCRE_INFO_DEFAULT_TABLES:
|
case PCRE_INFO_DEFAULT_TABLES:
|
||||||
*((const uschar **)where) = (const uschar *)(_pcre_default_tables);
|
*((const uschar **)where) = (const uschar *)(_pcre_default_tables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: return PCRE_ERROR_BADOPTION;
|
default: return PCRE_ERROR_BADOPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* End of pcre_fullinfo.c */
|
/* End of pcre_fullinfo.c */
|
||||||
|
|||||||
@@ -1,59 +1,59 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* PCRE is a library of functions to support regular expressions whose syntax
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
and semantics are as close as possible to those of the Perl 5 language.
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
Written by Philip Hazel
|
Written by Philip Hazel
|
||||||
Copyright (c) 1997-2007 University of Cambridge
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
contributors may be used to endorse or promote products derived from
|
contributors may be used to endorse or promote products derived from
|
||||||
this software without specific prior written permission.
|
this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* This module contains global variables that are exported by the PCRE library.
|
/* This module contains global variables that are exported by the PCRE library.
|
||||||
PCRE is thread-clean and doesn't use any global variables in the normal sense.
|
PCRE is thread-clean and doesn't use any global variables in the normal sense.
|
||||||
However, it calls memory allocation and freeing functions via the four
|
However, it calls memory allocation and freeing functions via the four
|
||||||
indirections below, and it can optionally do callouts, using the fifth
|
indirections below, and it can optionally do callouts, using the fifth
|
||||||
indirection. These values can be changed by the caller, but are shared between
|
indirection. These values can be changed by the caller, but are shared between
|
||||||
all threads. However, when compiling for Virtual Pascal, things are done
|
all threads. However, when compiling for Virtual Pascal, things are done
|
||||||
differently, and global variables are not used (see pcre.in). */
|
differently, and global variables are not used (see pcre.in). */
|
||||||
|
|
||||||
#include "pcre_internal.h"
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
#ifndef VPCOMPAT
|
#ifndef VPCOMPAT
|
||||||
PCRE_EXP_DATA_DEFN void *(*pcre_malloc)(size_t) = malloc;
|
PCRE_EXP_DATA_DEFN void *(*pcre_malloc)(size_t) = malloc;
|
||||||
PCRE_EXP_DATA_DEFN void (*pcre_free)(void *) = free;
|
PCRE_EXP_DATA_DEFN void (*pcre_free)(void *) = free;
|
||||||
PCRE_EXP_DATA_DEFN void *(*pcre_stack_malloc)(size_t) = malloc;
|
PCRE_EXP_DATA_DEFN void *(*pcre_stack_malloc)(size_t) = malloc;
|
||||||
PCRE_EXP_DATA_DEFN void (*pcre_stack_free)(void *) = free;
|
PCRE_EXP_DATA_DEFN void (*pcre_stack_free)(void *) = free;
|
||||||
PCRE_EXP_DATA_DEFN int (*pcre_callout)(pcre_callout_block *) = NULL;
|
PCRE_EXP_DATA_DEFN int (*pcre_callout)(pcre_callout_block *) = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* End of pcre_globals.c */
|
/* End of pcre_globals.c */
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,140 +1,140 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* PCRE is a library of functions to support regular expressions whose syntax
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
and semantics are as close as possible to those of the Perl 5 language.
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
Written by Philip Hazel
|
Written by Philip Hazel
|
||||||
Copyright (c) 1997-2007 University of Cambridge
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
contributors may be used to endorse or promote products derived from
|
contributors may be used to endorse or promote products derived from
|
||||||
this software without specific prior written permission.
|
this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* This module contains the external function pcre_maketables(), which builds
|
/* This module contains the external function pcre_maketables(), which builds
|
||||||
character tables for PCRE in the current locale. The file is compiled on its
|
character tables for PCRE in the current locale. The file is compiled on its
|
||||||
own as part of the PCRE library. However, it is also included in the
|
own as part of the PCRE library. However, it is also included in the
|
||||||
compilation of dftables.c, in which case the macro DFTABLES is defined. */
|
compilation of dftables.c, in which case the macro DFTABLES is defined. */
|
||||||
|
|
||||||
|
|
||||||
#ifndef DFTABLES
|
#ifndef DFTABLES
|
||||||
#include "pcre_internal.h"
|
#include "pcre_internal.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
* Create PCRE character tables *
|
* Create PCRE character tables *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* This function builds a set of character tables for use by PCRE and returns
|
/* This function builds a set of character tables for use by PCRE and returns
|
||||||
a pointer to them. They are build using the ctype functions, and consequently
|
a pointer to them. They are build using the ctype functions, and consequently
|
||||||
their contents will depend upon the current locale setting. When compiled as
|
their contents will depend upon the current locale setting. When compiled as
|
||||||
part of the library, the store is obtained via pcre_malloc(), but when compiled
|
part of the library, the store is obtained via pcre_malloc(), but when compiled
|
||||||
inside dftables, use malloc().
|
inside dftables, use malloc().
|
||||||
|
|
||||||
Arguments: none
|
Arguments: none
|
||||||
Returns: pointer to the contiguous block of data
|
Returns: pointer to the contiguous block of data
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const unsigned char *
|
const unsigned char *
|
||||||
pcre_maketables(void)
|
pcre_maketables(void)
|
||||||
{
|
{
|
||||||
unsigned char *yield, *p;
|
unsigned char *yield, *p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#ifndef DFTABLES
|
#ifndef DFTABLES
|
||||||
yield = (unsigned char*)(pcre_malloc)(tables_length);
|
yield = (unsigned char*)(pcre_malloc)(tables_length);
|
||||||
#else
|
#else
|
||||||
yield = (unsigned char*)malloc(tables_length);
|
yield = (unsigned char*)malloc(tables_length);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (yield == NULL) return NULL;
|
if (yield == NULL) return NULL;
|
||||||
p = yield;
|
p = yield;
|
||||||
|
|
||||||
/* First comes the lower casing table */
|
/* First comes the lower casing table */
|
||||||
|
|
||||||
for (i = 0; i < 256; i++) *p++ = tolower(i);
|
for (i = 0; i < 256; i++) *p++ = tolower(i);
|
||||||
|
|
||||||
/* Next the case-flipping table */
|
/* Next the case-flipping table */
|
||||||
|
|
||||||
for (i = 0; i < 256; i++) *p++ = islower(i)? toupper(i) : tolower(i);
|
for (i = 0; i < 256; i++) *p++ = islower(i)? toupper(i) : tolower(i);
|
||||||
|
|
||||||
/* Then the character class tables. Don't try to be clever and save effort on
|
/* Then the character class tables. Don't try to be clever and save effort on
|
||||||
exclusive ones - in some locales things may be different. Note that the table
|
exclusive ones - in some locales things may be different. Note that the table
|
||||||
for "space" includes everything "isspace" gives, including VT in the default
|
for "space" includes everything "isspace" gives, including VT in the default
|
||||||
locale. This makes it work for the POSIX class [:space:]. Note also that it is
|
locale. This makes it work for the POSIX class [:space:]. Note also that it is
|
||||||
possible for a character to be alnum or alpha without being lower or upper,
|
possible for a character to be alnum or alpha without being lower or upper,
|
||||||
such as "male and female ordinals" (\xAA and \xBA) in the fr_FR locale (at
|
such as "male and female ordinals" (\xAA and \xBA) in the fr_FR locale (at
|
||||||
least under Debian Linux's locales as of 12/2005). So we must test for alnum
|
least under Debian Linux's locales as of 12/2005). So we must test for alnum
|
||||||
specially. */
|
specially. */
|
||||||
|
|
||||||
memset(p, 0, cbit_length);
|
memset(p, 0, cbit_length);
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
{
|
{
|
||||||
if (isdigit(i)) p[cbit_digit + i/8] |= 1 << (i&7);
|
if (isdigit(i)) p[cbit_digit + i/8] |= 1 << (i&7);
|
||||||
if (isupper(i)) p[cbit_upper + i/8] |= 1 << (i&7);
|
if (isupper(i)) p[cbit_upper + i/8] |= 1 << (i&7);
|
||||||
if (islower(i)) p[cbit_lower + i/8] |= 1 << (i&7);
|
if (islower(i)) p[cbit_lower + i/8] |= 1 << (i&7);
|
||||||
if (isalnum(i)) p[cbit_word + i/8] |= 1 << (i&7);
|
if (isalnum(i)) p[cbit_word + i/8] |= 1 << (i&7);
|
||||||
if (i == '_') p[cbit_word + i/8] |= 1 << (i&7);
|
if (i == '_') p[cbit_word + i/8] |= 1 << (i&7);
|
||||||
if (isspace(i)) p[cbit_space + i/8] |= 1 << (i&7);
|
if (isspace(i)) p[cbit_space + i/8] |= 1 << (i&7);
|
||||||
if (isxdigit(i))p[cbit_xdigit + i/8] |= 1 << (i&7);
|
if (isxdigit(i))p[cbit_xdigit + i/8] |= 1 << (i&7);
|
||||||
if (isgraph(i)) p[cbit_graph + i/8] |= 1 << (i&7);
|
if (isgraph(i)) p[cbit_graph + i/8] |= 1 << (i&7);
|
||||||
if (isprint(i)) p[cbit_print + i/8] |= 1 << (i&7);
|
if (isprint(i)) p[cbit_print + i/8] |= 1 << (i&7);
|
||||||
if (ispunct(i)) p[cbit_punct + i/8] |= 1 << (i&7);
|
if (ispunct(i)) p[cbit_punct + i/8] |= 1 << (i&7);
|
||||||
if (iscntrl(i)) p[cbit_cntrl + i/8] |= 1 << (i&7);
|
if (iscntrl(i)) p[cbit_cntrl + i/8] |= 1 << (i&7);
|
||||||
}
|
}
|
||||||
p += cbit_length;
|
p += cbit_length;
|
||||||
|
|
||||||
/* Finally, the character type table. In this, we exclude VT from the white
|
/* Finally, the character type table. In this, we exclude VT from the white
|
||||||
space chars, because Perl doesn't recognize it as such for \s and for comments
|
space chars, because Perl doesn't recognize it as such for \s and for comments
|
||||||
within regexes. */
|
within regexes. */
|
||||||
|
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
{
|
{
|
||||||
int x = 0;
|
int x = 0;
|
||||||
if (i != 0x0b && isspace(i)) x += ctype_space;
|
if (i != 0x0b && isspace(i)) x += ctype_space;
|
||||||
if (isalpha(i)) x += ctype_letter;
|
if (isalpha(i)) x += ctype_letter;
|
||||||
if (isdigit(i)) x += ctype_digit;
|
if (isdigit(i)) x += ctype_digit;
|
||||||
if (isxdigit(i)) x += ctype_xdigit;
|
if (isxdigit(i)) x += ctype_xdigit;
|
||||||
if (isalnum(i) || i == '_') x += ctype_word;
|
if (isalnum(i) || i == '_') x += ctype_word;
|
||||||
|
|
||||||
/* Note: strchr includes the terminating zero in the characters it considers.
|
/* Note: strchr includes the terminating zero in the characters it considers.
|
||||||
In this instance, that is ok because we want binary zero to be flagged as a
|
In this instance, that is ok because we want binary zero to be flagged as a
|
||||||
meta-character, which in this sense is any character that terminates a run
|
meta-character, which in this sense is any character that terminates a run
|
||||||
of data characters. */
|
of data characters. */
|
||||||
|
|
||||||
if (strchr("\\*+?{^.$|()[", i) != 0) x += ctype_meta;
|
if (strchr("\\*+?{^.$|()[", i) != 0) x += ctype_meta;
|
||||||
*p++ = x;
|
*p++ = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
return yield;
|
return yield;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* End of pcre_maketables.c */
|
/* End of pcre_maketables.c */
|
||||||
|
|||||||
@@ -1,156 +1,156 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* PCRE is a library of functions to support regular expressions whose syntax
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
and semantics are as close as possible to those of the Perl 5 language.
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
Written by Philip Hazel
|
Written by Philip Hazel
|
||||||
Copyright (c) 1997-2007 University of Cambridge
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
contributors may be used to endorse or promote products derived from
|
contributors may be used to endorse or promote products derived from
|
||||||
this software without specific prior written permission.
|
this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* This module contains internal functions for testing newlines when more than
|
/* This module contains internal functions for testing newlines when more than
|
||||||
one kind of newline is to be recognized. When a newline is found, its length is
|
one kind of newline is to be recognized. When a newline is found, its length is
|
||||||
returned. In principle, we could implement several newline "types", each
|
returned. In principle, we could implement several newline "types", each
|
||||||
referring to a different set of newline characters. At present, PCRE supports
|
referring to a different set of newline characters. At present, PCRE supports
|
||||||
only NLTYPE_FIXED, which gets handled without these functions, NLTYPE_ANYCRLF,
|
only NLTYPE_FIXED, which gets handled without these functions, NLTYPE_ANYCRLF,
|
||||||
and NLTYPE_ANY. The full list of Unicode newline characters is taken from
|
and NLTYPE_ANY. The full list of Unicode newline characters is taken from
|
||||||
http://unicode.org/unicode/reports/tr18/. */
|
http://unicode.org/unicode/reports/tr18/. */
|
||||||
|
|
||||||
|
|
||||||
#include "pcre_internal.h"
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
* Check for newline at given position *
|
* Check for newline at given position *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* It is guaranteed that the initial value of ptr is less than the end of the
|
/* It is guaranteed that the initial value of ptr is less than the end of the
|
||||||
string that is being processed.
|
string that is being processed.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
ptr pointer to possible newline
|
ptr pointer to possible newline
|
||||||
type the newline type
|
type the newline type
|
||||||
endptr pointer to the end of the string
|
endptr pointer to the end of the string
|
||||||
lenptr where to return the length
|
lenptr where to return the length
|
||||||
utf8 TRUE if in utf8 mode
|
utf8 TRUE if in utf8 mode
|
||||||
|
|
||||||
Returns: TRUE or FALSE
|
Returns: TRUE or FALSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
_pcre_is_newline(const uschar *ptr, int type, const uschar *endptr,
|
_pcre_is_newline(const uschar *ptr, int type, const uschar *endptr,
|
||||||
int *lenptr, BOOL utf8)
|
int *lenptr, BOOL utf8)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
if (utf8) { GETCHAR(c, ptr); } else c = *ptr;
|
if (utf8) { GETCHAR(c, ptr); } else c = *ptr;
|
||||||
|
|
||||||
if (type == NLTYPE_ANYCRLF) switch(c)
|
if (type == NLTYPE_ANYCRLF) switch(c)
|
||||||
{
|
{
|
||||||
case 0x000a: *lenptr = 1; return TRUE; /* LF */
|
case 0x000a: *lenptr = 1; return TRUE; /* LF */
|
||||||
case 0x000d: *lenptr = (ptr < endptr - 1 && ptr[1] == 0x0a)? 2 : 1;
|
case 0x000d: *lenptr = (ptr < endptr - 1 && ptr[1] == 0x0a)? 2 : 1;
|
||||||
return TRUE; /* CR */
|
return TRUE; /* CR */
|
||||||
default: return FALSE;
|
default: return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NLTYPE_ANY */
|
/* NLTYPE_ANY */
|
||||||
|
|
||||||
else switch(c)
|
else switch(c)
|
||||||
{
|
{
|
||||||
case 0x000a: /* LF */
|
case 0x000a: /* LF */
|
||||||
case 0x000b: /* VT */
|
case 0x000b: /* VT */
|
||||||
case 0x000c: *lenptr = 1; return TRUE; /* FF */
|
case 0x000c: *lenptr = 1; return TRUE; /* FF */
|
||||||
case 0x000d: *lenptr = (ptr < endptr - 1 && ptr[1] == 0x0a)? 2 : 1;
|
case 0x000d: *lenptr = (ptr < endptr - 1 && ptr[1] == 0x0a)? 2 : 1;
|
||||||
return TRUE; /* CR */
|
return TRUE; /* CR */
|
||||||
case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */
|
case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */
|
||||||
case 0x2028: /* LS */
|
case 0x2028: /* LS */
|
||||||
case 0x2029: *lenptr = 3; return TRUE; /* PS */
|
case 0x2029: *lenptr = 3; return TRUE; /* PS */
|
||||||
default: return FALSE;
|
default: return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
* Check for newline at previous position *
|
* Check for newline at previous position *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* It is guaranteed that the initial value of ptr is greater than the start of
|
/* It is guaranteed that the initial value of ptr is greater than the start of
|
||||||
the string that is being processed.
|
the string that is being processed.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
ptr pointer to possible newline
|
ptr pointer to possible newline
|
||||||
type the newline type
|
type the newline type
|
||||||
startptr pointer to the start of the string
|
startptr pointer to the start of the string
|
||||||
lenptr where to return the length
|
lenptr where to return the length
|
||||||
utf8 TRUE if in utf8 mode
|
utf8 TRUE if in utf8 mode
|
||||||
|
|
||||||
Returns: TRUE or FALSE
|
Returns: TRUE or FALSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
_pcre_was_newline(const uschar *ptr, int type, const uschar *startptr,
|
_pcre_was_newline(const uschar *ptr, int type, const uschar *startptr,
|
||||||
int *lenptr, BOOL utf8)
|
int *lenptr, BOOL utf8)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
ptr--;
|
ptr--;
|
||||||
if (utf8)
|
if (utf8)
|
||||||
{
|
{
|
||||||
BACKCHAR(ptr);
|
BACKCHAR(ptr);
|
||||||
GETCHAR(c, ptr);
|
GETCHAR(c, ptr);
|
||||||
}
|
}
|
||||||
else c = *ptr;
|
else c = *ptr;
|
||||||
|
|
||||||
if (type == NLTYPE_ANYCRLF) switch(c)
|
if (type == NLTYPE_ANYCRLF) switch(c)
|
||||||
{
|
{
|
||||||
case 0x000a: *lenptr = (ptr > startptr && ptr[-1] == 0x0d)? 2 : 1;
|
case 0x000a: *lenptr = (ptr > startptr && ptr[-1] == 0x0d)? 2 : 1;
|
||||||
return TRUE; /* LF */
|
return TRUE; /* LF */
|
||||||
case 0x000d: *lenptr = 1; return TRUE; /* CR */
|
case 0x000d: *lenptr = 1; return TRUE; /* CR */
|
||||||
default: return FALSE;
|
default: return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
else switch(c)
|
else switch(c)
|
||||||
{
|
{
|
||||||
case 0x000a: *lenptr = (ptr > startptr && ptr[-1] == 0x0d)? 2 : 1;
|
case 0x000a: *lenptr = (ptr > startptr && ptr[-1] == 0x0d)? 2 : 1;
|
||||||
return TRUE; /* LF */
|
return TRUE; /* LF */
|
||||||
case 0x000b: /* VT */
|
case 0x000b: /* VT */
|
||||||
case 0x000c: /* FF */
|
case 0x000c: /* FF */
|
||||||
case 0x000d: *lenptr = 1; return TRUE; /* CR */
|
case 0x000d: *lenptr = 1; return TRUE; /* CR */
|
||||||
case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */
|
case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */
|
||||||
case 0x2028: /* LS */
|
case 0x2028: /* LS */
|
||||||
case 0x2029: *lenptr = 3; return TRUE; /* PS */
|
case 0x2029: *lenptr = 3; return TRUE; /* PS */
|
||||||
default: return FALSE;
|
default: return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* End of pcre_newline.c */
|
/* End of pcre_newline.c */
|
||||||
|
|||||||
@@ -1,82 +1,82 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* PCRE is a library of functions to support regular expressions whose syntax
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
and semantics are as close as possible to those of the Perl 5 language.
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
Written by Philip Hazel
|
Written by Philip Hazel
|
||||||
Copyright (c) 1997-2007 University of Cambridge
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
contributors may be used to endorse or promote products derived from
|
contributors may be used to endorse or promote products derived from
|
||||||
this software without specific prior written permission.
|
this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* This file contains a private PCRE function that converts an ordinal
|
/* This file contains a private PCRE function that converts an ordinal
|
||||||
character value into a UTF8 string. */
|
character value into a UTF8 string. */
|
||||||
|
|
||||||
|
|
||||||
#include "pcre_internal.h"
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
* Convert character value to UTF-8 *
|
* Convert character value to UTF-8 *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* This function takes an integer value in the range 0 - 0x7fffffff
|
/* This function takes an integer value in the range 0 - 0x7fffffff
|
||||||
and encodes it as a UTF-8 character in 0 to 6 bytes.
|
and encodes it as a UTF-8 character in 0 to 6 bytes.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
cvalue the character value
|
cvalue the character value
|
||||||
buffer pointer to buffer for result - at least 6 bytes long
|
buffer pointer to buffer for result - at least 6 bytes long
|
||||||
|
|
||||||
Returns: number of characters placed in the buffer
|
Returns: number of characters placed in the buffer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
_pcre_ord2utf8(int cvalue, uschar *buffer)
|
_pcre_ord2utf8(int cvalue, uschar *buffer)
|
||||||
{
|
{
|
||||||
#ifdef SUPPORT_UTF8
|
#ifdef SUPPORT_UTF8
|
||||||
register int i, j;
|
register int i, j;
|
||||||
for (i = 0; i < _pcre_utf8_table1_size; i++)
|
for (i = 0; i < _pcre_utf8_table1_size; i++)
|
||||||
if (cvalue <= _pcre_utf8_table1[i]) break;
|
if (cvalue <= _pcre_utf8_table1[i]) break;
|
||||||
buffer += i;
|
buffer += i;
|
||||||
for (j = i; j > 0; j--)
|
for (j = i; j > 0; j--)
|
||||||
{
|
{
|
||||||
*buffer-- = 0x80 | (cvalue & 0x3f);
|
*buffer-- = 0x80 | (cvalue & 0x3f);
|
||||||
cvalue >>= 6;
|
cvalue >>= 6;
|
||||||
}
|
}
|
||||||
*buffer = _pcre_utf8_table2[i] | cvalue;
|
*buffer = _pcre_utf8_table2[i] | cvalue;
|
||||||
return i + 1;
|
return i + 1;
|
||||||
#else
|
#else
|
||||||
return 0; /* Keep compiler happy; this function won't ever be */
|
return 0; /* Keep compiler happy; this function won't ever be */
|
||||||
#endif /* called when SUPPORT_UTF8 is not defined. */
|
#endif /* called when SUPPORT_UTF8 is not defined. */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* End of pcre_ord2utf8.c */
|
/* End of pcre_ord2utf8.c */
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,201 +1,201 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* PCRE is a library of functions to support regular expressions whose syntax
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
and semantics are as close as possible to those of the Perl 5 language.
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
Written by Philip Hazel
|
Written by Philip Hazel
|
||||||
Copyright (c) 1997-2007 University of Cambridge
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
contributors may be used to endorse or promote products derived from
|
contributors may be used to endorse or promote products derived from
|
||||||
this software without specific prior written permission.
|
this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* This module contains some fixed tables that are used by more than one of the
|
/* This module contains some fixed tables that are used by more than one of the
|
||||||
PCRE code modules. The tables are also #included by the pcretest program, which
|
PCRE code modules. The tables are also #included by the pcretest program, which
|
||||||
uses macros to change their names from _pcre_xxx to xxxx, thereby avoiding name
|
uses macros to change their names from _pcre_xxx to xxxx, thereby avoiding name
|
||||||
clashes with the library. */
|
clashes with the library. */
|
||||||
|
|
||||||
|
|
||||||
#include "pcre_internal.h"
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
/* Table of sizes for the fixed-length opcodes. It's defined in a macro so that
|
/* Table of sizes for the fixed-length opcodes. It's defined in a macro so that
|
||||||
the definition is next to the definition of the opcodes in pcre_internal.h. */
|
the definition is next to the definition of the opcodes in pcre_internal.h. */
|
||||||
|
|
||||||
const uschar _pcre_OP_lengths[] = { OP_LENGTHS };
|
const uschar _pcre_OP_lengths[] = { OP_LENGTHS };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
* Tables for UTF-8 support *
|
* Tables for UTF-8 support *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* These are the breakpoints for different numbers of bytes in a UTF-8
|
/* These are the breakpoints for different numbers of bytes in a UTF-8
|
||||||
character. */
|
character. */
|
||||||
|
|
||||||
#ifdef SUPPORT_UTF8
|
#ifdef SUPPORT_UTF8
|
||||||
|
|
||||||
const int _pcre_utf8_table1[] =
|
const int _pcre_utf8_table1[] =
|
||||||
{ 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff};
|
{ 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff};
|
||||||
|
|
||||||
const int _pcre_utf8_table1_size = sizeof(_pcre_utf8_table1)/sizeof(int);
|
const int _pcre_utf8_table1_size = sizeof(_pcre_utf8_table1)/sizeof(int);
|
||||||
|
|
||||||
/* These are the indicator bits and the mask for the data bits to set in the
|
/* These are the indicator bits and the mask for the data bits to set in the
|
||||||
first byte of a character, indexed by the number of additional bytes. */
|
first byte of a character, indexed by the number of additional bytes. */
|
||||||
|
|
||||||
const int _pcre_utf8_table2[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc};
|
const int _pcre_utf8_table2[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc};
|
||||||
const int _pcre_utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01};
|
const int _pcre_utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01};
|
||||||
|
|
||||||
/* Table of the number of extra bytes, indexed by the first byte masked with
|
/* Table of the number of extra bytes, indexed by the first byte masked with
|
||||||
0x3f. The highest number for a valid UTF-8 first byte is in fact 0x3d. */
|
0x3f. The highest number for a valid UTF-8 first byte is in fact 0x3d. */
|
||||||
|
|
||||||
const uschar _pcre_utf8_table4[] = {
|
const uschar _pcre_utf8_table4[] = {
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||||
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
|
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
|
||||||
3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 };
|
3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 };
|
||||||
|
|
||||||
/* This table translates Unicode property names into type and code values. It
|
/* This table translates Unicode property names into type and code values. It
|
||||||
is searched by binary chop, so must be in collating sequence of name. */
|
is searched by binary chop, so must be in collating sequence of name. */
|
||||||
|
|
||||||
const ucp_type_table _pcre_utt[] = {
|
const ucp_type_table _pcre_utt[] = {
|
||||||
{ "Any", PT_ANY, 0 },
|
{ "Any", PT_ANY, 0 },
|
||||||
{ "Arabic", PT_SC, ucp_Arabic },
|
{ "Arabic", PT_SC, ucp_Arabic },
|
||||||
{ "Armenian", PT_SC, ucp_Armenian },
|
{ "Armenian", PT_SC, ucp_Armenian },
|
||||||
{ "Balinese", PT_SC, ucp_Balinese },
|
{ "Balinese", PT_SC, ucp_Balinese },
|
||||||
{ "Bengali", PT_SC, ucp_Bengali },
|
{ "Bengali", PT_SC, ucp_Bengali },
|
||||||
{ "Bopomofo", PT_SC, ucp_Bopomofo },
|
{ "Bopomofo", PT_SC, ucp_Bopomofo },
|
||||||
{ "Braille", PT_SC, ucp_Braille },
|
{ "Braille", PT_SC, ucp_Braille },
|
||||||
{ "Buginese", PT_SC, ucp_Buginese },
|
{ "Buginese", PT_SC, ucp_Buginese },
|
||||||
{ "Buhid", PT_SC, ucp_Buhid },
|
{ "Buhid", PT_SC, ucp_Buhid },
|
||||||
{ "C", PT_GC, ucp_C },
|
{ "C", PT_GC, ucp_C },
|
||||||
{ "Canadian_Aboriginal", PT_SC, ucp_Canadian_Aboriginal },
|
{ "Canadian_Aboriginal", PT_SC, ucp_Canadian_Aboriginal },
|
||||||
{ "Cc", PT_PC, ucp_Cc },
|
{ "Cc", PT_PC, ucp_Cc },
|
||||||
{ "Cf", PT_PC, ucp_Cf },
|
{ "Cf", PT_PC, ucp_Cf },
|
||||||
{ "Cherokee", PT_SC, ucp_Cherokee },
|
{ "Cherokee", PT_SC, ucp_Cherokee },
|
||||||
{ "Cn", PT_PC, ucp_Cn },
|
{ "Cn", PT_PC, ucp_Cn },
|
||||||
{ "Co", PT_PC, ucp_Co },
|
{ "Co", PT_PC, ucp_Co },
|
||||||
{ "Common", PT_SC, ucp_Common },
|
{ "Common", PT_SC, ucp_Common },
|
||||||
{ "Coptic", PT_SC, ucp_Coptic },
|
{ "Coptic", PT_SC, ucp_Coptic },
|
||||||
{ "Cs", PT_PC, ucp_Cs },
|
{ "Cs", PT_PC, ucp_Cs },
|
||||||
{ "Cuneiform", PT_SC, ucp_Cuneiform },
|
{ "Cuneiform", PT_SC, ucp_Cuneiform },
|
||||||
{ "Cypriot", PT_SC, ucp_Cypriot },
|
{ "Cypriot", PT_SC, ucp_Cypriot },
|
||||||
{ "Cyrillic", PT_SC, ucp_Cyrillic },
|
{ "Cyrillic", PT_SC, ucp_Cyrillic },
|
||||||
{ "Deseret", PT_SC, ucp_Deseret },
|
{ "Deseret", PT_SC, ucp_Deseret },
|
||||||
{ "Devanagari", PT_SC, ucp_Devanagari },
|
{ "Devanagari", PT_SC, ucp_Devanagari },
|
||||||
{ "Ethiopic", PT_SC, ucp_Ethiopic },
|
{ "Ethiopic", PT_SC, ucp_Ethiopic },
|
||||||
{ "Georgian", PT_SC, ucp_Georgian },
|
{ "Georgian", PT_SC, ucp_Georgian },
|
||||||
{ "Glagolitic", PT_SC, ucp_Glagolitic },
|
{ "Glagolitic", PT_SC, ucp_Glagolitic },
|
||||||
{ "Gothic", PT_SC, ucp_Gothic },
|
{ "Gothic", PT_SC, ucp_Gothic },
|
||||||
{ "Greek", PT_SC, ucp_Greek },
|
{ "Greek", PT_SC, ucp_Greek },
|
||||||
{ "Gujarati", PT_SC, ucp_Gujarati },
|
{ "Gujarati", PT_SC, ucp_Gujarati },
|
||||||
{ "Gurmukhi", PT_SC, ucp_Gurmukhi },
|
{ "Gurmukhi", PT_SC, ucp_Gurmukhi },
|
||||||
{ "Han", PT_SC, ucp_Han },
|
{ "Han", PT_SC, ucp_Han },
|
||||||
{ "Hangul", PT_SC, ucp_Hangul },
|
{ "Hangul", PT_SC, ucp_Hangul },
|
||||||
{ "Hanunoo", PT_SC, ucp_Hanunoo },
|
{ "Hanunoo", PT_SC, ucp_Hanunoo },
|
||||||
{ "Hebrew", PT_SC, ucp_Hebrew },
|
{ "Hebrew", PT_SC, ucp_Hebrew },
|
||||||
{ "Hiragana", PT_SC, ucp_Hiragana },
|
{ "Hiragana", PT_SC, ucp_Hiragana },
|
||||||
{ "Inherited", PT_SC, ucp_Inherited },
|
{ "Inherited", PT_SC, ucp_Inherited },
|
||||||
{ "Kannada", PT_SC, ucp_Kannada },
|
{ "Kannada", PT_SC, ucp_Kannada },
|
||||||
{ "Katakana", PT_SC, ucp_Katakana },
|
{ "Katakana", PT_SC, ucp_Katakana },
|
||||||
{ "Kharoshthi", PT_SC, ucp_Kharoshthi },
|
{ "Kharoshthi", PT_SC, ucp_Kharoshthi },
|
||||||
{ "Khmer", PT_SC, ucp_Khmer },
|
{ "Khmer", PT_SC, ucp_Khmer },
|
||||||
{ "L", PT_GC, ucp_L },
|
{ "L", PT_GC, ucp_L },
|
||||||
{ "L&", PT_LAMP, 0 },
|
{ "L&", PT_LAMP, 0 },
|
||||||
{ "Lao", PT_SC, ucp_Lao },
|
{ "Lao", PT_SC, ucp_Lao },
|
||||||
{ "Latin", PT_SC, ucp_Latin },
|
{ "Latin", PT_SC, ucp_Latin },
|
||||||
{ "Limbu", PT_SC, ucp_Limbu },
|
{ "Limbu", PT_SC, ucp_Limbu },
|
||||||
{ "Linear_B", PT_SC, ucp_Linear_B },
|
{ "Linear_B", PT_SC, ucp_Linear_B },
|
||||||
{ "Ll", PT_PC, ucp_Ll },
|
{ "Ll", PT_PC, ucp_Ll },
|
||||||
{ "Lm", PT_PC, ucp_Lm },
|
{ "Lm", PT_PC, ucp_Lm },
|
||||||
{ "Lo", PT_PC, ucp_Lo },
|
{ "Lo", PT_PC, ucp_Lo },
|
||||||
{ "Lt", PT_PC, ucp_Lt },
|
{ "Lt", PT_PC, ucp_Lt },
|
||||||
{ "Lu", PT_PC, ucp_Lu },
|
{ "Lu", PT_PC, ucp_Lu },
|
||||||
{ "M", PT_GC, ucp_M },
|
{ "M", PT_GC, ucp_M },
|
||||||
{ "Malayalam", PT_SC, ucp_Malayalam },
|
{ "Malayalam", PT_SC, ucp_Malayalam },
|
||||||
{ "Mc", PT_PC, ucp_Mc },
|
{ "Mc", PT_PC, ucp_Mc },
|
||||||
{ "Me", PT_PC, ucp_Me },
|
{ "Me", PT_PC, ucp_Me },
|
||||||
{ "Mn", PT_PC, ucp_Mn },
|
{ "Mn", PT_PC, ucp_Mn },
|
||||||
{ "Mongolian", PT_SC, ucp_Mongolian },
|
{ "Mongolian", PT_SC, ucp_Mongolian },
|
||||||
{ "Myanmar", PT_SC, ucp_Myanmar },
|
{ "Myanmar", PT_SC, ucp_Myanmar },
|
||||||
{ "N", PT_GC, ucp_N },
|
{ "N", PT_GC, ucp_N },
|
||||||
{ "Nd", PT_PC, ucp_Nd },
|
{ "Nd", PT_PC, ucp_Nd },
|
||||||
{ "New_Tai_Lue", PT_SC, ucp_New_Tai_Lue },
|
{ "New_Tai_Lue", PT_SC, ucp_New_Tai_Lue },
|
||||||
{ "Nko", PT_SC, ucp_Nko },
|
{ "Nko", PT_SC, ucp_Nko },
|
||||||
{ "Nl", PT_PC, ucp_Nl },
|
{ "Nl", PT_PC, ucp_Nl },
|
||||||
{ "No", PT_PC, ucp_No },
|
{ "No", PT_PC, ucp_No },
|
||||||
{ "Ogham", PT_SC, ucp_Ogham },
|
{ "Ogham", PT_SC, ucp_Ogham },
|
||||||
{ "Old_Italic", PT_SC, ucp_Old_Italic },
|
{ "Old_Italic", PT_SC, ucp_Old_Italic },
|
||||||
{ "Old_Persian", PT_SC, ucp_Old_Persian },
|
{ "Old_Persian", PT_SC, ucp_Old_Persian },
|
||||||
{ "Oriya", PT_SC, ucp_Oriya },
|
{ "Oriya", PT_SC, ucp_Oriya },
|
||||||
{ "Osmanya", PT_SC, ucp_Osmanya },
|
{ "Osmanya", PT_SC, ucp_Osmanya },
|
||||||
{ "P", PT_GC, ucp_P },
|
{ "P", PT_GC, ucp_P },
|
||||||
{ "Pc", PT_PC, ucp_Pc },
|
{ "Pc", PT_PC, ucp_Pc },
|
||||||
{ "Pd", PT_PC, ucp_Pd },
|
{ "Pd", PT_PC, ucp_Pd },
|
||||||
{ "Pe", PT_PC, ucp_Pe },
|
{ "Pe", PT_PC, ucp_Pe },
|
||||||
{ "Pf", PT_PC, ucp_Pf },
|
{ "Pf", PT_PC, ucp_Pf },
|
||||||
{ "Phags_Pa", PT_SC, ucp_Phags_Pa },
|
{ "Phags_Pa", PT_SC, ucp_Phags_Pa },
|
||||||
{ "Phoenician", PT_SC, ucp_Phoenician },
|
{ "Phoenician", PT_SC, ucp_Phoenician },
|
||||||
{ "Pi", PT_PC, ucp_Pi },
|
{ "Pi", PT_PC, ucp_Pi },
|
||||||
{ "Po", PT_PC, ucp_Po },
|
{ "Po", PT_PC, ucp_Po },
|
||||||
{ "Ps", PT_PC, ucp_Ps },
|
{ "Ps", PT_PC, ucp_Ps },
|
||||||
{ "Runic", PT_SC, ucp_Runic },
|
{ "Runic", PT_SC, ucp_Runic },
|
||||||
{ "S", PT_GC, ucp_S },
|
{ "S", PT_GC, ucp_S },
|
||||||
{ "Sc", PT_PC, ucp_Sc },
|
{ "Sc", PT_PC, ucp_Sc },
|
||||||
{ "Shavian", PT_SC, ucp_Shavian },
|
{ "Shavian", PT_SC, ucp_Shavian },
|
||||||
{ "Sinhala", PT_SC, ucp_Sinhala },
|
{ "Sinhala", PT_SC, ucp_Sinhala },
|
||||||
{ "Sk", PT_PC, ucp_Sk },
|
{ "Sk", PT_PC, ucp_Sk },
|
||||||
{ "Sm", PT_PC, ucp_Sm },
|
{ "Sm", PT_PC, ucp_Sm },
|
||||||
{ "So", PT_PC, ucp_So },
|
{ "So", PT_PC, ucp_So },
|
||||||
{ "Syloti_Nagri", PT_SC, ucp_Syloti_Nagri },
|
{ "Syloti_Nagri", PT_SC, ucp_Syloti_Nagri },
|
||||||
{ "Syriac", PT_SC, ucp_Syriac },
|
{ "Syriac", PT_SC, ucp_Syriac },
|
||||||
{ "Tagalog", PT_SC, ucp_Tagalog },
|
{ "Tagalog", PT_SC, ucp_Tagalog },
|
||||||
{ "Tagbanwa", PT_SC, ucp_Tagbanwa },
|
{ "Tagbanwa", PT_SC, ucp_Tagbanwa },
|
||||||
{ "Tai_Le", PT_SC, ucp_Tai_Le },
|
{ "Tai_Le", PT_SC, ucp_Tai_Le },
|
||||||
{ "Tamil", PT_SC, ucp_Tamil },
|
{ "Tamil", PT_SC, ucp_Tamil },
|
||||||
{ "Telugu", PT_SC, ucp_Telugu },
|
{ "Telugu", PT_SC, ucp_Telugu },
|
||||||
{ "Thaana", PT_SC, ucp_Thaana },
|
{ "Thaana", PT_SC, ucp_Thaana },
|
||||||
{ "Thai", PT_SC, ucp_Thai },
|
{ "Thai", PT_SC, ucp_Thai },
|
||||||
{ "Tibetan", PT_SC, ucp_Tibetan },
|
{ "Tibetan", PT_SC, ucp_Tibetan },
|
||||||
{ "Tifinagh", PT_SC, ucp_Tifinagh },
|
{ "Tifinagh", PT_SC, ucp_Tifinagh },
|
||||||
{ "Ugaritic", PT_SC, ucp_Ugaritic },
|
{ "Ugaritic", PT_SC, ucp_Ugaritic },
|
||||||
{ "Yi", PT_SC, ucp_Yi },
|
{ "Yi", PT_SC, ucp_Yi },
|
||||||
{ "Z", PT_GC, ucp_Z },
|
{ "Z", PT_GC, ucp_Z },
|
||||||
{ "Zl", PT_PC, ucp_Zl },
|
{ "Zl", PT_PC, ucp_Zl },
|
||||||
{ "Zp", PT_PC, ucp_Zp },
|
{ "Zp", PT_PC, ucp_Zp },
|
||||||
{ "Zs", PT_PC, ucp_Zs }
|
{ "Zs", PT_PC, ucp_Zs }
|
||||||
};
|
};
|
||||||
|
|
||||||
const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table);
|
const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table);
|
||||||
|
|
||||||
#endif /* SUPPORT_UTF8 */
|
#endif /* SUPPORT_UTF8 */
|
||||||
|
|
||||||
/* End of pcre_tables.c */
|
/* End of pcre_tables.c */
|
||||||
|
|||||||
@@ -1,132 +1,132 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* PCRE is a library of functions to support regular expressions whose syntax
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
and semantics are as close as possible to those of the Perl 5 language.
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
Written by Philip Hazel
|
Written by Philip Hazel
|
||||||
Copyright (c) 1997-2007 University of Cambridge
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
contributors may be used to endorse or promote products derived from
|
contributors may be used to endorse or promote products derived from
|
||||||
this software without specific prior written permission.
|
this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* This module contains an internal function that tests a compiled pattern to
|
/* This module contains an internal function that tests a compiled pattern to
|
||||||
see if it was compiled with the opposite endianness. If so, it uses an
|
see if it was compiled with the opposite endianness. If so, it uses an
|
||||||
auxiliary local function to flip the appropriate bytes. */
|
auxiliary local function to flip the appropriate bytes. */
|
||||||
|
|
||||||
|
|
||||||
#include "pcre_internal.h"
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
* Flip bytes in an integer *
|
* Flip bytes in an integer *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* This function is called when the magic number in a regex doesn't match, in
|
/* This function is called when the magic number in a regex doesn't match, in
|
||||||
order to flip its bytes to see if we are dealing with a pattern that was
|
order to flip its bytes to see if we are dealing with a pattern that was
|
||||||
compiled on a host of different endianness. If so, this function is used to
|
compiled on a host of different endianness. If so, this function is used to
|
||||||
flip other byte values.
|
flip other byte values.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
value the number to flip
|
value the number to flip
|
||||||
n the number of bytes to flip (assumed to be 2 or 4)
|
n the number of bytes to flip (assumed to be 2 or 4)
|
||||||
|
|
||||||
Returns: the flipped value
|
Returns: the flipped value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static unsigned long int
|
static unsigned long int
|
||||||
byteflip(unsigned long int value, int n)
|
byteflip(unsigned long int value, int n)
|
||||||
{
|
{
|
||||||
if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8);
|
if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8);
|
||||||
return ((value & 0x000000ff) << 24) |
|
return ((value & 0x000000ff) << 24) |
|
||||||
((value & 0x0000ff00) << 8) |
|
((value & 0x0000ff00) << 8) |
|
||||||
((value & 0x00ff0000) >> 8) |
|
((value & 0x00ff0000) >> 8) |
|
||||||
((value & 0xff000000) >> 24);
|
((value & 0xff000000) >> 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
* Test for a byte-flipped compiled regex *
|
* Test for a byte-flipped compiled regex *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* This function is called from pcre_exec(), pcre_dfa_exec(), and also from
|
/* This function is called from pcre_exec(), pcre_dfa_exec(), and also from
|
||||||
pcre_fullinfo(). Its job is to test whether the regex is byte-flipped - that
|
pcre_fullinfo(). Its job is to test whether the regex is byte-flipped - that
|
||||||
is, it was compiled on a system of opposite endianness. The function is called
|
is, it was compiled on a system of opposite endianness. The function is called
|
||||||
only when the native MAGIC_NUMBER test fails. If the regex is indeed flipped,
|
only when the native MAGIC_NUMBER test fails. If the regex is indeed flipped,
|
||||||
we flip all the relevant values into a different data block, and return it.
|
we flip all the relevant values into a different data block, and return it.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
re points to the regex
|
re points to the regex
|
||||||
study points to study data, or NULL
|
study points to study data, or NULL
|
||||||
internal_re points to a new regex block
|
internal_re points to a new regex block
|
||||||
internal_study points to a new study block
|
internal_study points to a new study block
|
||||||
|
|
||||||
Returns: the new block if is is indeed a byte-flipped regex
|
Returns: the new block if is is indeed a byte-flipped regex
|
||||||
NULL if it is not
|
NULL if it is not
|
||||||
*/
|
*/
|
||||||
|
|
||||||
real_pcre *
|
real_pcre *
|
||||||
_pcre_try_flipped(const real_pcre *re, real_pcre *internal_re,
|
_pcre_try_flipped(const real_pcre *re, real_pcre *internal_re,
|
||||||
const pcre_study_data *study, pcre_study_data *internal_study)
|
const pcre_study_data *study, pcre_study_data *internal_study)
|
||||||
{
|
{
|
||||||
if (byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER)
|
if (byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
*internal_re = *re; /* To copy other fields */
|
*internal_re = *re; /* To copy other fields */
|
||||||
internal_re->size = byteflip(re->size, sizeof(re->size));
|
internal_re->size = byteflip(re->size, sizeof(re->size));
|
||||||
internal_re->options = byteflip(re->options, sizeof(re->options));
|
internal_re->options = byteflip(re->options, sizeof(re->options));
|
||||||
internal_re->top_bracket =
|
internal_re->top_bracket =
|
||||||
(pcre_uint16)byteflip(re->top_bracket, sizeof(re->top_bracket));
|
(pcre_uint16)byteflip(re->top_bracket, sizeof(re->top_bracket));
|
||||||
internal_re->top_backref =
|
internal_re->top_backref =
|
||||||
(pcre_uint16)byteflip(re->top_backref, sizeof(re->top_backref));
|
(pcre_uint16)byteflip(re->top_backref, sizeof(re->top_backref));
|
||||||
internal_re->first_byte =
|
internal_re->first_byte =
|
||||||
(pcre_uint16)byteflip(re->first_byte, sizeof(re->first_byte));
|
(pcre_uint16)byteflip(re->first_byte, sizeof(re->first_byte));
|
||||||
internal_re->req_byte =
|
internal_re->req_byte =
|
||||||
(pcre_uint16)byteflip(re->req_byte, sizeof(re->req_byte));
|
(pcre_uint16)byteflip(re->req_byte, sizeof(re->req_byte));
|
||||||
internal_re->name_table_offset =
|
internal_re->name_table_offset =
|
||||||
(pcre_uint16)byteflip(re->name_table_offset, sizeof(re->name_table_offset));
|
(pcre_uint16)byteflip(re->name_table_offset, sizeof(re->name_table_offset));
|
||||||
internal_re->name_entry_size =
|
internal_re->name_entry_size =
|
||||||
(pcre_uint16)byteflip(re->name_entry_size, sizeof(re->name_entry_size));
|
(pcre_uint16)byteflip(re->name_entry_size, sizeof(re->name_entry_size));
|
||||||
internal_re->name_count =
|
internal_re->name_count =
|
||||||
(pcre_uint16)byteflip(re->name_count, sizeof(re->name_count));
|
(pcre_uint16)byteflip(re->name_count, sizeof(re->name_count));
|
||||||
|
|
||||||
if (study != NULL)
|
if (study != NULL)
|
||||||
{
|
{
|
||||||
*internal_study = *study; /* To copy other fields */
|
*internal_study = *study; /* To copy other fields */
|
||||||
internal_study->size = byteflip(study->size, sizeof(study->size));
|
internal_study->size = byteflip(study->size, sizeof(study->size));
|
||||||
internal_study->options = byteflip(study->options, sizeof(study->options));
|
internal_study->options = byteflip(study->options, sizeof(study->options));
|
||||||
}
|
}
|
||||||
|
|
||||||
return internal_re;
|
return internal_re;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* End of pcre_tryflipped.c */
|
/* End of pcre_tryflipped.c */
|
||||||
|
|||||||
@@ -1,175 +1,175 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* PCRE is a library of functions to support regular expressions whose syntax
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
and semantics are as close as possible to those of the Perl 5 language.
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
Written by Philip Hazel
|
Written by Philip Hazel
|
||||||
Copyright (c) 1997-2007 University of Cambridge
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
contributors may be used to endorse or promote products derived from
|
contributors may be used to endorse or promote products derived from
|
||||||
this software without specific prior written permission.
|
this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* This module contains code for searching the table of Unicode character
|
/* This module contains code for searching the table of Unicode character
|
||||||
properties. */
|
properties. */
|
||||||
|
|
||||||
#include "pcre_internal.h"
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
#include "ucp.h" /* Category definitions */
|
#include "ucp.h" /* Category definitions */
|
||||||
#include "ucpinternal.h" /* Internal table details */
|
#include "ucpinternal.h" /* Internal table details */
|
||||||
#include "ucptable.h" /* The table itself */
|
#include "ucptable.h" /* The table itself */
|
||||||
|
|
||||||
|
|
||||||
/* Table to translate from particular type value to the general value. */
|
/* Table to translate from particular type value to the general value. */
|
||||||
|
|
||||||
static const int ucp_gentype[] = {
|
static const int ucp_gentype[] = {
|
||||||
ucp_C, ucp_C, ucp_C, ucp_C, ucp_C, /* Cc, Cf, Cn, Co, Cs */
|
ucp_C, ucp_C, ucp_C, ucp_C, ucp_C, /* Cc, Cf, Cn, Co, Cs */
|
||||||
ucp_L, ucp_L, ucp_L, ucp_L, ucp_L, /* Ll, Lu, Lm, Lo, Lt */
|
ucp_L, ucp_L, ucp_L, ucp_L, ucp_L, /* Ll, Lu, Lm, Lo, Lt */
|
||||||
ucp_M, ucp_M, ucp_M, /* Mc, Me, Mn */
|
ucp_M, ucp_M, ucp_M, /* Mc, Me, Mn */
|
||||||
ucp_N, ucp_N, ucp_N, /* Nd, Nl, No */
|
ucp_N, ucp_N, ucp_N, /* Nd, Nl, No */
|
||||||
ucp_P, ucp_P, ucp_P, ucp_P, ucp_P, /* Pc, Pd, Pe, Pf, Pi */
|
ucp_P, ucp_P, ucp_P, ucp_P, ucp_P, /* Pc, Pd, Pe, Pf, Pi */
|
||||||
ucp_P, ucp_P, /* Ps, Po */
|
ucp_P, ucp_P, /* Ps, Po */
|
||||||
ucp_S, ucp_S, ucp_S, ucp_S, /* Sc, Sk, Sm, So */
|
ucp_S, ucp_S, ucp_S, ucp_S, /* Sc, Sk, Sm, So */
|
||||||
ucp_Z, ucp_Z, ucp_Z /* Zl, Zp, Zs */
|
ucp_Z, ucp_Z, ucp_Z /* Zl, Zp, Zs */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
* Search table and return type *
|
* Search table and return type *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* Three values are returned: the category is ucp_C, ucp_L, etc. The detailed
|
/* Three values are returned: the category is ucp_C, ucp_L, etc. The detailed
|
||||||
character type is ucp_Lu, ucp_Nd, etc. The script is ucp_Latin, etc.
|
character type is ucp_Lu, ucp_Nd, etc. The script is ucp_Latin, etc.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
c the character value
|
c the character value
|
||||||
type_ptr the detailed character type is returned here
|
type_ptr the detailed character type is returned here
|
||||||
script_ptr the script is returned here
|
script_ptr the script is returned here
|
||||||
|
|
||||||
Returns: the character type category
|
Returns: the character type category
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
_pcre_ucp_findprop(const unsigned int c, int *type_ptr, int *script_ptr)
|
_pcre_ucp_findprop(const unsigned int c, int *type_ptr, int *script_ptr)
|
||||||
{
|
{
|
||||||
int bot = 0;
|
int bot = 0;
|
||||||
int top = sizeof(ucp_table)/sizeof(cnode);
|
int top = sizeof(ucp_table)/sizeof(cnode);
|
||||||
int mid;
|
int mid;
|
||||||
|
|
||||||
/* The table is searched using a binary chop. You might think that using
|
/* The table is searched using a binary chop. You might think that using
|
||||||
intermediate variables to hold some of the common expressions would speed
|
intermediate variables to hold some of the common expressions would speed
|
||||||
things up, but tests with gcc 3.4.4 on Linux showed that, on the contrary, it
|
things up, but tests with gcc 3.4.4 on Linux showed that, on the contrary, it
|
||||||
makes things a lot slower. */
|
makes things a lot slower. */
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (top <= bot)
|
if (top <= bot)
|
||||||
{
|
{
|
||||||
*type_ptr = ucp_Cn;
|
*type_ptr = ucp_Cn;
|
||||||
*script_ptr = ucp_Common;
|
*script_ptr = ucp_Common;
|
||||||
return ucp_C;
|
return ucp_C;
|
||||||
}
|
}
|
||||||
mid = (bot + top) >> 1;
|
mid = (bot + top) >> 1;
|
||||||
if (c == (ucp_table[mid].f0 & f0_charmask)) break;
|
if (c == (ucp_table[mid].f0 & f0_charmask)) break;
|
||||||
if (c < (ucp_table[mid].f0 & f0_charmask)) top = mid;
|
if (c < (ucp_table[mid].f0 & f0_charmask)) top = mid;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((ucp_table[mid].f0 & f0_rangeflag) != 0 &&
|
if ((ucp_table[mid].f0 & f0_rangeflag) != 0 &&
|
||||||
c <= (ucp_table[mid].f0 & f0_charmask) +
|
c <= (ucp_table[mid].f0 & f0_charmask) +
|
||||||
(ucp_table[mid].f1 & f1_rangemask)) break;
|
(ucp_table[mid].f1 & f1_rangemask)) break;
|
||||||
bot = mid + 1;
|
bot = mid + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Found an entry in the table. Set the script and detailed type values, and
|
/* Found an entry in the table. Set the script and detailed type values, and
|
||||||
return the general type. */
|
return the general type. */
|
||||||
|
|
||||||
*script_ptr = (ucp_table[mid].f0 & f0_scriptmask) >> f0_scriptshift;
|
*script_ptr = (ucp_table[mid].f0 & f0_scriptmask) >> f0_scriptshift;
|
||||||
*type_ptr = (ucp_table[mid].f1 & f1_typemask) >> f1_typeshift;
|
*type_ptr = (ucp_table[mid].f1 & f1_typemask) >> f1_typeshift;
|
||||||
|
|
||||||
return ucp_gentype[*type_ptr];
|
return ucp_gentype[*type_ptr];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
* Search table and return other case *
|
* Search table and return other case *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* If the given character is a letter, and there is another case for the
|
/* If the given character is a letter, and there is another case for the
|
||||||
letter, return the other case. Otherwise, return -1.
|
letter, return the other case. Otherwise, return -1.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
c the character value
|
c the character value
|
||||||
|
|
||||||
Returns: the other case or NOTACHAR if none
|
Returns: the other case or NOTACHAR if none
|
||||||
*/
|
*/
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
_pcre_ucp_othercase(const unsigned int c)
|
_pcre_ucp_othercase(const unsigned int c)
|
||||||
{
|
{
|
||||||
int bot = 0;
|
int bot = 0;
|
||||||
int top = sizeof(ucp_table)/sizeof(cnode);
|
int top = sizeof(ucp_table)/sizeof(cnode);
|
||||||
int mid, offset;
|
int mid, offset;
|
||||||
|
|
||||||
/* The table is searched using a binary chop. You might think that using
|
/* The table is searched using a binary chop. You might think that using
|
||||||
intermediate variables to hold some of the common expressions would speed
|
intermediate variables to hold some of the common expressions would speed
|
||||||
things up, but tests with gcc 3.4.4 on Linux showed that, on the contrary, it
|
things up, but tests with gcc 3.4.4 on Linux showed that, on the contrary, it
|
||||||
makes things a lot slower. */
|
makes things a lot slower. */
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (top <= bot) return -1;
|
if (top <= bot) return -1;
|
||||||
mid = (bot + top) >> 1;
|
mid = (bot + top) >> 1;
|
||||||
if (c == (ucp_table[mid].f0 & f0_charmask)) break;
|
if (c == (ucp_table[mid].f0 & f0_charmask)) break;
|
||||||
if (c < (ucp_table[mid].f0 & f0_charmask)) top = mid;
|
if (c < (ucp_table[mid].f0 & f0_charmask)) top = mid;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((ucp_table[mid].f0 & f0_rangeflag) != 0 &&
|
if ((ucp_table[mid].f0 & f0_rangeflag) != 0 &&
|
||||||
c <= (ucp_table[mid].f0 & f0_charmask) +
|
c <= (ucp_table[mid].f0 & f0_charmask) +
|
||||||
(ucp_table[mid].f1 & f1_rangemask)) break;
|
(ucp_table[mid].f1 & f1_rangemask)) break;
|
||||||
bot = mid + 1;
|
bot = mid + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Found an entry in the table. Return NOTACHAR for a range entry. Otherwise
|
/* Found an entry in the table. Return NOTACHAR for a range entry. Otherwise
|
||||||
return the other case if there is one, else NOTACHAR. */
|
return the other case if there is one, else NOTACHAR. */
|
||||||
|
|
||||||
if ((ucp_table[mid].f0 & f0_rangeflag) != 0) return NOTACHAR;
|
if ((ucp_table[mid].f0 & f0_rangeflag) != 0) return NOTACHAR;
|
||||||
|
|
||||||
offset = ucp_table[mid].f1 & f1_casemask;
|
offset = ucp_table[mid].f1 & f1_casemask;
|
||||||
if ((offset & f1_caseneg) != 0) offset |= f1_caseneg;
|
if ((offset & f1_caseneg) != 0) offset |= f1_caseneg;
|
||||||
return (offset == 0)? NOTACHAR : c + offset;
|
return (offset == 0)? NOTACHAR : c + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* End of pcre_ucp_searchfuncs.c */
|
/* End of pcre_ucp_searchfuncs.c */
|
||||||
|
|||||||
@@ -1,132 +1,132 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* PCRE is a library of functions to support regular expressions whose syntax
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
and semantics are as close as possible to those of the Perl 5 language.
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
Written by Philip Hazel
|
Written by Philip Hazel
|
||||||
Copyright (c) 1997-2007 University of Cambridge
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
contributors may be used to endorse or promote products derived from
|
contributors may be used to endorse or promote products derived from
|
||||||
this software without specific prior written permission.
|
this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* This module contains an internal function for validating UTF-8 character
|
/* This module contains an internal function for validating UTF-8 character
|
||||||
strings. */
|
strings. */
|
||||||
|
|
||||||
|
|
||||||
#include "pcre_internal.h"
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
* Validate a UTF-8 string *
|
* Validate a UTF-8 string *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* This function is called (optionally) at the start of compile or match, to
|
/* This function is called (optionally) at the start of compile or match, to
|
||||||
validate that a supposed UTF-8 string is actually valid. The early check means
|
validate that a supposed UTF-8 string is actually valid. The early check means
|
||||||
that subsequent code can assume it is dealing with a valid string. The check
|
that subsequent code can assume it is dealing with a valid string. The check
|
||||||
can be turned off for maximum performance, but the consequences of supplying
|
can be turned off for maximum performance, but the consequences of supplying
|
||||||
an invalid string are then undefined.
|
an invalid string are then undefined.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
string points to the string
|
string points to the string
|
||||||
length length of string, or -1 if the string is zero-terminated
|
length length of string, or -1 if the string is zero-terminated
|
||||||
|
|
||||||
Returns: < 0 if the string is a valid UTF-8 string
|
Returns: < 0 if the string is a valid UTF-8 string
|
||||||
>= 0 otherwise; the value is the offset of the bad byte
|
>= 0 otherwise; the value is the offset of the bad byte
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
_pcre_valid_utf8(const uschar *string, int length)
|
_pcre_valid_utf8(const uschar *string, int length)
|
||||||
{
|
{
|
||||||
#ifdef SUPPORT_UTF8
|
#ifdef SUPPORT_UTF8
|
||||||
register const uschar *p;
|
register const uschar *p;
|
||||||
|
|
||||||
if (length < 0)
|
if (length < 0)
|
||||||
{
|
{
|
||||||
for (p = string; *p != 0; p++);
|
for (p = string; *p != 0; p++);
|
||||||
length = p - string;
|
length = p - string;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (p = string; length-- > 0; p++)
|
for (p = string; length-- > 0; p++)
|
||||||
{
|
{
|
||||||
register int ab;
|
register int ab;
|
||||||
register int c = *p;
|
register int c = *p;
|
||||||
if (c < 128) continue;
|
if (c < 128) continue;
|
||||||
if (c < 0xc0) return p - string;
|
if (c < 0xc0) return p - string;
|
||||||
ab = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */
|
ab = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */
|
||||||
if (length < ab) return p - string;
|
if (length < ab) return p - string;
|
||||||
length -= ab;
|
length -= ab;
|
||||||
|
|
||||||
/* Check top bits in the second byte */
|
/* Check top bits in the second byte */
|
||||||
if ((*(++p) & 0xc0) != 0x80) return p - string;
|
if ((*(++p) & 0xc0) != 0x80) return p - string;
|
||||||
|
|
||||||
/* Check for overlong sequences for each different length */
|
/* Check for overlong sequences for each different length */
|
||||||
switch (ab)
|
switch (ab)
|
||||||
{
|
{
|
||||||
/* Check for xx00 000x */
|
/* Check for xx00 000x */
|
||||||
case 1:
|
case 1:
|
||||||
if ((c & 0x3e) == 0) return p - string;
|
if ((c & 0x3e) == 0) return p - string;
|
||||||
continue; /* We know there aren't any more bytes to check */
|
continue; /* We know there aren't any more bytes to check */
|
||||||
|
|
||||||
/* Check for 1110 0000, xx0x xxxx */
|
/* Check for 1110 0000, xx0x xxxx */
|
||||||
case 2:
|
case 2:
|
||||||
if (c == 0xe0 && (*p & 0x20) == 0) return p - string;
|
if (c == 0xe0 && (*p & 0x20) == 0) return p - string;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Check for 1111 0000, xx00 xxxx */
|
/* Check for 1111 0000, xx00 xxxx */
|
||||||
case 3:
|
case 3:
|
||||||
if (c == 0xf0 && (*p & 0x30) == 0) return p - string;
|
if (c == 0xf0 && (*p & 0x30) == 0) return p - string;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Check for 1111 1000, xx00 0xxx */
|
/* Check for 1111 1000, xx00 0xxx */
|
||||||
case 4:
|
case 4:
|
||||||
if (c == 0xf8 && (*p & 0x38) == 0) return p - string;
|
if (c == 0xf8 && (*p & 0x38) == 0) return p - string;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Check for leading 0xfe or 0xff, and then for 1111 1100, xx00 00xx */
|
/* Check for leading 0xfe or 0xff, and then for 1111 1100, xx00 00xx */
|
||||||
case 5:
|
case 5:
|
||||||
if (c == 0xfe || c == 0xff ||
|
if (c == 0xfe || c == 0xff ||
|
||||||
(c == 0xfc && (*p & 0x3c) == 0)) return p - string;
|
(c == 0xfc && (*p & 0x3c) == 0)) return p - string;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for valid bytes after the 2nd, if any; all must start 10 */
|
/* Check for valid bytes after the 2nd, if any; all must start 10 */
|
||||||
while (--ab > 0)
|
while (--ab > 0)
|
||||||
{
|
{
|
||||||
if ((*(++p) & 0xc0) != 0x80) return p - string;
|
if ((*(++p) & 0xc0) != 0x80) return p - string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* End of pcre_valid_utf8.c */
|
/* End of pcre_valid_utf8.c */
|
||||||
|
|||||||
@@ -1,144 +1,144 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* PCRE is a library of functions to support regular expressions whose syntax
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
and semantics are as close as possible to those of the Perl 5 language.
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
Written by Philip Hazel
|
Written by Philip Hazel
|
||||||
Copyright (c) 1997-2007 University of Cambridge
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
contributors may be used to endorse or promote products derived from
|
contributors may be used to endorse or promote products derived from
|
||||||
this software without specific prior written permission.
|
this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* This module contains an internal function that is used to match an extended
|
/* This module contains an internal function that is used to match an extended
|
||||||
class (one that contains characters whose values are > 255). It is used by both
|
class (one that contains characters whose values are > 255). It is used by both
|
||||||
pcre_exec() and pcre_def_exec(). */
|
pcre_exec() and pcre_def_exec(). */
|
||||||
|
|
||||||
|
|
||||||
#include "pcre_internal.h"
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
* Match character against an XCLASS *
|
* Match character against an XCLASS *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* This function is called to match a character against an extended class that
|
/* This function is called to match a character against an extended class that
|
||||||
might contain values > 255.
|
might contain values > 255.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
c the character
|
c the character
|
||||||
data points to the flag byte of the XCLASS data
|
data points to the flag byte of the XCLASS data
|
||||||
|
|
||||||
Returns: TRUE if character matches, else FALSE
|
Returns: TRUE if character matches, else FALSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
_pcre_xclass(int c, const uschar *data)
|
_pcre_xclass(int c, const uschar *data)
|
||||||
{
|
{
|
||||||
int t;
|
int t;
|
||||||
BOOL negated = (*data & XCL_NOT) != 0;
|
BOOL negated = (*data & XCL_NOT) != 0;
|
||||||
|
|
||||||
/* Character values < 256 are matched against a bitmap, if one is present. If
|
/* Character values < 256 are matched against a bitmap, if one is present. If
|
||||||
not, we still carry on, because there may be ranges that start below 256 in the
|
not, we still carry on, because there may be ranges that start below 256 in the
|
||||||
additional data. */
|
additional data. */
|
||||||
|
|
||||||
if (c < 256)
|
if (c < 256)
|
||||||
{
|
{
|
||||||
if ((*data & XCL_MAP) != 0 && (data[1 + c/8] & (1 << (c&7))) != 0)
|
if ((*data & XCL_MAP) != 0 && (data[1 + c/8] & (1 << (c&7))) != 0)
|
||||||
return !negated; /* char found */
|
return !negated; /* char found */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* First skip the bit map if present. Then match against the list of Unicode
|
/* First skip the bit map if present. Then match against the list of Unicode
|
||||||
properties or large chars or ranges that end with a large char. We won't ever
|
properties or large chars or ranges that end with a large char. We won't ever
|
||||||
encounter XCL_PROP or XCL_NOTPROP when UCP support is not compiled. */
|
encounter XCL_PROP or XCL_NOTPROP when UCP support is not compiled. */
|
||||||
|
|
||||||
if ((*data++ & XCL_MAP) != 0) data += 32;
|
if ((*data++ & XCL_MAP) != 0) data += 32;
|
||||||
|
|
||||||
while ((t = *data++) != XCL_END)
|
while ((t = *data++) != XCL_END)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
if (t == XCL_SINGLE)
|
if (t == XCL_SINGLE)
|
||||||
{
|
{
|
||||||
GETCHARINC(x, data);
|
GETCHARINC(x, data);
|
||||||
if (c == x) return !negated;
|
if (c == x) return !negated;
|
||||||
}
|
}
|
||||||
else if (t == XCL_RANGE)
|
else if (t == XCL_RANGE)
|
||||||
{
|
{
|
||||||
GETCHARINC(x, data);
|
GETCHARINC(x, data);
|
||||||
GETCHARINC(y, data);
|
GETCHARINC(y, data);
|
||||||
if (c >= x && c <= y) return !negated;
|
if (c >= x && c <= y) return !negated;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SUPPORT_UCP
|
#ifdef SUPPORT_UCP
|
||||||
else /* XCL_PROP & XCL_NOTPROP */
|
else /* XCL_PROP & XCL_NOTPROP */
|
||||||
{
|
{
|
||||||
int chartype, script;
|
int chartype, script;
|
||||||
int category = _pcre_ucp_findprop(c, &chartype, &script);
|
int category = _pcre_ucp_findprop(c, &chartype, &script);
|
||||||
|
|
||||||
switch(*data)
|
switch(*data)
|
||||||
{
|
{
|
||||||
case PT_ANY:
|
case PT_ANY:
|
||||||
if (t == XCL_PROP) return !negated;
|
if (t == XCL_PROP) return !negated;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PT_LAMP:
|
case PT_LAMP:
|
||||||
if ((chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) ==
|
if ((chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) ==
|
||||||
(t == XCL_PROP)) return !negated;
|
(t == XCL_PROP)) return !negated;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PT_GC:
|
case PT_GC:
|
||||||
if ((data[1] == category) == (t == XCL_PROP)) return !negated;
|
if ((data[1] == category) == (t == XCL_PROP)) return !negated;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PT_PC:
|
case PT_PC:
|
||||||
if ((data[1] == chartype) == (t == XCL_PROP)) return !negated;
|
if ((data[1] == chartype) == (t == XCL_PROP)) return !negated;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PT_SC:
|
case PT_SC:
|
||||||
if ((data[1] == script) == (t == XCL_PROP)) return !negated;
|
if ((data[1] == script) == (t == XCL_PROP)) return !negated;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* This should never occur, but compilers may mutter if there is no
|
/* This should never occur, but compilers may mutter if there is no
|
||||||
default. */
|
default. */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
data += 2;
|
data += 2;
|
||||||
}
|
}
|
||||||
#endif /* SUPPORT_UCP */
|
#endif /* SUPPORT_UCP */
|
||||||
}
|
}
|
||||||
|
|
||||||
return negated; /* char did not match */
|
return negated; /* char did not match */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* End of pcre_xclass.c */
|
/* End of pcre_xclass.c */
|
||||||
|
|||||||
@@ -1,133 +1,133 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Unicode Property Table handler *
|
* Unicode Property Table handler *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
#ifndef _UCP_H
|
#ifndef _UCP_H
|
||||||
#define _UCP_H
|
#define _UCP_H
|
||||||
|
|
||||||
/* This file contains definitions of the property values that are returned by
|
/* This file contains definitions of the property values that are returned by
|
||||||
the function _pcre_ucp_findprop(). New values that are added for new releases
|
the function _pcre_ucp_findprop(). New values that are added for new releases
|
||||||
of Unicode should always be at the end of each enum, for backwards
|
of Unicode should always be at the end of each enum, for backwards
|
||||||
compatibility. */
|
compatibility. */
|
||||||
|
|
||||||
/* These are the general character categories. */
|
/* These are the general character categories. */
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ucp_C, /* Other */
|
ucp_C, /* Other */
|
||||||
ucp_L, /* Letter */
|
ucp_L, /* Letter */
|
||||||
ucp_M, /* Mark */
|
ucp_M, /* Mark */
|
||||||
ucp_N, /* Number */
|
ucp_N, /* Number */
|
||||||
ucp_P, /* Punctuation */
|
ucp_P, /* Punctuation */
|
||||||
ucp_S, /* Symbol */
|
ucp_S, /* Symbol */
|
||||||
ucp_Z /* Separator */
|
ucp_Z /* Separator */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* These are the particular character types. */
|
/* These are the particular character types. */
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ucp_Cc, /* Control */
|
ucp_Cc, /* Control */
|
||||||
ucp_Cf, /* Format */
|
ucp_Cf, /* Format */
|
||||||
ucp_Cn, /* Unassigned */
|
ucp_Cn, /* Unassigned */
|
||||||
ucp_Co, /* Private use */
|
ucp_Co, /* Private use */
|
||||||
ucp_Cs, /* Surrogate */
|
ucp_Cs, /* Surrogate */
|
||||||
ucp_Ll, /* Lower case letter */
|
ucp_Ll, /* Lower case letter */
|
||||||
ucp_Lm, /* Modifier letter */
|
ucp_Lm, /* Modifier letter */
|
||||||
ucp_Lo, /* Other letter */
|
ucp_Lo, /* Other letter */
|
||||||
ucp_Lt, /* Title case letter */
|
ucp_Lt, /* Title case letter */
|
||||||
ucp_Lu, /* Upper case letter */
|
ucp_Lu, /* Upper case letter */
|
||||||
ucp_Mc, /* Spacing mark */
|
ucp_Mc, /* Spacing mark */
|
||||||
ucp_Me, /* Enclosing mark */
|
ucp_Me, /* Enclosing mark */
|
||||||
ucp_Mn, /* Non-spacing mark */
|
ucp_Mn, /* Non-spacing mark */
|
||||||
ucp_Nd, /* Decimal number */
|
ucp_Nd, /* Decimal number */
|
||||||
ucp_Nl, /* Letter number */
|
ucp_Nl, /* Letter number */
|
||||||
ucp_No, /* Other number */
|
ucp_No, /* Other number */
|
||||||
ucp_Pc, /* Connector punctuation */
|
ucp_Pc, /* Connector punctuation */
|
||||||
ucp_Pd, /* Dash punctuation */
|
ucp_Pd, /* Dash punctuation */
|
||||||
ucp_Pe, /* Close punctuation */
|
ucp_Pe, /* Close punctuation */
|
||||||
ucp_Pf, /* Final punctuation */
|
ucp_Pf, /* Final punctuation */
|
||||||
ucp_Pi, /* Initial punctuation */
|
ucp_Pi, /* Initial punctuation */
|
||||||
ucp_Po, /* Other punctuation */
|
ucp_Po, /* Other punctuation */
|
||||||
ucp_Ps, /* Open punctuation */
|
ucp_Ps, /* Open punctuation */
|
||||||
ucp_Sc, /* Currency symbol */
|
ucp_Sc, /* Currency symbol */
|
||||||
ucp_Sk, /* Modifier symbol */
|
ucp_Sk, /* Modifier symbol */
|
||||||
ucp_Sm, /* Mathematical symbol */
|
ucp_Sm, /* Mathematical symbol */
|
||||||
ucp_So, /* Other symbol */
|
ucp_So, /* Other symbol */
|
||||||
ucp_Zl, /* Line separator */
|
ucp_Zl, /* Line separator */
|
||||||
ucp_Zp, /* Paragraph separator */
|
ucp_Zp, /* Paragraph separator */
|
||||||
ucp_Zs /* Space separator */
|
ucp_Zs /* Space separator */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* These are the script identifications. */
|
/* These are the script identifications. */
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ucp_Arabic,
|
ucp_Arabic,
|
||||||
ucp_Armenian,
|
ucp_Armenian,
|
||||||
ucp_Bengali,
|
ucp_Bengali,
|
||||||
ucp_Bopomofo,
|
ucp_Bopomofo,
|
||||||
ucp_Braille,
|
ucp_Braille,
|
||||||
ucp_Buginese,
|
ucp_Buginese,
|
||||||
ucp_Buhid,
|
ucp_Buhid,
|
||||||
ucp_Canadian_Aboriginal,
|
ucp_Canadian_Aboriginal,
|
||||||
ucp_Cherokee,
|
ucp_Cherokee,
|
||||||
ucp_Common,
|
ucp_Common,
|
||||||
ucp_Coptic,
|
ucp_Coptic,
|
||||||
ucp_Cypriot,
|
ucp_Cypriot,
|
||||||
ucp_Cyrillic,
|
ucp_Cyrillic,
|
||||||
ucp_Deseret,
|
ucp_Deseret,
|
||||||
ucp_Devanagari,
|
ucp_Devanagari,
|
||||||
ucp_Ethiopic,
|
ucp_Ethiopic,
|
||||||
ucp_Georgian,
|
ucp_Georgian,
|
||||||
ucp_Glagolitic,
|
ucp_Glagolitic,
|
||||||
ucp_Gothic,
|
ucp_Gothic,
|
||||||
ucp_Greek,
|
ucp_Greek,
|
||||||
ucp_Gujarati,
|
ucp_Gujarati,
|
||||||
ucp_Gurmukhi,
|
ucp_Gurmukhi,
|
||||||
ucp_Han,
|
ucp_Han,
|
||||||
ucp_Hangul,
|
ucp_Hangul,
|
||||||
ucp_Hanunoo,
|
ucp_Hanunoo,
|
||||||
ucp_Hebrew,
|
ucp_Hebrew,
|
||||||
ucp_Hiragana,
|
ucp_Hiragana,
|
||||||
ucp_Inherited,
|
ucp_Inherited,
|
||||||
ucp_Kannada,
|
ucp_Kannada,
|
||||||
ucp_Katakana,
|
ucp_Katakana,
|
||||||
ucp_Kharoshthi,
|
ucp_Kharoshthi,
|
||||||
ucp_Khmer,
|
ucp_Khmer,
|
||||||
ucp_Lao,
|
ucp_Lao,
|
||||||
ucp_Latin,
|
ucp_Latin,
|
||||||
ucp_Limbu,
|
ucp_Limbu,
|
||||||
ucp_Linear_B,
|
ucp_Linear_B,
|
||||||
ucp_Malayalam,
|
ucp_Malayalam,
|
||||||
ucp_Mongolian,
|
ucp_Mongolian,
|
||||||
ucp_Myanmar,
|
ucp_Myanmar,
|
||||||
ucp_New_Tai_Lue,
|
ucp_New_Tai_Lue,
|
||||||
ucp_Ogham,
|
ucp_Ogham,
|
||||||
ucp_Old_Italic,
|
ucp_Old_Italic,
|
||||||
ucp_Old_Persian,
|
ucp_Old_Persian,
|
||||||
ucp_Oriya,
|
ucp_Oriya,
|
||||||
ucp_Osmanya,
|
ucp_Osmanya,
|
||||||
ucp_Runic,
|
ucp_Runic,
|
||||||
ucp_Shavian,
|
ucp_Shavian,
|
||||||
ucp_Sinhala,
|
ucp_Sinhala,
|
||||||
ucp_Syloti_Nagri,
|
ucp_Syloti_Nagri,
|
||||||
ucp_Syriac,
|
ucp_Syriac,
|
||||||
ucp_Tagalog,
|
ucp_Tagalog,
|
||||||
ucp_Tagbanwa,
|
ucp_Tagbanwa,
|
||||||
ucp_Tai_Le,
|
ucp_Tai_Le,
|
||||||
ucp_Tamil,
|
ucp_Tamil,
|
||||||
ucp_Telugu,
|
ucp_Telugu,
|
||||||
ucp_Thaana,
|
ucp_Thaana,
|
||||||
ucp_Thai,
|
ucp_Thai,
|
||||||
ucp_Tibetan,
|
ucp_Tibetan,
|
||||||
ucp_Tifinagh,
|
ucp_Tifinagh,
|
||||||
ucp_Ugaritic,
|
ucp_Ugaritic,
|
||||||
ucp_Yi,
|
ucp_Yi,
|
||||||
ucp_Balinese, /* New for Unicode 5.0.0 */
|
ucp_Balinese, /* New for Unicode 5.0.0 */
|
||||||
ucp_Cuneiform, /* New for Unicode 5.0.0 */
|
ucp_Cuneiform, /* New for Unicode 5.0.0 */
|
||||||
ucp_Nko, /* New for Unicode 5.0.0 */
|
ucp_Nko, /* New for Unicode 5.0.0 */
|
||||||
ucp_Phags_Pa, /* New for Unicode 5.0.0 */
|
ucp_Phags_Pa, /* New for Unicode 5.0.0 */
|
||||||
ucp_Phoenician /* New for Unicode 5.0.0 */
|
ucp_Phoenician /* New for Unicode 5.0.0 */
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* End of ucp.h */
|
/* End of ucp.h */
|
||||||
|
|||||||
@@ -1,92 +1,92 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Unicode Property Table handler *
|
* Unicode Property Table handler *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
#ifndef _UCPINTERNAL_H
|
#ifndef _UCPINTERNAL_H
|
||||||
#define _UCPINTERNAL_H
|
#define _UCPINTERNAL_H
|
||||||
|
|
||||||
/* Internal header file defining the layout of the bits in each pair of 32-bit
|
/* Internal header file defining the layout of the bits in each pair of 32-bit
|
||||||
words that form a data item in the table. */
|
words that form a data item in the table. */
|
||||||
|
|
||||||
typedef struct cnode {
|
typedef struct cnode {
|
||||||
pcre_uint32 f0;
|
pcre_uint32 f0;
|
||||||
pcre_uint32 f1;
|
pcre_uint32 f1;
|
||||||
} cnode;
|
} cnode;
|
||||||
|
|
||||||
/* Things for the f0 field */
|
/* Things for the f0 field */
|
||||||
|
|
||||||
#define f0_scriptmask 0xff000000 /* Mask for script field */
|
#define f0_scriptmask 0xff000000 /* Mask for script field */
|
||||||
#define f0_scriptshift 24 /* Shift for script value */
|
#define f0_scriptshift 24 /* Shift for script value */
|
||||||
#define f0_rangeflag 0x00f00000 /* Flag for a range item */
|
#define f0_rangeflag 0x00f00000 /* Flag for a range item */
|
||||||
#define f0_charmask 0x001fffff /* Mask for code point value */
|
#define f0_charmask 0x001fffff /* Mask for code point value */
|
||||||
|
|
||||||
/* Things for the f1 field */
|
/* Things for the f1 field */
|
||||||
|
|
||||||
#define f1_typemask 0xfc000000 /* Mask for char type field */
|
#define f1_typemask 0xfc000000 /* Mask for char type field */
|
||||||
#define f1_typeshift 26 /* Shift for the type field */
|
#define f1_typeshift 26 /* Shift for the type field */
|
||||||
#define f1_rangemask 0x0000ffff /* Mask for a range offset */
|
#define f1_rangemask 0x0000ffff /* Mask for a range offset */
|
||||||
#define f1_casemask 0x0000ffff /* Mask for a case offset */
|
#define f1_casemask 0x0000ffff /* Mask for a case offset */
|
||||||
#define f1_caseneg 0xffff8000 /* Bits for negation */
|
#define f1_caseneg 0xffff8000 /* Bits for negation */
|
||||||
|
|
||||||
/* The data consists of a vector of structures of type cnode. The two unsigned
|
/* The data consists of a vector of structures of type cnode. The two unsigned
|
||||||
32-bit integers are used as follows:
|
32-bit integers are used as follows:
|
||||||
|
|
||||||
(f0) (1) The most significant byte holds the script number. The numbers are
|
(f0) (1) The most significant byte holds the script number. The numbers are
|
||||||
defined by the enum in ucp.h.
|
defined by the enum in ucp.h.
|
||||||
|
|
||||||
(2) The 0x00800000 bit is set if this entry defines a range of characters.
|
(2) The 0x00800000 bit is set if this entry defines a range of characters.
|
||||||
It is not set if this entry defines a single character
|
It is not set if this entry defines a single character
|
||||||
|
|
||||||
(3) The 0x00600000 bits are spare.
|
(3) The 0x00600000 bits are spare.
|
||||||
|
|
||||||
(4) The 0x001fffff bits contain the code point. No Unicode code point will
|
(4) The 0x001fffff bits contain the code point. No Unicode code point will
|
||||||
ever be greater than 0x0010ffff, so this should be OK for ever.
|
ever be greater than 0x0010ffff, so this should be OK for ever.
|
||||||
|
|
||||||
(f1) (1) The 0xfc000000 bits contain the character type number. The numbers are
|
(f1) (1) The 0xfc000000 bits contain the character type number. The numbers are
|
||||||
defined by an enum in ucp.h.
|
defined by an enum in ucp.h.
|
||||||
|
|
||||||
(2) The 0x03ff0000 bits are spare.
|
(2) The 0x03ff0000 bits are spare.
|
||||||
|
|
||||||
(3) The 0x0000ffff bits contain EITHER the unsigned offset to the top of
|
(3) The 0x0000ffff bits contain EITHER the unsigned offset to the top of
|
||||||
range if this entry defines a range, OR the *signed* offset to the
|
range if this entry defines a range, OR the *signed* offset to the
|
||||||
character's "other case" partner if this entry defines a single
|
character's "other case" partner if this entry defines a single
|
||||||
character. There is no partner if the value is zero.
|
character. There is no partner if the value is zero.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| script (8) |.|.|.| codepoint (21) || type (6) |.|.| spare (8) | offset (16) |
|
| script (8) |.|.|.| codepoint (21) || type (6) |.|.| spare (8) | offset (16) |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| | | | |
|
| | | | |
|
||||||
| | |-> spare | |-> spare
|
| | |-> spare | |-> spare
|
||||||
| | |
|
| | |
|
||||||
| |-> spare |-> spare
|
| |-> spare |-> spare
|
||||||
|
|
|
|
||||||
|-> range flag
|
|-> range flag
|
||||||
|
|
||||||
The upper/lower casing information is set only for characters that come in
|
The upper/lower casing information is set only for characters that come in
|
||||||
pairs. The non-one-to-one mappings in the Unicode data are ignored.
|
pairs. The non-one-to-one mappings in the Unicode data are ignored.
|
||||||
|
|
||||||
When searching the data, proceed as follows:
|
When searching the data, proceed as follows:
|
||||||
|
|
||||||
(1) Set up for a binary chop search.
|
(1) Set up for a binary chop search.
|
||||||
|
|
||||||
(2) If the top is not greater than the bottom, the character is not in the
|
(2) If the top is not greater than the bottom, the character is not in the
|
||||||
table. Its type must therefore be "Cn" ("Undefined").
|
table. Its type must therefore be "Cn" ("Undefined").
|
||||||
|
|
||||||
(3) Find the middle vector element.
|
(3) Find the middle vector element.
|
||||||
|
|
||||||
(4) Extract the code point and compare. If equal, we are done.
|
(4) Extract the code point and compare. If equal, we are done.
|
||||||
|
|
||||||
(5) If the test character is smaller, set the top to the current point, and
|
(5) If the test character is smaller, set the top to the current point, and
|
||||||
goto (2).
|
goto (2).
|
||||||
|
|
||||||
(6) If the current entry defines a range, compute the last character by adding
|
(6) If the current entry defines a range, compute the last character by adding
|
||||||
the offset, and see if the test character is within the range. If it is,
|
the offset, and see if the test character is within the range. If it is,
|
||||||
we are done.
|
we are done.
|
||||||
|
|
||||||
(7) Otherwise, set the bottom to one element past the current point and goto
|
(7) Otherwise, set the bottom to one element past the current point and goto
|
||||||
(2).
|
(2).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#endif /* _UCPINTERNAL_H */
|
#endif /* _UCPINTERNAL_H */
|
||||||
|
|
||||||
/* End of ucpinternal.h */
|
/* End of ucpinternal.h */
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user