=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/parse/main.c,v retrieving revision 1.4 retrieving revision 1.13 diff -u -p -r1.4 -r1.13 --- OpenXM_contrib2/asir2000/parse/main.c 2000/08/21 08:31:47 1.4 +++ OpenXM_contrib2/asir2000/parse/main.c 2001/12/25 02:39:06 1.13 @@ -23,7 +23,7 @@ * shall be made on your publication or presentation in any form of the * results obtained by use of the SOFTWARE. * (4) In the event that you modify the SOFTWARE, you shall notify FLL by - * e-mail at risa-admin@flab.fujitsu.co.jp of the detailed specification + * e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification * for such modification or the source code of the modified part of the * SOFTWARE. * @@ -45,36 +45,44 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/parse/main.c,v 1.3 2000/02/08 04:47:12 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/parse/main.c,v 1.12 2001/12/20 08:18:27 noro Exp $ */ #include "ca.h" #include "parse.h" -#if defined(THINK_C) -#include -#endif #if PARI #include "genpari.h" -extern jmp_buf environnement; +extern JMP_BUF environnement; #endif -extern jmp_buf env; -extern int *StackBottom; +extern JMP_BUF main_env; +#if defined(INTERVAL) +#ifndef ASIRRCNAME +#define ASIRRCNAME "int_asirrc" +#endif +#else +#ifndef ASIRRCNAME +#define ASIRRCNAME "asirrc" +#endif +#endif + + double get_current_time(); +void init_socket(); +void recover(); + extern int mpi_nprocs,mpi_myid; #if defined(VISUAL_LIB) -void Main(argc,argv) +void Main(int argc,char *argv[]) #else #if defined(VISUAL) void #endif -main(argc,argv) +main(int argc,char *argv[]) #endif -int argc; -char *argv[]; { int tmp; FILE *ifp; @@ -84,12 +92,15 @@ char *argv[]; extern int do_asirrc; extern int do_file; extern FILE *in_fp; + extern int *StackBottom; char *getenv(); char *homedir; - char *slash,*binname; char *ptr; +#if !defined(VISUAL) + char *slash,*binname; +#endif - StackBottom = &tmp + 1; /* XXX */ + StackBottom = &tmp; #if MPI mpi_init(); if ( mpi_myid ) { @@ -129,15 +140,9 @@ char *argv[]; srandom((int)get_current_time()); /* mt_sgenrand((unsigned long)get_current_time()); */ -#if defined(THINK_C) - param_init(); -#endif rtime_init(); env_init(); endian_init(); -#if 0 && !defined(VISUAL) && !defined(THINK_C) - check_key(); -#endif GC_init(); process_args(--argc,++argv); #if PARI @@ -165,9 +170,6 @@ char *argv[]; if ( ptr = getenv("ASIR_CONFIG") ) strcpy(ifname,ptr); else { -#if defined(THINK_C) - sprintf(ifname,"asirrc"); -#else homedir = getenv("HOME"); if ( !homedir ) { char rootname[BUFSIZ]; @@ -175,13 +177,12 @@ char *argv[]; get_rootdir(rootname,sizeof(rootname)); homedir = rootname; } - sprintf(ifname,"%s/.asirrc",homedir); -#endif + sprintf(ifname,"%s/." ASIRRCNAME,homedir); } if ( do_asirrc && (ifp = fopen(ifname,"r")) ) { input_init(ifp,ifname); - if ( !setjmp(env) ) { + if ( !SETJMP(main_env) ) { read_exec_file = 1; read_eval_loop(); read_exec_file = 0; @@ -197,12 +198,12 @@ char *argv[]; while ( 1 ) { #if PARI recover(0); - if ( setjmp(environnement) ) { + if ( SETJMP(environnement) ) { avma = top; recover(1); resetenv(""); } #endif - if ( setjmp(env) ) + if ( SETJMP(main_env) ) prompt(); read_eval_loop(); } @@ -211,8 +212,6 @@ char *argv[]; #if !defined(VISUAL_LIB) /* a dummy function */ -void set_error(code,reasion,action) -int code; -char *reasion,*action; +void set_error(int code,char *reason,char *action) {} #endif