Strophe 0.11
XMPP client library
Data Structures | Macros | Enumerations | Functions | Variables
xmltok.c File Reference

Data Structures

struct  normal_encoding
 
struct  unknown_encoding
 

Macros

#define IGNORE_SECTION_TOK_VTABLE   /* as nothing */
 
#define VTABLE1
 
#define VTABLE   VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16)
 
#define UCS2_GET_NAMING(pages, hi, lo)    (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1u << ((lo)&0x1F)))
 
#define UTF8_GET_NAMING2(pages, byte)
 
#define UTF8_GET_NAMING3(pages, byte)
 
#define UTF8_GET_NAMING(pages, p, n)
 
#define UTF8_INVALID2(p)    ((*p) < 0xC2 || ((p)[1] & 0x80) == 0 || ((p)[1] & 0xC0) == 0xC0)
 
#define UTF8_INVALID3(p)
 
#define UTF8_INVALID4(p)
 
#define utf8_isName4   isNever
 
#define utf8_isNmstrt4   isNever
 
#define AS_NORMAL_ENCODING(enc)   ((const struct normal_encoding *)(enc))
 
#define STANDARD_VTABLE(E)   /* as nothing */
 
#define NORMAL_VTABLE(E)
 
#define NULL_VTABLE
 
#define MINBPC(enc)   1
 
#define SB_BYTE_TYPE(enc, p)    (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)])
 
#define BYTE_TYPE(enc, p)   SB_BYTE_TYPE(enc, p)
 
#define BYTE_TO_ASCII(enc, p)   (*(p))
 
#define IS_NAME_CHAR(enc, p, n)   (AS_NORMAL_ENCODING(enc)->isName##n(enc, p))
 
#define IS_NMSTRT_CHAR(enc, p, n)   (AS_NORMAL_ENCODING(enc)->isNmstrt##n(enc, p))
 
#define IS_INVALID_CHAR(enc, p, n)    (AS_NORMAL_ENCODING(enc)->isInvalid##n(enc, p))
 
#define IS_NAME_CHAR_MINBPC(enc, p)   (0)
 
#define IS_NMSTRT_CHAR_MINBPC(enc, p)   (0)
 
#define CHAR_MATCHES(enc, p, c)   (*(p) == c)
 
#define PREFIX(ident)   normal_##ident
 
#define XML_TOK_IMPL_C
 
#define BT_COLON   BT_NMSTRT
 
#define BT_COLON   BT_NMSTRT
 
#define BT_COLON   BT_NMSTRT
 
#define BT_COLON   BT_NMSTRT
 
#define DEFINE_UTF16_TO_UTF8(E)
 
#define DEFINE_UTF16_TO_UTF16(E)
 
#define SET2(ptr, ch)   (((ptr)[0] = ((ch)&0xff)), ((ptr)[1] = ((ch) >> 8)))
 
#define GET_LO(ptr)   ((unsigned char)(ptr)[0])
 
#define GET_HI(ptr)   ((unsigned char)(ptr)[1])
 
#define SET2(ptr, ch)   (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch)&0xFF)))
 
#define GET_LO(ptr)   ((unsigned char)(ptr)[1])
 
#define GET_HI(ptr)   ((unsigned char)(ptr)[0])
 
#define LITTLE2_BYTE_TYPE(enc, p)
 
#define LITTLE2_BYTE_TO_ASCII(p)   ((p)[1] == 0 ? (p)[0] : -1)
 
#define LITTLE2_CHAR_MATCHES(p, c)   ((p)[1] == 0 && (p)[0] == c)
 
#define LITTLE2_IS_NAME_CHAR_MINBPC(p)    UCS2_GET_NAMING(namePages, (unsigned char)p[1], (unsigned char)p[0])
 
#define LITTLE2_IS_NMSTRT_CHAR_MINBPC(p)    UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[1], (unsigned char)p[0])
 
#define PREFIX(ident)   little2_##ident
 
#define MINBPC(enc)   2
 
#define BYTE_TYPE(enc, p)   LITTLE2_BYTE_TYPE(enc, p)
 
#define BYTE_TO_ASCII(enc, p)   LITTLE2_BYTE_TO_ASCII(p)
 
#define CHAR_MATCHES(enc, p, c)   LITTLE2_CHAR_MATCHES(p, c)
 
#define IS_NAME_CHAR(enc, p, n)   0
 
#define IS_NAME_CHAR_MINBPC(enc, p)   LITTLE2_IS_NAME_CHAR_MINBPC(p)
 
#define IS_NMSTRT_CHAR(enc, p, n)   (0)
 
#define IS_NMSTRT_CHAR_MINBPC(enc, p)   LITTLE2_IS_NMSTRT_CHAR_MINBPC(p)
 
