/src/libxml2/include/libxml/chvalid.h
Line  | Count  | Source (jump to first uncovered line)  | 
1  |  | /*  | 
2  |  |  * Summary: Unicode character range checking  | 
3  |  |  * Description: this module exports interfaces for the character  | 
4  |  |  *               range validation APIs  | 
5  |  |  *  | 
6  |  |  * This file is automatically generated from the cvs source  | 
7  |  |  * definition files using the genChRanges.py Python script  | 
8  |  |  *  | 
9  |  |  * Generation date: Mon Mar 27 11:09:48 2006  | 
10  |  |  * Sources: chvalid.def  | 
11  |  |  * Author: William Brack <wbrack@mmm.com.hk>  | 
12  |  |  */  | 
13  |  |  | 
14  |  | #ifndef __XML_CHVALID_H__  | 
15  |  | #define __XML_CHVALID_H__  | 
16  |  |  | 
17  |  | #include <libxml/xmlversion.h>  | 
18  |  | #include <libxml/xmlstring.h>  | 
19  |  |  | 
20  |  | #ifdef __cplusplus  | 
21  |  | extern "C" { | 
22  |  | #endif  | 
23  |  |  | 
24  |  | /*  | 
25  |  |  * Define our typedefs and structures  | 
26  |  |  *  | 
27  |  |  */  | 
28  |  | typedef struct _xmlChSRange xmlChSRange;  | 
29  |  | typedef xmlChSRange *xmlChSRangePtr;  | 
30  |  | struct _xmlChSRange { | 
31  |  |     unsigned short  low;  | 
32  |  |     unsigned short  high;  | 
33  |  | };  | 
34  |  |  | 
35  |  | typedef struct _xmlChLRange xmlChLRange;  | 
36  |  | typedef xmlChLRange *xmlChLRangePtr;  | 
37  |  | struct _xmlChLRange { | 
38  |  |     unsigned int  low;  | 
39  |  |     unsigned int  high;  | 
40  |  | };  | 
41  |  |  | 
42  |  | typedef struct _xmlChRangeGroup xmlChRangeGroup;  | 
43  |  | typedef xmlChRangeGroup *xmlChRangeGroupPtr;  | 
44  |  | struct _xmlChRangeGroup { | 
45  |  |     int     nbShortRange;  | 
46  |  |     int     nbLongRange;  | 
47  |  |     const xmlChSRange *shortRange;  /* points to an array of ranges */  | 
48  |  |     const xmlChLRange *longRange;  | 
49  |  | };  | 
50  |  |  | 
51  |  | /**  | 
52  |  |  * Range checking routine  | 
53  |  |  */  | 
54  |  | XMLPUBFUN int  | 
55  |  |     xmlCharInRange(unsigned int val, const xmlChRangeGroup *group);  | 
56  |  |  | 
57  |  |  | 
58  |  | /**  | 
59  |  |  * xmlIsBaseChar_ch:  | 
60  |  |  * @c: char to validate  | 
61  |  |  *  | 
62  |  |  * Automatically generated by genChRanges.py  | 
63  |  |  */  | 
64  | 1.47M  | #define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \  | 
65  | 1.47M  |          ((0x61 <= (c)) && ((c) <= 0x7a)) || \  | 
66  | 1.47M  |          ((0xc0 <= (c)) && ((c) <= 0xd6)) || \  | 
67  | 1.47M  |          ((0xd8 <= (c)) && ((c) <= 0xf6)) || \  | 
68  | 1.47M  |           (0xf8 <= (c)))  | 
69  |  |  | 
70  |  | /**  | 
71  |  |  * xmlIsBaseCharQ:  | 
72  |  |  * @c: char to validate  | 
73  |  |  *  | 
74  |  |  * Automatically generated by genChRanges.py  | 
75  |  |  */  | 
76  | 2.96M  | #define xmlIsBaseCharQ(c) (((c) < 0x100) ? \  | 
77  | 2.96M  |          xmlIsBaseChar_ch((c)) : \  | 
78  | 2.96M  |          xmlCharInRange((c), &xmlIsBaseCharGroup))  | 
79  |  |  | 
80  |  | XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup;  | 
81  |  |  | 
82  |  | /**  | 
83  |  |  * xmlIsBlank_ch:  | 
84  |  |  * @c: char to validate  | 
85  |  |  *  | 
86  |  |  * Automatically generated by genChRanges.py  | 
87  |  |  */  | 
88  | 105M  | #define xmlIsBlank_ch(c)  (((c) == 0x20) || \  | 
89  | 103M  |          ((0x9 <= (c)) && ((c) <= 0xa)) || \  | 
90  | 38.3M  |          ((c) == 0xd))  | 
91  |  |  | 
92  |  | /**  | 
93  |  |  * xmlIsBlankQ:  | 
94  |  |  * @c: char to validate  | 
95  |  |  *  | 
96  |  |  * Automatically generated by genChRanges.py  | 
97  |  |  */  | 
98  | 22.1k  | #define xmlIsBlankQ(c)    (((c) < 0x100) ? \  | 
99  | 22.1k  |          xmlIsBlank_ch((c)) : 0)  | 
100  |  |  | 
101  |  |  | 
102  |  | /**  | 
103  |  |  * xmlIsChar_ch:  | 
104  |  |  * @c: char to validate  | 
105  |  |  *  | 
106  |  |  * Automatically generated by genChRanges.py  | 
107  |  |  */  | 
108  | 43.2M  | #define xmlIsChar_ch(c)   (((0x9 <= (c)) && ((c) <= 0xa)) || \  | 
109  | 43.2M  |          ((c) == 0xd) || \  | 
110  | 43.2M  |           (0x20 <= (c)))  | 
111  |  |  | 
112  |  | /**  | 
113  |  |  * xmlIsCharQ:  | 
114  |  |  * @c: char to validate  | 
115  |  |  *  | 
116  |  |  * Automatically generated by genChRanges.py  | 
117  |  |  */  | 
118  | 46.5M  | #define xmlIsCharQ(c)   (((c) < 0x100) ? \  | 
119  | 46.5M  |          xmlIsChar_ch((c)) :\  | 
120  | 46.5M  |         (((0x100 <= (c)) && ((c) <= 0xd7ff)) || \  | 
121  | 2.20M  |          ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \  | 
122  | 2.20M  |          ((0x10000 <= (c)) && ((c) <= 0x10ffff))))  | 
123  |  |  | 
124  |  | XMLPUBVAR const xmlChRangeGroup xmlIsCharGroup;  | 
125  |  |  | 
126  |  | /**  | 
127  |  |  * xmlIsCombiningQ:  | 
128  |  |  * @c: char to validate  | 
129  |  |  *  | 
130  |  |  * Automatically generated by genChRanges.py  | 
131  |  |  */  | 
132  | 118k  | #define xmlIsCombiningQ(c)  (((c) < 0x100) ? \  | 
133  | 118k  |          0 : \  | 
134  | 118k  |          xmlCharInRange((c), &xmlIsCombiningGroup))  | 
135  |  |  | 
136  |  | XMLPUBVAR const xmlChRangeGroup xmlIsCombiningGroup;  | 
137  |  |  | 
138  |  | /**  | 
139  |  |  * xmlIsDigit_ch:  | 
140  |  |  * @c: char to validate  | 
141  |  |  *  | 
142  |  |  * Automatically generated by genChRanges.py  | 
143  |  |  */  | 
144  | 285k  | #define xmlIsDigit_ch(c)  (((0x30 <= (c)) && ((c) <= 0x39)))  | 
145  |  |  | 
146  |  | /**  | 
147  |  |  * xmlIsDigitQ:  | 
148  |  |  * @c: char to validate  | 
149  |  |  *  | 
150  |  |  * Automatically generated by genChRanges.py  | 
151  |  |  */  | 
152  | 293k  | #define xmlIsDigitQ(c)    (((c) < 0x100) ? \  | 
153  | 293k  |          xmlIsDigit_ch((c)) : \  | 
154  | 293k  |          xmlCharInRange((c), &xmlIsDigitGroup))  | 
155  |  |  | 
156  |  | XMLPUBVAR const xmlChRangeGroup xmlIsDigitGroup;  | 
157  |  |  | 
158  |  | /**  | 
159  |  |  * xmlIsExtender_ch:  | 
160  |  |  * @c: char to validate  | 
161  |  |  *  | 
162  |  |  * Automatically generated by genChRanges.py  | 
163  |  |  */  | 
164  | 111k  | #define xmlIsExtender_ch(c) (((c) == 0xb7))  | 
165  |  |  | 
166  |  | /**  | 
167  |  |  * xmlIsExtenderQ:  | 
168  |  |  * @c: char to validate  | 
169  |  |  *  | 
170  |  |  * Automatically generated by genChRanges.py  | 
171  |  |  */  | 
172  | 112k  | #define xmlIsExtenderQ(c) (((c) < 0x100) ? \  | 
173  | 112k  |          xmlIsExtender_ch((c)) : \  | 
174  | 112k  |          xmlCharInRange((c), &xmlIsExtenderGroup))  | 
175  |  |  | 
176  |  | XMLPUBVAR const xmlChRangeGroup xmlIsExtenderGroup;  | 
177  |  |  | 
178  |  | /**  | 
179  |  |  * xmlIsIdeographicQ:  | 
180  |  |  * @c: char to validate  | 
181  |  |  *  | 
182  |  |  * Automatically generated by genChRanges.py  | 
183  |  |  */  | 
184  | 321k  | #define xmlIsIdeographicQ(c)  (((c) < 0x100) ? \  | 
185  | 321k  |          0 :\  | 
186  | 321k  |         (((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \  | 
187  | 4.75k  |          ((c) == 0x3007) || \  | 
188  | 4.75k  |          ((0x3021 <= (c)) && ((c) <= 0x3029))))  | 
189  |  |  | 
190  |  | XMLPUBVAR const xmlChRangeGroup xmlIsIdeographicGroup;  | 
191  |  | XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];  | 
192  |  |  | 
193  |  | /**  | 
194  |  |  * xmlIsPubidChar_ch:  | 
195  |  |  * @c: char to validate  | 
196  |  |  *  | 
197  |  |  * Automatically generated by genChRanges.py  | 
198  |  |  */  | 
199  | 543k  | #define xmlIsPubidChar_ch(c)  (xmlIsPubidChar_tab[(c)])  | 
200  |  |  | 
201  |  | /**  | 
202  |  |  * xmlIsPubidCharQ:  | 
203  |  |  * @c: char to validate  | 
204  |  |  *  | 
205  |  |  * Automatically generated by genChRanges.py  | 
206  |  |  */  | 
207  | 0  | #define xmlIsPubidCharQ(c)  (((c) < 0x100) ? \  | 
208  | 0  |          xmlIsPubidChar_ch((c)) : 0)  | 
209  |  |  | 
210  |  | XMLPUBFUN int  | 
211  |  |     xmlIsBaseChar(unsigned int ch);  | 
212  |  | XMLPUBFUN int  | 
213  |  |     xmlIsBlank(unsigned int ch);  | 
214  |  | XMLPUBFUN int  | 
215  |  |     xmlIsChar(unsigned int ch);  | 
216  |  | XMLPUBFUN int  | 
217  |  |     xmlIsCombining(unsigned int ch);  | 
218  |  | XMLPUBFUN int  | 
219  |  |     xmlIsDigit(unsigned int ch);  | 
220  |  | XMLPUBFUN int  | 
221  |  |     xmlIsExtender(unsigned int ch);  | 
222  |  | XMLPUBFUN int  | 
223  |  |     xmlIsIdeographic(unsigned int ch);  | 
224  |  | XMLPUBFUN int  | 
225  |  |     xmlIsPubidChar(unsigned int ch);  | 
226  |  |  | 
227  |  | #ifdef __cplusplus  | 
228  |  | }  | 
229  |  | #endif  | 
230  |  | #endif /* __XML_CHVALID_H__ */  |