Changeset 97 for trunk/src/helpers/xmltok.c
- Timestamp:
- Aug 12, 2001, 5:34:51 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/xmltok.c
r75 r97 1 2 1 /* 3 *sourcefile xmltok.c 4 * part of the expat implementation. See xmlparse.c. 5 * 2 * Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 3 * See the file COPYING for copying permission. 6 4 */ 7 5 8 /* 9 * Copyright (C) 2001 Ulrich Mller. 10 * Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd. 11 * and Clark Cooper. 12 * 13 * Permission is hereby granted, free of charge, to any person obtaining 14 * a copy of this software and associated documentation files (the 15 * "Software"), to deal in the Software without restriction, including 16 * without limitation the rights to use, copy, modify, merge, publish, 17 * distribute, sublicense, and/or sell copies of the Software, and to 18 * permit persons to whom the Software is furnished to do so, subject to 19 * the following conditions: 20 * 21 * The above copyright notice and this permission notice shall be included 22 * in all copies or substantial portions of the Software. 23 * 24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 27 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 28 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 29 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 30 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 6 /* #ifdef COMPILED_FROM_DSP 7 * # include "winconfig.h" 8 * #else 9 * # include <config.h> 10 * #endif 31 11 */ 32 12 33 #include "setup.h"34 35 #include "expat\expat_setup.h" 13 #include <memory.h> 14 15 #include "expat\expat_setup.h" // V0.9.9 (2001-02-10) [umoeller] 36 16 37 17 #pragma info(norea, nogen) … … 105 85 #define UTF8_INVALID4(p) ((*p) == 0xF4 && ((p)[1] & 0x30) != 0) 106 86 107 static int EXPATENTRY isNever(const ENCODING * enc, const char *p) 87 static 88 int isNever(const ENCODING * enc, const char *p) 108 89 { 109 90 return 0; 110 91 } 111 92 112 static int EXPATENTRY utf8_isName2(const ENCODING * enc, const char *p) 93 static 94 int utf8_isName2(const ENCODING * enc, const char *p) 113 95 { 114 96 return UTF8_GET_NAMING2(namePages, (const unsigned char *)p); 115 97 } 116 98 117 static int EXPATENTRY utf8_isName3(const ENCODING * enc, const char *p) 99 static 100 int utf8_isName3(const ENCODING * enc, const char *p) 118 101 { 119 102 return UTF8_GET_NAMING3(namePages, (const unsigned char *)p); … … 122 105 #define utf8_isName4 isNever 123 106 124 static int EXPATENTRY utf8_isNmstrt2(const ENCODING * enc, const char *p) 107 static 108 int utf8_isNmstrt2(const ENCODING * enc, const char *p) 125 109 { 126 110 return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p); 127 111 } 128 112 129 static int EXPATENTRY utf8_isNmstrt3(const ENCODING * enc, const char *p) 113 static 114 int utf8_isNmstrt3(const ENCODING * enc, const char *p) 130 115 { 131 116 return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p); … … 136 121 #define utf8_isInvalid2 isNever 137 122 138 static int EXPATENTRY utf8_isInvalid3(const ENCODING * enc, const char *p) 123 static 124 int utf8_isInvalid3(const ENCODING * enc, const char *p) 139 125 { 140 126 return UTF8_INVALID3((const unsigned char *)p); 141 127 } 142 128 143 static int EXPATENTRY utf8_isInvalid4(const ENCODING * enc, const char *p) 129 static 130 int utf8_isInvalid4(const ENCODING * enc, const char *p) 144 131 { 145 132 return UTF8_INVALID4((const unsigned char *)p); … … 151 138 unsigned char type[256]; 152 139 #ifdef XML_MIN_SIZE 153 int (* EXPATENTRYbyteType) (const ENCODING *, const char *);154 int (* EXPATENTRYisNameMin) (const ENCODING *, const char *);155 int (* EXPATENTRYisNmstrtMin) (const ENCODING *, const char *);156 int (* EXPATENTRYbyteToAscii) (const ENCODING *, const char *);157 int (* EXPATENTRYcharMatches) (const ENCODING *, const char *, int);140 int (*byteType) (const ENCODING *, const char *); 141 int (*isNameMin) (const ENCODING *, const char *); 142 int (*isNmstrtMin) (const ENCODING *, const char *); 143 int (*byteToAscii) (const ENCODING *, const char *); 144 int (*charMatches) (const ENCODING *, const char *, int); 158 145 #endif /* XML_MIN_SIZE */ 159 int (* EXPATENTRYisName2) (const ENCODING *, const char *);160 int (* EXPATENTRYisName3) (const ENCODING *, const char *);161 int (* EXPATENTRYisName4) (const ENCODING *, const char *);162 int (* EXPATENTRYisNmstrt2) (const ENCODING *, const char *);163 int (* EXPATENTRYisNmstrt3) (const ENCODING *, const char *);164 int (* EXPATENTRYisNmstrt4) (const ENCODING *, const char *);165 int (* EXPATENTRYisInvalid2) (const ENCODING *, const char *);166 int (* EXPATENTRYisInvalid3) (const ENCODING *, const char *);167 int (* EXPATENTRYisInvalid4) (const ENCODING *, const char *);146 int (*isName2) (const ENCODING *, const char *); 147 int (*isName3) (const ENCODING *, const char *); 148 int (*isName4) (const ENCODING *, const char *); 149 int (*isNmstrt2) (const ENCODING *, const char *); 150 int (*isNmstrt3) (const ENCODING *, const char *); 151 int (*isNmstrt4) (const ENCODING *, const char *); 152 int (*isInvalid2) (const ENCODING *, const char *); 153 int (*isInvalid3) (const ENCODING *, const char *); 154 int (*isInvalid4) (const ENCODING *, const char *); 168 155 }; 169 156 … … 215 202 216 203 #ifdef XML_MIN_SIZE 217 static int EXPATENTRY sb_byteType(const ENCODING * enc, const char *p) 204 static 205 int sb_byteType(const ENCODING * enc, const char *p) 218 206 { 219 207 return SB_BYTE_TYPE(enc, p); … … 228 216 #define BYTE_TO_ASCII(enc, p) \ 229 217 (((const struct normal_encoding *)(enc))->byteToAscii(enc, p)) 230 static int EXPATENTRY sb_byteToAscii(const ENCODING * enc, const char *p) 218 static 219 int sb_byteToAscii(const ENCODING * enc, const char *p) 231 220 { 232 221 return *p; … … 256 245 #define CHAR_MATCHES(enc, p, c) \ 257 246 (((const struct normal_encoding *)(enc))->charMatches(enc, p, c)) 258 static int EXPATENTRY sb_charMatches(const ENCODING * enc, const char *p, int c) 247 static 248 int sb_charMatches(const ENCODING * enc, const char *p, int c) 259 249 { 260 250 return *p == c; … … 286 276 }; 287 277 288 static void EXPATENTRYutf8_toUtf8(const ENCODING * enc,289 290 291 292 278 static void utf8_toUtf8(const ENCODING * enc, 279 const char **fromP, 280 const char *fromLim, 281 char **toP, 282 const char *toLim) 293 283 { 294 284 char *to; … … 298 288 { 299 289 /* Avoid copying partial characters. */ 300 for (fromLim = *fromP + (toLim - *toP); fromLim > *fromP; fromLim--) 290 for (fromLim = *fromP + (toLim - *toP); 291 fromLim > *fromP; 292 fromLim--) 301 293 if (((unsigned char)fromLim[-1] & 0xc0) != 0x80) 302 294 break; 303 295 } 304 for (to = *toP, from = *fromP; from != fromLim; from++, to++) 296 for (to = *toP, from = *fromP; 297 from != fromLim; 298 from++, to++) 305 299 *to = *from; 306 300 *fromP = from; … … 308 302 } 309 303 310 static void EXPATENTRY utf8_toUtf16(const ENCODING * enc, 311 const char **fromP, const char *fromLim, 312 unsigned short **toP, const unsigned short *toLim) 304 static void utf8_toUtf16(const ENCODING * enc, 305 const char **fromP, 306 const char *fromLim, 307 unsigned short **toP, 308 const unsigned short *toLim) 313 309 { 314 310 unsigned short *to = *toP; … … 401 397 }; 402 398 403 static void EXPATENTRY latin1_toUtf8(const ENCODING * enc, 404 const char **fromP, const char *fromLim, 405 char **toP, const char *toLim) 399 static void latin1_toUtf8(const ENCODING * enc, 400 const char **fromP, 401 const char *fromLim, 402 char **toP, 403 const char *toLim) 406 404 { 407 405 for (;;) … … 429 427 } 430 428 431 static void EXPATENTRY latin1_toUtf16(const ENCODING * enc, 432 const char **fromP, const char *fromLim, 433 unsigned short **toP, const unsigned short *toLim) 429 static void latin1_toUtf16(const ENCODING * enc, 430 const char **fromP, 431 const char *fromLim, 432 unsigned short **toP, 433 const unsigned short *toLim) 434 434 { 435 435 while (*fromP != fromLim && *toP != toLim) … … 463 463 }; 464 464 465 static void EXPATENTRY ascii_toUtf8(const ENCODING * enc, 466 const char **fromP, const char *fromLim, 467 char **toP, const char *toLim) 465 static void ascii_toUtf8(const ENCODING * enc, 466 const char **fromP, 467 const char *fromLim, 468 char **toP, 469 const char *toLim) 468 470 { 469 471 while (*fromP != fromLim && *toP != toLim) … … 524 526 525 527 #define DEFINE_UTF16_TO_UTF8(E) \ 526 static void EXPATENTRY E ## toUtf8(const ENCODING *enc, \ 528 static \ 529 void E ## toUtf8(const ENCODING *enc, \ 527 530 const char **fromP, const char *fromLim, \ 528 531 char **toP, const char *toLim) \ … … 586 589 587 590 #define DEFINE_UTF16_TO_UTF16(E) \ 588 static void EXPATENTRY E ## toUtf16(const ENCODING *enc, \ 591 static \ 592 void E ## toUtf16(const ENCODING *enc, \ 589 593 const char **fromP, const char *fromLim, \ 590 594 unsigned short **toP, const unsigned short *toLim) \ … … 635 639 #ifdef XML_MIN_SIZE 636 640 637 static int EXPATENTRY little2_byteType(const ENCODING * enc, const char *p) 638 { 639 return LITTLE2_BYTE_TYPE(enc, p); 640 } 641 642 static int EXPATENTRY little2_byteToAscii(const ENCODING * enc, const char *p) 643 { 644 return LITTLE2_BYTE_TO_ASCII(enc, p); 645 } 646 647 static int EXPATENTRY little2_charMatches(const ENCODING * enc, const char *p, int c) 648 { 649 return LITTLE2_CHAR_MATCHES(enc, p, c); 650 } 651 652 static int EXPATENTRY little2_isNameMin(const ENCODING * enc, const char *p) 653 { 654 return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p); 655 } 656 657 static int EXPATENTRY little2_isNmstrtMin(const ENCODING * enc, const char *p) 658 { 659 return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p); 660 } 661 662 #undef VTABLE 663 #define VTABLE VTABLE1, little2_toUtf8, little2_toUtf16 641 static 642 int little2_byteType(const ENCODING * enc, const char *p) 643 { 644 return LITTLE2_BYTE_TYPE(enc, p); 645 } 646 647 static int little2_byteToAscii(const ENCODING * enc, const char *p) 648 { 649 return LITTLE2_BYTE_TO_ASCII(enc, p); 650 } 651 652 static int little2_charMatches(const ENCODING * enc, const char *p, int c) 653 { 654 return LITTLE2_CHAR_MATCHES(enc, p, c); 655 } 656 657 static int little2_isNameMin(const ENCODING * enc, const char *p) 658 { 659 return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p); 660 } 661 662 static int little2_isNmstrtMin(const ENCODING * enc, const char *p) 663 { 664 return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p); 665 } 666 667 #undef VTABLE 668 #define VTABLE VTABLE1, little2_toUtf8, little2_toUtf16 664 669 665 670 #else /* not XML_MIN_SIZE */ 666 671 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 672 #undef PREFIX 673 #define PREFIX(ident) little2_ ## ident 674 #define MINBPC(enc) 2 675 /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ 676 #define BYTE_TYPE(enc, p) LITTLE2_BYTE_TYPE(enc, p) 677 #define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p) 678 #define CHAR_MATCHES(enc, p, c) LITTLE2_CHAR_MATCHES(enc, p, c) 679 #define IS_NAME_CHAR(enc, p, n) 0 680 #define IS_NAME_CHAR_MINBPC(enc, p) LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) 681 #define IS_NMSTRT_CHAR(enc, p, n) (0) 682 #define IS_NMSTRT_CHAR_MINBPC(enc, p) LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p) 683 684 #include "xmltok_impl.c" 685 686 #undef MINBPC 687 #undef BYTE_TYPE 688 #undef BYTE_TO_ASCII 689 #undef CHAR_MATCHES 690 #undef IS_NAME_CHAR 691 #undef IS_NAME_CHAR_MINBPC 692 #undef IS_NMSTRT_CHAR 693 #undef IS_NMSTRT_CHAR_MINBPC 694 #undef IS_INVALID_CHAR 690 695 691 696 #endif /* not XML_MIN_SIZE */ … … 693 698 #ifdef XML_NS 694 699 695 static const struct normal_encoding little2_encoding_ns = 700 static const struct normal_encoding little2_encoding_ns = 701 { 702 {VTABLE, 2, 0, 703 #if XML_BYTE_ORDER == 12 704 1 705 #else 706 0 707 #endif 708 }, 696 709 { 697 {VTABLE, 2, 0, 698 #if XML_BYTE_ORDER == 12 699 1 700 #else 701 0 702 #endif 703 }, 704 { 705 #include "expat\asciitab.h" 706 #include "expat\latin1tab.h" 707 }, 708 STANDARD_VTABLE(little2_) 709 }; 710 #include "expat\asciitab.h" 711 #include "expat\latin1tab.h" 712 }, 713 STANDARD_VTABLE(little2_) 714 }; 710 715 711 716 #endif … … 773 778 #ifdef XML_MIN_SIZE 774 779 775 static int EXPATENTRYbig2_byteType(const ENCODING * enc, const char *p)776 777 778 779 780 static int EXPATENTRYbig2_byteToAscii(const ENCODING * enc, const char *p)781 782 783 784 785 static int EXPATENTRYbig2_charMatches(const ENCODING * enc, const char *p, int c)786 787 788 789 790 static int EXPATENTRYbig2_isNameMin(const ENCODING * enc, const char *p)791 792 793 794 795 static int EXPATENTRYbig2_isNmstrtMin(const ENCODING * enc, const char *p)796 797 798 799 800 801 780 static int big2_byteType(const ENCODING * enc, const char *p) 781 { 782 return BIG2_BYTE_TYPE(enc, p); 783 } 784 785 static int big2_byteToAscii(const ENCODING * enc, const char *p) 786 { 787 return BIG2_BYTE_TO_ASCII(enc, p); 788 } 789 790 static int big2_charMatches(const ENCODING * enc, const char *p, int c) 791 { 792 return BIG2_CHAR_MATCHES(enc, p, c); 793 } 794 795 static int big2_isNameMin(const ENCODING * enc, const char *p) 796 { 797 return BIG2_IS_NAME_CHAR_MINBPC(enc, p); 798 } 799 800 static int big2_isNmstrtMin(const ENCODING * enc, const char *p) 801 { 802 return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p); 803 } 804 805 #undef VTABLE 806 #define VTABLE VTABLE1, big2_toUtf8, big2_toUtf16 802 807 803 808 #else /* not XML_MIN_SIZE */ 804 809 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 810 #undef PREFIX 811 #define PREFIX(ident) big2_ ## ident 812 #define MINBPC(enc) 2 813 /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ 814 #define BYTE_TYPE(enc, p) BIG2_BYTE_TYPE(enc, p) 815 #define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p) 816 #define CHAR_MATCHES(enc, p, c) BIG2_CHAR_MATCHES(enc, p, c) 817 #define IS_NAME_CHAR(enc, p, n) 0 818 #define IS_NAME_CHAR_MINBPC(enc, p) BIG2_IS_NAME_CHAR_MINBPC(enc, p) 819 #define IS_NMSTRT_CHAR(enc, p, n) (0) 820 #define IS_NMSTRT_CHAR_MINBPC(enc, p) BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) 821 822 #include "xmltok_impl.c" 823 824 #undef MINBPC 825 #undef BYTE_TYPE 826 #undef BYTE_TO_ASCII 827 #undef CHAR_MATCHES 828 #undef IS_NAME_CHAR 829 #undef IS_NAME_CHAR_MINBPC 830 #undef IS_NMSTRT_CHAR 831 #undef IS_NMSTRT_CHAR_MINBPC 832 #undef IS_INVALID_CHAR 828 833 829 834 #endif /* not XML_MIN_SIZE */ … … 899 904 #undef PREFIX 900 905 901 static 902 int streqci(const char *s1, const char *s2) 906 static int streqci(const char *s1, const char *s2) 903 907 { 904 908 for (;;) … … 919 923 } 920 924 921 static void EXPATENTRY initUpdatePosition(const ENCODING * enc, 922 const char *ptr, 923 const char *end, 924 POSITION * pos) 925 static void initUpdatePosition(const ENCODING * enc, const char *ptr, 926 const char *end, POSITION * pos) 925 927 { 926 928 normal_updatePosition(&utf8_encoding.enc, ptr, end, pos); 927 929 } 928 930 929 static int EXPATENTRYtoAscii(const ENCODING * enc, const char *ptr, const char *end)931 static int toAscii(const ENCODING * enc, const char *ptr, const char *end) 930 932 { 931 933 char buf[1]; … … 954 956 /* Return 1 if there's just optional white space 955 957 * or there's an S followed by name=val. */ 956 static int EXPATENTRYparsePseudoAttribute(const ENCODING * enc,957 958 959 960 961 962 958 static int parsePseudoAttribute(const ENCODING * enc, 959 const char *ptr, 960 const char *end, 961 const char **namePtr, 962 const char **nameEndPtr, 963 const char **valPtr, 964 const char **nextTokPtr) 963 965 { 964 966 int c; … … 1081 1083 }; 1082 1084 1083 static int doParseXmlDecl(const ENCODING * (* EXPATENTRY encodingFinder)(const ENCODING *,1084 1085 1085 static int doParseXmlDecl(const ENCODING * (*encodingFinder) (const ENCODING *, 1086 const char *, 1087 const char *), 1086 1088 int isGeneralTextEntity, 1087 1089 const ENCODING * enc, … … 1281 1283 }; 1282 1284 1283 int EXPATENTRYXmlSizeOfUnknownEncoding(void)1285 int XmlSizeOfUnknownEncoding(void) 1284 1286 { 1285 1287 return sizeof(struct unknown_encoding); 1286 1288 } 1287 1289 1288 static int EXPATENTRYunknown_isName(const ENCODING * enc, const char *p)1290 static int unknown_isName(const ENCODING * enc, const char *p) 1289 1291 { 1290 1292 int c = ((const struct unknown_encoding *)enc) … … 1296 1298 } 1297 1299 1298 static int EXPATENTRYunknown_isNmstrt(const ENCODING * enc, const char *p)1300 static int unknown_isNmstrt(const ENCODING * enc, const char *p) 1299 1301 { 1300 1302 int c = ((const struct unknown_encoding *)enc) … … 1306 1308 } 1307 1309 1308 static int EXPATENTRYunknown_isInvalid(const ENCODING * enc, const char *p)1310 static int unknown_isInvalid(const ENCODING * enc, const char *p) 1309 1311 { 1310 1312 int c = ((const struct unknown_encoding *)enc) … … 1314 1316 } 1315 1317 1316 static void EXPATENTRYunknown_toUtf8(const ENCODING * enc,1317 1318 1319 1320 1318 static void unknown_toUtf8(const ENCODING * enc, 1319 const char **fromP, 1320 const char *fromLim, 1321 char **toP, 1322 const char *toLim) 1321 1323 { 1322 1324 char buf[XML_UTF8_ENCODE_MAX]; … … 1357 1359 } 1358 1360 1359 static void EXPATENTRYunknown_toUtf16(const ENCODING * enc,1360 1361 1362 1363 1361 static void unknown_toUtf16(const ENCODING * enc, 1362 const char **fromP, 1363 const char *fromLim, 1364 unsigned short **toP, 1365 const unsigned short *toLim) 1364 1366 { 1365 1367 while (*fromP != fromLim && *toP != toLim) … … 1381 1383 } 1382 1384 1383 ENCODING * XmlInitUnknownEncoding(void *mem, 1384 int *table, 1385 int (*convert) (void *userData, const char *p), 1386 void *userData) 1385 /* 1386 *@@ XmlInitUnknownEncoding: 1387 * 1388 *@@changed V0.9.14 (2001-08-09) [umoeller]: couple of performance hacks 1389 */ 1390 1391 ENCODING* XmlInitUnknownEncoding(void *mem, 1392 int *table, 1393 int (*convert) (void *userData, const char *p), 1394 void *userData) 1387 1395 { 1388 1396 int i; 1389 struct unknown_encoding *e = (struct unknown_encoding *)mem; 1390 for (i = 0; i < (int)sizeof(struct normal_encoding); i++) 1391 1392 ((char *)mem)[i] = ((char *)&latin1_encoding)[i]; 1397 struct unknown_encoding *e = mem; 1398 1399 // gee, isn't this a regular memcpy?!? 1400 /* for (i = 0; 1401 i < (int)sizeof(struct normal_encoding); 1402 i++) 1403 ((char *)mem)[i] = ((char *)&latin1_encoding)[i]; */ 1404 1405 // replaced the above with this V0.9.14 (2001-08-09) [umoeller] 1406 memcpy(mem, &latin1_encoding, sizeof(struct normal_encoding)); 1407 1393 1408 for (i = 0; i < 128; i++) 1394 if (latin1_encoding.type[i] != BT_OTHER 1395 && latin1_encoding.type[i] != BT_NONXML 1396 && table[i] != i) 1409 if ( latin1_encoding.type[i] != BT_OTHER 1410 && latin1_encoding.type[i] != BT_NONXML 1411 && table[i] != i 1412 ) 1397 1413 return 0; 1414 1398 1415 for (i = 0; i < 256; i++) 1399 1416 { … … 1418 1435 else if (c < 0x80) 1419 1436 { 1420 if (latin1_encoding.type[c] != BT_OTHER 1421 && latin1_encoding.type[c] != BT_NONXML 1422 && c != i) 1437 if ( latin1_encoding.type[c] != BT_OTHER 1438 && latin1_encoding.type[c] != BT_NONXML 1439 && c != i 1440 ) 1423 1441 return 0; 1424 1442 e->normal.type[i] = latin1_encoding.type[c]; … … 1523 1541 if (name == 0) 1524 1542 return NO_ENC; 1525 for (i = 0; i < (int)(sizeof(encodingNames) / sizeof(encodingNames[0])); i++) 1543 for (i = 0; 1544 i < (int)(sizeof(encodingNames) / sizeof(encodingNames[0])); 1545 i++) 1526 1546 if (streqci(name, encodingNames[i])) 1527 1547 return i; … … 1543 1563 1544 1564 1545 static int EXPATENTRYinitScan(const ENCODING ** encodingTable,1546 1547 1548 1549 1550 1565 static int initScan(const ENCODING ** encodingTable, 1566 const INIT_ENCODING * enc, 1567 int state, 1568 const char *ptr, 1569 const char *end, 1570 const char **nextTokPtr) 1551 1571 { 1552 1572 const ENCODING **encPtr; … … 1630 1650 if ((unsigned char)ptr[2] == 0xBF) 1631 1651 { 1652 *nextTokPtr = ptr + 3; 1632 1653 *encPtr = encodingTable[UTF_8_ENC]; 1633 1654 return XML_TOK_BOM; … … 1687 1708 ENCODING * XmlInitUnknownEncodingNS(void *mem, 1688 1709 int *table, 1689 int (* EXPATENTRYconvert) (void *userData, const char *p),1710 int (*convert) (void *userData, const char *p), 1690 1711 void *userData) 1691 1712 {
Note:
See TracChangeset
for help on using the changeset viewer.