예제 #1
0
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;
}
예제 #2
0
int
NS(xmlrpc_XmlInitEncoding)(INIT_ENCODING *   const p,
                           const ENCODING ** const encPP,
                           const char *      const name) {

    int const index = getEncodingIndex(name);

    int retval;

    if (index == UNKNOWN_ENC)
        retval = 0;
    else {
        SET_INIT_ENC_INDEX(p, index);
        p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog);
        p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent);
        p->initEnc.updatePosition = initUpdatePosition;
        p->encPtr = encPP;
        *encPP = &(p->initEnc);

        retval = 1;
    }
    return retval;
}