Annotation of XML/parserInternals.h, revision 1.29

1.1       daniel      1: /*
                      2:  * parserInternals.h : internals routines exported by the parser.
                      3:  *
                      4:  * See Copyright for the status of this software.
                      5:  *
                      6:  * Daniel.Veillard@w3.org
                      7:  */
                      8: 
                      9: #ifndef __XML_PARSER_INTERNALS_H__
                     10: #define __XML_PARSER_INTERNALS_H__
                     11: 
1.28      daniel     12: #include <libxml/parser.h>
1.1       daniel     13: 
                     14: #ifdef __cplusplus
                     15: extern "C" {
                     16: #endif
                     17: 
1.14      daniel     18: #define XML_MAX_NAMELEN 1000
                     19: 
1.3       daniel     20: /************************************************************************
                     21:  *                                                                     *
                     22:  * UNICODE version of the macros.                                              *
                     23:  *                                                                     *
                     24:  ************************************************************************/
                     25: /*
                     26:  * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
                     27:  *                  | [#x10000-#x10FFFF]
                     28:  * any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
                     29:  */
                     30: #define IS_CHAR(c)                                                     \
1.29    ! daniel     31:     ((((c) == 0x09) || ((c) == 0x0A) || ((c) == 0x0D) ||               \
1.3       daniel     32:       (((c) >= 0x20) && ((c) != 0xFFFE) && ((c) != 0xFFFF))) &&                \
                     33:       (((c) <= 0xD7FF) || ((c) >= 0xE000)) && ((c) >= 0) &&            \
                     34:       ((c) <= 0x10FFFF))
                     35: 
                     36: /*
                     37:  * [3] S ::= (#x20 | #x9 | #xD | #xA)+
                     38:  */
1.29    ! daniel     39: #define IS_BLANK(c) (((c) == 0x20) || ((c) == 0x09) || ((c) == 0xA) || \
1.3       daniel     40:                      ((c) == 0x0D))
                     41: 
                     42: /*
                     43:  * [85] BaseChar ::= ... long list see REC ...
                     44:  *
                     45:  * VI is your friend !
                     46:  * :1,$ s/\[#x\([0-9A-Z]*\)-#x\([0-9A-Z]*\)\]/     (((c) >= 0x\1) \&\& ((c) <= 0x\2)) ||/
                     47:  * and 
                     48:  * :1,$ s/#x\([0-9A-Z]*\)/     ((c) == 0x\1) ||/
                     49:  */
                     50: #define IS_BASECHAR(c)                                                 \
                     51:      ((((c) >= 0x0041) && ((c) <= 0x005A)) ||                          \
                     52:       (((c) >= 0x0061) && ((c) <= 0x007A)) ||                          \
                     53:       (((c) >= 0x00C0) && ((c) <= 0x00D6)) ||                          \
                     54:       (((c) >= 0x00D8) && ((c) <= 0x00F6)) ||                          \
                     55:       (((c) >= 0x00F8) && ((c) <= 0x00FF)) ||                          \
                     56:       (((c) >= 0x0100) && ((c) <= 0x0131)) ||                          \
                     57:       (((c) >= 0x0134) && ((c) <= 0x013E)) ||                          \
                     58:       (((c) >= 0x0141) && ((c) <= 0x0148)) ||                          \
                     59:       (((c) >= 0x014A) && ((c) <= 0x017E)) ||                          \
                     60:       (((c) >= 0x0180) && ((c) <= 0x01C3)) ||                          \
                     61:       (((c) >= 0x01CD) && ((c) <= 0x01F0)) ||                          \
                     62:       (((c) >= 0x01F4) && ((c) <= 0x01F5)) ||                          \
                     63:       (((c) >= 0x01FA) && ((c) <= 0x0217)) ||                          \
                     64:       (((c) >= 0x0250) && ((c) <= 0x02A8)) ||                          \
                     65:       (((c) >= 0x02BB) && ((c) <= 0x02C1)) ||                          \
                     66:       ((c) == 0x0386) ||                                               \
                     67:       (((c) >= 0x0388) && ((c) <= 0x038A)) ||                          \
                     68:       ((c) == 0x038C) ||                                               \
                     69:       (((c) >= 0x038E) && ((c) <= 0x03A1)) ||                          \
                     70:       (((c) >= 0x03A3) && ((c) <= 0x03CE)) ||                          \
                     71:       (((c) >= 0x03D0) && ((c) <= 0x03D6)) ||                          \
                     72:       ((c) == 0x03DA) ||                                               \
                     73:       ((c) == 0x03DC) ||                                               \
                     74:       ((c) == 0x03DE) ||                                               \
                     75:       ((c) == 0x03E0) ||                                               \
                     76:       (((c) >= 0x03E2) && ((c) <= 0x03F3)) ||                          \
                     77:       (((c) >= 0x0401) && ((c) <= 0x040C)) ||                          \
                     78:       (((c) >= 0x040E) && ((c) <= 0x044F)) ||                          \
                     79:       (((c) >= 0x0451) && ((c) <= 0x045C)) ||                          \
                     80:       (((c) >= 0x045E) && ((c) <= 0x0481)) ||                          \
                     81:       (((c) >= 0x0490) && ((c) <= 0x04C4)) ||                          \
                     82:       (((c) >= 0x04C7) && ((c) <= 0x04C8)) ||                          \
                     83:       (((c) >= 0x04CB) && ((c) <= 0x04CC)) ||                          \
                     84:       (((c) >= 0x04D0) && ((c) <= 0x04EB)) ||                          \
                     85:       (((c) >= 0x04EE) && ((c) <= 0x04F5)) ||                          \
                     86:       (((c) >= 0x04F8) && ((c) <= 0x04F9)) ||                          \
                     87:       (((c) >= 0x0531) && ((c) <= 0x0556)) ||                          \
                     88:       ((c) == 0x0559) ||                                               \
                     89:       (((c) >= 0x0561) && ((c) <= 0x0586)) ||                          \
                     90:       (((c) >= 0x05D0) && ((c) <= 0x05EA)) ||                          \
                     91:       (((c) >= 0x05F0) && ((c) <= 0x05F2)) ||                          \
                     92:       (((c) >= 0x0621) && ((c) <= 0x063A)) ||                          \
                     93:       (((c) >= 0x0641) && ((c) <= 0x064A)) ||                          \
                     94:       (((c) >= 0x0671) && ((c) <= 0x06B7)) ||                          \
                     95:       (((c) >= 0x06BA) && ((c) <= 0x06BE)) ||                          \
                     96:       (((c) >= 0x06C0) && ((c) <= 0x06CE)) ||                          \
                     97:       (((c) >= 0x06D0) && ((c) <= 0x06D3)) ||                          \
                     98:       ((c) == 0x06D5) ||                                               \
                     99:       (((c) >= 0x06E5) && ((c) <= 0x06E6)) ||                          \
                    100:       (((c) >= 0x0905) && ((c) <= 0x0939)) ||                          \
                    101:       ((c) == 0x093D) ||                                               \
                    102:       (((c) >= 0x0958) && ((c) <= 0x0961)) ||                          \
                    103:       (((c) >= 0x0985) && ((c) <= 0x098C)) ||                          \
                    104:       (((c) >= 0x098F) && ((c) <= 0x0990)) ||                          \
                    105:       (((c) >= 0x0993) && ((c) <= 0x09A8)) ||                          \
                    106:       (((c) >= 0x09AA) && ((c) <= 0x09B0)) ||                          \
                    107:       ((c) == 0x09B2) ||                                               \
                    108:       (((c) >= 0x09B6) && ((c) <= 0x09B9)) ||                          \
                    109:       (((c) >= 0x09DC) && ((c) <= 0x09DD)) ||                          \
                    110:       (((c) >= 0x09DF) && ((c) <= 0x09E1)) ||                          \
                    111:       (((c) >= 0x09F0) && ((c) <= 0x09F1)) ||                          \
                    112:       (((c) >= 0x0A05) && ((c) <= 0x0A0A)) ||                          \
                    113:       (((c) >= 0x0A0F) && ((c) <= 0x0A10)) ||                          \
                    114:       (((c) >= 0x0A13) && ((c) <= 0x0A28)) ||                          \
                    115:       (((c) >= 0x0A2A) && ((c) <= 0x0A30)) ||                          \
                    116:       (((c) >= 0x0A32) && ((c) <= 0x0A33)) ||                          \
                    117:       (((c) >= 0x0A35) && ((c) <= 0x0A36)) ||                          \
                    118:       (((c) >= 0x0A38) && ((c) <= 0x0A39)) ||                          \
                    119:       (((c) >= 0x0A59) && ((c) <= 0x0A5C)) ||                          \
                    120:       ((c) == 0x0A5E) ||                                               \
                    121:       (((c) >= 0x0A72) && ((c) <= 0x0A74)) ||                          \
                    122:       (((c) >= 0x0A85) && ((c) <= 0x0A8B)) ||                          \
                    123:       ((c) == 0x0A8D) ||                                               \
                    124:       (((c) >= 0x0A8F) && ((c) <= 0x0A91)) ||                          \
                    125:       (((c) >= 0x0A93) && ((c) <= 0x0AA8)) ||                          \
                    126:       (((c) >= 0x0AAA) && ((c) <= 0x0AB0)) ||                          \
                    127:       (((c) >= 0x0AB2) && ((c) <= 0x0AB3)) ||                          \
                    128:       (((c) >= 0x0AB5) && ((c) <= 0x0AB9)) ||                          \
                    129:       ((c) == 0x0ABD) ||                                               \
                    130:       ((c) == 0x0AE0) ||                                               \
                    131:       (((c) >= 0x0B05) && ((c) <= 0x0B0C)) ||                          \
                    132:       (((c) >= 0x0B0F) && ((c) <= 0x0B10)) ||                          \
                    133:       (((c) >= 0x0B13) && ((c) <= 0x0B28)) ||                          \
                    134:       (((c) >= 0x0B2A) && ((c) <= 0x0B30)) ||                          \
                    135:       (((c) >= 0x0B32) && ((c) <= 0x0B33)) ||                          \
                    136:       (((c) >= 0x0B36) && ((c) <= 0x0B39)) ||                          \
                    137:       ((c) == 0x0B3D) ||                                               \
                    138:       (((c) >= 0x0B5C) && ((c) <= 0x0B5D)) ||                          \
                    139:       (((c) >= 0x0B5F) && ((c) <= 0x0B61)) ||                          \
                    140:       (((c) >= 0x0B85) && ((c) <= 0x0B8A)) ||                          \
                    141:       (((c) >= 0x0B8E) && ((c) <= 0x0B90)) ||                          \
                    142:       (((c) >= 0x0B92) && ((c) <= 0x0B95)) ||                          \
                    143:       (((c) >= 0x0B99) && ((c) <= 0x0B9A)) ||                          \
                    144:       ((c) == 0x0B9C) ||                                               \
                    145:       (((c) >= 0x0B9E) && ((c) <= 0x0B9F)) ||                          \
                    146:       (((c) >= 0x0BA3) && ((c) <= 0x0BA4)) ||                          \
                    147:       (((c) >= 0x0BA8) && ((c) <= 0x0BAA)) ||                          \
                    148:       (((c) >= 0x0BAE) && ((c) <= 0x0BB5)) ||                          \
                    149:       (((c) >= 0x0BB7) && ((c) <= 0x0BB9)) ||                          \
                    150:       (((c) >= 0x0C05) && ((c) <= 0x0C0C)) ||                          \
                    151:       (((c) >= 0x0C0E) && ((c) <= 0x0C10)) ||                          \
                    152:       (((c) >= 0x0C12) && ((c) <= 0x0C28)) ||                          \
                    153:       (((c) >= 0x0C2A) && ((c) <= 0x0C33)) ||                          \
                    154:       (((c) >= 0x0C35) && ((c) <= 0x0C39)) ||                          \
                    155:       (((c) >= 0x0C60) && ((c) <= 0x0C61)) ||                          \
                    156:       (((c) >= 0x0C85) && ((c) <= 0x0C8C)) ||                          \
                    157:       (((c) >= 0x0C8E) && ((c) <= 0x0C90)) ||                          \
                    158:       (((c) >= 0x0C92) && ((c) <= 0x0CA8)) ||                          \
                    159:       (((c) >= 0x0CAA) && ((c) <= 0x0CB3)) ||                          \
                    160:       (((c) >= 0x0CB5) && ((c) <= 0x0CB9)) ||                          \
                    161:       ((c) == 0x0CDE) ||                                               \
                    162:       (((c) >= 0x0CE0) && ((c) <= 0x0CE1)) ||                          \
                    163:       (((c) >= 0x0D05) && ((c) <= 0x0D0C)) ||                          \
                    164:       (((c) >= 0x0D0E) && ((c) <= 0x0D10)) ||                          \
                    165:       (((c) >= 0x0D12) && ((c) <= 0x0D28)) ||                          \
                    166:       (((c) >= 0x0D2A) && ((c) <= 0x0D39)) ||                          \
                    167:       (((c) >= 0x0D60) && ((c) <= 0x0D61)) ||                          \
                    168:       (((c) >= 0x0E01) && ((c) <= 0x0E2E)) ||                          \
                    169:       ((c) == 0x0E30) ||                                               \
                    170:       (((c) >= 0x0E32) && ((c) <= 0x0E33)) ||                          \
                    171:       (((c) >= 0x0E40) && ((c) <= 0x0E45)) ||                          \
                    172:       (((c) >= 0x0E81) && ((c) <= 0x0E82)) ||                          \
                    173:       ((c) == 0x0E84) ||                                               \
                    174:       (((c) >= 0x0E87) && ((c) <= 0x0E88)) ||                          \
                    175:       ((c) == 0x0E8A) ||                                               \
                    176:       ((c) == 0x0E8D) ||                                               \
                    177:       (((c) >= 0x0E94) && ((c) <= 0x0E97)) ||                          \
                    178:       (((c) >= 0x0E99) && ((c) <= 0x0E9F)) ||                          \
                    179:       (((c) >= 0x0EA1) && ((c) <= 0x0EA3)) ||                          \
                    180:       ((c) == 0x0EA5) ||                                               \
                    181:       ((c) == 0x0EA7) ||                                               \
                    182:       (((c) >= 0x0EAA) && ((c) <= 0x0EAB)) ||                          \
                    183:       (((c) >= 0x0EAD) && ((c) <= 0x0EAE)) ||                          \
                    184:       ((c) == 0x0EB0) ||                                               \
                    185:       (((c) >= 0x0EB2) && ((c) <= 0x0EB3)) ||                          \
                    186:       ((c) == 0x0EBD) ||                                               \
                    187:       (((c) >= 0x0EC0) && ((c) <= 0x0EC4)) ||                          \
                    188:       (((c) >= 0x0F40) && ((c) <= 0x0F47)) ||                          \
                    189:       (((c) >= 0x0F49) && ((c) <= 0x0F69)) ||                          \
                    190:       (((c) >= 0x10A0) && ((c) <= 0x10C5)) ||                          \
                    191:       (((c) >= 0x10D0) && ((c) <= 0x10F6)) ||                          \
                    192:       ((c) == 0x1100) ||                                               \
                    193:       (((c) >= 0x1102) && ((c) <= 0x1103)) ||                          \
                    194:       (((c) >= 0x1105) && ((c) <= 0x1107)) ||                          \
                    195:       ((c) == 0x1109) ||                                               \
                    196:       (((c) >= 0x110B) && ((c) <= 0x110C)) ||                          \
                    197:       (((c) >= 0x110E) && ((c) <= 0x1112)) ||                          \
                    198:       ((c) == 0x113C) ||                                               \
                    199:       ((c) == 0x113E) ||                                               \
                    200:       ((c) == 0x1140) ||                                               \
                    201:       ((c) == 0x114C) ||                                               \
                    202:       ((c) == 0x114E) ||                                               \
                    203:       ((c) == 0x1150) ||                                               \
                    204:       (((c) >= 0x1154) && ((c) <= 0x1155)) ||                          \
                    205:       ((c) == 0x1159) ||                                               \
                    206:       (((c) >= 0x115F) && ((c) <= 0x1161)) ||                          \
                    207:       ((c) == 0x1163) ||                                               \
                    208:       ((c) == 0x1165) ||                                               \
                    209:       ((c) == 0x1167) ||                                               \
                    210:       ((c) == 0x1169) ||                                               \
                    211:       (((c) >= 0x116D) && ((c) <= 0x116E)) ||                          \
                    212:       (((c) >= 0x1172) && ((c) <= 0x1173)) ||                          \
                    213:       ((c) == 0x1175) ||                                               \
                    214:       ((c) == 0x119E) ||                                               \
                    215:       ((c) == 0x11A8) ||                                               \
                    216:       ((c) == 0x11AB) ||                                               \
                    217:       (((c) >= 0x11AE) && ((c) <= 0x11AF)) ||                          \
                    218:       (((c) >= 0x11B7) && ((c) <= 0x11B8)) ||                          \
                    219:       ((c) == 0x11BA) ||                                               \
                    220:       (((c) >= 0x11BC) && ((c) <= 0x11C2)) ||                          \
                    221:       ((c) == 0x11EB) ||                                               \
                    222:       ((c) == 0x11F0) ||                                               \
                    223:       ((c) == 0x11F9) ||                                               \
                    224:       (((c) >= 0x1E00) && ((c) <= 0x1E9B)) ||                          \
                    225:       (((c) >= 0x1EA0) && ((c) <= 0x1EF9)) ||                          \
                    226:       (((c) >= 0x1F00) && ((c) <= 0x1F15)) ||                          \
                    227:       (((c) >= 0x1F18) && ((c) <= 0x1F1D)) ||                          \
                    228:       (((c) >= 0x1F20) && ((c) <= 0x1F45)) ||                          \
                    229:       (((c) >= 0x1F48) && ((c) <= 0x1F4D)) ||                          \
                    230:       (((c) >= 0x1F50) && ((c) <= 0x1F57)) ||                          \
                    231:       ((c) == 0x1F59) ||                                               \
                    232:       ((c) == 0x1F5B) ||                                               \
                    233:       ((c) == 0x1F5D) ||                                               \
                    234:       (((c) >= 0x1F5F) && ((c) <= 0x1F7D)) ||                          \
                    235:       (((c) >= 0x1F80) && ((c) <= 0x1FB4)) ||                          \
                    236:       (((c) >= 0x1FB6) && ((c) <= 0x1FBC)) ||                          \
                    237:       ((c) == 0x1FBE) ||                                               \
                    238:       (((c) >= 0x1FC2) && ((c) <= 0x1FC4)) ||                          \
                    239:       (((c) >= 0x1FC6) && ((c) <= 0x1FCC)) ||                          \
                    240:       (((c) >= 0x1FD0) && ((c) <= 0x1FD3)) ||                          \
                    241:       (((c) >= 0x1FD6) && ((c) <= 0x1FDB)) ||                          \
                    242:       (((c) >= 0x1FE0) && ((c) <= 0x1FEC)) ||                          \
                    243:       (((c) >= 0x1FF2) && ((c) <= 0x1FF4)) ||                          \
                    244:       (((c) >= 0x1FF6) && ((c) <= 0x1FFC)) ||                          \
                    245:       ((c) == 0x2126) ||                                               \
                    246:       (((c) >= 0x212A) && ((c) <= 0x212B)) ||                          \
                    247:       ((c) == 0x212E) ||                                               \
                    248:       (((c) >= 0x2180) && ((c) <= 0x2182)) ||                          \
                    249:       (((c) >= 0x3041) && ((c) <= 0x3094)) ||                          \
                    250:       (((c) >= 0x30A1) && ((c) <= 0x30FA)) ||                          \
                    251:       (((c) >= 0x3105) && ((c) <= 0x312C)) ||                          \
                    252:       (((c) >= 0xAC00) && ((c) <= 0xD7A3)))
                    253: 
                    254: /*
                    255:  * [88] Digit ::= ... long list see REC ...
                    256:  */
                    257: #define IS_DIGIT(c)                                                    \
                    258:      ((((c) >= 0x0030) && ((c) <= 0x0039)) ||                          \
                    259:       (((c) >= 0x0660) && ((c) <= 0x0669)) ||                          \
                    260:       (((c) >= 0x06F0) && ((c) <= 0x06F9)) ||                          \
                    261:       (((c) >= 0x0966) && ((c) <= 0x096F)) ||                          \
                    262:       (((c) >= 0x09E6) && ((c) <= 0x09EF)) ||                          \
                    263:       (((c) >= 0x0A66) && ((c) <= 0x0A6F)) ||                          \
                    264:       (((c) >= 0x0AE6) && ((c) <= 0x0AEF)) ||                          \
                    265:       (((c) >= 0x0B66) && ((c) <= 0x0B6F)) ||                          \
                    266:       (((c) >= 0x0BE7) && ((c) <= 0x0BEF)) ||                          \
                    267:       (((c) >= 0x0C66) && ((c) <= 0x0C6F)) ||                          \
                    268:       (((c) >= 0x0CE6) && ((c) <= 0x0CEF)) ||                          \
                    269:       (((c) >= 0x0D66) && ((c) <= 0x0D6F)) ||                          \
                    270:       (((c) >= 0x0E50) && ((c) <= 0x0E59)) ||                          \
                    271:       (((c) >= 0x0ED0) && ((c) <= 0x0ED9)) ||                          \
                    272:       (((c) >= 0x0F20) && ((c) <= 0x0F29)))
                    273: 
                    274: /*
                    275:  * [87] CombiningChar ::= ... long list see REC ...
                    276:  */
                    277: #define IS_COMBINING(c)                                                \
                    278:      ((((c) >= 0x0300) && ((c) <= 0x0345)) ||                          \
                    279:       (((c) >= 0x0360) && ((c) <= 0x0361)) ||                          \
                    280:       (((c) >= 0x0483) && ((c) <= 0x0486)) ||                          \
                    281:       (((c) >= 0x0591) && ((c) <= 0x05A1)) ||                          \
                    282:       (((c) >= 0x05A3) && ((c) <= 0x05B9)) ||                          \
                    283:       (((c) >= 0x05BB) && ((c) <= 0x05BD)) ||                          \
                    284:       ((c) == 0x05BF) ||                                               \
                    285:       (((c) >= 0x05C1) && ((c) <= 0x05C2)) ||                          \
                    286:       ((c) == 0x05C4) ||                                               \
                    287:       (((c) >= 0x064B) && ((c) <= 0x0652)) ||                          \
                    288:       ((c) == 0x0670) ||                                               \
                    289:       (((c) >= 0x06D6) && ((c) <= 0x06DC)) ||                          \
                    290:       (((c) >= 0x06DD) && ((c) <= 0x06DF)) ||                          \
                    291:       (((c) >= 0x06E0) && ((c) <= 0x06E4)) ||                          \
                    292:       (((c) >= 0x06E7) && ((c) <= 0x06E8)) ||                          \
                    293:       (((c) >= 0x06EA) && ((c) <= 0x06ED)) ||                          \
                    294:       (((c) >= 0x0901) && ((c) <= 0x0903)) ||                          \
                    295:       ((c) == 0x093C) ||                                               \
                    296:       (((c) >= 0x093E) && ((c) <= 0x094C)) ||                          \
                    297:       ((c) == 0x094D) ||                                               \
                    298:       (((c) >= 0x0951) && ((c) <= 0x0954)) ||                          \
                    299:       (((c) >= 0x0962) && ((c) <= 0x0963)) ||                          \
                    300:       (((c) >= 0x0981) && ((c) <= 0x0983)) ||                          \
                    301:       ((c) == 0x09BC) ||                                               \
                    302:       ((c) == 0x09BE) ||                                               \
                    303:       ((c) == 0x09BF) ||                                               \
                    304:       (((c) >= 0x09C0) && ((c) <= 0x09C4)) ||                          \
                    305:       (((c) >= 0x09C7) && ((c) <= 0x09C8)) ||                          \
                    306:       (((c) >= 0x09CB) && ((c) <= 0x09CD)) ||                          \
                    307:       ((c) == 0x09D7) ||                                               \
                    308:       (((c) >= 0x09E2) && ((c) <= 0x09E3)) ||                          \
                    309:       ((c) == 0x0A02) ||                                               \
                    310:       ((c) == 0x0A3C) ||                                               \
                    311:       ((c) == 0x0A3E) ||                                               \
                    312:       ((c) == 0x0A3F) ||                                               \
                    313:       (((c) >= 0x0A40) && ((c) <= 0x0A42)) ||                          \
                    314:       (((c) >= 0x0A47) && ((c) <= 0x0A48)) ||                          \
                    315:       (((c) >= 0x0A4B) && ((c) <= 0x0A4D)) ||                          \
                    316:       (((c) >= 0x0A70) && ((c) <= 0x0A71)) ||                          \
                    317:       (((c) >= 0x0A81) && ((c) <= 0x0A83)) ||                          \
                    318:       ((c) == 0x0ABC) ||                                               \
                    319:       (((c) >= 0x0ABE) && ((c) <= 0x0AC5)) ||                          \
                    320:       (((c) >= 0x0AC7) && ((c) <= 0x0AC9)) ||                          \
                    321:       (((c) >= 0x0ACB) && ((c) <= 0x0ACD)) ||                          \
                    322:       (((c) >= 0x0B01) && ((c) <= 0x0B03)) ||                          \
                    323:       ((c) == 0x0B3C) ||                                               \
                    324:       (((c) >= 0x0B3E) && ((c) <= 0x0B43)) ||                          \
                    325:       (((c) >= 0x0B47) && ((c) <= 0x0B48)) ||                          \
                    326:       (((c) >= 0x0B4B) && ((c) <= 0x0B4D)) ||                          \
                    327:       (((c) >= 0x0B56) && ((c) <= 0x0B57)) ||                          \
                    328:       (((c) >= 0x0B82) && ((c) <= 0x0B83)) ||                          \
                    329:       (((c) >= 0x0BBE) && ((c) <= 0x0BC2)) ||                          \
                    330:       (((c) >= 0x0BC6) && ((c) <= 0x0BC8)) ||                          \
                    331:       (((c) >= 0x0BCA) && ((c) <= 0x0BCD)) ||                          \
                    332:       ((c) == 0x0BD7) ||                                               \
                    333:       (((c) >= 0x0C01) && ((c) <= 0x0C03)) ||                          \
                    334:       (((c) >= 0x0C3E) && ((c) <= 0x0C44)) ||                          \
                    335:       (((c) >= 0x0C46) && ((c) <= 0x0C48)) ||                          \
                    336:       (((c) >= 0x0C4A) && ((c) <= 0x0C4D)) ||                          \
                    337:       (((c) >= 0x0C55) && ((c) <= 0x0C56)) ||                          \
                    338:       (((c) >= 0x0C82) && ((c) <= 0x0C83)) ||                          \
                    339:       (((c) >= 0x0CBE) && ((c) <= 0x0CC4)) ||                          \
                    340:       (((c) >= 0x0CC6) && ((c) <= 0x0CC8)) ||                          \
                    341:       (((c) >= 0x0CCA) && ((c) <= 0x0CCD)) ||                          \
                    342:       (((c) >= 0x0CD5) && ((c) <= 0x0CD6)) ||                          \
                    343:       (((c) >= 0x0D02) && ((c) <= 0x0D03)) ||                          \
                    344:       (((c) >= 0x0D3E) && ((c) <= 0x0D43)) ||                          \
                    345:       (((c) >= 0x0D46) && ((c) <= 0x0D48)) ||                          \
                    346:       (((c) >= 0x0D4A) && ((c) <= 0x0D4D)) ||                          \
                    347:       ((c) == 0x0D57) ||                                               \
                    348:       ((c) == 0x0E31) ||                                               \
                    349:       (((c) >= 0x0E34) && ((c) <= 0x0E3A)) ||                          \
                    350:       (((c) >= 0x0E47) && ((c) <= 0x0E4E)) ||                          \
                    351:       ((c) == 0x0EB1) ||                                               \
                    352:       (((c) >= 0x0EB4) && ((c) <= 0x0EB9)) ||                          \
                    353:       (((c) >= 0x0EBB) && ((c) <= 0x0EBC)) ||                          \
                    354:       (((c) >= 0x0EC8) && ((c) <= 0x0ECD)) ||                          \
                    355:       (((c) >= 0x0F18) && ((c) <= 0x0F19)) ||                          \
                    356:       ((c) == 0x0F35) ||                                               \
                    357:       ((c) == 0x0F37) ||                                               \
                    358:       ((c) == 0x0F39) ||                                               \
                    359:       ((c) == 0x0F3E) ||                                               \
                    360:       ((c) == 0x0F3F) ||                                               \
                    361:       (((c) >= 0x0F71) && ((c) <= 0x0F84)) ||                          \
                    362:       (((c) >= 0x0F86) && ((c) <= 0x0F8B)) ||                          \
                    363:       (((c) >= 0x0F90) && ((c) <= 0x0F95)) ||                          \
                    364:       ((c) == 0x0F97) ||                                               \
                    365:       (((c) >= 0x0F99) && ((c) <= 0x0FAD)) ||                          \
                    366:       (((c) >= 0x0FB1) && ((c) <= 0x0FB7)) ||                          \
                    367:       ((c) == 0x0FB9) ||                                               \
                    368:       (((c) >= 0x20D0) && ((c) <= 0x20DC)) ||                          \
                    369:       ((c) == 0x20E1) ||                                               \
                    370:       (((c) >= 0x302A) && ((c) <= 0x302F)) ||                          \
                    371:       ((c) == 0x3099) ||                                               \
                    372:       ((c) == 0x309A))
                    373: 
                    374: /*
                    375:  * [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 |
                    376:  *                   #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] |
                    377:  *                   [#x309D-#x309E] | [#x30FC-#x30FE]
                    378:  */
                    379: #define IS_EXTENDER(c)                                                 \
                    380:     (((c) == 0xb7) || ((c) == 0x2d0) || ((c) == 0x2d1) ||              \
                    381:      ((c) == 0x387) || ((c) == 0x640) || ((c) == 0xe46) ||             \
1.21      daniel    382:      ((c) == 0xec6) || ((c) == 0x3005) ||                              \
1.3       daniel    383:      (((c) >= 0x3031) && ((c) <= 0x3035)) ||                           \
                    384:      (((c) >= 0x309b) && ((c) <= 0x309e)) ||                           \
                    385:      (((c) >= 0x30fc) && ((c) <= 0x30fe)))
                    386: 
                    387: /*
                    388:  * [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
                    389:  */
                    390: #define IS_IDEOGRAPHIC(c)                                              \
                    391:     ((((c) >= 0x4e00) && ((c) <= 0x9fa5)) ||                           \
                    392:      (((c) >= 0xf900) && ((c) <= 0xfa2d)) ||                           \
                    393:      (((c) >= 0x3021) && ((c) <= 0x3029)) ||                           \
                    394:       ((c) == 0x3007))
                    395: 
                    396: /*
                    397:  * [84] Letter ::= BaseChar | Ideographic 
                    398:  */
                    399: #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
                    400: 
                    401: 
                    402: /*
                    403:  * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
                    404:  */
                    405: #define IS_PUBIDCHAR(c)                                                        \
                    406:     (((c) == 0x20) || ((c) == 0x0D) || ((c) == 0x0A) ||                        \
                    407:      (((c) >= 'a') && ((c) <= 'z')) ||                                 \
                    408:      (((c) >= 'A') && ((c) <= 'Z')) ||                                 \
                    409:      (((c) >= '0') && ((c) <= '9')) ||                                 \
                    410:      ((c) == '-') || ((c) == '\'') || ((c) == '(') || ((c) == ')') ||  \
                    411:      ((c) == '+') || ((c) == ',') || ((c) == '.') || ((c) == '/') ||   \
                    412:      ((c) == ':') || ((c) == '=') || ((c) == '?') || ((c) == ';') ||   \
                    413:      ((c) == '!') || ((c) == '*') || ((c) == '#') || ((c) == '@') ||   \
                    414:      ((c) == '$') || ((c) == '_') || ((c) == '%'))
                    415: 
                    416: #define SKIP_EOL(p)                                                    \
                    417:     if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; }                 \
                    418:     if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; }
                    419: 
                    420: #define MOVETO_ENDTAG(p)                                               \
