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.88 1999/12/11 19:24:38 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.89 1999/12/11 23:37:29 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:48:    * multiset works similarly to arrays.    * functions are _very_ special:    * they are coded like this:    * T_FUNCTION <arg type> <arg type> ... <arg type> T_MANY <arg type> <return type>    * note that the type after T_MANY can be T_VOID    * T_MIXED matches anything except T_VOID    * T_UNKNOWN only matches T_MIXED and T_UNKNOWN    * objects are coded thus:    * T_OBJECT <0/1> <program_id>    * ^ -  * 0 means 'inherits' -  * 1 means 'is' +  * 0 means 'implements' +  * 1 means 'inherits'    * Integers are encoded as:    * T_INT <min> <max>    * Everything except T_VOID matches T_ZERO.    */      struct pike_string *string_type_string;   struct pike_string *int_type_string;   struct pike_string *float_type_string;   struct pike_string *function_type_string;   struct pike_string *object_type_string;
pike.git/src/pike_types.c:760: Inside #if defined(PIKE_DEBUG)
   printf("(%ld..%ld)",(long)min,(long)max);    e+=sizeof(INT32)*2;    break;    }    case T_FLOAT: printf("float"); break;    case T_STRING: printf("string"); break;    case T_TYPE: printf("type"); break;    case T_PROGRAM: printf("program"); break;    case T_OBJECT:    printf("object(%s %ld)", -  EXTRACT_UCHAR(a+e+1)?"clone of":"inherits", +  EXTRACT_UCHAR(a+e+1)?"inherits":"implements",    (long)extract_type_int(a+e+2));    e+=sizeof(INT32)+1;    break;    case T_FUNCTION: printf("function"); break;    case T_ARRAY: printf("array"); break;    case T_MAPPING: printf("mapping"); break;    case T_MULTISET: printf("multiset"); break;       case T_UNKNOWN: printf("unknown"); break;    case T_MANY: printf("many"); break;
pike.git/src/pike_types.c:849:    t+=sizeof(INT32)*2;       break;    }    case T_FLOAT: my_strcat("float"); break;    case T_PROGRAM: my_strcat("program"); break;    case T_OBJECT:    if(extract_type_int(t+1))    {    char buffer[100]; -  sprintf(buffer,"object(%s %ld)",*t?"is":"implements",(long)extract_type_int(t+1)); +  sprintf(buffer,"object(%s %ld)",*t?"inherits":"implements", +  (long)extract_type_int(t+1));    my_strcat(buffer);    }else{    my_strcat("object");    }       t+=sizeof(INT32)+1;    /* Prog id */    break;    case T_STRING: my_strcat("string"); break;    case T_TYPE: my_strcat("type"); break;