Back to index

php5  5.3.10
pcre_chartables.c
Go to the documentation of this file.
00001 /*************************************************
00002 *      Perl-Compatible Regular Expressions       *
00003 *************************************************/
00004 
00005 /* This file contains character tables that are used when no external tables
00006 are passed to PCRE by the application that calls it. The tables are used only
00007 for characters whose code values are less than 256.
00008 
00009 This is a default version of the tables that assumes ASCII encoding. A program
00010 called dftables (which is distributed with PCRE) can be used to build
00011 alternative versions of this file. This is necessary if you are running in an
00012 EBCDIC environment, or if you want to default to a different encoding, for
00013 example ISO-8859-1. When dftables is run, it creates these tables in the
00014 current locale. If PCRE is configured with --enable-rebuild-chartables, this
00015 happens automatically.
00016 
00017 The following #includes are present because without them gcc 4.x may remove the
00018 array definition from the final binary if PCRE is built into a static library
00019 and dead code stripping is activated. This leads to link errors. Pulling in the
00020 header ensures that the array gets flagged as "someone outside this compilation
00021 unit might reference this" and so it will always be supplied to the linker. */
00022 
00023 #include "config.h"
00024 
00025 #include "pcre_internal.h"
00026 
00027 const unsigned char _pcre_default_tables[] = {
00028 
00029 /* This table is a lower casing table. */
00030 
00031     0,  1,  2,  3,  4,  5,  6,  7,
00032     8,  9, 10, 11, 12, 13, 14, 15,
00033    16, 17, 18, 19, 20, 21, 22, 23,
00034    24, 25, 26, 27, 28, 29, 30, 31,
00035    32, 33, 34, 35, 36, 37, 38, 39,
00036    40, 41, 42, 43, 44, 45, 46, 47,
00037    48, 49, 50, 51, 52, 53, 54, 55,
00038    56, 57, 58, 59, 60, 61, 62, 63,
00039    64, 97, 98, 99,100,101,102,103,
00040   104,105,106,107,108,109,110,111,
00041   112,113,114,115,116,117,118,119,
00042   120,121,122, 91, 92, 93, 94, 95,
00043    96, 97, 98, 99,100,101,102,103,
00044   104,105,106,107,108,109,110,111,
00045   112,113,114,115,116,117,118,119,
00046   120,121,122,123,124,125,126,127,
00047   128,129,130,131,132,133,134,135,
00048   136,137,138,139,140,141,142,143,
00049   144,145,146,147,148,149,150,151,
00050   152,153,154,155,156,157,158,159,
00051   160,161,162,163,164,165,166,167,
00052   168,169,170,171,172,173,174,175,
00053   176,177,178,179,180,181,182,183,
00054   184,185,186,187,188,189,190,191,
00055   192,193,194,195,196,197,198,199,
00056   200,201,202,203,204,205,206,207,
00057   208,209,210,211,212,213,214,215,
00058   216,217,218,219,220,221,222,223,
00059   224,225,226,227,228,229,230,231,
00060   232,233,234,235,236,237,238,239,
00061   240,241,242,243,244,245,246,247,
00062   248,249,250,251,252,253,254,255,
00063 
00064 /* This table is a case flipping table. */
00065 
00066     0,  1,  2,  3,  4,  5,  6,  7,
00067     8,  9, 10, 11, 12, 13, 14, 15,
00068    16, 17, 18, 19, 20, 21, 22, 23,
00069    24, 25, 26, 27, 28, 29, 30, 31,
00070    32, 33, 34, 35, 36, 37, 38, 39,
00071    40, 41, 42, 43, 44, 45, 46, 47,
00072    48, 49, 50, 51, 52, 53, 54, 55,
00073    56, 57, 58, 59, 60, 61, 62, 63,
00074    64, 97, 98, 99,100,101,102,103,
00075   104,105,106,107,108,109,110,111,
00076   112,113,114,115,116,117,118,119,
00077   120,121,122, 91, 92, 93, 94, 95,
00078    96, 65, 66, 67, 68, 69, 70, 71,
00079    72, 73, 74, 75, 76, 77, 78, 79,
00080    80, 81, 82, 83, 84, 85, 86, 87,
00081    88, 89, 90,123,124,125,126,127,
00082   128,129,130,131,132,133,134,135,
00083   136,137,138,139,140,141,142,143,
00084   144,145,146,147,148,149,150,151,
00085   152,153,154,155,156,157,158,159,
00086   160,161,162,163,164,165,166,167,
00087   168,169,170,171,172,173,174,175,
00088   176,177,178,179,180,181,182,183,
00089   184,185,186,187,188,189,190,191,
00090   192,193,194,195,196,197,198,199,
00091   200,201,202,203,204,205,206,207,
00092   208,209,210,211,212,213,214,215,
00093   216,217,218,219,220,221,222,223,
00094   224,225,226,227,228,229,230,231,
00095   232,233,234,235,236,237,238,239,
00096   240,241,242,243,244,245,246,247,
00097   248,249,250,251,252,253,254,255,
00098 
00099 /* This table contains bit maps for various character classes. Each map is 32
00100 bytes long and the bits run from the least significant end of each byte. The
00101 classes that have their own maps are: space, xdigit, digit, upper, lower, word,
00102 graph, print, punct, and cntrl. Other classes are built from combinations. */
00103 
00104   0x00,0x3e,0x00,0x00,0x01,0x00,0x00,0x00,
00105   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00106   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00107   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00108 
00109   0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
00110   0x7e,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,
00111   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00112   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00113 
00114   0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
00115   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00116   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00117   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00118 
00119   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00120   0xfe,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
00121   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00122   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00123 
00124   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00125   0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07,
00126   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00127   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00128 
00129   0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
00130   0xfe,0xff,0xff,0x87,0xfe,0xff,0xff,0x07,
00131   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00132   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00133 
00134   0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
00135   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
00136   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00137   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00138 
00139   0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
00140   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
00141   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00142   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00143 
00144   0x00,0x00,0x00,0x00,0xfe,0xff,0x00,0xfc,
00145   0x01,0x00,0x00,0xf8,0x01,0x00,0x00,0x78,
00146   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00147   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00148 
00149   0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
00150   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
00151   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00152   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00153 
00154 /* This table identifies various classes of character by individual bits:
00155   0x01   white space character
00156   0x02   letter
00157   0x04   decimal digit
00158   0x08   hexadecimal digit
00159   0x10   alphanumeric or '_'
00160   0x80   regular expression metacharacter or binary zero
00161 */
00162 
00163   0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*   0-  7 */
00164   0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00, /*   8- 15 */
00165   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  16- 23 */
00166   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  24- 31 */
00167   0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /*    - '  */
00168   0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x00, /*  ( - /  */
00169   0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /*  0 - 7  */
00170   0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x80, /*  8 - ?  */
00171   0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /*  @ - G  */
00172   0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  H - O  */
00173   0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  P - W  */
00174   0x12,0x12,0x12,0x80,0x80,0x00,0x80,0x10, /*  X - _  */
00175   0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /*  ` - g  */
00176   0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  h - o  */
00177   0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  p - w  */
00178   0x12,0x12,0x12,0x80,0x80,0x00,0x00,0x00, /*  x -127 */
00179   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */
00180   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */
00181   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */
00182   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */
00183   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */
00184   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */
00185   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */
00186   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
00187   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */
00188   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */
00189   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */
00190   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */
00191   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */
00192   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */
00193   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */
00194   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */
00195 
00196 /* End of pcre_chartables.c */