pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: pike_types.c,v 1.109 1999/12/21 20:40:12 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.110 1999/12/22 00:13:03 grubba 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:3285:    fatal("Completely failed to zzap function return!\n");    }       default:    type_stack_mark();    push_type(s->type);    return pop_unfinished_type();    }   }    + static struct pike_string *low_object_type_to_program_type(char *obj_t) + { +  struct pike_string *res = NULL; +  struct pike_string *sub; +  struct svalue sval; +  int id; +  +  while(EXTRACT_UCHAR(obj_t) == T_OR) { +  obj_t++; +  sub = low_object_type_to_program_type(obj_t); +  if (!sub) { +  if (res) { +  free_string(res); +  } +  return NULL; +  } +  if (res) { +  struct pike_string *tmp = or_pike_types(res, sub, 1); +  free_string(res); +  free_string(sub); +  res = tmp; +  } else { +  res = sub; +  } +  obj_t += type_length(obj_t); +  } +  sval.type = T_PROGRAM; +  if ((EXTRACT_UCHAR(obj_t) != T_OBJECT) || +  (!(id = extract_type_int(obj_t + 2))) || +  (!(sval.u.program = id_to_program(id))) || +  (!(sub = get_type_of_svalue(&sval)))) { +  if (res) { +  free_string(res); +  } +  return NULL; +  } +  if (res) { +  struct pike_string *tmp = or_pike_types(res, sub, 1); +  free_string(res); +  free_string(sub); +  return tmp; +  } +  return sub; + } +  + /* Used by fix_object_program_type() */ + struct pike_string *object_type_to_program_type(struct pike_string *obj_t) + { +  return low_object_type_to_program_type(obj_t->str); + } +    char *get_name_of_type(int t)   {    switch(t)    {    case T_ARRAY: return "array";    case T_FLOAT: return "float";    case T_FUNCTION: return "function";    case T_INT: return "int";    case T_LVALUE: return "lvalue";    case T_MAPPING: return "mapping";