pike.git / src / lex.c

version» Context lines:

pike.git/src/lex.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: lex.c,v 1.35 1997/12/23 06:26:07 hubbe Exp $"); + RCSID("$Id: lex.c,v 1.36 1998/01/02 01:05:47 hubbe Exp $");   #include "language.h"   #include "array.h"   #include "lex.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "constants.h"   #include "hashtable.h"   #include "stuff.h"   #include "pike_memory.h"   #include "interpret.h"
pike.git/src/lex.c:45:   INT32 nexpands;   int pragma_all_inline; /* inline all possible inlines */      struct pike_predef_s   {    char *name;    char *value;    struct pike_predef_s *next;   };    - struct pike_predef_s *pike_predefs=0; + static struct pike_predef_s *pike_predefs=0;      static int calc(void);   static void calc1(void);      void exit_lex(void)   {   #ifdef DEBUG    if(p_flag)    {    int e;
pike.git/src/lex.c:790:   {    if(magic)    {    add_define(make_shared_string(name),-1,0,magic);    }else{    push_string(make_shared_string(as));    add_define(make_shared_string(name),-1,1,magic);    }   }    - void free_one_define(struct hash_entry *h) + static void free_one_define(struct hash_entry *h)   {    struct define *d;    d=BASEOF(h, define, link);    if(d->parts) free_array(d->parts);    free((void *)d);   }      static void free_all_defines(void)   {    if(defines)
pike.git/src/lex.c:2188:    check_destructed(sp-1);    ret=!IS_ZERO(sp-1);    pop_stack();    }    UNSETJMP(recovery);       return ret;   }      /*** Magic defines ***/ - void insert_current_line(void) + static void insert_current_line(void)   {    char buf[20];    sprintf(buf," %ld ",(long)current_line);    UNGETSTR(buf,strlen(buf));   }    - void insert_current_file_as_string(void) + static void insert_current_file_as_string(void)   {    UNGETSTR("\"",1);    UNGETSTR(current_file->str, current_file->len);    UNGETSTR("\"",1);   }    - void insert_current_time_as_string(void) + static void insert_current_time_as_string(void)   {    time_t tmp;    char *buf;    time(&tmp);    buf=ctime(&tmp);       UNGETSTR("\"",1);    UNGETSTR(buf+11, 8);    UNGETSTR("\"",1);   }    - void insert_current_date_as_string(void) + static void insert_current_date_as_string(void)   {    time_t tmp;    char *buf;    time(&tmp);    buf=ctime(&tmp);       UNGETSTR("\"",1);    UNGETSTR(buf+19, 5);    UNGETSTR(buf+4, 6);    UNGETSTR("\"",1);
pike.git/src/lex.c:2287:    current_file=0;    }       free_inputstate(istate);    istate=NULL;    free_all_defines();    total_lines+=current_line-old_line;   }       + #if 0   void add_predefine(char *s)   {    char buffer1[100],buffer2[10000];    struct pike_predef_s *tmp;       if(sscanf(s,"%[^=]=%[ -~=]",buffer1,buffer2) ==2)    {    s=buffer1;    }else{    buffer2[0]='1';    buffer2[1]=0;    }    tmp=ALLOC_STRUCT(pike_predef_s);    tmp->name=(char *)xalloc(strlen(s)+1);    strcpy(tmp->name,s);    tmp->value=(char *)xalloc(strlen(buffer2)+1);    strcpy(tmp->value,buffer2);    tmp->next=pike_predefs;    pike_predefs=tmp;   } -  + #endif