pike.git / src / main.c

version» Context lines:

pike.git/src/main.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: main.c,v 1.221 2005/01/01 14:35:45 grubba Exp $ + || $Id: main.c,v 1.222 2005/01/01 17:35:54 grubba Exp $   */      #include "global.h"   #include "fdlib.h"   #include "backend.h"   #include "module.h"   #include "object.h"   #include "lex.h"   #include "pike_types.h"   #include "builtin_functions.h"
pike.git/src/main.c:231: Inside #if defined(LIBPIKE)
   /* Not likely to happen as long as MASTER_COOKIE is longer than "pike.so".    */    fprintf(stderr, "Too long path to pike.so.\n");    exit(1);    }    /* Don't forget the NUL! */    memcpy(p, "pike.so", CONSTANT_STRLEN("pike.so") + 1);   #endif /* LIBPIKE */   }    -  -  - 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; -  - PMOD_EXPORT 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); - } -  -  -  -  +    int main(int argc, char **argv)   {    JMP_BUF back;    int e, num;    char *p;    struct array *a;       TRACE((stderr, "Init master...\n"));       find_lib_dir(argc, argv);
pike.git/src/main.c:386:    e++;    if(e >= argc)    {    fprintf(stderr,"Missing argument to -q\n");    exit(1);    }    p=argv[e];    }else{    p++;    } -  instructions_left=STRTOL(p,&p,0); +  set_pike_evaluator_limit(STRTOL(p, &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;
pike.git/src/main.c:573:    s=complex_free_buf(&buf);       fputs(s.str, stderr);    free(s.str);    }    else    call_handle_error();    num=10;    }    }else{ +  struct object *m; +     back.severity=THROW_EXIT;    -  TRACE((stderr, "Init master...\n")); -  -  master(); -  call_callback(& post_master_callbacks, 0); -  free_callback_list(& post_master_callbacks); -  +  if ((m = load_pike_master())) {    TRACE((stderr, "Call master->_main()...\n"));       pike_push_argv(argc, argv);       pike_push_env();    -  apply(master(),"_main",2); +  apply(m, "_main", 2);    pop_stack();    num=0; -  +  } else { +  num = -1;    } -  +  }    UNSETJMP(back);       TRACE((stderr, "Exit %d...\n", num));       pike_do_exit(num);    return num; /* avoid warning */   }