#define XML_TOK_IMPL_C
 
#define BT_COLON   BT_NMSTRT
 
#define BT_COLON   BT_NMSTRT
 
#define BIG2_BYTE_TYPE(enc, p)
 
#define BIG2_BYTE_TO_ASCII(p)   ((p)[0] == 0 ? (p)[1] : -1)
 
#define BIG2_CHAR_MATCHES(p, c)   ((p)[0] == 0 && (p)[1] == c)
 
#define BIG2_IS_NAME_CHAR_MINBPC(p)    UCS2_GET_NAMING(namePages, (unsigned char)p[0], (unsigned char)p[1])
 
#define BIG2_IS_NMSTRT_CHAR_MINBPC(p)    UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[0], (unsigned char)p[1])
 
#define PREFIX(ident)   big2_##ident
 
#define MINBPC(enc)   2
 
#define BYTE_TYPE(enc, p)   BIG2_BYTE_TYPE(enc, p)
 
#define BYTE_TO_ASCII(enc, p)   BIG2_BYTE_TO_ASCII(p)
 
#define CHAR_MATCHES(enc, p, c)   BIG2_CHAR_MATCHES(p, c)
 
#define IS_NAME_CHAR(enc, p, n)   0
 
#define IS_NAME_CHAR_MINBPC(enc, p)   BIG2_IS_NAME_CHAR_MINBPC(p)
 
#define IS_NMSTRT_CHAR(enc, p, n)   (0)
 
#define IS_NMSTRT_CHAR_MINBPC(enc, p)   BIG2_IS_NMSTRT_CHAR_MINBPC(p)
 
#define XML_TOK_IMPL_C
 
#define BT_COLON   BT_NMSTRT
 
#define BT_COLON   BT_NMSTRT
 
#define AS_UNKNOWN_ENCODING(enc)   ((const struct unknown_encoding *)(enc))
 
#define INIT_ENC_INDEX(enc)   ((int)(enc)->initEnc.isUtf16)
 
#define SET_INIT_ENC_INDEX(enc, i)   ((enc)->initEnc.isUtf16 = (char)i)
 
#define NS(x)   x
 
#define ns(x)   x
 
#define XML_TOK_NS_C
 

Enumerations

enum  { UTF8_cval1 = 0x00 , UTF8_cval2 = 0xc0 , UTF8_cval3 = 0xe0 , UTF8_cval4 = 0xf0 }
 
enum  {
  UNKNOWN_ENC = -1 , ISO_8859_1_ENC = 0 , US_ASCII_ENC , UTF_8_ENC ,
  UTF_16_ENC , UTF_16BE_ENC , UTF_16LE_ENC , NO_ENC
}
 

Functions

static int PTRFASTCALL isNever (const ENCODING *enc, const char *p)
 
static int PTRFASTCALL utf8_isName2 (const ENCODING *enc, const char *p)
 
static int PTRFASTCALL utf8_isName3 (const ENCODING *enc, const char *p)
 
static int PTRFASTCALL utf8_isNmstrt2 (const ENCODING *enc, const char *p)
 
static int PTRFASTCALL utf8_isNmstrt3 (const ENCODING *enc, const char *p)
 
static int PTRFASTCALL utf8_isInvalid2 (const ENCODING *enc, const char *p)
 
static int PTRFASTCALL utf8_isInvalid3 (const ENCODING *enc, const char *p)
 
static int PTRFASTCALL utf8_isInvalid4 (const ENCODING *enc, const char *p)
 
static int FASTCALL checkCharRefNumber (int)
 
void _INTERNAL_trim_to_complete_utf8_characters (const char *from, const char **fromLimRef)
 
static enum XML_Convert_Result PTRCALL utf8_toUtf8 (const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim)
 
static enum XML_Convert_Result PTRCALL utf8_toUtf16 (const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim)
 
static enum XML_Convert_Result PTRCALL latin1_toUtf8 (const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim)
 
static enum XML_Convert_Result PTRCALL latin1_toUtf16 (const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim)
 
static enum XML_Convert_Result PTRCALL ascii_toUtf8 (const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim)
 
static int PTRFASTCALL unicode_byte_type (char hi, char lo)
 
static int FASTCALL streqci (const char *s1, const char *s2)
 
static void PTRCALL initUpdatePosition (const ENCODING *enc, const char *ptr, const char *end, POSITION *pos)
 
static int toAscii (const ENCODING *enc, const char *ptr, const char *end)
 
static int FASTCALL isSpace (int c)
 
static int parsePseudoAttribute (const ENCODING *enc, const char *ptr, const char *end, const char **namePtr, const char **nameEndPtr, const char **valPtr, const char **nextTokPtr)
 
