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.36 1998/01/25 09:15:47 hubbe Exp $"); + RCSID("$Id: main.c,v 1.37 1998/01/26 19:59:56 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:62:      static struct callback_list exit_callbacks;      struct callback *add_exit_callback(callback_func call,    void *arg,    callback_func free_func)   {    return add_to_callback(&exit_callbacks, call, arg, free_func);   }    - int main(int argc, char **argv) + int dbm_main(int argc, char **argv)   {    JMP_BUF back;    int e, num, do_backend;    char *p;    struct array *a;   #ifdef DECLARE_ENVIRON    extern char **environ;   #endif       ARGV=argv;
pike.git/src/main.c:297:       apply(master(),"_main",2);    pop_stack();       backend();    num=0;    }    UNSETJMP(back);       do_exit(num); +  return num; /* avoid warning */   }    - void do_exit(int num) + #undef ATTRIBUTE + #define ATTRIBUTE(X) +  + void do_exit(int num) ATTRIBUTE((noreturn))   {    call_callback(&exit_callbacks, (void *)0);    free_callback(&exit_callbacks);       exit_modules();       exit(num);   }      
pike.git/src/main.c:354:       do_gc();       cleanup_callbacks();   #if defined(DEBUG) && defined(DEBUG_MALLOC)    if(verbose_debug_exit)    {    INT32 num,size,recount=0;       count_memory_in_arrays(&num, &size); -  if(num || size) +  if(num)    {    recount++;    fprintf(stderr,"Arrays left: %d (%d bytes) (zapped)\n",num,size);    }       zap_all_arrays();       count_memory_in_mappings(&num, &size); -  if(num || size) +  if(num)    {    recount++;    fprintf(stderr,"Mappings left: %d (%d bytes) (zapped)\n",num,size);    }       zap_all_mappings();       count_memory_in_multisets(&num, &size); -  if(num || size) +  if(num)    fprintf(stderr,"Multisets left: %d (%d bytes)\n",num,size);          if(recount)    {    fprintf(stderr,"Garbage collecting..\n");    do_gc();       count_memory_in_arrays(&num, &size);    fprintf(stderr,"Arrays left: %d (%d bytes)\n",num,size);    count_memory_in_mappings(&num, &size);    fprintf(stderr,"Mappings left: %d (%d bytes)\n",num,size);    count_memory_in_multisets(&num, &size);    fprintf(stderr,"Multisets left: %d (%d bytes)\n",num,size);    }          count_memory_in_programs(&num, &size); -  if(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);    }    }          count_memory_in_objects(&num, &size); -  if(num || size) +  if(num)    fprintf(stderr,"Objects left: %d (%d bytes)\n",num,size);    -  count_memory_in_strings(&num, &size); -  if(num || size) -  fprintf(stderr,"Strings left: %d (%d bytes) (zapped)\n",num,size); -  +     cleanup_shared_string_table();    }   #else       zap_all_arrays();    zap_all_mappings();       cleanup_shared_string_table();   #endif   }