1.21      daniel    421:     while ((*p) && (*(p) != '>')) (p)++
1.3       daniel    422: 
                    423: #define MOVETO_STARTTAG(p)                                             \
1.21      daniel    424:     while ((*p) && (*(p) != '<')) (p)++
1.8       daniel    425: 
                    426: /**
1.2       daniel    427:  * Parser context
                    428:  */
1.18      daniel    429: xmlParserCtxtPtr       xmlCreateDocParserCtxt  (xmlChar *cur);
1.15      daniel    430: xmlParserCtxtPtr       xmlCreateFileParserCtxt (const char *filename);
                    431: xmlParserCtxtPtr       xmlCreateMemoryParserCtxt(char *buffer,
                    432:                                                 int size);
                    433: xmlParserCtxtPtr       xmlNewParserCtxt        (void);
1.26      daniel    434: xmlParserCtxtPtr       xmlCreateEntityParserCtxt(const xmlChar *URL,
                    435:                                                 const xmlChar *ID,
                    436:                                                 const xmlChar *base);
1.15      daniel    437: void                   xmlSwitchEncoding       (xmlParserCtxtPtr ctxt,
                    438:                                                 xmlCharEncoding enc);
1.25      daniel    439: void                   xmlFreeParserCtxt       (xmlParserCtxtPtr ctxt);
1.2       daniel    440: 
                    441: /**
1.1       daniel    442:  * Entities
                    443:  */