static int doParseXmlDecl (const ENCODING *(*encodingFinder)(const ENCODING *, const char *, const char *), 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)
 
int FASTCALL XmlUtf8Encode (int c, char *buf)
 
int FASTCALL XmlUtf16Encode (int charNum, unsigned short *buf)
 
int XmlSizeOfUnknownEncoding (void)
 
static int PTRFASTCALL unknown_isName (const ENCODING *enc, const char *p)
 
static int PTRFASTCALL unknown_isNmstrt (const ENCODING *enc, const char *p)
 
static int PTRFASTCALL unknown_isInvalid (const ENCODING *enc, const char *p)
 
static enum XML_Convert_Result PTRCALL unknown_toUtf8 (const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim)
 
static enum XML_Convert_Result PTRCALL unknown_toUtf16 (const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim)
 
ENCODING * XmlInitUnknownEncoding (void *mem, int *table, CONVERTER convert, void *userData)
 
static int FASTCALL getEncodingIndex (const char *name)
 
static int initScan (const ENCODING *const *encodingTable, const INIT_ENCODING *enc, int state, const char *ptr, const char *end, const char **nextTokPtr)
 

Variables

static const struct normal_encoding utf8_encoding
 
static const struct normal_encoding internal_utf8_encoding
 
static const struct normal_encoding latin1_encoding
 
static const struct normal_encoding ascii_encoding
 
static const struct normal_encoding little2_encoding
 
static const struct normal_encoding internal_little2_encoding
 
static const struct normal_encoding big2_encoding
 
static const struct normal_encoding internal_big2_encoding
 
static const char KW_version [] = {ASCII_v, ASCII_e, ASCII_r, ASCII_s, ASCII_i, ASCII_o, ASCII_n, '\0'}
 
static const char KW_encoding []
 
static const char KW_standalone []
 
static const char KW_yes [] = {ASCII_y, ASCII_e, ASCII_s, '\0'}
 
static const char KW_no [] = {ASCII_n, ASCII_o, '\0'}
 
static const char KW_ISO_8859_1 []
 
static const char KW_US_ASCII []
 
static const char KW_UTF_8 [] = {ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_8, '\0'}
 
static const char KW_UTF_16 [] = {ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, '\0'}
 
static const char KW_UTF_16BE []
 
static const char KW_UTF_16LE []
 

Macro Definition Documentation

◆ IGNORE_SECTION_TOK_VTABLE

#define IGNORE_SECTION_TOK_VTABLE   /* as nothing */

◆ VTABLE1

#define VTABLE1
Value:
{PREFIX(prologTok), PREFIX(contentTok), \
PREFIX(cdataSectionTok) IGNORE_SECTION_TOK_VTABLE}, \
{PREFIX(attributeValueTok), PREFIX(entityValueTok)}, \
PREFIX(nameMatchesAscii), PREFIX(nameLength), PREFIX(skipS), \
PREFIX(getAtts), PREFIX(charRefNumber), PREFIX(predefinedEntityName), \
PREFIX(updatePosition), PREFIX(isPublicId)
#define IGNORE_SECTION_TOK_VTABLE
Definition: xmltok.c:61
#define PREFIX(ident)
Definition: xmltok.c:917

◆ VTABLE

#define VTABLE   VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16)

◆ UCS2_GET_NAMING

#define UCS2_GET_NAMING (   pages,
  hi,
  lo 
)     (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1u << ((lo)&0x1F)))

◆ UTF8_GET_NAMING2

#define UTF8_GET_NAMING2 (   pages,
  byte 
)
Value:
(namingBitmap[((pages)[(((byte)[0]) >> 2) & 7] << 3) \
+ ((((byte)[0]) & 3) << 1) + ((((byte)[1]) >> 5) & 1)] \
& (1u << (((byte)[1]) & 0x1F)))
static const unsigned namingBitmap[]
Definition: nametab.h:33

◆ UTF8_GET_NAMING3

#define UTF8_GET_NAMING3 (   pages,
  byte 
)
Value:
[((pages)[((((byte)[0]) & 0xF) << 4) + ((((byte)[1]) >> 2) & 0xF)] \
<< 3) \
+ ((((byte)[1]) & 3) << 1) + ((((byte)[2]) >> 5) & 1)] \
& (1u << (((byte)[2]) & 0x1F)))

◆ UTF8_GET_NAMING

#define UTF8_GET_NAMING (   pages,
  p,
 
)
Value:
((n) == 2 \
? UTF8_GET_NAMING2(pages, (const unsigned char *)(p)) \
: ((n) == 3 ? UTF8_GET_NAMING3(pages, (const unsigned char *)(p)) : 0))
#define UTF8_GET_NAMING3(pages, byte)
Definition: xmltok.c:91
#define UTF8_GET_NAMING2(pages, byte)
Definition: xmltok.c:81

