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.50 1999/02/10 21:46:48 hubbe Exp $"); + RCSID("$Id: pike_types.c,v 1.51 1999/02/12 01:15:50 hubbe 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:95: Inside #if defined(PIKE_DEBUG)
   if(type_length(s->str) != s->len)    {    stupid_describe_type(s->str,s->len);    fatal("Length of type is wrong. (should be %d, is %d)\n",type_length(s->str),s->len);    }   }   #endif      void init_types(void)   { -  string_type_string=parse_type("string"); -  int_type_string=parse_type("int"); -  object_type_string=parse_type("object"); -  program_type_string=parse_type("program"); -  float_type_string=parse_type("float"); -  mixed_type_string=parse_type("mixed"); -  array_type_string=parse_type("array"); -  multiset_type_string=parse_type("multiset"); -  mapping_type_string=parse_type("mapping"); -  function_type_string=parse_type("function"); -  void_type_string=parse_type("void"); -  any_type_string=parse_type("void|mixed"); + #define CONSTTYPE(X) make_shared_binary_string(X,CONSTANT_STRLEN(X)) +  string_type_string = CONSTTYPE(tString); +  int_type_string = CONSTTYPE(tInt); +  object_type_string = CONSTTYPE(tObj); +  float_type_string = CONSTTYPE(tFloat); +  mixed_type_string=CONSTTYPE(tMix); +  array_type_string=CONSTTYPE(tArray); +  multiset_type_string=CONSTTYPE(tMultiset); +  mapping_type_string=CONSTTYPE(tMapping); +  function_type_string=CONSTTYPE(tFunction); +  void_type_string=CONSTTYPE(tVoid); +  any_type_string=CONSTTYPE(tOr(tVoid,tMix));   }      static int type_length(char *t)   {    char *q=t;   one_more_type:    switch(EXTRACT_UCHAR(t++))    {    default:    fatal("error in type string %d.\n",EXTRACT_UCHAR(t-1));