pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:18:   #include "pike_error.h"   #include "operators.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "fsort.h"   #include "threads.h"   #include "stuff.h"   #include "version.h"   #include "bignum.h"    - RCSID("$Id: encode.c,v 1.95 2001/03/29 02:54:10 per Exp $"); + RCSID("$Id: encode.c,v 1.96 2001/04/09 10:01:49 hubbe Exp $");      /* #define ENCODE_DEBUG */      #ifdef ENCODE_DEBUG   #define EDB(X) X   #else   #define EDB(X)   #endif      /* The sp macro conflicts with Solaris 2.5.1's <sys/conf.h>. */
pike.git/src/encode.c:754:    Pike_error("Canonical encoding of programs not supported.\n");    check_stack(1);    push_svalue(val);    apply(data->codec,"nameof", 1);    if(Pike_sp[-1].type == val->type)    Pike_error("Error in master()->nameof(), same type returned.\n");    if(Pike_sp[-1].type == T_INT && Pike_sp[-1].subtype == NUMBER_UNDEFINED)    {    INT32 e;    struct program *p=val->u.program; +  if( (p->flags & PROGRAM_HAS_C_METHODS) || p->event_handler ) +  { +  if(p->parent) +  { +  /* We have to remove ourself from the cache for now */ +  struct svalue tmp=data->counter; +  tmp.u.integer--; +  map_delete(data->encoded, val); +  +  code_entry(type_to_tag(val->type), 2,data); +  ref_push_program(p->parent); +  encode_value2(Pike_sp-1,data); +  +  ref_push_program(p); +  f_function_name(1); +  if(Pike_sp[-1].type == PIKE_T_INT) +  Pike_error("Cannot encode C programs.\n"); +  encode_value2(Pike_sp-1, data); +  +  pop_n_elems(3); +  +  /* Put value back in cache */ +  mapping_insert(data->encoded, val, &tmp); +  return; +  }    if( p->event_handler )    Pike_error("Cannot encode programs with event handlers.\n"); -  if( (p->flags & PROGRAM_HAS_C_METHODS) ) +     Pike_error("Cannot encode C programs.\n"); -  +  }    code_entry(type_to_tag(val->type), 1,data);    f_version(0);    encode_value2(Pike_sp-1,data);    pop_stack();    code_number(p->flags,data);    code_number(p->storage_needed,data);    code_number(p->alignment_needed,data);    code_number(p->timestamp.tv_sec,data);    code_number(p->timestamp.tv_usec,data);   
pike.git/src/encode.c:1873:    check_program(p);   #endif /* PIKE_DEBUG */      #ifdef _REENTRANT    UNSET_ONERROR(err);    exit_threads_disable(NULL);   #endif    return;    }    +  case 2: +  tmp=data->counter; +  data->counter.u.integer++; +  decode_value2(data); +  decode_value2(data); +  if(Pike_sp[-2].type==T_INT) +  { +  pop_stack(); +  }else{ +  f_arrow(2); +  } +  if(data->pickyness && Pike_sp[-1].type != T_PROGRAM) +  Pike_error("Failed to decode program.\n"); +  break; +     default:    Pike_error("Cannot decode program encoding type %d\n",num);    }    break;       default:    Pike_error("Failed to restore string. (Illegal type)\n");    }       mapping_insert(data->decoded, & tmp, Pike_sp-1);