Roxen.git / server / etc / modules / RXML.pmod / utils.pmod

version» Context lines:

Roxen.git/server/etc/modules/RXML.pmod/utils.pmod:1:   //! Things that belong elsewhere but can't lie there for various silly   //! reasons. Everything here is considered internal and not part of   //! the RXML.pmod API.   //!   //! E.g. one reason is to avoid circular references in the parser   //! objects when the callbacks are defined in them.   //!   //! Created 2000-01-21 by Martin Stjernholm   //! - //! $Id: utils.pmod,v 1.15 2001/03/01 03:12:57 mast Exp $ + //! $Id: utils.pmod,v 1.16 2001/03/13 20:35:18 mast Exp $         array return_zero (mixed... ignored) {return 0;}   array return_empty_array (mixed... ignored) {return ({});}      int(1..1)|string|array free_text_error (Parser.HTML p, string str)   {    sscanf (str, "%[ \t\n\r]", string ws);    if (str != ws) {    sscanf (reverse (str), "%*[ \t\n\r]%s", str);
Roxen.git/server/etc/modules/RXML.pmod/utils.pmod:66:   int(1..1)|string|array p_xml_entity_cb (Parser.HTML p, string str)   {    string entity = p->tag_name();    if (sizeof (entity)) {    if (entity[0] != '#')    return p->handle_var (entity,    p->html_context() == "splice_arg" ?    // No quoting of splice args. FIXME: Add    // some sort of safeguard against splicing    // in things like "nice><evil stuff='...'"? -  RXML.t_text : +  RXML.t_plain :    p->type);    if (!p->type->entity_syntax) {    // Don't decode normal entities if we're outputting xml-like stuff.    if (!p->type->free_text)    RXML.parse_error ("Unknown entity &%s; not allowed in this context.\n", entity);    if (sscanf (entity,    (<"#x", "#X">)[entity[..1]] ? "%*2s%x%*c" : "%*c%d%*c",    int char) == 2)    catch {return ({(string) ({char})});};    // Lax error handling: Just let it through if it can't be
Roxen.git/server/etc/modules/RXML.pmod/utils.pmod:94:      int(1..1)|string|array p_xml_compat_entity_cb (Parser.HTML p, string str)   {    string entity = p->tag_name();    if (sizeof (entity) && entity[0] != '#')    return p->handle_var (entity,    p->html_context() == "splice_arg" ?    // No quoting of splice args. FIXME: Add    // some sort of safeguard against splicing    // in things like "nice><evil stuff='...'"? -  RXML.t_text : +  RXML.t_plain :    p->type);    if (!p->type->free_text)    RXML.parse_error ("Unknown entity &%s; not allowed in this context.\n", entity);    return 0;   }