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.   //!   //! 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.8 2000/03/04 19:08:41 mast Exp $ + //! $Id: utils.pmod,v 1.9 2000/03/06 13:02:17 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:33:   {    if (p->errmsgs) str = p->errmsgs + str, p->errmsgs = 0;    if (p->type->free_text) p->_set_data_callback (0);    else p->_set_data_callback (free_text_error);    return ({str});   }         // PXml and PEnt callbacks.    + int(1..1)|string|array p_xml_comment_cb (Parser.HTML p, string str) + // FIXME: This is a kludge until quote tags are handled like other tags. + { +  string name; +  sscanf (str, "%[^\t\n\r ]%s", name, str); +  if (sizeof (name)) { +  name = p->tag_name() + name; +  if (string|array|function tdef = p->tags()[name]) { +  if (stringp (tdef)) +  return ({tdef}); +  else if (arrayp (tdef)) +  return tdef[0] (p, p->parse_tag_args (str), @tdef[1..]); +  else +  return tdef (p, p->parse_tag_args (str)); +  } +  else if (p->containers()[name]) +  RXML.parse_error ("Sorry, can't handle containers beginning with " + +  p->tag_name() + ".\n"); +  } +  return p->type->free_text ? 0 : ({}); + } +    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='...'"?