Example #1
0
/* @method String XmlReader.getQuoteChar() */
METHOD XmlReader_getQuoteChar(Ctx *ctx, knh_sfp_t *sfp)
{
    xmlTextReaderPtr reader = (xmlTextReaderPtr) p_cptr(sfp[0]);
    int num = xmlTextReaderQuoteChar(reader);
    char* ret = " ";
    if(num == 34){
        ret[0] = '"';
    } else {
        ret[0] = '\0';
    }
    KNH_RETURN(ctx,sfp,new_String(ctx,B(ret),NULL));
}
Example #2
0
//## @Native String XmlReader.getQuoteChar();
static KMETHOD XmlReader_getQuoteChar(KonohaContext *kctx, KonohaStack *sfp)
{
	xmlTextReaderPtr reader = getRawXmlReader(sfp[0]);
	char buf[4] = {0};
	const char* ret = NULL;
	if(reader != NULL) {
		int ch = xmlTextReaderQuoteChar(reader);
		buf[0] = ch;
		ret = (const char *)buf;
	}
	KReturn(KLIB new_kString(kctx, GcUnsafe, ret, strlen(ret), 0));
}
Example #3
0
/* reader:quote_char() */
static int xmlreader_quote_char(lua_State *L) {
  xmlreader xr = check_xmlreader(L, 1);

  int ret = xmlTextReaderQuoteChar(xr);
  if (ret != -1) {
    lua_pushfstring(L, "%c", ret);
    return 1;
  } else {
    lua_pushnil(L);
    xmlreader_pusherror(L);
    return 2;
  }
}
Example #4
0
/*
 * call-seq:
 *    reader.quote_char -> char
 *
 * Get the quotation mark character used to enclose the value of an attribute,
 * as an integer value (and -1 in case of error).
 */
static VALUE rxml_reader_quote_char(VALUE self)
{
  return INT2FIX(xmlTextReaderQuoteChar(rxml_text_reader_get(self)));
}
Example #5
0
/*
 * call-seq:
 *    reader.quote_char -> char
 *
 * Get the quotation mark character used to enclose the value of an attribute,
 * as an integer value (and -1 in case of error).
 */
static VALUE rxml_reader_quote_char(VALUE self)
{
  xmlTextReaderPtr xreader = rxml_text_reader_get(self);
  return INT2FIX(xmlTextReaderQuoteChar(xreader));
}