1.15      daniel    444: void                   xmlHandleEntity         (xmlParserCtxtPtr ctxt,
                    445:                                                 xmlEntityPtr entity);
1.1       daniel    446: 
1.2       daniel    447: /**
                    448:  * Input Streams
                    449:  */
1.15      daniel    450: xmlParserInputPtr      xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
                    451:                                                 xmlEntityPtr entity);
                    452: void                   xmlPushInput            (xmlParserCtxtPtr ctxt,
                    453:                                                 xmlParserInputPtr input);
1.18      daniel    454: xmlChar                        xmlPopInput             (xmlParserCtxtPtr ctxt);
1.15      daniel    455: void                   xmlFreeInputStream      (xmlParserInputPtr input);
                    456: xmlParserInputPtr      xmlNewInputFromFile     (xmlParserCtxtPtr ctxt,
                    457:                                                 const char *filename);
1.2       daniel    458: 
                    459: /**
1.1       daniel    460:  * Namespaces.
                    461:  */
1.23      daniel    462: xmlChar *              xmlSplitQName           (xmlParserCtxtPtr ctxt,
1.22      daniel    463:                                                 const xmlChar *name,
1.18      daniel    464:                                                 xmlChar **prefix);
1.23      daniel    465: xmlChar *              xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
                    466: xmlChar *              xmlNamespaceParseQName  (xmlParserCtxtPtr ctxt,
1.18      daniel    467:                                                 xmlChar **prefix);
1.23      daniel    468: xmlChar *              xmlNamespaceParseNSDef  (xmlParserCtxtPtr ctxt);
                    469: xmlChar *              xmlParseQuotedString    (xmlParserCtxtPtr ctxt);
1.15      daniel    470: void                   xmlParseNamespace       (xmlParserCtxtPtr ctxt);
1.1       daniel    471: 
1.2       daniel    472: /**
1.1       daniel    473:  * Generic production rules
                    474:  */
1.23      daniel    475: xmlChar *              xmlScanName             (xmlParserCtxtPtr ctxt);
                    476: xmlChar *              xmlParseName            (xmlParserCtxtPtr ctxt);
                    477: xmlChar *              xmlParseNmtoken         (xmlParserCtxtPtr ctxt);
                    478: xmlChar *              xmlParseEntityValue     (xmlParserCtxtPtr ctxt,
1.18      daniel    479:                                                 xmlChar **orig);
1.23      daniel    480: xmlChar *              xmlParseAttValue        (xmlParserCtxtPtr ctxt);
                    481: xmlChar *              xmlParseSystemLiteral   (xmlParserCtxtPtr ctxt);
                    482: xmlChar *              xmlParsePubidLiteral    (xmlParserCtxtPtr ctxt);
1.15      daniel    483: void                   xmlParseCharData        (xmlParserCtxtPtr ctxt,
                    484:                                                 int cdata);
1.23      daniel    485: xmlChar *              xmlParseExternalID      (xmlParserCtxtPtr ctxt,
1.18      daniel    486:                                                 xmlChar **publicID,
1.15      daniel    487:                                                 int strict);
                    488: void                   xmlParseComment         (xmlParserCtxtPtr ctxt);
1.23      daniel    489: xmlChar *              xmlParsePITarget        (xmlParserCtxtPtr ctxt);
1.15      daniel    490: void                   xmlParsePI              (xmlParserCtxtPtr ctxt);
                    491: void                   xmlParseNotationDecl    (xmlParserCtxtPtr ctxt);
                    492: void                   xmlParseEntityDecl      (xmlParserCtxtPtr ctxt);
                    493: int                    xmlParseDefaultDecl     (xmlParserCtxtPtr ctxt,
1.18      daniel    494:                                                 xmlChar **value);
1.15      daniel    495: xmlEnumerationPtr      xmlParseNotationType    (xmlParserCtxtPtr ctxt);
                    496: xmlEnumerationPtr      xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
                    497: int                    xmlParseEnumeratedType  (xmlParserCtxtPtr ctxt,
                    498:                                                 xmlEnumerationPtr *tree);
                    499: int                    xmlParseAttributeType   (xmlParserCtxtPtr ctxt,
                    500:                                                 xmlEnumerationPtr *tree);
                    501: void                   xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
                    502: xmlElementContentPtr   xmlParseElementMixedContentDecl
                    503:                                                (xmlParserCtxtPtr ctxt);
                    504: xmlElementContentPtr   xmlParseElementChildrenContentDecl
                    505:                                                (xmlParserCtxtPtr ctxt);
                    506: int                    xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