◆ UTF8_INVALID2

#define UTF8_INVALID2 (   p)     ((*p) < 0xC2 || ((p)[1] & 0x80) == 0 || ((p)[1] & 0xC0) == 0xC0)

◆ UTF8_INVALID3

#define UTF8_INVALID3 (   p)
Value:
(((p)[2] & 0x80) == 0 \
|| ((*p) == 0xEF && (p)[1] == 0xBF ? (p)[2] > 0xBD \
: ((p)[2] & 0xC0) == 0xC0) \
|| ((*p) == 0xE0 \
? (p)[1] < 0xA0 || ((p)[1] & 0xC0) == 0xC0 \
: ((p)[1] & 0x80) == 0 \
|| ((*p) == 0xED ? (p)[1] > 0x9F : ((p)[1] & 0xC0) == 0xC0)))

◆ UTF8_INVALID4

#define UTF8_INVALID4 (   p)
Value:
(((p)[3] & 0x80) == 0 || ((p)[3] & 0xC0) == 0xC0 || ((p)[2] & 0x80) == 0 \
|| ((p)[2] & 0xC0) == 0xC0 \
|| ((*p) == 0xF0 \
? (p)[1] < 0x90 || ((p)[1] & 0xC0) == 0xC0 \
: ((p)[1] & 0x80) == 0 \
|| ((*p) == 0xF4 ? (p)[1] > 0x8F : ((p)[1] & 0xC0) == 0xC0)))

◆ utf8_isName4

#define utf8_isName4   isNever

◆ utf8_isNmstrt4

#define utf8_isNmstrt4   isNever

◆ AS_NORMAL_ENCODING

#define AS_NORMAL_ENCODING (   enc)    ((const struct normal_encoding *)(enc))

◆ STANDARD_VTABLE

#define STANDARD_VTABLE (   E)    /* as nothing */

◆ NORMAL_VTABLE

#define NORMAL_VTABLE (   E)
Value:
E##isName2, E##isName3, E##isName4, E##isNmstrt2, E##isNmstrt3, \
E##isNmstrt4, E##isInvalid2, E##isInvalid3, E##isInvalid4

◆ NULL_VTABLE

#define NULL_VTABLE
Value:
/* isName2 */ NULL, /* isName3 */ NULL, /* isName4 */ NULL, \
/* isNmstrt2 */ NULL, /* isNmstrt3 */ NULL, /* isNmstrt4 */ NULL, \
/* isInvalid2 */ NULL, /* isInvalid3 */ NULL, /* isInvalid4 */ NULL

◆ MINBPC [1/3]

#define MINBPC (   enc)    1

◆ SB_BYTE_TYPE

#define SB_BYTE_TYPE (   enc,
 
)     (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)])

◆ BYTE_TYPE [1/3]

#define BYTE_TYPE (   enc,
 
)    SB_BYTE_TYPE(enc, p)

◆ BYTE_TO_ASCII [1/3]

#define BYTE_TO_ASCII (   enc,
 
)    (*(p))

◆ IS_NAME_CHAR [1/3]

#define IS_NAME_CHAR (   enc,
  p,
 
)    (AS_NORMAL_ENCODING(enc)->isName##n(enc, p))

◆ IS_NMSTRT_CHAR [1/3]

#define IS_NMSTRT_CHAR (   enc,
  p,
 
)    (AS_NORMAL_ENCODING(enc)->isNmstrt##n(enc, p))

◆ IS_INVALID_CHAR

#define IS_INVALID_CHAR (   enc,
  p,
 
)     (AS_NORMAL_ENCODING(enc)->isInvalid##n(enc, p))

◆ IS_NAME_CHAR_MINBPC [1/3]

#define IS_NAME_CHAR_MINBPC (   enc,
 
)    (0)

◆ IS_NMSTRT_CHAR_MINBPC [1/3]

#define IS_NMSTRT_CHAR_MINBPC (   enc,
 
)    (0)

◆ CHAR_MATCHES [1/3]

#define CHAR_MATCHES (   enc,
  p,
 
)    (*(p) == c)

◆ PREFIX [1/3]

#define PREFIX (   ident)    normal_##ident

◆ XML_TOK_IMPL_C [1/3]

#define XML_TOK_IMPL_C

◆ BT_COLON [1/8]

#define BT_COLON   BT_NMSTRT

◆ BT_COLON [2/8]

#define BT_COLON   BT_NMSTRT

◆ BT_COLON [3/8]

#define BT_COLON   BT_NMSTRT

◆ BT_COLON [4/8]

#define BT_COLON   BT_NMSTRT

◆ DEFINE_UTF16_TO_UTF8

#define DEFINE_UTF16_TO_UTF8 (   E)

