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.140 2000/09/10 17:24:00 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.141 2000/10/04 05:12:13 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:48:    * T_ARRAY <data type>    * mappings are followed by two arguments, the first is the type    * for the indices, and the second is the type of the data, ie:    * T_MAPPING <indice type> <data type>    * 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 +  * PIKE_T_UNKNOWN only matches T_MIXED and PIKE_T_UNKNOWN    * objects are coded thus:    * T_OBJECT <0/1> <program_id>    * ^    * 0 means 'implements'    * 1 means 'is' (aka 'clone of')    * Integers are encoded as:    * T_INT <min> <max>    * Everything except T_VOID matches T_ZERO.    */   
pike.git/src/pike_types.c:183:    case '7':    case '8':    case '9':    case T_FLOAT:    case T_STRING:    case T_TYPE:    case T_PROGRAM:    case T_MIXED:    case T_VOID:    case T_ZERO: -  case T_UNKNOWN: +  case PIKE_T_UNKNOWN:    break;       case T_INT:    t+=sizeof(INT32)*2;    break;       case T_OBJECT:    t++;    t+=sizeof(INT32);    break;
pike.git/src/pike_types.c:588:    ++*s;    }else{    push_type(T_MIXED);    }    push_type(T_MULTISET);    break;    }    goto bad_type;       case 'u': -  if(!strcmp(buf,"unknown")) { push_type(T_UNKNOWN); break; } +  if(!strcmp(buf,"unknown")) { push_type(PIKE_T_UNKNOWN); break; }    goto bad_type;       case 'a':    if(!strcmp(buf,"array"))    {    while(ISSPACE(**s)) ++*s;    if(**s == '(')    {    ++*s;    internal_parse_type(_s);
pike.git/src/pike_types.c:789: Inside #if defined(PIKE_DEBUG)
   printf("object(%s %ld)",    EXTRACT_UCHAR(a+e+1)?"is":"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 PIKE_T_UNKNOWN: printf("unknown"); break;    case T_MANY: printf("many"); break;    case T_OR: printf("or"); break;    case T_AND: printf("and"); break;    case T_NOT: printf("not"); break;    case T_VOID: printf("void"); break;    case T_ZERO: printf("zero"); break;    case T_MIXED: printf("mixed"); break;       default: printf("%d",EXTRACT_UCHAR(a+e)); break;    }
pike.git/src/pike_types.c:846:    my_putchar('[');    t = low_describe_type(t);    my_putchar(',');    t = low_describe_type(t);    my_putchar(']');    break;       case T_VOID: my_strcat("void"); break;    case T_ZERO: my_strcat("zero"); break;    case T_MIXED: my_strcat("mixed"); break; -  case T_UNKNOWN: my_strcat("unknown"); break; +  case PIKE_T_UNKNOWN: my_strcat("unknown"); break;    case T_INT:    {    INT32 min=extract_type_int(t);    INT32 max=extract_type_int(t+sizeof(INT32));    my_strcat("int");       if(min!=MIN_INT32 || max!=MAX_INT32)    {    char buffer[100];    sprintf(buffer,"(%ld..%ld)",(long)min,(long)max);