1.18      daniel    507:                                                 xmlChar *name,
1.15      daniel    508:                                                 xmlElementContentPtr *result);
                    509: int                    xmlParseElementDecl     (xmlParserCtxtPtr ctxt);
                    510: void                   xmlParseMarkupDecl      (xmlParserCtxtPtr ctxt);
                    511: int                    xmlParseCharRef         (xmlParserCtxtPtr ctxt);
                    512: xmlEntityPtr           xmlParseEntityRef       (xmlParserCtxtPtr ctxt);
                    513: void                   xmlParseReference       (xmlParserCtxtPtr ctxt);
                    514: void                   xmlParsePEReference     (xmlParserCtxtPtr ctxt);
                    515: void                   xmlParseDocTypeDecl     (xmlParserCtxtPtr ctxt);
1.23      daniel    516: xmlChar *              xmlParseAttribute       (xmlParserCtxtPtr ctxt,
1.18      daniel    517:                                                 xmlChar **value);
1.23      daniel    518: xmlChar *              xmlParseStartTag        (xmlParserCtxtPtr ctxt);
1.20      daniel    519: void                   xmlParseEndTag          (xmlParserCtxtPtr ctxt);
1.15      daniel    520: void                   xmlParseCDSect          (xmlParserCtxtPtr ctxt);
                    521: void                   xmlParseContent         (xmlParserCtxtPtr ctxt);
                    522: void                   xmlParseElement         (xmlParserCtxtPtr ctxt);
