00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __XML_CHVALID_H__
00028
00029 #define __XML_CHVALID_H__
00030
00031
00032
00033 #include <libxml/xmlversion.h>
00034
00035 #include <libxml/xmlstring.h>
00036
00037
00038
00039 #ifdef __cplusplus
00040
00041 extern "C" {
00042
00043 #endif
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 typedef struct _xmlChSRange xmlChSRange;
00056
00057 typedef xmlChSRange *xmlChSRangePtr;
00058
00059 struct _xmlChSRange {
00060
00061 unsigned short low;
00062
00063 unsigned short high;
00064
00065 };
00066
00067
00068
00069 typedef struct _xmlChLRange xmlChLRange;
00070
00071 typedef xmlChLRange *xmlChLRangePtr;
00072
00073 struct _xmlChLRange {
00074
00075 unsigned int low;
00076
00077 unsigned int high;
00078
00079 };
00080
00081
00082
00083 typedef struct _xmlChRangeGroup xmlChRangeGroup;
00084
00085 typedef xmlChRangeGroup *xmlChRangeGroupPtr;
00086
00087 struct _xmlChRangeGroup {
00088
00089 int nbShortRange;
00090
00091 int nbLongRange;
00092
00093 xmlChSRangePtr shortRange;
00094
00095 xmlChLRangePtr longRange;
00096
00097 };
00098
00099
00100
00107 XMLPUBFUN int XMLCALL
00108
00109 xmlCharInRange(unsigned int val, const xmlChRangeGroupPtr group);
00110
00111
00112
00113
00114
00127 #define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
00128
00129 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
00130
00131 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
00132
00133 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
00134
00135 (0xf8 <= (c)))
00136
00137
00138
00151 #define xmlIsBaseCharQ(c) (((c) < 0x100) ? \
00152
00153 xmlIsBaseChar_ch((c)) : \
00154
00155 xmlCharInRange((c), &xmlIsBaseCharGroup))
00156
00157
00158
00159 XMLPUBVAR xmlChRangeGroup xmlIsBaseCharGroup;
00160
00161
00162
00175 #define xmlIsBlank_ch(c) (((c) == 0x20) || \
00176
00177 ((0x9 <= (c)) && ((c) <= 0xa)) || \
00178
00179 ((c) == 0xd))
00180
00181
00182
00195 #define xmlIsBlankQ(c) (((c) < 0x100) ? \
00196
00197 xmlIsBlank_ch((c)) : 0)
00198
00199
00200
00201
00202
00215 #define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \
00216
00217 ((c) == 0xd) || \
00218
00219 (0x20 <= (c)))
00220
00221
00222
00235 #define xmlIsCharQ(c) (((c) < 0x100) ? \
00236
00237 xmlIsChar_ch((c)) :\
00238
00239 (((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
00240
00241 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
00242
00243 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
00244
00245
00246
00247 XMLPUBVAR xmlChRangeGroup xmlIsCharGroup;
00248
00249
00250
00263 #define xmlIsCombiningQ(c) (((c) < 0x100) ? \
00264
00265 0 : \
00266
00267 xmlCharInRange((c), &xmlIsCombiningGroup))
00268
00269
00270
00271 XMLPUBVAR xmlChRangeGroup xmlIsCombiningGroup;
00272
00273
00274
00287 #define xmlIsDigit_ch(c) (((0x30 <= (c)) && ((c) <= 0x39)))
00288
00289
00290
00303 #define xmlIsDigitQ(c) (((c) < 0x100) ? \
00304
00305 xmlIsDigit_ch((c)) : \
00306
00307 xmlCharInRange((c), &xmlIsDigitGroup))
00308
00309
00310
00311 XMLPUBVAR xmlChRangeGroup xmlIsDigitGroup;
00312
00313
00314
00327 #define xmlIsExtender_ch(c) (((c) == 0xb7))
00328
00329
00330
00343 #define xmlIsExtenderQ(c) (((c) < 0x100) ? \
00344
00345 xmlIsExtender_ch((c)) : \
00346
00347 xmlCharInRange((c), &xmlIsExtenderGroup))
00348
00349
00350
00351 XMLPUBVAR xmlChRangeGroup xmlIsExtenderGroup;
00352
00353
00354
00367 #define xmlIsIdeographicQ(c) (((c) < 0x100) ? \
00368
00369 0 :\
00370
00371 (((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
00372
00373 ((c) == 0x3007) || \
00374
00375 ((0x3021 <= (c)) && ((c) <= 0x3029))))
00376
00377
00378
00379 XMLPUBVAR xmlChRangeGroup xmlIsIdeographicGroup;
00380
00381 XMLPUBVAR unsigned char xmlIsPubidChar_tab[256];
00382
00383
00384
00397 #define xmlIsPubidChar_ch(c) (xmlIsPubidChar_tab[(c)])
00398
00399
00400
00401
00413 #define xmlIsPubidCharQ(c) (((c) < 0x100) ? \
00414
00415 xmlIsPubidChar_ch((c)) : 0)
00416
00417
00418
00419 XMLPUBFUN int XMLCALL
00420
00421 xmlIsBaseChar(unsigned int ch);
00422
00423 XMLPUBFUN int XMLCALL
00424
00425 xmlIsBlank(unsigned int ch);
00426
00427 XMLPUBFUN int XMLCALL
00428
00429 xmlIsChar(unsigned int ch);
00430
00431 XMLPUBFUN int XMLCALL
00432
00433 xmlIsCombining(unsigned int ch);
00434
00435 XMLPUBFUN int XMLCALL
00436
00437 xmlIsDigit(unsigned int ch);
00438
00439 XMLPUBFUN int XMLCALL
00440
00441 xmlIsExtender(unsigned int ch);
00442
00443 XMLPUBFUN int XMLCALL
00444
00445 xmlIsIdeographic(unsigned int ch);
00446
00447 XMLPUBFUN int XMLCALL
00448
00449 xmlIsPubidChar(unsigned int ch);
00450
00451
00452
00453 #ifdef __cplusplus
00454
00455 }
00456
00457 #endif
00458
00459 #endif
00460