native EOL

This commit is contained in:
Aleksandar Fabijanic
2008-09-22 17:56:35 +00:00
parent aaddff0f41
commit 95b2f13647
13 changed files with 14703 additions and 14703 deletions

View File

@@ -1,195 +1,195 @@
/************************************************* /*************************************************
* 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 #includes are present because without the gcc 4.x may remove the The following #includes are present because without the 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_config.h" #include "pcre_config.h"
#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

View File

@@ -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

View File

@@ -1,162 +1,162 @@
/************************************************* /*************************************************
* 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-2008 University of Cambridge Copyright (c) 1997-2008 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_config.h" #include "pcre_config.h"
#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_CALL_CONVENTION PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
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->flags & PCRE_FIRSTSET) != 0)? re->first_byte : ((re->flags & PCRE_FIRSTSET) != 0)? re->first_byte :
((re->flags & PCRE_STARTLINE) != 0)? -1 : -2; ((re->flags & 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->flags & PCRE_REQCHSET) != 0)? re->req_byte : -1; ((re->flags & 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;
case PCRE_INFO_OKPARTIAL: case PCRE_INFO_OKPARTIAL:
*((int *)where) = (re->flags & PCRE_NOPARTIAL) == 0; *((int *)where) = (re->flags & PCRE_NOPARTIAL) == 0;
break; break;
case PCRE_INFO_JCHANGED: case PCRE_INFO_JCHANGED:
*((int *)where) = (re->flags & PCRE_JCHANGED) != 0; *((int *)where) = (re->flags & PCRE_JCHANGED) != 0;
break; break;
case PCRE_INFO_HASCRORLF: case PCRE_INFO_HASCRORLF:
*((int *)where) = (re->flags & PCRE_HASCRORLF) != 0; *((int *)where) = (re->flags & PCRE_HASCRORLF) != 0;
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 */

View File

@@ -1,60 +1,60 @@
/************************************************* /*************************************************
* 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-2008 University of Cambridge Copyright (c) 1997-2008 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_config.h" #include "pcre_config.h"
#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

View File

@@ -1,141 +1,141 @@
/************************************************* /*************************************************
* 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-2008 University of Cambridge Copyright (c) 1997-2008 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_config.h" # include "pcre_config.h"
# 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 */

View File

@@ -1,161 +1,161 @@
/************************************************* /*************************************************
* 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-2008 University of Cambridge Copyright (c) 1997-2008 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_config.h" #include "pcre_config.h"
#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--;
#ifdef SUPPORT_UTF8 #ifdef SUPPORT_UTF8
if (utf8) if (utf8)
{ {
BACKCHAR(ptr); BACKCHAR(ptr);
GETCHAR(c, ptr); GETCHAR(c, ptr);
} }
else c = *ptr; else c = *ptr;
#else /* no UTF-8 support */ #else /* no UTF-8 support */
c = *ptr; c = *ptr;
#endif /* SUPPORT_UTF8 */ #endif /* SUPPORT_UTF8 */
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 */

View File

@@ -1,84 +1,84 @@
/************************************************* /*************************************************
* 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-2008 University of Cambridge Copyright (c) 1997-2008 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_config.h" #include "pcre_config.h"
#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
(void)(cvalue); /* Keep compiler happy; this function won't ever be */ (void)(cvalue); /* Keep compiler happy; this function won't ever be */
(void)(buffer); /* called when SUPPORT_UTF8 is not defined. */ (void)(buffer); /* called when SUPPORT_UTF8 is not defined. */
return 0; return 0;
#endif #endif
} }
/* End of pcre_ord2utf8.c */ /* End of pcre_ord2utf8.c */

File diff suppressed because it is too large Load Diff

View File

