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.29 2002/04/03 12:02:04 mast Exp $ + //! $Id: utils.pmod,v 1.30 2002/07/16 09:24:11 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, void|int length)
Roxen.git/server/etc/modules/RXML.pmod/utils.pmod:33:    for (int i = 0; i < sizeof (val);) {    format_val (val[i]);    if (++i < sizeof (val)) res += ", ";    if (sizeof (res) >= length) throw (0);    }    res += end;    }    else if (mappingp (val)) {    res += "([";    if (sizeof (res) >= length) throw (0); -  array ind = sort (indices (val)); +  array ind = indices (val); +  catch (ind = sort (ind)); // sort might fail if there are objects without `< or `>.    for (int i = 0; i < sizeof (ind);) {    format_val (ind[i]);    res += ": ";    if (sizeof (res) >= length) throw (0);    format_val (val[ind[i]]);    if (++i < sizeof (ind)) res += ", ";    if (sizeof (res) >= length) throw (0);    }    res += "])";    }