Branch: Tag:

2002-11-22

2002-11-22 14:13:20 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Support for {en,de}coding of pike type name nodes.

Rev: src/encode.c:1.156

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: encode.c,v 1.155 2002/10/11 01:39:30 nilsson Exp $ + || $Id: encode.c,v 1.156 2002/11/22 14:13:20 grubba Exp $   */      #include "global.h"
27:   #include "bignum.h"   #include "pikecode.h"    - RCSID("$Id: encode.c,v 1.155 2002/10/11 01:39:30 nilsson Exp $"); + RCSID("$Id: encode.c,v 1.156 2002/11/22 14:13:20 grubba Exp $");      /* #define ENCODE_DEBUG */   
261:    if (t->type == T_MANY) {    addchar(T_FUNCTION);    addchar(T_MANY); -  } else if (t->type != PIKE_T_NAME) { +  } else {    addchar(t->type);    }    switch(t->type) {
272:    break;       case PIKE_T_NAME: -  /* Strip the name. */ +  { +  struct svalue sval; +  sval.type = PIKE_T_STRING; +  sval.subtype = 0; +  sval.u.string = (void *)t->car; +  +  encode_value2(&sval, encode_data); +  }    t=t->cdr;    goto one_more_type;   
1886:    push_type(tmp);    break;    +  case PIKE_T_NAME: +  decode_value2(data); +  +  if (Pike_sp[-1].type != PIKE_T_STRING) { +  Pike_error("decode_value(): Type name is not a string (%s)\n", +  get_name_of_type(Pike_sp[-1].type)); +  } +  low_decode_type(data); +  push_type_name(Pike_sp[-1].u.string); +  pop_stack(); +  break; +     case T_OBJECT:    {    int flag = GETC();