2 * Summary: Unicode character range checking
3 * Description: this module exports interfaces for the character
4 * range validation APIs
6 * This file is automatically generated from the cvs source
7 * definition files using the genChRanges.py Python script
9 * Generation date: Mon Mar 27 11:09:48 2006
10 * Sources: chvalid.def
11 * Author: William Brack <wbrack@mmm.com.hk>
14 #ifndef __XML_CHVALID_H__
15 #define __XML_CHVALID_H__
17 #include <libxml/xmlversion.h>
18 #include <libxml/xmlstring.h>
25 * Define our typedefs and structures
28 typedef struct _xmlChSRange xmlChSRange;
29 typedef xmlChSRange *xmlChSRangePtr;
35 typedef struct _xmlChLRange xmlChLRange;
36 typedef xmlChLRange *xmlChLRangePtr;
42 typedef struct _xmlChRangeGroup xmlChRangeGroup;
43 typedef xmlChRangeGroup *xmlChRangeGroupPtr;
44 struct _xmlChRangeGroup {
47 const xmlChSRange *shortRange; /* points to an array of ranges */
48 const xmlChLRange *longRange;
52 * Range checking routine
55 xmlCharInRange(unsigned int val, const xmlChRangeGroup *group);
60 * @c: char to validate
62 * Automatically generated by genChRanges.py
64 #define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
65 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
66 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
67 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
72 * @c: char to validate
74 * Automatically generated by genChRanges.py
76 #define xmlIsBaseCharQ(c) (((c) < 0x100) ? \
77 xmlIsBaseChar_ch((c)) : \
78 xmlCharInRange((c), &xmlIsBaseCharGroup))
80 XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup;
84 * @c: char to validate
86 * Automatically generated by genChRanges.py
88 #define xmlIsBlank_ch(c) (((c) == 0x20) || \
89 ((0x9 <= (c)) && ((c) <= 0xa)) || \
94 * @c: char to validate
96 * Automatically generated by genChRanges.py
98 #define xmlIsBlankQ(c) (((c) < 0x100) ? \
99 xmlIsBlank_ch((c)) : 0)
104 * @c: char to validate
106 * Automatically generated by genChRanges.py
108 #define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \
114 * @c: char to validate
116 * Automatically generated by genChRanges.py
118 #define xmlIsCharQ(c) (((c) < 0x100) ? \
120 (((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
121 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
122 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
124 XMLPUBVAR const xmlChRangeGroup xmlIsCharGroup;
128 * @c: char to validate
130 * Automatically generated by genChRanges.py
132 #define xmlIsCombiningQ(c) (((c) < 0x100) ? \
134 xmlCharInRange((c), &xmlIsCombiningGroup))
136 XMLPUBVAR const xmlChRangeGroup xmlIsCombiningGroup;
140 * @c: char to validate
142 * Automatically generated by genChRanges.py
144 #define xmlIsDigit_ch(c) (((0x30 <= (c)) && ((c) <= 0x39)))
148 * @c: char to validate
150 * Automatically generated by genChRanges.py
152 #define xmlIsDigitQ(c) (((c) < 0x100) ? \
153 xmlIsDigit_ch((c)) : \
154 xmlCharInRange((c), &xmlIsDigitGroup))
156 XMLPUBVAR const xmlChRangeGroup xmlIsDigitGroup;
160 * @c: char to validate
162 * Automatically generated by genChRanges.py
164 #define xmlIsExtender_ch(c) (((c) == 0xb7))
168 * @c: char to validate
170 * Automatically generated by genChRanges.py
172 #define xmlIsExtenderQ(c) (((c) < 0x100) ? \
173 xmlIsExtender_ch((c)) : \
174 xmlCharInRange((c), &xmlIsExtenderGroup))
176 XMLPUBVAR const xmlChRangeGroup xmlIsExtenderGroup;
180 * @c: char to validate
182 * Automatically generated by genChRanges.py
184 #define xmlIsIdeographicQ(c) (((c) < 0x100) ? \
186 (((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
188 ((0x3021 <= (c)) && ((c) <= 0x3029))))
190 XMLPUBVAR const xmlChRangeGroup xmlIsIdeographicGroup;
191 XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
195 * @c: char to validate
197 * Automatically generated by genChRanges.py
199 #define xmlIsPubidChar_ch(c) (xmlIsPubidChar_tab[(c)])
203 * @c: char to validate
205 * Automatically generated by genChRanges.py
207 #define xmlIsPubidCharQ(c) (((c) < 0x100) ? \
208 xmlIsPubidChar_ch((c)) : 0)
210 XMLPUBFUN int XMLCALL
211 xmlIsBaseChar(unsigned int ch);
212 XMLPUBFUN int XMLCALL
213 xmlIsBlank(unsigned int ch);
214 XMLPUBFUN int XMLCALL
215 xmlIsChar(unsigned int ch);
216 XMLPUBFUN int XMLCALL
217 xmlIsCombining(unsigned int ch);
218 XMLPUBFUN int XMLCALL
219 xmlIsDigit(unsigned int ch);
220 XMLPUBFUN int XMLCALL
221 xmlIsExtender(unsigned int ch);
222 XMLPUBFUN int XMLCALL
223 xmlIsIdeographic(unsigned int ch);
224 XMLPUBFUN int XMLCALL
225 xmlIsPubidChar(unsigned int ch);
230 #endif /* __XML_CHVALID_H__ */