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.38 1998/04/10 22:24:21 hubbe Exp $"); + RCSID("$Id: pike_types.c,v 1.39 1998/04/14 22:10:49 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:638:    my_putchar(')');    break;       case T_VOID: my_strcat("void"); break;    case T_MIXED: my_strcat("mixed"); break;    case T_UNKNOWN: my_strcat("unknown"); break;    case T_INT: my_strcat("int"); break;    case T_FLOAT: my_strcat("float"); break;    case T_PROGRAM: my_strcat("program"); break;    case T_OBJECT: +  if(EXTRACT_INT(t+1)) +  { +  char buffer[100]; +  sprintf(buffer,"object(%s %ld)",*t?"is":"implements",(long)EXTRACT_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_FUNCTION:    {    int s;    my_strcat("function(");    s=0;
pike.git/src/pike_types.c:849:      static struct pike_string *low_object_fun_type(char *t,    struct pike_string *tmp)   {    struct program *p;    int i;    p=id_to_program(EXTRACT_INT(t+2));    if(!p) return 0;    i=FIND_LFUN(p, LFUN_CALL);    -  if(EXTRACT_UCHAR(t+1) || -  (p->identifier_references[i].id_flags & ID_NOMASK) || -  (ID_FROM_INT(p, i)->identifier_flags & IDENTIFIER_PROTOTYPED)) +     return ID_FROM_INT(p, i)->type; -  -  return 0; +    }      static struct pike_string *low_object_lfun_type(char *t, short lfun)   {    struct program *p;    int i;    p=id_to_program(EXTRACT_INT(t+2));    if(!p) return 0;    i=FIND_LFUN(p, LFUN_CALL);    -  if(EXTRACT_UCHAR(t+1) || -  (p->identifier_references[i].id_flags & ID_NOMASK) || -  (ID_FROM_INT(p, i)->identifier_flags & IDENTIFIER_PROTOTYPED)) +     return ID_FROM_INT(p, i)->type; -  -  return 0; +    }      #define A_EXACT 1   #define B_EXACT 2   #define NO_MAX_ARGS 4      /*    * match two type strings, return zero if they don't match, and return    * the part of 'a' that _did_ match if it did.    */
pike.git/src/pike_types.c:1083:       {    struct program *ap,*bp;    ap=id_to_program(EXTRACT_UCHAR(a+2));    bp=id_to_program(EXTRACT_UCHAR(b+2));       if(!ap || !bp) break;       if(EXTRACT_UCHAR(a+1))    { -  if(low_get_storage(bp,ap)==-1) +  if(!implements(ap,bp))    return 0;    }else{ -  if(low_get_storage(ap,bp)==-1) +  if(!implements(bp,ap))    return 0;    }    }       break;       case T_MULTISET:    case T_ARRAY:    if(!low_match_types(++a,++b,flags)) return 0;