summaryrefslogtreecommitdiffstats
path: root/Utilities/cmexpat/xmltok_ns.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-05-06 12:22:31 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-05-06 12:22:31 (GMT)
commit058b22cd5a544aea09a59dc90c9d642662844ea3 (patch)
treead80faa33787e0594ecac83001a8448c71485421 /Utilities/cmexpat/xmltok_ns.c
parent0723a9fec8eb5268df4ffb6510546c450d49d741 (diff)
parent58216d16946b7a14570f1a1dd4d260ed146b3faa (diff)
downloadCMake-058b22cd5a544aea09a59dc90c9d642662844ea3.zip
CMake-058b22cd5a544aea09a59dc90c9d642662844ea3.tar.gz
CMake-058b22cd5a544aea09a59dc90c9d642662844ea3.tar.bz2
Merge topic 'update-expat'
58216d16 expat: Suppress compiler warnings f177c8a0 expat: Re-write CMake build system for our needs 4544c68a expat: Hard-code configuration options for our needs 9f7de396 expat: Drop upstream test/install/packaging code b4678e1c expat: Update cm_expat.h wrapper for new header location 94c62680 Merge branch 'upstream-expat' into update-expat 318b1c17 expat 2016-05-01 (379213ca) 48764630 expat: Disable all whitespace checks in third-party code f4bd9d43 Add script to update Expat from upstream 7eb7a189 Drop old expat sources to make room for a fresh import
Diffstat (limited to 'Utilities/cmexpat/xmltok_ns.c')
-rw-r--r--Utilities/cmexpat/xmltok_ns.c98
1 files changed, 0 insertions, 98 deletions
diff --git a/Utilities/cmexpat/xmltok_ns.c b/Utilities/cmexpat/xmltok_ns.c
deleted file mode 100644
index fa78adf..0000000
--- a/Utilities/cmexpat/xmltok_ns.c
+++ /dev/null
@@ -1,98 +0,0 @@
-const ENCODING *NS(XmlGetUtf8InternalEncoding)(void)
-{
- return &ns(internal_utf8_encoding).enc;
-}
-
-const ENCODING *NS(XmlGetUtf16InternalEncoding)(void)
-{
-#if XML_BYTE_ORDER == 12
- return &ns(internal_little2_encoding).enc;
-#elif XML_BYTE_ORDER == 21
- return &ns(internal_big2_encoding).enc;
-#else
- const short n = 1;
- return *(const char *)&n ? &ns(internal_little2_encoding).enc : &ns(internal_big2_encoding).enc;
-#endif
-}
-
-static
-const ENCODING *NS(encodings)[] = {
- &ns(latin1_encoding).enc,
- &ns(ascii_encoding).enc,
- &ns(utf8_encoding).enc,
- &ns(big2_encoding).enc,
- &ns(big2_encoding).enc,
- &ns(little2_encoding).enc,
- &ns(utf8_encoding).enc /* NO_ENC */
-};
-
-static
-int NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
- const char **nextTokPtr)
-{
- return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_PROLOG_STATE, ptr, end, nextTokPtr);
-}
-
-static
-int NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
- const char **nextTokPtr)
-{
- return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_CONTENT_STATE, ptr, end, nextTokPtr);
-}
-
-int NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr, const char *name)
-{
- int i = getEncodingIndex(name);
- if (i == UNKNOWN_ENC)
- return 0;
- SET_INIT_ENC_INDEX(p, i);
- p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog);
- p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent);
- p->initEnc.updatePosition = initUpdatePosition;
- p->encPtr = encPtr;
- *encPtr = &(p->initEnc);
- return 1;
-}
-
-static
-const ENCODING *NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end)
-{
-#define ENCODING_MAX 128
- char buf[ENCODING_MAX];
- char *p = buf;
- int i;
- XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
- if (ptr != end)
- return 0;
- *p = 0;
- if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2)
- return enc;
- i = getEncodingIndex(buf);
- if (i == UNKNOWN_ENC)
- return 0;
- return NS(encodings)[i];
-}
-
-int NS(XmlParseXmlDecl)(int isGeneralTextEntity,
- const ENCODING *enc,
- const char *ptr,
- const char *end,
- const char **badPtr,
- const char **versionPtr,
- const char **versionEndPtr,
- const char **encodingName,
- const ENCODING **encoding,
- int *standalone)
-{
- return doParseXmlDecl(NS(findEncoding),
- isGeneralTextEntity,
- enc,
- ptr,
- end,
- badPtr,
- versionPtr,
- versionEndPtr,
- encodingName,
- encoding,
- standalone);
-}