Back to index

python3.2  3.2.2
Defines | Functions
xmltok_ns.c File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ENCODING_MAX   128

Functions

const ENCODING *NS() XmlGetUtf8InternalEncoding (void)
const ENCODING *NS() XmlGetUtf16InternalEncoding (void)
static const ENCODING *const NS (encodings)[]
static int PTRCALL NS() initScanProlog (const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr)
static int PTRCALL 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 **versionEndPtr, const char **encodingName, const ENCODING **encoding, int *standalone)

Define Documentation

#define ENCODING_MAX   128

Function Documentation

static const ENCODING* NS() findEncoding ( const ENCODING *  enc,
const char *  ptr,
const char *  end 
) [static]

Definition at line 65 of file xmltok_ns.c.

{
#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];
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int PTRCALL NS() initScanContent ( const ENCODING *  enc,
const char *  ptr,
const char *  end,
const char **  nextTokPtr 
) [static]

Definition at line 41 of file xmltok_ns.c.

{
  return initScan(NS(encodings), (const INIT_ENCODING *)enc,
                  XML_CONTENT_STATE, ptr, end, nextTokPtr);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int PTRCALL NS() initScanProlog ( const ENCODING *  enc,
const char *  ptr,
const char *  end,
const char **  nextTokPtr 
) [static]

Definition at line 33 of file xmltok_ns.c.

{
  return initScan(NS(encodings), (const INIT_ENCODING *)enc,
                  XML_PROLOG_STATE, ptr, end, nextTokPtr);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static const ENCODING* const NS ( encodings  ) [static]

Here is the caller graph for this function:

Definition at line 8 of file xmltok_ns.c.

{
#if BYTEORDER == 1234
  return &ns(internal_little2_encoding).enc;
#elif BYTEORDER == 4321
  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
}

Definition at line 2 of file xmltok_ns.c.

{
  return &ns(internal_utf8_encoding).enc;
}
int NS() XmlInitEncoding ( INIT_ENCODING p,
const ENCODING **  encPtr,
const char *  name 
)

Definition at line 49 of file xmltok_ns.c.

{
  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;
}

Here is the call graph for this function:

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 
)

Definition at line 84 of file xmltok_ns.c.

{
  return doParseXmlDecl(NS(findEncoding),
                        isGeneralTextEntity,
                        enc,
                        ptr,
                        end,
                        badPtr,
                        versionPtr,
                        versionEndPtr,
                        encodingName,
                        encoding,
                        standalone);
}

Here is the call graph for this function: