Go to the source code of this file.
Defines | |
#define | ENCODING_MAX 128 |
Functions | |
const ENCODING *NS() | XmlGetUtf8InternalEncoding () |
const ENCODING *NS() | XmlGetUtf16InternalEncoding () |
static const ENCODING * | NS (encodings)[] |
static int NS() | initScanProlog (const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) |
static int NS() | initScanContent (const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) |
int NS() | XmlInitEncoding (INIT_ENCODING *p, const ENCODING **encPtr, const char *name) |
static const ENCODING *NS() | findEncoding (const ENCODING *enc, const char *ptr, const char *end) |
int NS() | XmlParseXmlDecl (int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **encodingName, const ENCODING **encoding, int *standalone) |
#define ENCODING_MAX 128 |
Referenced by findEncoding().
static const ENCODING* NS() findEncoding | ( | const ENCODING * | enc, | |
const char * | ptr, | |||
const char * | end | |||
) | [static] |
Definition at line 58 of file xmltok_ns.c.
References normal_encoding::enc, ENCODING_MAX, deljobs::end, getEncodingIndex(), genRecEmupikp::i, NS, streqci(), and UNKNOWN_ENC.
Referenced by XmlParseXmlDecl().
00059 { 00060 #define ENCODING_MAX 128 00061 char buf[ENCODING_MAX]; 00062 char *p = buf; 00063 int i; 00064 XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); 00065 if (ptr != end) 00066 return 0; 00067 *p = 0; 00068 if (streqci(buf, "UTF-16") && enc->minBytesPerChar == 2) 00069 return enc; 00070 i = getEncodingIndex(buf); 00071 if (i == UNKNOWN_ENC) 00072 return 0; 00073 return NS(encodings)[i]; 00074 }
static int NS() initScanContent | ( | const ENCODING * | enc, | |
const char * | ptr, | |||
const char * | end, | |||
const char ** | nextTokPtr | |||
) | [static] |
Definition at line 37 of file xmltok_ns.c.
References normal_encoding::enc, deljobs::end, initScan(), and NS.
Referenced by XmlInitEncoding().
00039 { 00040 return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_CONTENT_STATE, ptr, end, nextTokPtr); 00041 }
static int NS() initScanProlog | ( | const ENCODING * | enc, | |
const char * | ptr, | |||
const char * | end, | |||
const char ** | nextTokPtr | |||
) | [static] |
Definition at line 30 of file xmltok_ns.c.
References normal_encoding::enc, deljobs::end, initScan(), and NS.
Referenced by XmlInitEncoding().
00032 { 00033 return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_PROLOG_STATE, ptr, end, nextTokPtr); 00034 }
static const ENCODING* NS | ( | encodings | ) | [static] |
const ENCODING* NS() XmlGetUtf16InternalEncoding | ( | ) |
Definition at line 6 of file xmltok_ns.c.
References internal_big2_encoding, internal_little2_encoding, and ns.
00007 { 00008 #if XML_BYTE_ORDER == 12 00009 return &ns(internal_little2_encoding).enc; 00010 #elif XML_BYTE_ORDER == 21 00011 return &ns(internal_big2_encoding).enc; 00012 #else 00013 const short n = 1; 00014 return *(const char *)&n ? &ns(internal_little2_encoding).enc : &ns(internal_big2_encoding).enc; 00015 #endif 00016 }
const ENCODING* NS() XmlGetUtf8InternalEncoding | ( | ) |
Definition at line 1 of file xmltok_ns.c.
References internal_utf8_encoding, and ns.
00002 { 00003 return &ns(internal_utf8_encoding).enc; 00004 }
int NS() XmlInitEncoding | ( | INIT_ENCODING * | p, | |
const ENCODING ** | encPtr, | |||
const char * | name | |||
) |
Definition at line 43 of file xmltok_ns.c.
References getEncodingIndex(), genRecEmupikp::i, INIT_ENC_INDEX, initScanContent(), initScanProlog(), initUpdatePosition(), NS, and UNKNOWN_ENC.
00044 { 00045 int i = getEncodingIndex(name); 00046 if (i == UNKNOWN_ENC) 00047 return 0; 00048 INIT_ENC_INDEX(p) = (char)i; 00049 p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog); 00050 p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent); 00051 p->initEnc.updatePosition = initUpdatePosition; 00052 p->encPtr = encPtr; 00053 *encPtr = &(p->initEnc); 00054 return 1; 00055 }
int NS() XmlParseXmlDecl | ( | int | isGeneralTextEntity, | |
const ENCODING * | enc, | |||
const char * | ptr, | |||
const char * | end, | |||
const char ** | badPtr, | |||
const char ** | versionPtr, | |||
const char ** | encodingName, | |||
const ENCODING ** | encoding, | |||
int * | standalone | |||
) |
Definition at line 76 of file xmltok_ns.c.
References doParseXmlDecl(), normal_encoding::enc, deljobs::end, findEncoding(), and NS.
00085 { 00086 return doParseXmlDecl(NS(findEncoding), 00087 isGeneralTextEntity, 00088 enc, 00089 ptr, 00090 end, 00091 badPtr, 00092 versionPtr, 00093 encodingName, 00094 encoding, 00095 standalone); 00096 }