◆ DEFINE_UTF16_TO_UTF16

#define DEFINE_UTF16_TO_UTF16 (   E)
Value:
static enum XML_Convert_Result PTRCALL E##toUtf16( \
const ENCODING *enc, const char **fromP, const char *fromLim, \
unsigned short **toP, const unsigned short *toLim) { \
UNUSED_P(enc); \
fromLim = *fromP + (((fromLim - *fromP) >> 1) << 1); /* shrink to even */ \
/* Avoid copying first half only of surrogate */ \
if (fromLim - *fromP > ((toLim - *toP) << 1) \
&& (GET_HI(fromLim - 2) & 0xF8) == 0xD8) { \
fromLim -= 2; \
} \
for (; *fromP < fromLim && *toP < toLim; *fromP += 2) \
*(*toP)++ = (GET_HI(*fromP) << 8) | GET_LO(*fromP); \
if ((*toP == toLim) && (*fromP < fromLim)) \
else \
return res; \
}
#define PTRCALL
Definition: internal.h:81
#define GET_HI(ptr)
Definition: xmltok.c:726
#define GET_LO(ptr)
Definition: xmltok.c:725
XML_Convert_Result
Definition: xmltok.h:159
@ XML_CONVERT_OUTPUT_EXHAUSTED
Definition: xmltok.h:162
@ XML_CONVERT_COMPLETED
Definition: xmltok.h:160
@ XML_CONVERT_INPUT_INCOMPLETE
Definition: xmltok.h:161

◆ SET2 [1/2]

#define SET2 (   ptr,
  ch 
)    (((ptr)[0] = ((ch)&0xff)), ((ptr)[1] = ((ch) >> 8)))

◆ GET_LO [1/2]

#define GET_LO (   ptr)    ((unsigned char)(ptr)[0])

◆ GET_HI [1/2]

#define GET_HI (   ptr)    ((unsigned char)(ptr)[1])

◆ SET2 [2/2]

#define SET2 (   ptr,
  ch 
)    (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch)&0xFF)))

◆ GET_LO [2/2]

#define GET_LO (   ptr)    ((unsigned char)(ptr)[1])

◆ GET_HI [2/2]

#define GET_HI (   ptr)    ((unsigned char)(ptr)[0])

◆ LITTLE2_BYTE_TYPE

#define LITTLE2_BYTE_TYPE (   enc,
 
)
Value:
((p)[1] == 0 ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \
: unicode_byte_type((p)[1], (p)[0]))
Definition: xmltok.c:186
static int PTRFASTCALL unicode_byte_type(char hi, char lo)
Definition: xmltok.c:590

◆ LITTLE2_BYTE_TO_ASCII

#define LITTLE2_BYTE_TO_ASCII (   p)    ((p)[1] == 0 ? (p)[0] : -1)

◆ LITTLE2_CHAR_MATCHES

#define LITTLE2_CHAR_MATCHES (   p,
 
)    ((p)[1] == 0 && (p)[0] == c)

◆ LITTLE2_IS_NAME_CHAR_MINBPC

#define LITTLE2_IS_NAME_CHAR_MINBPC (   p)     UCS2_GET_NAMING(namePages, (unsigned char)p[1], (unsigned char)p[0])

◆ LITTLE2_IS_NMSTRT_CHAR_MINBPC

#define LITTLE2_IS_NMSTRT_CHAR_MINBPC (   p)     UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[1], (unsigned char)p[0])

◆ PREFIX [2/3]

#define PREFIX (   ident)    little2_##ident

◆ MINBPC [2/3]

#define MINBPC (   enc)    2

◆ BYTE_TYPE [2/3]

#define BYTE_TYPE (   enc,
 
)    LITTLE2_BYTE_TYPE(enc, p)

◆ BYTE_TO_ASCII [2/3]

#define BYTE_TO_ASCII (   enc,
 
)    LITTLE2_BYTE_TO_ASCII(p)

◆ CHAR_MATCHES [2/3]

#define CHAR_MATCHES (   enc,
  p,
 
)    LITTLE2_CHAR_MATCHES(p, c)

◆ IS_NAME_CHAR [2/3]

#define IS_NAME_CHAR (   enc,
  p,
 
)    0

◆ IS_NAME_CHAR_MINBPC [2/3]

#define IS_NAME_CHAR_MINBPC (   enc,
 
)    LITTLE2_IS_NAME_CHAR_MINBPC(p)

◆ IS_NMSTRT_CHAR [2/3]

#define IS_NMSTRT_CHAR (   enc,
  p,
 
)    (0)

◆ IS_NMSTRT_CHAR_MINBPC [2/3]

