ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

chvalid.c
Go to the documentation of this file.
00001 /*
00002  * chvalid.c:   this module implements the character range
00003  *      validation APIs
00004  *
00005  * This file is automatically generated from the cvs source
00006  * definition files using the genChRanges.py Python script
00007  *
00008  * Generation date: Mon Mar 27 11:09:48 2006
00009  * Sources: chvalid.def
00010  * William Brack <wbrack@mmm.com.hk>
00011  */
00012 
00013 #define IN_LIBXML
00014 #include "libxml.h"
00015 #include <libxml/chvalid.h>
00016 
00017 /*
00018  * The initial tables ({func_name}_tab) are used to validate whether a
00019  * single-byte character is within the specified group.  Each table
00020  * contains 256 bytes, with each byte representing one of the 256
00021  * possible characters.  If the table byte is set, the character is
00022  * allowed.
00023  *
00024  */
00025 const unsigned char xmlIsPubidChar_tab[256] = {
00026     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
00027     0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00028     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
00029     0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
00030     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
00031     0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
00032     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
00033     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
00034     0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
00035     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
00036     0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00037     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00038     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00039     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00040     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00041     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00042     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00043     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00044     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00045     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00046     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00047     0x00, 0x00, 0x00, 0x00 };
00048 
00049 static const xmlChSRange xmlIsBaseChar_srng[] = { {0x100, 0x131}, 
00050     {0x134, 0x13e}, {0x141, 0x148}, {0x14a, 0x17e}, {0x180, 0x1c3}, 
00051     {0x1cd, 0x1f0}, {0x1f4, 0x1f5}, {0x1fa, 0x217}, {0x250, 0x2a8}, 
00052     {0x2bb, 0x2c1}, {0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c}, 
00053     {0x38e, 0x3a1}, {0x3a3, 0x3ce}, {0x3d0, 0x3d6}, {0x3da, 0x3da}, 
00054     {0x3dc, 0x3dc}, {0x3de, 0x3de}, {0x3e0, 0x3e0}, {0x3e2, 0x3f3}, 
00055     {0x401, 0x40c}, {0x40e, 0x44f}, {0x451, 0x45c}, {0x45e, 0x481}, 
00056     {0x490, 0x4c4}, {0x4c7, 0x4c8}, {0x4cb, 0x4cc}, {0x4d0, 0x4eb}, 
00057     {0x4ee, 0x4f5}, {0x4f8, 0x4f9}, {0x531, 0x556}, {0x559, 0x559}, 
00058     {0x561, 0x586}, {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, 
00059     {0x641, 0x64a}, {0x671, 0x6b7}, {0x6ba, 0x6be}, {0x6c0, 0x6ce}, 
00060     {0x6d0, 0x6d3}, {0x6d5, 0x6d5}, {0x6e5, 0x6e6}, {0x905, 0x939}, 
00061     {0x93d, 0x93d}, {0x958, 0x961}, {0x985, 0x98c}, {0x98f, 0x990}, 
00062     {0x993, 0x9a8}, {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, {0x9b6, 0x9b9}, 
00063     {0x9dc, 0x9dd}, {0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a}, 
00064     {0xa0f, 0xa10}, {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33}, 
00065     {0xa35, 0xa36}, {0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e}, 
00066     {0xa72, 0xa74}, {0xa85, 0xa8b}, {0xa8d, 0xa8d}, {0xa8f, 0xa91}, 
00067     {0xa93, 0xaa8}, {0xaaa, 0xab0}, {0xab2, 0xab3}, {0xab5, 0xab9}, 
00068     {0xabd, 0xabd}, {0xae0, 0xae0}, {0xb05, 0xb0c}, {0xb0f, 0xb10}, 
00069     {0xb13, 0xb28}, {0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb36, 0xb39}, 
00070     {0xb3d, 0xb3d}, {0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb85, 0xb8a}, 
00071     {0xb8e, 0xb90}, {0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c}, 
00072     {0xb9e, 0xb9f}, {0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5}, 
00073     {0xbb7, 0xbb9}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, 
00074     {0xc2a, 0xc33}, {0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c}, 
00075     {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, 
00076     {0xcde, 0xcde}, {0xce0, 0xce1}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, 
00077     {0xd12, 0xd28}, {0xd2a, 0xd39}, {0xd60, 0xd61}, {0xe01, 0xe2e}, 
00078     {0xe30, 0xe30}, {0xe32, 0xe33}, {0xe40, 0xe45}, {0xe81, 0xe82}, 
00079     {0xe84, 0xe84}, {0xe87, 0xe88}, {0xe8a, 0xe8a}, {0xe8d, 0xe8d}, 
00080     {0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xea5, 0xea5}, 
00081     {0xea7, 0xea7}, {0xeaa, 0xeab}, {0xead, 0xeae}, {0xeb0, 0xeb0}, 
00082     {0xeb2, 0xeb3}, {0xebd, 0xebd}, {0xec0, 0xec4}, {0xf40, 0xf47}, 
00083     {0xf49, 0xf69}, {0x10a0, 0x10c5}, {0x10d0, 0x10f6}, {0x1100, 0x1100}, 
00084     {0x1102, 0x1103}, {0x1105, 0x1107}, {0x1109, 0x1109}, {0x110b, 0x110c}, 
00085     {0x110e, 0x1112}, {0x113c, 0x113c}, {0x113e, 0x113e}, {0x1140, 0x1140}, 
00086     {0x114c, 0x114c}, {0x114e, 0x114e}, {0x1150, 0x1150}, {0x1154, 0x1155}, 
00087     {0x1159, 0x1159}, {0x115f, 0x1161}, {0x1163, 0x1163}, {0x1165, 0x1165}, 
00088     {0x1167, 0x1167}, {0x1169, 0x1169}, {0x116d, 0x116e}, {0x1172, 0x1173}, 
00089     {0x1175, 0x1175}, {0x119e, 0x119e}, {0x11a8, 0x11a8}, {0x11ab, 0x11ab}, 
00090     {0x11ae, 0x11af}, {0x11b7, 0x11b8}, {0x11ba, 0x11ba}, {0x11bc, 0x11c2}, 
00091     {0x11eb, 0x11eb}, {0x11f0, 0x11f0}, {0x11f9, 0x11f9}, {0x1e00, 0x1e9b}, 
00092     {0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, 
00093     {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b}, 
00094     {0x1f5d, 0x1f5d}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc}, 
00095     {0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, 
00096     {0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, 
00097     {0x2126, 0x2126}, {0x212a, 0x212b}, {0x212e, 0x212e}, {0x2180, 0x2182}, 
00098     {0x3041, 0x3094}, {0x30a1, 0x30fa}, {0x3105, 0x312c}, {0xac00, 0xd7a3}};
00099 const xmlChRangeGroup xmlIsBaseCharGroup =
00100     {197, 0, xmlIsBaseChar_srng, (xmlChLRangePtr)0};
00101 
00102 static const xmlChSRange xmlIsChar_srng[] = { {0x100, 0xd7ff}, 
00103     {0xe000, 0xfffd}};
00104 static const xmlChLRange xmlIsChar_lrng[] = { {0x10000, 0x10ffff}};
00105 const xmlChRangeGroup xmlIsCharGroup =
00106     {2, 1, xmlIsChar_srng, xmlIsChar_lrng};
00107 
00108 static const xmlChSRange xmlIsCombining_srng[] = { {0x300, 0x345}, 
00109     {0x360, 0x361}, {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, 
00110     {0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, 
00111     {0x64b, 0x652}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6dd, 0x6df}, 
00112     {0x6e0, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x901, 0x903}, 
00113     {0x93c, 0x93c}, {0x93e, 0x94c}, {0x94d, 0x94d}, {0x951, 0x954}, 
00114     {0x962, 0x963}, {0x981, 0x983}, {0x9bc, 0x9bc}, {0x9be, 0x9be}, 
00115     {0x9bf, 0x9bf}, {0x9c0, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd}, 
00116     {0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa02, 0xa02}, {0xa3c, 0xa3c}, 
00117     {0xa3e, 0xa3e}, {0xa3f, 0xa3f}, {0xa40, 0xa42}, {0xa47, 0xa48}, 
00118     {0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa83}, {0xabc, 0xabc}, 
00119     {0xabe, 0xac5}, {0xac7, 0xac9}, {0xacb, 0xacd}, {0xb01, 0xb03}, 
00120     {0xb3c, 0xb3c}, {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d}, 
00121     {0xb56, 0xb57}, {0xb82, 0xb83}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, 
00122     {0xbca, 0xbcd}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44}, 
00123     {0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83}, 
00124     {0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6}, 
00125     {0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d}, 
00126     {0xd57, 0xd57}, {0xe31, 0xe31}, {0xe34, 0xe3a}, {0xe47, 0xe4e}, 
00127     {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, {0xec8, 0xecd}, 
00128     {0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, {0xf39, 0xf39}, 
00129     {0xf3e, 0xf3e}, {0xf3f, 0xf3f}, {0xf71, 0xf84}, {0xf86, 0xf8b}, 
00130     {0xf90, 0xf95}, {0xf97, 0xf97}, {0xf99, 0xfad}, {0xfb1, 0xfb7}, 
00131     {0xfb9, 0xfb9}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, {0x302a, 0x302f}, 
00132     {0x3099, 0x3099}, {0x309a, 0x309a}};
00133 const xmlChRangeGroup xmlIsCombiningGroup =
00134     {95, 0, xmlIsCombining_srng, (xmlChLRangePtr)0};
00135 
00136 static const xmlChSRange xmlIsDigit_srng[] = { {0x660, 0x669}, 
00137     {0x6f0, 0x6f9}, {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f}, 
00138     {0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f}, 
00139     {0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, 
00140     {0xf20, 0xf29}};
00141 const xmlChRangeGroup xmlIsDigitGroup =
00142     {14, 0, xmlIsDigit_srng, (xmlChLRangePtr)0};
00143 
00144 static const xmlChSRange xmlIsExtender_srng[] = { {0x2d0, 0x2d0}, 
00145     {0x2d1, 0x2d1}, {0x387, 0x387}, {0x640, 0x640}, {0xe46, 0xe46}, 
00146     {0xec6, 0xec6}, {0x3005, 0x3005}, {0x3031, 0x3035}, {0x309d, 0x309e}, 
00147     {0x30fc, 0x30fe}};
00148 const xmlChRangeGroup xmlIsExtenderGroup =
00149     {10, 0, xmlIsExtender_srng, (xmlChLRangePtr)0};
00150 
00151 static const xmlChSRange xmlIsIdeographic_srng[] = { {0x3007, 0x3007}, 
00152     {0x3021, 0x3029}, {0x4e00, 0x9fa5}};
00153 const xmlChRangeGroup xmlIsIdeographicGroup =
00154     {3, 0, xmlIsIdeographic_srng, (xmlChLRangePtr)0};
00155 
00156 
00167 int
00168 xmlCharInRange (unsigned int val, const xmlChRangeGroup *rptr) {
00169     int low, high, mid;
00170     const xmlChSRange *sptr;
00171     const xmlChLRange *lptr;
00172 
00173     if (rptr == NULL) return(0);
00174     if (val < 0x10000) {    /* is val in 'short' or 'long'  array? */
00175     if (rptr->nbShortRange == 0)
00176         return 0;
00177     low = 0;
00178     high = rptr->nbShortRange - 1;
00179     sptr = rptr->shortRange;
00180     while (low <= high) {
00181         mid = (low + high) / 2;
00182         if ((unsigned short) val < sptr[mid].low) {
00183         high = mid - 1;
00184         } else {
00185             if ((unsigned short) val > sptr[mid].high) {
00186             low = mid + 1;
00187         } else {
00188             return 1;
00189         }
00190         }
00191     }
00192     } else {
00193     if (rptr->nbLongRange == 0) {
00194         return 0;
00195     }
00196     low = 0;
00197     high = rptr->nbLongRange - 1;
00198     lptr = rptr->longRange;
00199     while (low <= high) {
00200         mid = (low + high) / 2;
00201         if (val < lptr[mid].low) {
00202         high = mid - 1;
00203         } else {
00204             if (val > lptr[mid].high) {
00205             low = mid + 1;
00206         } else {
00207             return 1;
00208         }
00209         }
00210     }
00211     }
00212     return 0;
00213 }
00214 
00215 
00225 int
00226 xmlIsBaseChar(unsigned int ch) {
00227     return(xmlIsBaseCharQ(ch));
00228 }
00229 
00230 
00240 int
00241 xmlIsBlank(unsigned int ch) {
00242     return(xmlIsBlankQ(ch));
00243 }
00244 
00245 
00255 int
00256 xmlIsChar(unsigned int ch) {
00257     return(xmlIsCharQ(ch));
00258 }
00259 
00260 
00270 int
00271 xmlIsCombining(unsigned int ch) {
00272     return(xmlIsCombiningQ(ch));
00273 }
00274 
00275 
00285 int
00286 xmlIsDigit(unsigned int ch) {
00287     return(xmlIsDigitQ(ch));
00288 }
00289 
00290 
00300 int
00301 xmlIsExtender(unsigned int ch) {
00302     return(xmlIsExtenderQ(ch));
00303 }
00304 
00305 
00315 int
00316 xmlIsIdeographic(unsigned int ch) {
00317     return(xmlIsIdeographicQ(ch));
00318 }
00319 
00320 
00330 int
00331 xmlIsPubidChar(unsigned int ch) {
00332     return(xmlIsPubidCharQ(ch));
00333 }
00334 
00335 #define bottom_chvalid
00336 #include "elfgcchack.h"

Generated on Sun May 27 2012 04:34:14 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.