Branch: Tag:

2008-02-14

2008-02-14 22:13:16 by Martin Stjernholm <mast@lysator.liu.se>

Fixed _sprintf in some classes that are commonly inherited to show the
actual class name.

Rev: server/etc/modules/RXML.pmod/module.pmod:1.363

2:   //   // Created 1999-07-30 by Martin Stjernholm.   // - // $Id: module.pmod,v 1.362 2007/05/29 13:12:37 mast Exp $ + // $Id: module.pmod,v 1.363 2008/02/14 22:13:16 mast Exp $      // Kludge: Must use "RXML.refs" somewhere for the whole module to be   // loaded correctly.
530:    string _sprintf (void|int flag)    {    return flag == 'O' && -  ("RXML.Tag(" + [string] this_object()->name + +  ((function_name (object_program (this)) || "RXML.Tag") + +  "(" + [string] this->name +    (this->plugin_name ? "#" + [string] this->plugin_name : "") +    ([int] this->flags & FLAG_PROC_INSTR ? " [PI]" : "") + ")" +    OBJ_COUNT);
664: Inside #if defined(MODULE_DEBUG)
   name_, owner_);   #ifdef MODULE_DEBUG    array bt = backtrace(); -  report_debug (describe_backtrace (bt[sizeof (bt) - 6..])); +  report_debug (describe_backtrace (bt/*[sizeof (bt) - 6..]*/));   #endif    }   
1265:    string _sprintf (void|int flag)    {    if (flag != 'O') return 0; -  return "RXML.TagSet(" + +  return (function_name (object_program (this)) || "RXML.TagSet") + +  "(" +    // No, the owner isn't written unambiguously; we try to be brief here.    (string) (owner && (owner->is_module ?    owner->module_local_id() :
1426:    //! good reasons; the backtrace easily just becomes confusing    //! instead.    -  string _sprintf (void|int flag) {return flag == 'O' && "RXML.Value()";} +  string _sprintf (void|int flag) +  { +  return flag == 'O' && +  ((function_name (object_program (this)) || "RXML.Value") + "()");    } -  + }      class Scope   //! Interface for objects that emulate a scope mapping.
1525:    else return "";    }    -  string _sprintf (void|int flag) {return flag == 'O' && "RXML.Scope()";} +  string _sprintf (void|int flag) +  { +  return flag == 'O' && +  ((function_name (object_program (this)) || "RXML.Scope") + "()");    } -  + }      mapping(string:mixed) scope_to_mapping (SCOPE_TYPE scope,    void|Context ctx,
2516:       string _sprintf (int flag)    { -  return flag == 'O' && ("RXML.Context()" + OBJ_COUNT); +  return flag == 'O' && +  ((function_name (object_program (this)) || "RXML.Context") + +  "()" + OBJ_COUNT);    }      #ifdef MODULE_DEBUG
4865:    string _sprintf (void|int flag)    {    return flag == 'O' && -  ("RXML.Frame(" + (tag && [string] tag->name) + ")" + OBJ_COUNT); +  ((function_name (object_program (this)) || "RXML.Frame") + +  "(" + (tag && [string] tag->name) + ")" + OBJ_COUNT);    }   }   
5562:       string _sprintf (void|int flag)    { -  return flag == 'O' && sprintf ("RXML.Parser(%O)%s", type, OBJ_COUNT); +  return flag == 'O' && +  sprintf ("%s(%O)%s", +  function_name (object_program (this)) || "RXML.Parser", +  type, OBJ_COUNT);    }   }