1.23      daniel    523: xmlChar *              xmlParseVersionNum      (xmlParserCtxtPtr ctxt);
                    524: xmlChar *              xmlParseVersionInfo     (xmlParserCtxtPtr ctxt);
                    525: xmlChar *              xmlParseEncName         (xmlParserCtxtPtr ctxt);
                    526: xmlChar *              xmlParseEncodingDecl    (xmlParserCtxtPtr ctxt);
1.15      daniel    527: int                    xmlParseSDDecl          (xmlParserCtxtPtr ctxt);
                    528: void                   xmlParseXMLDecl         (xmlParserCtxtPtr ctxt);
1.24      daniel    529: void                   xmlParseTextDecl        (xmlParserCtxtPtr ctxt);
1.15      daniel    530: void                   xmlParseMisc            (xmlParserCtxtPtr ctxt);
                    531: void                   xmlParseExternalSubset  (xmlParserCtxtPtr ctxt,
1.18      daniel    532:                                                 const xmlChar *ExternalID,
                    533:                                                 const xmlChar *SystemID); 
1.6       daniel    534: /*
                    535:  * Entities substitution
                    536:  */
                    537: #define XML_SUBSTITUTE_NONE    0
                    538: #define XML_SUBSTITUTE_REF     1
                    539: #define XML_SUBSTITUTE_PEREF   2
                    540: #define XML_SUBSTITUTE_BOTH    3
                    541: 