#define IS_NMSTRT_CHAR_MINBPC (   enc,
 
)    LITTLE2_IS_NMSTRT_CHAR_MINBPC(p)

◆ XML_TOK_IMPL_C [2/3]

#define XML_TOK_IMPL_C

◆ BT_COLON [5/8]

#define BT_COLON   BT_NMSTRT

◆ BT_COLON [6/8]

#define BT_COLON   BT_NMSTRT

◆ BIG2_BYTE_TYPE

#define BIG2_BYTE_TYPE (   enc,
 
)
Value:
((p)[0] == 0 \
? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \
: unicode_byte_type((p)[0], (p)[1]))

◆ BIG2_BYTE_TO_ASCII

#define BIG2_BYTE_TO_ASCII (   p)    ((p)[0] == 0 ? (p)[1] : -1)

◆ BIG2_CHAR_MATCHES

#define BIG2_CHAR_MATCHES (   p,
 
)    ((p)[0] == 0 && (p)[1] == c)

◆ BIG2_IS_NAME_CHAR_MINBPC

#define BIG2_IS_NAME_CHAR_MINBPC (   p)     UCS2_GET_NAMING(namePages, (unsigned char)p[0], (unsigned char)p[1])

◆ BIG2_IS_NMSTRT_CHAR_MINBPC

#define BIG2_IS_NMSTRT_CHAR_MINBPC (   p)     UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[0], (unsigned char)p[1])

◆ PREFIX [3/3]

#define PREFIX (   ident)    big2_##ident

◆ MINBPC [3/3]

#define MINBPC (   enc)    2

◆ BYTE_TYPE [3/3]

#define BYTE_TYPE (   enc,
 
)    BIG2_BYTE_TYPE(enc, p)

◆ BYTE_TO_ASCII [3/3]

#define BYTE_TO_ASCII (   enc,
 
)    BIG2_BYTE_TO_ASCII(p)

◆ CHAR_MATCHES [3/3]

#define CHAR_MATCHES (   enc,
  p,
 
)    BIG2_CHAR_MATCHES(p, c)

◆ IS_NAME_CHAR [3/3]

#define IS_NAME_CHAR (   enc,
  p,
 
)    0

◆ IS_NAME_CHAR_MINBPC [3/3]

#define IS_NAME_CHAR_MINBPC (   enc,
 
)    BIG2_IS_NAME_CHAR_MINBPC(p)

◆ IS_NMSTRT_CHAR [3/3]

#define IS_NMSTRT_CHAR (   enc,
  p,
 
)    (0)

◆ IS_NMSTRT_CHAR_MINBPC [3/3]

#define IS_NMSTRT_CHAR_MINBPC (   enc,
 
)    BIG2_IS_NMSTRT_CHAR_MINBPC(p)

◆ XML_TOK_IMPL_C [3/3]

#define XML_TOK_IMPL_C

◆ BT_COLON [7/8]

#define BT_COLON   BT_NMSTRT

◆ BT_COLON [8/8]

#define BT_COLON   BT_NMSTRT

◆ AS_UNKNOWN_ENCODING

#define AS_UNKNOWN_ENCODING (   enc)    ((const struct unknown_encoding *)(enc))

◆ INIT_ENC_INDEX

#define INIT_ENC_INDEX (   enc)    ((int)(enc)->initEnc.isUtf16)

◆ SET_INIT_ENC_INDEX

#define SET_INIT_ENC_INDEX (   enc,
 
)    ((enc)->initEnc.isUtf16 = (char)i)

◆ NS

#define NS (   x)    x

◆ ns

#define ns (   x)    x

◆ XML_TOK_NS_C

#define XML_TOK_NS_C

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
UTF8_cval1 
UTF8_cval2 
UTF8_cval3 
UTF8_cval4 

◆ anonymous enum

anonymous enum
Enumerator
UNKNOWN_ENC 
ISO_8859_1_ENC 
US_ASCII_ENC 
UTF_8_ENC 
UTF_16_ENC 
UTF_16BE_ENC 
UTF_16LE_ENC 
NO_ENC 

Function Documentation

◆ isNever()

static int PTRFASTCALL isNever ( const ENCODING *  enc,
const char *  p 
)
static

◆ utf8_isName2()

static int PTRFASTCALL utf8_isName2 ( const ENCODING *  enc,
const char *  p 
)
static

◆ utf8_isName3()

static int PTRFASTCALL utf8_isName3 ( const ENCODING *  enc,
const char *  p 
)
static

◆ utf8_isNmstrt2()

static int PTRFASTCALL utf8_isNmstrt2 ( const ENCODING *  enc,
const char *  p 
)
static

◆ utf8_isNmstrt3()

static int PTRFASTCALL utf8_isNmstrt3 ( const ENCODING *  enc,
const char *  p 
)
static

