chvalid.h

Go to the documentation of this file.
00001 /*
00002  * Summary: Unicode character range checking
00003  * Description: this module exports interfaces for the character
00004  *               range validation APIs
00005  *
00006  * This file is automatically generated from the cvs source
00007  * definition files using the genChRanges.py Python script
00008  *
00009  * Generation date: Mon Mar 27 11:09:48 2006
00010  * Sources: chvalid.def
00011  * Author: William Brack <wbrack@mmm.com.hk>
00012  */
00013 
00014 #ifndef __XML_CHVALID_H__
00015 #define __XML_CHVALID_H__
00016 
00017 #include <libxml/xmlversion.h>
00018 #include <libxml/xmlstring.h>
00019 
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023 
00024 /*
00025  * Define our typedefs and structures
00026  *
00027  */
00028 typedef struct _xmlChSRange xmlChSRange;
00029 typedef xmlChSRange *xmlChSRangePtr;
00030 struct _xmlChSRange {
00031     unsigned short  low;
00032     unsigned short  high;
00033 };
00034 
00035 typedef struct _xmlChLRange xmlChLRange;
00036 typedef xmlChLRange *xmlChLRangePtr;
00037 struct _xmlChLRange {
00038     unsigned int    low;
00039     unsigned int    high;
00040 };
00041 
00042 typedef struct _xmlChRangeGroup xmlChRangeGroup;
00043 typedef xmlChRangeGroup *xmlChRangeGroupPtr;
00044 struct _xmlChRangeGroup {
00045     int         nbShortRange;
00046     int         nbLongRange;
00047     const xmlChSRange   *shortRange;    /* points to an array of ranges */
00048     const xmlChLRange   *longRange;
00049 };
00050 
00054 XMLPUBFUN int XMLCALL
00055         xmlCharInRange(unsigned int val, const xmlChRangeGroup *group);
00056 
00057 
00064 #define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
00065                  ((0x61 <= (c)) && ((c) <= 0x7a)) || \
00066                  ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
00067                  ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
00068                   (0xf8 <= (c)))
00069 
00076 #define xmlIsBaseCharQ(c)   (((c) < 0x100) ? \
00077                  xmlIsBaseChar_ch((c)) : \
00078                  xmlCharInRange((c), &xmlIsBaseCharGroup))
00079 
00080 XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup;
00081 
00088 #define xmlIsBlank_ch(c)    (((c) == 0x20) || \
00089                  ((0x9 <= (c)) && ((c) <= 0xa)) || \
00090                  ((c) == 0xd))
00091 
00098 #define xmlIsBlankQ(c)      (((c) < 0x100) ? \
00099                  xmlIsBlank_ch((c)) : 0)
00100 
00101 
00108 #define xmlIsChar_ch(c)     (((0x9 <= (c)) && ((c) <= 0xa)) || \
00109                  ((c) == 0xd) || \
00110                   (0x20 <= (c)))
00111 
00118 #define xmlIsCharQ(c)       (((c) < 0x100) ? \
00119                  xmlIsChar_ch((c)) :\
00120                 (((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
00121                  ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
00122                  ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
00123 
00124 XMLPUBVAR const xmlChRangeGroup xmlIsCharGroup;
00125 
00132 #define xmlIsCombiningQ(c)  (((c) < 0x100) ? \
00133                  0 : \
00134                  xmlCharInRange((c), &xmlIsCombiningGroup))
00135 
00136 XMLPUBVAR const xmlChRangeGroup xmlIsCombiningGroup;
00137 
00144 #define xmlIsDigit_ch(c)    (((0x30 <= (c)) && ((c) <= 0x39)))
00145 
00152 #define xmlIsDigitQ(c)      (((c) < 0x100) ? \
00153                  xmlIsDigit_ch((c)) : \
00154                  xmlCharInRange((c), &xmlIsDigitGroup))
00155 
00156 XMLPUBVAR const xmlChRangeGroup xmlIsDigitGroup;
00157 
00164 #define xmlIsExtender_ch(c) (((c) == 0xb7))
00165 
00172 #define xmlIsExtenderQ(c)   (((c) < 0x100) ? \
00173                  xmlIsExtender_ch((c)) : \
00174                  xmlCharInRange((c), &xmlIsExtenderGroup))
00175 
00176 XMLPUBVAR const xmlChRangeGroup xmlIsExtenderGroup;
00177 
00184 #define xmlIsIdeographicQ(c)    (((c) < 0x100) ? \
00185                  0 :\
00186                 (((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
00187                  ((c) == 0x3007) || \
00188                  ((0x3021 <= (c)) && ((c) <= 0x3029))))
00189 
00190 XMLPUBVAR const xmlChRangeGroup xmlIsIdeographicGroup;
00191 XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
00192 
00199 #define xmlIsPubidChar_ch(c)    (xmlIsPubidChar_tab[(c)])
00200 
00207 #define xmlIsPubidCharQ(c)  (((c) < 0x100) ? \
00208                  xmlIsPubidChar_ch((c)) : 0)
00209 
00210 XMLPUBFUN int XMLCALL
00211         xmlIsBaseChar(unsigned int ch);
00212 XMLPUBFUN int XMLCALL
00213         xmlIsBlank(unsigned int ch);
00214 XMLPUBFUN int XMLCALL
00215         xmlIsChar(unsigned int ch);
00216 XMLPUBFUN int XMLCALL
00217         xmlIsCombining(unsigned int ch);
00218 XMLPUBFUN int XMLCALL
00219         xmlIsDigit(unsigned int ch);
00220 XMLPUBFUN int XMLCALL
00221         xmlIsExtender(unsigned int ch);
00222 XMLPUBFUN int XMLCALL
00223         xmlIsIdeographic(unsigned int ch);
00224 XMLPUBFUN int XMLCALL
00225         xmlIsPubidChar(unsigned int ch);
00226 
00227 #ifdef __cplusplus
00228 }
00229 #endif
00230 #endif /* __XML_CHVALID_H__ */
footer
 SourceForge.net Logo