@@ -1,353 +1,353 @@
/************************************************* /*************************************************
* 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-2008 University of Cambridge Copyright (c) 1997-2008 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_config.h" #include "pcre_config.h"
#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 };
/* Table to translate from particular type value to the general value. */ /* Table to translate from particular type value to the general value. */
const int _pcre_ucp_gentype[] = { const int _pcre_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 */
}; };
/* The pcre_utt[] table below translates Unicode property names into type and /* The pcre_utt[] table below translates Unicode property names into type and
code values. It is searched by binary chop, so must be in collating sequence of code values. It is searched by binary chop, so must be in collating sequence of
name. Originally, the table contained pointers to the name strings in the first name. Originally, the table contained pointers to the name strings in the first
field of each entry. However, that leads to a large number of relocations when field of each entry. However, that leads to a large number of relocations when
a shared library is dynamically loaded. A significant reduction is made by a shared library is dynamically loaded. A significant reduction is made by
putting all the names into a single, large string and then using offsets in the putting all the names into a single, large string and then using offsets in the
table itself. Maintenance is more error-prone, but frequent changes to this table itself. Maintenance is more error-prone, but frequent changes to this
data are unlikely. data are unlikely.
July 2008: There is now a script called maint/GenerateUtt.py which can be used July 2008: There is now a script called maint/GenerateUtt.py which can be used
to generate this data instead of maintaining it entirely by hand. */ to generate this data instead of maintaining it entirely by hand. */
const char _pcre_utt_names[] = const char _pcre_utt_names[] =
"Any\0" "Any\0"
"Arabic\0" "Arabic\0"
"Armenian\0" "Armenian\0"
"Balinese\0" "Balinese\0"
"Bengali\0" "Bengali\0"
"Bopomofo\0" "Bopomofo\0"
"Braille\0" "Braille\0"
"Buginese\0" "Buginese\0"
"Buhid\0" "Buhid\0"
"C\0" "C\0"
"Canadian_Aboriginal\0" "Canadian_Aboriginal\0"
"Carian\0" "Carian\0"
"Cc\0" "Cc\0"
"Cf\0" "Cf\0"
"Cham\0" "Cham\0"
"Cherokee\0" "Cherokee\0"
"Cn\0" "Cn\0"
"Co\0" "Co\0"
"Common\0" "Common\0"
"Coptic\0" "Coptic\0"
"Cs\0" "Cs\0"
"Cuneiform\0" "Cuneiform\0"
"Cypriot\0" "Cypriot\0"
"Cyrillic\0" "Cyrillic\0"
"Deseret\0" "Deseret\0"
"Devanagari\0" "Devanagari\0"
"Ethiopic\0" "Ethiopic\0"
"Georgian\0" "Georgian\0"
"Glagolitic\0" "Glagolitic\0"
"Gothic\0" "Gothic\0"
"Greek\0" "Greek\0"
"Gujarati\0" "Gujarati\0"
"Gurmukhi\0" "Gurmukhi\0"
"Han\0" "Han\0"
"Hangul\0" "Hangul\0"
"Hanunoo\0" "Hanunoo\0"
"Hebrew\0" "Hebrew\0"
"Hiragana\0" "Hiragana\0"
"Inherited\0" "Inherited\0"
"Kannada\0" "Kannada\0"
"Katakana\0" "Katakana\0"
"Kayah_Li\0" "Kayah_Li\0"
"Kharoshthi\0" "Kharoshthi\0"
"Khmer\0" "Khmer\0"
"L\0" "L\0"
"L&\0" "L&\0"
"Lao\0" "Lao\0"
"Latin\0" "Latin\0"
"Lepcha\0" "Lepcha\0"
"Limbu\0" "Limbu\0"
"Linear_B\0" "Linear_B\0"
"Ll\0" "Ll\0"
"Lm\0" "Lm\0"
"Lo\0" "Lo\0"
"Lt\0" "Lt\0"
"Lu\0" "Lu\0"
"Lycian\0" "Lycian\0"
"Lydian\0" "Lydian\0"
"M\0" "M\0"
"Malayalam\0" "Malayalam\0"
"Mc\0" "Mc\0"
"Me\0" "Me\0"
"Mn\0" "Mn\0"
"Mongolian\0" "Mongolian\0"
"Myanmar\0" "Myanmar\0"
"N\0" "N\0"
"Nd\0" "Nd\0"
"New_Tai_Lue\0" "New_Tai_Lue\0"
"Nko\0" "Nko\0"
"Nl\0" "Nl\0"
"No\0" "No\0"
"Ogham\0" "Ogham\0"
"Ol_Chiki\0" "Ol_Chiki\0"
"Old_Italic\0" "Old_Italic\0"
"Old_Persian\0" "Old_Persian\0"
"Oriya\0" "Oriya\0"
"Osmanya\0" "Osmanya\0"
"P\0" "P\0"
"Pc\0" "Pc\0"
"Pd\0" "Pd\0"
"Pe\0" "Pe\0"
"Pf\0" "Pf\0"
"Phags_Pa\0" "Phags_Pa\0"
"Phoenician\0" "Phoenician\0"
"Pi\0" "Pi\0"
"Po\0" "Po\0"
"Ps\0" "Ps\0"
"Rejang\0" "Rejang\0"
"Runic\0" "Runic\0"
"S\0" "S\0"
"Saurashtra\0" "Saurashtra\0"
"Sc\0" "Sc\0"
"Shavian\0" "Shavian\0"
"Sinhala\0" "Sinhala\0"
"Sk\0" "Sk\0"
"Sm\0" "Sm\0"
"So\0" "So\0"
"Sundanese\0" "Sundanese\0"
"Syloti_Nagri\0" "Syloti_Nagri\0"
"Syriac\0" "Syriac\0"
"Tagalog\0" "Tagalog\0"
"Tagbanwa\0" "Tagbanwa\0"
"Tai_Le\0" "Tai_Le\0"
"Tamil\0" "Tamil\0"
"Telugu\0" "Telugu\0"
"Thaana\0" "Thaana\0"
"Thai\0" "Thai\0"
"Tibetan\0" "Tibetan\0"
"Tifinagh\0" "Tifinagh\0"
"Ugaritic\0" "Ugaritic\0"
"Vai\0" "Vai\0"
"Yi\0" "Yi\0"
"Z\0" "Z\0"
"Zl\0" "Zl\0"
"Zp\0" "Zp\0"
"Zs\0"; "Zs\0";
const ucp_type_table _pcre_utt[] = { const ucp_type_table _pcre_utt[] = {
{ 0, PT_ANY, 0 }, { 0, PT_ANY, 0 },
{ 4, PT_SC, ucp_Arabic }, { 4, PT_SC, ucp_Arabic },
{ 11, PT_SC, ucp_Armenian }, { 11, PT_SC, ucp_Armenian },
{ 20, PT_SC, ucp_Balinese }, { 20, PT_SC, ucp_Balinese },
{ 29, PT_SC, ucp_Bengali }, { 29, PT_SC, ucp_Bengali },
{ 37, PT_SC, ucp_Bopomofo }, { 37, PT_SC, ucp_Bopomofo },
{ 46, PT_SC, ucp_Braille }, { 46, PT_SC, ucp_Braille },
{ 54, PT_SC, ucp_Buginese }, { 54, PT_SC, ucp_Buginese },
{ 63, PT_SC, ucp_Buhid }, { 63, PT_SC, ucp_Buhid },
{ 69, PT_GC, ucp_C }, { 69, PT_GC, ucp_C },
{ 71, PT_SC, ucp_Canadian_Aboriginal }, { 71, PT_SC, ucp_Canadian_Aboriginal },
{ 91, PT_SC, ucp_Carian }, { 91, PT_SC, ucp_Carian },
{ 98, PT_PC, ucp_Cc }, { 98, PT_PC, ucp_Cc },
{ 101, PT_PC, ucp_Cf }, { 101, PT_PC, ucp_Cf },
{ 104, PT_SC, ucp_Cham }, { 104, PT_SC, ucp_Cham },
{ 109, PT_SC, ucp_Cherokee }, { 109, PT_SC, ucp_Cherokee },
{ 118, PT_PC, ucp_Cn }, { 118, PT_PC, ucp_Cn },
{ 121, PT_PC, ucp_Co }, { 121, PT_PC, ucp_Co },
{ 124, PT_SC, ucp_Common }, { 124, PT_SC, ucp_Common },
{ 131, PT_SC, ucp_Coptic }, { 131, PT_SC, ucp_Coptic },
{ 138, PT_PC, ucp_Cs }, { 138, PT_PC, ucp_Cs },
{ 141, PT_SC, ucp_Cuneiform }, { 141, PT_SC, ucp_Cuneiform },
{ 151, PT_SC, ucp_Cypriot }, { 151, PT_SC, ucp_Cypriot },
{ 159, PT_SC, ucp_Cyrillic }, { 159, PT_SC, ucp_Cyrillic },
{ 168, PT_SC, ucp_Deseret }, { 168, PT_SC, ucp_Deseret },
{ 176, PT_SC, ucp_Devanagari }, { 176, PT_SC, ucp_Devanagari },
{ 187, PT_SC, ucp_Ethiopic }, { 187, PT_SC, ucp_Ethiopic },
{ 196, PT_SC, ucp_Georgian }, { 196, PT_SC, ucp_Georgian },
{ 205, PT_SC, ucp_Glagolitic }, { 205, PT_SC, ucp_Glagolitic },
{ 216, PT_SC, ucp_Gothic }, { 216, PT_SC, ucp_Gothic },
{ 223, PT_SC, ucp_Greek }, { 223, PT_SC, ucp_Greek },
{ 229, PT_SC, ucp_Gujarati }, { 229, PT_SC, ucp_Gujarati },
{ 238, PT_SC, ucp_Gurmukhi }, { 238, PT_SC, ucp_Gurmukhi },
{ 247, PT_SC, ucp_Han }, { 247, PT_SC, ucp_Han },
{ 251, PT_SC, ucp_Hangul }, { 251, PT_SC, ucp_Hangul },
{ 258, PT_SC, ucp_Hanunoo }, { 258, PT_SC, ucp_Hanunoo },
{ 266, PT_SC, ucp_Hebrew }, { 266, PT_SC, ucp_Hebrew },
{ 273, PT_SC, ucp_Hiragana }, { 273, PT_SC, ucp_Hiragana },
{ 282, PT_SC, ucp_Inherited }, { 282, PT_SC, ucp_Inherited },
{ 292, PT_SC, ucp_Kannada }, { 292, PT_SC, ucp_Kannada },
{ 300, PT_SC, ucp_Katakana }, { 300, PT_SC, ucp_Katakana },
{ 309, PT_SC, ucp_Kayah_Li }, { 309, PT_SC, ucp_Kayah_Li },
{ 318, PT_SC, ucp_Kharoshthi }, { 318, PT_SC, ucp_Kharoshthi },
{ 329, PT_SC, ucp_Khmer }, { 329, PT_SC, ucp_Khmer },
{ 335, PT_GC, ucp_L }, { 335, PT_GC, ucp_L },
{ 337, PT_LAMP, 0 }, { 337, PT_LAMP, 0 },
{ 340, PT_SC, ucp_Lao }, { 340, PT_SC, ucp_Lao },
{ 344, PT_SC, ucp_Latin }, { 344, PT_SC, ucp_Latin },
{ 350, PT_SC, ucp_Lepcha }, { 350, PT_SC, ucp_Lepcha },
{ 357, PT_SC, ucp_Limbu }, { 357, PT_SC, ucp_Limbu },
{ 363, PT_SC, ucp_Linear_B }, { 363, PT_SC, ucp_Linear_B },
{ 372, PT_PC, ucp_Ll }, { 372, PT_PC, ucp_Ll },
{ 375, PT_PC, ucp_Lm }, { 375, PT_PC, ucp_Lm },
{ 378, PT_PC, ucp_Lo }, { 378, PT_PC, ucp_Lo },
{ 381, PT_PC, ucp_Lt }, { 381, PT_PC, ucp_Lt },
{ 384, PT_PC, ucp_Lu }, { 384, PT_PC, ucp_Lu },
{ 387, PT_SC, ucp_Lycian }, { 387, PT_SC, ucp_Lycian },
{ 394, PT_SC, ucp_Lydian }, { 394, PT_SC, ucp_Lydian },
{ 401, PT_GC, ucp_M }, { 401, PT_GC, ucp_M },
{ 403, PT_SC, ucp_Malayalam }, { 403, PT_SC, ucp_Malayalam },
{ 413, PT_PC, ucp_Mc }, { 413, PT_PC, ucp_Mc },
{ 416, PT_PC, ucp_Me }, { 416, PT_PC, ucp_Me },
{ 419, PT_PC, ucp_Mn }, { 419, PT_PC, ucp_Mn },
{ 422, PT_SC, ucp_Mongolian }, { 422, PT_SC, ucp_Mongolian },
{ 432, PT_SC, ucp_Myanmar }, { 432, PT_SC, ucp_Myanmar },
{ 440, PT_GC, ucp_N }, { 440, PT_GC, ucp_N },
{ 442, PT_PC, ucp_Nd }, { 442, PT_PC, ucp_Nd },
{ 445, PT_SC, ucp_New_Tai_Lue }, { 445, PT_SC, ucp_New_Tai_Lue },
{ 457, PT_SC, ucp_Nko }, { 457, PT_SC, ucp_Nko },
{ 461, PT_PC, ucp_Nl }, { 461, PT_PC, ucp_Nl },
{ 464, PT_PC, ucp_No }, { 464, PT_PC, ucp_No },
{ 467, PT_SC, ucp_Ogham }, { 467, PT_SC, ucp_Ogham },
{ 473, PT_SC, ucp_Ol_Chiki }, { 473, PT_SC, ucp_Ol_Chiki },
{ 482, PT_SC, ucp_Old_Italic }, { 482, PT_SC, ucp_Old_Italic },
{ 493, PT_SC, ucp_Old_Persian }, { 493, PT_SC, ucp_Old_Persian },
{ 505, PT_SC, ucp_Oriya }, { 505, PT_SC, ucp_Oriya },
{ 511, PT_SC, ucp_Osmanya }, { 511, PT_SC, ucp_Osmanya },
{ 519, PT_GC, ucp_P }, { 519, PT_GC, ucp_P },
{ 521, PT_PC, ucp_Pc }, { 521, PT_PC, ucp_Pc },
{ 524, PT_PC, ucp_Pd }, { 524, PT_PC, ucp_Pd },
{ 527, PT_PC, ucp_Pe }, { 527, PT_PC, ucp_Pe },
{ 530, PT_PC, ucp_Pf }, { 530, PT_PC, ucp_Pf },
{ 533, PT_SC, ucp_Phags_Pa }, { 533, PT_SC, ucp_Phags_Pa },
{ 542, PT_SC, ucp_Phoenician }, { 542, PT_SC, ucp_Phoenician },
{ 553, PT_PC, ucp_Pi }, { 553, PT_PC, ucp_Pi },
{ 556, PT_PC, ucp_Po }, { 556, PT_PC, ucp_Po },
{ 559, PT_PC, ucp_Ps }, { 559, PT_PC, ucp_Ps },
{ 562, PT_SC, ucp_Rejang }, { 562, PT_SC, ucp_Rejang },
{ 569, PT_SC, ucp_Runic }, { 569, PT_SC, ucp_Runic },
{ 575, PT_GC, ucp_S }, { 575, PT_GC, ucp_S },
{ 577, PT_SC, ucp_Saurashtra }, { 577, PT_SC, ucp_Saurashtra },
{ 588, PT_PC, ucp_Sc }, { 588, PT_PC, ucp_Sc },
{ 591, PT_SC, ucp_Shavian }, { 591, PT_SC, ucp_Shavian },
{ 599, PT_SC, ucp_Sinhala }, { 599, PT_SC, ucp_Sinhala },
{ 607, PT_PC, ucp_Sk }, { 607, PT_PC, ucp_Sk },
{ 610, PT_PC, ucp_Sm }, { 610, PT_PC, ucp_Sm },
{ 613, PT_PC, ucp_So }, { 613, PT_PC, ucp_So },
{ 616, PT_SC, ucp_Sundanese }, { 616, PT_SC, ucp_Sundanese },
{ 626, PT_SC, ucp_Syloti_Nagri }, { 626, PT_SC, ucp_Syloti_Nagri },
{ 639, PT_SC, ucp_Syriac }, { 639, PT_SC, ucp_Syriac },
{ 646, PT_SC, ucp_Tagalog }, { 646, PT_SC, ucp_Tagalog },
{ 654, PT_SC, ucp_Tagbanwa }, { 654, PT_SC, ucp_Tagbanwa },
{ 663, PT_SC, ucp_Tai_Le }, { 663, PT_SC, ucp_Tai_Le },
{ 670, PT_SC, ucp_Tamil }, { 670, PT_SC, ucp_Tamil },
{ 676, PT_SC, ucp_Telugu }, { 676, PT_SC, ucp_Telugu },
{ 683, PT_SC, ucp_Thaana }, { 683, PT_SC, ucp_Thaana },
{ 690, PT_SC, ucp_Thai }, { 690, PT_SC, ucp_Thai },
{ 695, PT_SC, ucp_Tibetan }, { 695, PT_SC, ucp_Tibetan },
{ 703, PT_SC, ucp_Tifinagh }, { 703, PT_SC, ucp_Tifinagh },
{ 712, PT_SC, ucp_Ugaritic }, { 712, PT_SC, ucp_Ugaritic },
{ 721, PT_SC, ucp_Vai }, { 721, PT_SC, ucp_Vai },
{ 725, PT_SC, ucp_Yi }, { 725, PT_SC, ucp_Yi },
{ 728, PT_GC, ucp_Z }, { 728, PT_GC, ucp_Z },
{ 730, PT_PC, ucp_Zl }, { 730, PT_PC, ucp_Zl },
{ 733, PT_PC, ucp_Zp }, { 733, PT_PC, ucp_Zp },
{ 736, PT_PC, ucp_Zs } { 736, 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 */

View File

@@ -1,134 +1,134 @@
/************************************************* /*************************************************
* 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-2008 University of Cambridge Copyright (c) 1997-2008 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_config.h" #include "pcre_config.h"
#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->flags = (pcre_uint16)byteflip(re->flags, sizeof(re->flags)); internal_re->flags = (pcre_uint16)byteflip(re->flags, sizeof(re->flags));
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 */