◆ utf8_isInvalid2()

static int PTRFASTCALL utf8_isInvalid2 ( const ENCODING *  enc,
const char *  p 
)
static

◆ utf8_isInvalid3()

static int PTRFASTCALL utf8_isInvalid3 ( const ENCODING *  enc,
const char *  p 
)
static

◆ utf8_isInvalid4()

static int PTRFASTCALL utf8_isInvalid4 ( const ENCODING *  enc,
const char *  p 
)
static

◆ checkCharRefNumber()

static int FASTCALL checkCharRefNumber ( int  result)
static

◆ _INTERNAL_trim_to_complete_utf8_characters()

void _INTERNAL_trim_to_complete_utf8_characters ( const char *  from,
const char **  fromLimRef 
)

◆ utf8_toUtf8()

static enum XML_Convert_Result PTRCALL utf8_toUtf8 ( const ENCODING *  enc,
const char **  fromP,
const char *  fromLim,
char **  toP,
const char *  toLim 
)
static

◆ utf8_toUtf16()

static enum XML_Convert_Result PTRCALL utf8_toUtf16 ( const ENCODING *  enc,
const char **  fromP,
const char *  fromLim,
unsigned short **  toP,
const unsigned short *  toLim 
)
static

◆ latin1_toUtf8()

static enum XML_Convert_Result PTRCALL latin1_toUtf8 ( const ENCODING *  enc,
const char **  fromP,
const char *  fromLim,
char **  toP,
const char *  toLim 
)
static

◆ latin1_toUtf16()

static enum XML_Convert_Result PTRCALL latin1_toUtf16 ( const ENCODING *  enc,
const char **  fromP,
const char *  fromLim,
unsigned short **  toP,
const unsigned short *  toLim 
)
static

◆ ascii_toUtf8()

static enum XML_Convert_Result PTRCALL ascii_toUtf8 ( const ENCODING *  enc,
const char **  fromP,
const char *  fromLim,
char **  toP,
const char *  toLim 
)
static

◆ unicode_byte_type()

static int PTRFASTCALL unicode_byte_type ( char  hi,
char  lo 
)
static

◆ streqci()

static int FASTCALL streqci ( const char *  s1,
const char *  s2 
)
static

◆ initUpdatePosition()

static void PTRCALL initUpdatePosition ( const ENCODING *  enc,
const char *  ptr,
const char *  end,
POSITION pos 
)
static

◆ toAscii()

static int toAscii ( const ENCODING *  enc,
const char *  ptr,
const char *  end 
)
static

◆ isSpace()

static int FASTCALL isSpace ( int  c)
static

◆ parsePseudoAttribute()

static int parsePseudoAttribute ( const ENCODING *  enc,
const char *  ptr,
const char *  end,
const char **  namePtr,
const char **  nameEndPtr,
const char **  valPtr,
const char **  nextTokPtr 
)
static

◆ doParseXmlDecl()

static int doParseXmlDecl ( const ENCODING *(*)(const ENCODING *, const char *, const char *)  encodingFinder,
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 
)
static

◆ XmlUtf8Encode()

int FASTCALL XmlUtf8Encode ( int  c,
char *  buf 
)

◆ XmlUtf16Encode()

int FASTCALL XmlUtf16Encode ( int  charNum,
unsigned short *  buf 
)

◆ XmlSizeOfUnknownEncoding()

int XmlSizeOfUnknownEncoding ( void  )

◆ unknown_isName()

static int PTRFASTCALL unknown_isName ( const ENCODING *  enc,
const char *  p 
)
static

◆ unknown_isNmstrt()

static int PTRFASTCALL unknown_isNmstrt ( const ENCODING *  enc,
const char *  p 
)
static

◆ unknown_isInvalid()

static int PTRFASTCALL unknown_isInvalid ( const ENCODING *  enc,
const char *  p 
)
static

◆ unknown_toUtf8()

static enum XML_Convert_Result PTRCALL unknown_toUtf8 ( const ENCODING *  enc,
const char **  fromP,
const char *  fromLim,
char **  toP,
const char *  toLim 
)
static

◆ unknown_toUtf16()

static enum XML_Convert_Result PTRCALL unknown_toUtf16 ( const ENCODING *  enc,
const char **  fromP,
const char *  fromLim,
unsigned short **  toP,
const unsigned short *  toLim 
)
static

◆ XmlInitUnknownEncoding()

ENCODING * XmlInitUnknownEncoding ( void *  mem,
int *  table,
CONVERTER  convert,
void *  userData 
)

◆ getEncodingIndex()

static int FASTCALL getEncodingIndex ( const char *  name)
static

◆ initScan()

static int initScan ( const ENCODING *const *  encodingTable,
const INIT_ENCODING enc,
int  state,
const char *  ptr,
const char *  end,
const char **  nextTokPtr 
)
static

