pike.git / src / main.c

version» Context lines:

pike.git/src/main.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: main.c,v 1.45 1998/04/01 14:26:51 grubba Exp $"); + RCSID("$Id: main.c,v 1.46 1998/04/06 04:27:06 hubbe Exp $");   #include "fdlib.h"   #include "backend.h"   #include "module.h"   #include "object.h"   #include "lex.h"   #include "pike_types.h"   #include "builtin_functions.h"   #include "array.h"   #include "stralloc.h"   #include "interpret.h"
pike.git/src/main.c:43:   char *master_file;   char **ARGV;      int debug_options=0;   int d_flag=0;   int c_flag=0;   int t_flag=0;   int a_flag=0;   int l_flag=0;   int p_flag=0; + static long instructions_left;    -  + static void time_to_exit(struct callback *cb,void *tmp,void *ignored) + { +  if(instructions_left-- < 0) +  { +  push_int(0); +  f_exit(1); +  } + } +    static struct callback_list post_master_callbacks;      struct callback *add_post_master_callback(callback_func call,    void *arg,    callback_func free_func)   {    return add_to_callback(&post_master_callbacks, call, arg, free_func);   }      
pike.git/src/main.c:180:    stack_size=STRTOL(p+1,&p,0);    p+=strlen(p);       if(stack_size < 256)    {    fprintf(stderr,"Stack size must at least be 256.\n");    exit(1);    }    break;    +  case 'q': +  if(!p[1]) +  { +  e++; +  if(e >= argc) +  { +  fprintf(stderr,"Missing argument to -q\n"); +  exit(1); +  } +  p=argv[e]; +  } +  instructions_left=STRTOL(p+1,&p,0); +  p+=strlen(p); +  add_to_callback(&evaluator_callbacks, +  time_to_exit, +  0,0); +  +  break; +     case 'd':    more_d_flags:    switch(p[1])    {    case '0': case '1': case '2': case '3': case '4':    case '5': case '6': case '7': case '8': case '9':    d_flag+=STRTOL(p+1,&p,10);    break;       case 's':
pike.git/src/main.c:435: Inside #if defined(DEBUG) && defined(DEBUG_MALLOC)
         count_memory_in_programs(&num, &size);    if(num)    fprintf(stderr,"Programs left: %d (%d bytes)\n",num,size);       {    struct program *p;    for(p=first_program;p;p=p->next)    { -  describe_something(p, T_PROGRAM); +  describe_something(p, T_PROGRAM, 1);    }    }          count_memory_in_objects(&num, &size);    if(num)    fprintf(stderr,"Objects left: %d (%d bytes)\n",num,size);       cleanup_shared_string_table();    }   #else       zap_all_arrays();    zap_all_mappings();       cleanup_shared_string_table();   #endif   }