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.24 1997/08/21 00:47:42 hubbe Exp $"); + RCSID("$Id: pike_types.c,v 1.25 1997/08/30 18:35:51 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:67: Inside #if defined(DEBUG)
   if(debug_findstring(s) != s)    fatal("Type string not shared.\n");       if(type_length(s->str) != s->len)    fatal("Length of type is wrong.\n");   }   #else   #define CHECK_TYPE(X)   #endif    - void init_types() + 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");
pike.git/src/pike_types.c:138:   static unsigned char **mark_stackp=mark_stack;      void push_type(unsigned char tmp)   {    *type_stackp=tmp;    type_stackp++;    if(type_stackp > type_stack + sizeof(type_stack))    yyerror("Type stack overflow.");   }    - void type_stack_mark() + void type_stack_mark(void)   {    *mark_stackp=type_stackp;    mark_stackp++;    if(mark_stackp > mark_stack + NELEM(mark_stack))    yyerror("Type mark stack overflow.");   }    - INT32 pop_stack_mark() + INT32 pop_stack_mark(void)   {    mark_stackp--;    if(mark_stackp<mark_stack)    fatal("Type mark stack underflow\n");       return type_stackp - *mark_stackp;   }    - void pop_type_stack() + void pop_type_stack(void)   {    type_stackp--;    if(type_stackp<type_stack)    fatal("Type stack underflow\n");   }    - void type_stack_pop_to_mark() + void type_stack_pop_to_mark(void)   {    type_stackp-=pop_stack_mark();   #ifdef DEBUG    if(type_stackp<type_stack)    fatal("Type stack underflow\n");   #endif   }    - void reset_type_stack() + void reset_type_stack(void)   {    type_stack_pop_to_mark();    type_stack_mark();   }    - void type_stack_reverse() + void type_stack_reverse(void)   {    INT32 a;    a=pop_stack_mark();    reverse((char *)(type_stackp-a),a,1);   }      void push_type_int(unsigned INT32 i)   {    int e;    for(e=sizeof(i)-1;e>=0;e--)
pike.git/src/pike_types.c:205:    for(e--;e>=0;e--) push_type(s[e]);   }      void push_finished_type(struct pike_string *type)   {    int e;    CHECK_TYPE(type);    for(e=type->len-1;e>=0;e--) push_type(type->str[e]);   }    - struct pike_string *pop_unfinished_type() + struct pike_string *pop_unfinished_type(void)   {    int len,e;    struct pike_string *s;    len=pop_stack_mark();    s=begin_shared_string(len);    type_stackp-=len;    MEMCPY(s->str, type_stackp, len);    reverse(s->str, len, 1);    s=end_shared_string(s);    CHECK_TYPE(s);    return s;   }    - struct pike_string *pop_type() + struct pike_string *pop_type(void)   {    struct pike_string *s;    s=pop_unfinished_type();    type_stack_mark();    return s;   }      static void internal_parse_typeA(char **_s)   {    char buf[80];
pike.git/src/pike_types.c:1218:    case T_MAPPING: return "mapping";    case T_MULTISET: return "multiset";    case T_OBJECT: return "object";    case T_PROGRAM: return "program";    case T_STRING: return "string";    case T_VOID: return "void";    default: return "unknown";    }   }    - void cleanup_pike_types() + void cleanup_pike_types(void)   {    free_string(string_type_string);    free_string(int_type_string);    free_string(float_type_string);    free_string(function_type_string);    free_string(object_type_string);    free_string(program_type_string);    free_string(array_type_string);    free_string(multiset_type_string);    free_string(mapping_type_string);    free_string(mixed_type_string);    free_string(void_type_string);    free_string(any_type_string);   }