Branch: Tag:

1998-04-06

1998-04-06 04:27:06 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

new option -q<instructions before forced exit>

Rev: src/main.c:1.46

4:   ||| 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"
50:   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,
187:    }    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])
442: Inside #if defined(DEBUG) && defined(DEBUG_MALLOC)
   struct program *p;    for(p=first_program;p;p=p->next)    { -  describe_something(p, T_PROGRAM); +  describe_something(p, T_PROGRAM, 1);    }    }