Lines Matching full:enc
160 isNever(const ENCODING *UNUSED_P(enc), const char *UNUSED_P(p)) in isNever() argument
166 utf8_isName2(const ENCODING *UNUSED_P(enc), const char *p) in utf8_isName2() argument
172 utf8_isName3(const ENCODING *UNUSED_P(enc), const char *p) in utf8_isName3() argument
180 utf8_isNmstrt2(const ENCODING *UNUSED_P(enc), const char *p) in utf8_isNmstrt2() argument
186 utf8_isNmstrt3(const ENCODING *UNUSED_P(enc), const char *p) in utf8_isNmstrt3() argument
194 utf8_isInvalid2(const ENCODING *UNUSED_P(enc), const char *p) in utf8_isInvalid2() argument
200 utf8_isInvalid3(const ENCODING *UNUSED_P(enc), const char *p) in utf8_isInvalid3() argument
206 utf8_isInvalid4(const ENCODING *UNUSED_P(enc), const char *p) in utf8_isInvalid4() argument
212 ENCODING enc; member
232 #define AS_NORMAL_ENCODING(enc) ((const struct normal_encoding *) (enc)) argument
282 #define MINBPC(enc) ((enc)->minBytesPerChar) argument
285 #define MINBPC(enc) 1 argument
288 #define SB_BYTE_TYPE(enc, p) \ argument
289 (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)])
293 sb_byteType(const ENCODING *enc, const char *p) in sb_byteType() argument
295 return SB_BYTE_TYPE(enc, p); in sb_byteType()
297 #define BYTE_TYPE(enc, p) \ argument
298 (AS_NORMAL_ENCODING(enc)->byteType(enc, p))
300 #define BYTE_TYPE(enc, p) SB_BYTE_TYPE(enc, p) argument
304 #define BYTE_TO_ASCII(enc, p) \ argument
305 (AS_NORMAL_ENCODING(enc)->byteToAscii(enc, p))
307 sb_byteToAscii(const ENCODING *enc, const char *p) in sb_byteToAscii() argument
312 #define BYTE_TO_ASCII(enc, p) (*(p)) argument
315 #define IS_NAME_CHAR(enc, p, n) \ argument
316 (AS_NORMAL_ENCODING(enc)->isName ## n(enc, p))
317 #define IS_NMSTRT_CHAR(enc, p, n) \ argument
318 (AS_NORMAL_ENCODING(enc)->isNmstrt ## n(enc, p))
319 #define IS_INVALID_CHAR(enc, p, n) \ argument
320 (AS_NORMAL_ENCODING(enc)->isInvalid ## n(enc, p))
323 #define IS_NAME_CHAR_MINBPC(enc, p) \ argument
324 (AS_NORMAL_ENCODING(enc)->isNameMin(enc, p))
325 #define IS_NMSTRT_CHAR_MINBPC(enc, p) \ argument
326 (AS_NORMAL_ENCODING(enc)->isNmstrtMin(enc, p))
328 #define IS_NAME_CHAR_MINBPC(enc, p) (0) argument
329 #define IS_NMSTRT_CHAR_MINBPC(enc, p) (0) argument
333 #define CHAR_MATCHES(enc, p, c) \ argument
334 (AS_NORMAL_ENCODING(enc)->charMatches(enc, p, c))
336 sb_charMatches(const ENCODING *enc, const char *p, int c) in sb_charMatches() argument
342 #define CHAR_MATCHES(enc, p, c) (*(p) == c) argument
403 utf8_toUtf8(const ENCODING *UNUSED_P(enc), in utf8_toUtf8() argument
443 utf8_toUtf16(const ENCODING *enc, in utf8_toUtf16() argument
451 switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) { in utf8_toUtf16()
549 latin1_toUtf8(const ENCODING *UNUSED_P(enc), in latin1_toUtf8() argument
574 latin1_toUtf16(const ENCODING *UNUSED_P(enc), in latin1_toUtf16() argument
612 ascii_toUtf8(const ENCODING *UNUSED_P(enc), in ascii_toUtf8() argument
670 E ## toUtf8(const ENCODING *UNUSED_P(enc), \
742 E ## toUtf16(const ENCODING *UNUSED_P(enc), \
786 #define LITTLE2_BYTE_TYPE(enc, p) \ in DEFINE_UTF16_TO_UTF16() argument
788 ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \ in DEFINE_UTF16_TO_UTF16()
790 #define LITTLE2_BYTE_TO_ASCII(enc, p) ((p)[1] == 0 ? (p)[0] : -1) in DEFINE_UTF16_TO_UTF16() argument
791 #define LITTLE2_CHAR_MATCHES(enc, p, c) ((p)[1] == 0 && (p)[0] == c) in DEFINE_UTF16_TO_UTF16() argument
792 #define LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) \ in DEFINE_UTF16_TO_UTF16() argument
794 #define LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p) \ in DEFINE_UTF16_TO_UTF16() argument
800 little2_byteType(const ENCODING *enc, const char *p) in DEFINE_UTF16_TO_UTF16()
802 return LITTLE2_BYTE_TYPE(enc, p); in DEFINE_UTF16_TO_UTF16()
806 little2_byteToAscii(const ENCODING *enc, const char *p) in little2_byteToAscii() argument
808 return LITTLE2_BYTE_TO_ASCII(enc, p); in little2_byteToAscii()
812 little2_charMatches(const ENCODING *enc, const char *p, int c) in little2_charMatches() argument
814 return LITTLE2_CHAR_MATCHES(enc, p, c); in little2_charMatches()
818 little2_isNameMin(const ENCODING *enc, const char *p) in little2_isNameMin() argument
820 return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p); in little2_isNameMin()
824 little2_isNmstrtMin(const ENCODING *enc, const char *p) in little2_isNmstrtMin() argument
826 return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p); in little2_isNmstrtMin()
836 #define MINBPC(enc) 2
838 #define BYTE_TYPE(enc, p) LITTLE2_BYTE_TYPE(enc, p)
839 #define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p)
840 #define CHAR_MATCHES(enc, p, c) LITTLE2_CHAR_MATCHES(enc, p, c)
841 #define IS_NAME_CHAR(enc, p, n) 0
842 #define IS_NAME_CHAR_MINBPC(enc, p) LITTLE2_IS_NAME_CHAR_MINBPC(enc, p)
843 #define IS_NMSTRT_CHAR(enc, p, n) (0)
844 #define IS_NMSTRT_CHAR_MINBPC(enc, p) LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p)
927 #define BIG2_BYTE_TYPE(enc, p) \ argument
929 ? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \
931 #define BIG2_BYTE_TO_ASCII(enc, p) ((p)[0] == 0 ? (p)[1] : -1) argument
932 #define BIG2_CHAR_MATCHES(enc, p, c) ((p)[0] == 0 && (p)[1] == c) argument
933 #define BIG2_IS_NAME_CHAR_MINBPC(enc, p) \ argument
935 #define BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) \ argument
941 big2_byteType(const ENCODING *enc, const char *p) in big2_byteType() argument
943 return BIG2_BYTE_TYPE(enc, p); in big2_byteType()
947 big2_byteToAscii(const ENCODING *enc, const char *p) in big2_byteToAscii() argument
949 return BIG2_BYTE_TO_ASCII(enc, p); in big2_byteToAscii()
953 big2_charMatches(const ENCODING *enc, const char *p, int c) in big2_charMatches() argument
955 return BIG2_CHAR_MATCHES(enc, p, c); in big2_charMatches()
959 big2_isNameMin(const ENCODING *enc, const char *p) in big2_isNameMin() argument
961 return BIG2_IS_NAME_CHAR_MINBPC(enc, p); in big2_isNameMin()
965 big2_isNmstrtMin(const ENCODING *enc, const char *p) in big2_isNmstrtMin() argument
967 return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p); in big2_isNmstrtMin()
977 #define MINBPC(enc) 2 argument
979 #define BYTE_TYPE(enc, p) BIG2_BYTE_TYPE(enc, p) argument
980 #define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p) argument
981 #define CHAR_MATCHES(enc, p, c) BIG2_CHAR_MATCHES(enc, p, c) argument
982 #define IS_NAME_CHAR(enc, p, n) 0 argument
983 #define IS_NAME_CHAR_MINBPC(enc, p) BIG2_IS_NAME_CHAR_MINBPC(enc, p) argument
984 #define IS_NMSTRT_CHAR(enc, p, n) (0) argument
985 #define IS_NMSTRT_CHAR_MINBPC(enc, p) BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) argument
1092 initUpdatePosition(const ENCODING *UNUSED_P(enc), const char *ptr, in initUpdatePosition() argument
1095 normal_updatePosition(&utf8_encoding.enc, ptr, end, pos); in initUpdatePosition()
1099 toAscii(const ENCODING *enc, const char *ptr, const char *end) in toAscii() argument
1103 XmlUtf8Convert(enc, &ptr, end, &p, p + 1); in toAscii()
1127 parsePseudoAttribute(const ENCODING *enc, in parsePseudoAttribute() argument
1141 if (!isSpace(toAscii(enc, ptr, end))) { in parsePseudoAttribute()
1146 ptr += enc->minBytesPerChar; in parsePseudoAttribute()
1147 } while (isSpace(toAscii(enc, ptr, end))); in parsePseudoAttribute()
1154 c = toAscii(enc, ptr, end); in parsePseudoAttribute()
1166 ptr += enc->minBytesPerChar; in parsePseudoAttribute()
1167 } while (isSpace(c = toAscii(enc, ptr, end))); in parsePseudoAttribute()
1174 ptr += enc->minBytesPerChar; in parsePseudoAttribute()
1180 ptr += enc->minBytesPerChar; in parsePseudoAttribute()
1181 c = toAscii(enc, ptr, end); in parsePseudoAttribute()
1183 ptr += enc->minBytesPerChar; in parsePseudoAttribute()
1184 c = toAscii(enc, ptr, end); in parsePseudoAttribute()
1191 ptr += enc->minBytesPerChar; in parsePseudoAttribute()
1193 for (;; ptr += enc->minBytesPerChar) { in parsePseudoAttribute()
1194 c = toAscii(enc, ptr, end); in parsePseudoAttribute()
1207 *nextTokPtr = ptr + enc->minBytesPerChar; in parsePseudoAttribute()
1237 const ENCODING *enc, in doParseXmlDecl() argument
1250 ptr += 5 * enc->minBytesPerChar; in doParseXmlDecl()
1251 end -= 2 * enc->minBytesPerChar; in doParseXmlDecl()
1252 if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr) in doParseXmlDecl()
1257 if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_version)) { in doParseXmlDecl()
1268 if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) { in doParseXmlDecl()
1281 if (XmlNameMatchesAscii(enc, name, nameEnd, KW_encoding)) { in doParseXmlDecl()
1282 int c = toAscii(enc, val, end); in doParseXmlDecl()
1290 *encoding = encodingFinder(enc, val, ptr - enc->minBytesPerChar); in doParseXmlDecl()
1291 if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) { in doParseXmlDecl()
1298 if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_standalone) in doParseXmlDecl()
1303 if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_yes)) { in doParseXmlDecl()
1307 else if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_no)) { in doParseXmlDecl()
1315 while (isSpace(toAscii(enc, ptr, end))) in doParseXmlDecl()
1316 ptr += enc->minBytesPerChar; in doParseXmlDecl()
1406 #define AS_UNKNOWN_ENCODING(enc) ((const struct unknown_encoding *) (enc)) argument
1415 unknown_isName(const ENCODING *enc, const char *p) in unknown_isName() argument
1417 const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); in unknown_isName()
1425 unknown_isNmstrt(const ENCODING *enc, const char *p) in unknown_isNmstrt() argument
1427 const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); in unknown_isNmstrt()
1435 unknown_isInvalid(const ENCODING *enc, const char *p) in unknown_isInvalid() argument
1437 const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); in unknown_isInvalid()
1443 unknown_toUtf8(const ENCODING *enc, in unknown_toUtf8() argument
1447 const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); in unknown_toUtf8()
1462 *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP] in unknown_toUtf8()
1476 unknown_toUtf16(const ENCODING *enc, in unknown_toUtf16() argument
1480 const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); in unknown_toUtf16()
1486 *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP] in unknown_toUtf16()
1577 e->normal.enc.utf8Convert = unknown_toUtf8; in XmlInitUnknownEncoding()
1578 e->normal.enc.utf16Convert = unknown_toUtf16; in XmlInitUnknownEncoding()
1579 return &(e->normal.enc); in XmlInitUnknownEncoding()
1643 #define INIT_ENC_INDEX(enc) ((int)(enc)->initEnc.isUtf16) argument
1644 #define SET_INIT_ENC_INDEX(enc, i) ((enc)->initEnc.isUtf16 = (char)i) argument
1647 encoding indices to encodings; INIT_ENC_INDEX(enc) is the index of
1656 const INIT_ENCODING *enc, in initScan() argument
1666 encPtr = enc->encPtr; in initScan()
1676 switch (INIT_ENC_INDEX(enc)) { in initScan()
1686 if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC in initScan()
1698 if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC in initScan()
1706 if ((INIT_ENC_INDEX(enc) == UTF_16BE_ENC in initScan()
1707 || INIT_ENC_INDEX(enc) == UTF_16_ENC) in initScan()
1713 if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC in initScan()
1728 int e = INIT_ENC_INDEX(enc); in initScan()
1749 if (state == XML_CONTENT_STATE && INIT_ENC_INDEX(enc) == UTF_16LE_ENC) in initScan()
1772 *encPtr = encodingTable[INIT_ENC_INDEX(enc)]; in initScan()
1803 ENCODING *enc = XmlInitUnknownEncoding(mem, table, convert, userData); in XmlInitUnknownEncodingNS() local
1804 if (enc) in XmlInitUnknownEncodingNS()
1805 ((struct normal_encoding *)enc)->type[ASCII_COLON] = BT_COLON; in XmlInitUnknownEncodingNS()
1806 return enc; in XmlInitUnknownEncodingNS()