Branch: Tag:

2007-03-30

2007-03-30 12:47:25 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Attempt to lookup the name of the programs that objects implement.

Rev: src/pike_types.c:1.270

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: pike_types.c,v 1.269 2007/03/29 15:53:55 grubba Exp $ + || $Id: pike_types.c,v 1.270 2007/03/30 12:47:25 grubba Exp $   */      #include "global.h"
1913:    case T_OBJECT:    if (t->cdr)    { +  struct svalue s; +  if (t->car) { +  my_strcat("object(is "); +  } else { +  my_strcat("object(implements "); +  } +  if ((s.u.program = id_to_program(CDR_TO_INT(t)))) { +  s.type = T_PROGRAM; +  s.subtype = 0; +  describe_svalue(&s, 0, NULL); +  my_strcat(")"); +  } else {    char buffer[100]; -  sprintf(buffer,"object(%s %"PRINTPTRDIFFT"d)", -  t->car?"is":"implements", +  sprintf(buffer,"%"PRINTPTRDIFFT"d)",    CDR_TO_INT(t));    my_strcat(buffer); -  +  }    }else{    my_strcat("object");    }