Variable Documentation

◆ utf8_encoding

const struct normal_encoding utf8_encoding
static
Initial value:
{
#define BT_COLON
},
#define STANDARD_VTABLE(E)
Definition: xmltok.c:216
#define VTABLE1
Definition: xmltok.c:64
static enum XML_Convert_Result PTRCALL utf8_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim)
Definition: xmltok.c:360
static enum XML_Convert_Result PTRCALL utf8_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim)
Definition: xmltok.c:399
#define NORMAL_VTABLE(E)
Definition: xmltok.c:220

◆ internal_utf8_encoding

const struct normal_encoding internal_utf8_encoding
static
Initial value:
{
#define BT_COLON
},

◆ latin1_encoding

const struct normal_encoding latin1_encoding
static
Initial value:
{
#define BT_COLON
},
#define NULL_VTABLE
Definition: xmltok.c:224
static enum XML_Convert_Result PTRCALL latin1_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim)
Definition: xmltok.c:520
static enum XML_Convert_Result PTRCALL latin1_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim)
Definition: xmltok.c:497

◆ ascii_encoding

const struct normal_encoding ascii_encoding
static
Initial value:
{
#define BT_COLON
},
static enum XML_Convert_Result PTRCALL ascii_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim)
Definition: xmltok.c:555

◆ little2_encoding

const struct normal_encoding little2_encoding
static
Initial value:
= {{VTABLE, 2, 0,
0
},
{
#define BT_COLON
},
#define VTABLE
Definition: xmltok.c:72

◆ internal_little2_encoding

const struct normal_encoding internal_little2_encoding
static
Initial value:
= {{VTABLE, 2, 0, 1},
{
# define BT_COLON
},

◆ big2_encoding

const struct normal_encoding big2_encoding
static
Initial value:
= {{VTABLE, 2, 0,
0
},
{
#define BT_COLON
},

◆ internal_big2_encoding

const struct normal_encoding internal_big2_encoding
static
Initial value:
= {{VTABLE, 2, 0, 1},
{
# define BT_COLON
},

◆ KW_version

const char KW_version[] = {ASCII_v, ASCII_e, ASCII_r, ASCII_s, ASCII_i, ASCII_o, ASCII_n, '\0'}
static

◆ KW_encoding

const char KW_encoding[]
static
Initial value:
#define ASCII_i
Definition: ascii.h:68
#define ASCII_o
Definition: ascii.h:74
#define ASCII_n
Definition: ascii.h:73
#define ASCII_c
Definition: ascii.h:62
#define ASCII_e
Definition: ascii.h:64
#define ASCII_d
Definition: ascii.h:63
#define ASCII_g
Definition: ascii.h:66

◆ KW_standalone

const char KW_standalone[]
static
Initial value:
#define ASCII_l
Definition: ascii.h:71
#define ASCII_s
Definition: ascii.h:78
#define ASCII_t
Definition: ascii.h:79
#define ASCII_a
Definition: ascii.h:60

◆ KW_yes

const char KW_yes[] = {ASCII_y, ASCII_e, ASCII_s, '\0'}
static

◆ KW_no

const char KW_no[] = {ASCII_n, ASCII_o, '\0'}
static

◆ KW_ISO_8859_1

const char KW_ISO_8859_1[]
static
Initial value:
#define ASCII_O
Definition: ascii.h:47
#define ASCII_5
Definition: ascii.h:92
#define ASCII_I
Definition: ascii.h:41
#define ASCII_9
Definition: ascii.h:96
#define ASCII_8
Definition: ascii.h:95
#define ASCII_1
Definition: ascii.h:88
#define ASCII_S
Definition: ascii.h:51
#define ASCII_MINUS
Definition: ascii.h:104

◆ KW_US_ASCII

const char KW_US_ASCII[]
static
Initial value:
#define ASCII_C
Definition: ascii.h:35
#define ASCII_A
Definition: ascii.h:33
#define ASCII_U
Definition: ascii.h:53

◆ KW_UTF_8

const char KW_UTF_8[] = {ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_8, '\0'}
static

◆ KW_UTF_16

const char KW_UTF_16[] = {ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, '\0'}
static

◆ KW_UTF_16BE

const char KW_UTF_16BE[]
static
Initial value:
#define ASCII_F
Definition: ascii.h:38
#define ASCII_E
Definition: ascii.h:37
#define ASCII_6
Definition: ascii.h:93
#define ASCII_B
Definition: ascii.h:34
#define ASCII_T
Definition: ascii.h:52

◆ KW_UTF_16LE

const char KW_UTF_16LE[]
static
Initial value:
#define ASCII_L
Definition: ascii.h:44