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.26 2001/06/29 00:21:06 mast Exp $ + //! $Id: utils.pmod,v 1.27 2001/07/09 04:03:03 mast Exp $      constant is_RXML_encodable = 1;    -  + #ifdef RXML_ENCODE_DEBUG + string _sprintf() {return "RXML.utils.pmod";} + #endif +    constant short_format_length = 40;      final string format_short (mixed val)   // This one belongs somewhere else..   {    string res = "";       void format_val (mixed val)    {    if (arrayp (val) || multisetp (val)) {
Roxen.git/server/etc/modules/RXML.pmod/utils.pmod:30:    if (++i < sizeof (val)) res += ", ";    if (sizeof (res) >= short_format_length) throw (0);    }    res += end;    }    else if (mappingp (val)) {    res += "([";    if (sizeof (res) >= short_format_length) throw (0);    array ind = sort (indices (val));    for (int i = 0; i < sizeof (ind);) { -  format_val (ind[i]) + ": "; +  format_val (ind[i]); +  res += ": ";    if (sizeof (res) >= short_format_length) throw (0);    format_val (val[ind[i]]);    if (++i < sizeof (ind)) res += ", ";    if (sizeof (res) >= short_format_length) throw (0);    }    res += "])";    }    else {    if (stringp (val) && sizeof (val) > short_format_length - sizeof (res)) {    sscanf (val, "%[ \t\n\r]", string lead);