1.27      daniel    542: xmlChar *              xmlDecodeEntities       (xmlParserCtxtPtr ctxt,
1.15      daniel    543:                                                 int len,
1.27      daniel    544:                                                 int what,
                    545:                                                 xmlChar end,
                    546:                                                 xmlChar  end2,
                    547:                                                 xmlChar end3);
                    548: xmlChar *              xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,
                    549:                                                 const xmlChar *str,
1.15      daniel    550:                                                 int what,
1.18      daniel    551:                                                 xmlChar end,
                    552:                                                 xmlChar  end2,
                    553:                                                 xmlChar end3);
1.1       daniel    554: 
1.4       daniel    555: /*
                    556:  * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP
                    557:  */
1.15      daniel    558: int                    nodePush                (xmlParserCtxtPtr ctxt,
                    559:                                                 xmlNodePtr value);
                    560: xmlNodePtr             nodePop                 (xmlParserCtxtPtr ctxt);
                    561: int                    inputPush               (xmlParserCtxtPtr ctxt,
                    562:                                                 xmlParserInputPtr value);
                    563: xmlParserInputPtr      inputPop                (xmlParserCtxtPtr ctxt);
1.1       daniel    564: 
1.17      daniel    565: #ifdef __cplusplus
                    566: }
                    567: #endif
1.1       daniel    568: #endif /* __XML_PARSER_INTERNALS_H__ */

Webmaster