pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.c:1:   /*   || 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.199 2002/10/28 13:02:27 nilsson Exp $ + || $Id: pike_types.c,v 1.200 2002/11/21 15:12:01 marcus Exp $   */      #include "global.h" - RCSID("$Id: pike_types.c,v 1.199 2002/10/28 13:02:27 nilsson Exp $"); + RCSID("$Id: pike_types.c,v 1.200 2002/11/21 15:12:01 marcus Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"   #include "stralloc.h"   #include "stuff.h"   #include "array.h"   #include "program.h"   #include "constants.h"   #include "object.h"   #include "multiset.h"
pike.git/src/pike_types.c:4488:       case T_INT:    *cont = type_string + 9; /* 2*sizeof(INT32) + 1 */    return mk_type(T_INT,    (void *)(ptrdiff_t)extract_type_int(type_string+1),    (void *)(ptrdiff_t)extract_type_int(type_string+5), 0);    case T_OBJECT:    *cont = type_string + 6; /* 1 + sizeof(INT32) + 1 */    return mk_type(T_OBJECT, (void *)(ptrdiff_t)(type_string[1]),    (void *)(ptrdiff_t)extract_type_int(type_string+2), 0); +  case PIKE_T_NAME: +  { +  int size_shift = type_string[1]&127; +  struct pike_string *str; +  INT32 bytes; +  switch(size_shift) { +  case 0: +  bytes = strlen(type_string+2); +  break; +  case 1: +  for(bytes=0; ; bytes+=2) +  if(!type_string[bytes+3] && !type_string[bytes+2]) +  break; +  break; +  case 2: +  for(bytes=0; ; bytes+=4) +  if(!type_string[bytes+5] && !type_string[bytes+4] && +  !type_string[bytes+3] && !type_string[bytes+2]) +  break; +  break; +  } +  str = begin_wide_shared_string(bytes>>size_shift, size_shift); +  MEMCPY(str->str, type_string+2, bytes); +  return mk_type(PIKE_T_NAME, (void *)end_shared_string(str), +  low_make_pike_type(type_string + 2 + bytes + +  (1<<size_shift), cont), +  PT_COPY_CDR); +  }    default:    Pike_fatal("compile_type_string(): Error in type string %d.\n", type);    /* NOT_REACHED */    break;    }    /* NOT_REACHED */    return NULL;   }      /* Make a pike-type from a serialized (old-style) type. */