File indexing completed on 2025-02-22 10:41:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef __XML_CHVALID_H__
0015 #define __XML_CHVALID_H__
0016
0017 #include <libxml/xmlversion.h>
0018 #include <libxml/xmlstring.h>
0019
0020 #ifdef __cplusplus
0021 extern "C" {
0022 #endif
0023
0024
0025
0026
0027
0028 typedef struct _xmlChSRange xmlChSRange;
0029 typedef xmlChSRange *xmlChSRangePtr;
0030 struct _xmlChSRange {
0031 unsigned short low;
0032 unsigned short high;
0033 };
0034
0035 typedef struct _xmlChLRange xmlChLRange;
0036 typedef xmlChLRange *xmlChLRangePtr;
0037 struct _xmlChLRange {
0038 unsigned int low;
0039 unsigned int high;
0040 };
0041
0042 typedef struct _xmlChRangeGroup xmlChRangeGroup;
0043 typedef xmlChRangeGroup *xmlChRangeGroupPtr;
0044 struct _xmlChRangeGroup {
0045 int nbShortRange;
0046 int nbLongRange;
0047 const xmlChSRange *shortRange;
0048 const xmlChLRange *longRange;
0049 };
0050
0051
0052
0053
0054 XMLPUBFUN int
0055 xmlCharInRange(unsigned int val, const xmlChRangeGroup *group);
0056
0057
0058
0059
0060
0061
0062
0063
0064 #define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
0065 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
0066 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
0067 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
0068 (0xf8 <= (c)))
0069
0070
0071
0072
0073
0074
0075
0076 #define xmlIsBaseCharQ(c) (((c) < 0x100) ? \
0077 xmlIsBaseChar_ch((c)) : \
0078 xmlCharInRange((c), &xmlIsBaseCharGroup))
0079
0080 XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup;
0081
0082
0083
0084
0085
0086
0087
0088 #define xmlIsBlank_ch(c) (((c) == 0x20) || \
0089 ((0x9 <= (c)) && ((c) <= 0xa)) || \
0090 ((c) == 0xd))
0091
0092
0093
0094
0095
0096
0097
0098 #define xmlIsBlankQ(c) (((c) < 0x100) ? \
0099 xmlIsBlank_ch((c)) : 0)
0100
0101
0102
0103
0104
0105
0106
0107
0108 #define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \
0109 ((c) == 0xd) || \
0110 (0x20 <= (c)))
0111
0112
0113
0114
0115
0116
0117
0118 #define xmlIsCharQ(c) (((c) < 0x100) ? \
0119 xmlIsChar_ch((c)) :\
0120 (((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
0121 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
0122 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
0123
0124 XMLPUBVAR const xmlChRangeGroup xmlIsCharGroup;
0125
0126
0127
0128
0129
0130
0131
0132 #define xmlIsCombiningQ(c) (((c) < 0x100) ? \
0133 0 : \
0134 xmlCharInRange((c), &xmlIsCombiningGroup))
0135
0136 XMLPUBVAR const xmlChRangeGroup xmlIsCombiningGroup;
0137
0138
0139
0140
0141
0142
0143
0144 #define xmlIsDigit_ch(c) (((0x30 <= (c)) && ((c) <= 0x39)))
0145
0146
0147
0148
0149
0150
0151
0152 #define xmlIsDigitQ(c) (((c) < 0x100) ? \
0153 xmlIsDigit_ch((c)) : \
0154 xmlCharInRange((c), &xmlIsDigitGroup))
0155
0156 XMLPUBVAR const xmlChRangeGroup xmlIsDigitGroup;
0157
0158
0159
0160
0161
0162
0163
0164 #define xmlIsExtender_ch(c) (((c) == 0xb7))
0165
0166
0167
0168
0169
0170
0171
0172 #define xmlIsExtenderQ(c) (((c) < 0x100) ? \
0173 xmlIsExtender_ch((c)) : \
0174 xmlCharInRange((c), &xmlIsExtenderGroup))
0175
0176 XMLPUBVAR const xmlChRangeGroup xmlIsExtenderGroup;
0177
0178
0179
0180
0181
0182
0183
0184 #define xmlIsIdeographicQ(c) (((c) < 0x100) ? \
0185 0 :\
0186 (((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
0187 ((c) == 0x3007) || \
0188 ((0x3021 <= (c)) && ((c) <= 0x3029))))
0189
0190 XMLPUBVAR const xmlChRangeGroup xmlIsIdeographicGroup;
0191 XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
0192
0193
0194
0195
0196
0197
0198
0199 #define xmlIsPubidChar_ch(c) (xmlIsPubidChar_tab[(c)])
0200
0201
0202
0203
0204
0205
0206
0207 #define xmlIsPubidCharQ(c) (((c) < 0x100) ? \
0208 xmlIsPubidChar_ch((c)) : 0)
0209
0210 XMLPUBFUN int
0211 xmlIsBaseChar(unsigned int ch);
0212 XMLPUBFUN int
0213 xmlIsBlank(unsigned int ch);
0214 XMLPUBFUN int
0215 xmlIsChar(unsigned int ch);
0216 XMLPUBFUN int
0217 xmlIsCombining(unsigned int ch);
0218 XMLPUBFUN int
0219 xmlIsDigit(unsigned int ch);
0220 XMLPUBFUN int
0221 xmlIsExtender(unsigned int ch);
0222 XMLPUBFUN int
0223 xmlIsIdeographic(unsigned int ch);
0224 XMLPUBFUN int
0225 xmlIsPubidChar(unsigned int ch);
0226
0227 #ifdef __cplusplus
0228 }
0229 #endif
0230 #endif