=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/parse/glob.c,v retrieving revision 1.53 retrieving revision 1.61 diff -u -p -r1.53 -r1.61 --- OpenXM_contrib2/asir2000/parse/glob.c 2004/12/17 03:09:08 1.53 +++ OpenXM_contrib2/asir2000/parse/glob.c 2006/02/03 03:55:18 1.61 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/parse/glob.c,v 1.52 2004/12/15 22:51:40 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/parse/glob.c,v 1.60 2005/10/26 07:33:03 noro Exp $ */ #include "ca.h" #include "al.h" @@ -85,6 +85,7 @@ INFILE asir_infile; JMP_BUF main_env,debug_env,timer_env,exec_env; int little_endian,debug_mode,no_debug_on_error; char *asir_libdir; +char *asir_contrib_dir; char *asir_pager; NODE usrf,sysf,noargsysf,ubinf,parif; @@ -125,10 +126,11 @@ struct oVL oVLIST[52]; VL CO = oVLIST; VL ALG; -struct oVS oGPVS,oAPVS,oEPVS; +struct oVS oGPVS,oAPVS,oEPVS,oPPVS; VS GPVS = &oGPVS; VS APVS = &oAPVS; VS EPVS = &oEPVS; +VS PPVS = &oPPVS; VS CPVS,MPVS; NODE MODULE_LIST; @@ -164,6 +166,7 @@ void glob_init() { VR(&oVLIST[i]) = &oVAR[i]; NEXT(&oVLIST[i]) = 0; reallocarray((char **)&GPVS->va,(int *)&GPVS->asize,(int *)&GPVS->n,(int)sizeof(struct oPV)); reallocarray((char **)&APVS->va,(int *)&APVS->asize,(int *)&APVS->n,(int)sizeof(struct oPV)); + reallocarray((char **)&PPVS->va,(int *)&PPVS->asize,(int *)&PPVS->n,(int)sizeof(struct oPV)); CPVS = GPVS; MKNODE(ONENODE,mkfnode(1,I_FORMULA,ONE),0); OID(F_TRUE)=O_F; FOP(F_TRUE)=AL_TRUE; F_TRUE->arg.dummy = 0; @@ -193,6 +196,7 @@ int do_asirrc; int do_file; char *do_filename; int do_message; +int do_terse; int do_fep; int read_exec_file; int asir_setenv; @@ -225,6 +229,14 @@ void asir_terminate(int status) else LONGJMP(exec_env,status); } else { + if ( user_quit_handler ) { + if ( !do_terse ) + fprintf(stderr,"Calling the registered quit callbacks..."); + for ( n = user_quit_handler; n; n = NEXT(n) ) + bevalf((FUNC)BDY(n),0); + if ( !do_terse ) + fprintf(stderr, "done.\n"); + } tty_reset(); #if defined(MPI) if ( !mpi_myid ) @@ -244,12 +256,6 @@ void asir_terminate(int status) write_history(asir_history); } #endif - if ( user_quit_handler ) { - fprintf(stderr,"Calling the registered quit callbacks..."); - for ( n = user_quit_handler; n; n = NEXT(n) ) - bevalf((FUNC)BDY(n),0); - fprintf(stderr, "done.\n"); - } ExitAsir(); } } @@ -473,7 +479,13 @@ void resetenv(char *s) #if !defined(VISUAL) reset_timer(); #endif - LONGJMP(main_env,1); + if ( read_exec_file <= 1 ) { + read_exec_file = 0; + LONGJMP(main_env,1); + } else { + read_exec_file = 0; + LONGJMP(exec_env,1); + } } void fatal(int n) @@ -555,17 +567,18 @@ void int_handler(int sig) restore_handler(); if ( c == 'u' ) { if ( user_int_handler ) { - fprintf(stderr, - "Calling the registered exception callbacks..."); + if ( !do_terse ) + fprintf(stderr, + "Calling the registered exception callbacks..."); for ( t = user_int_handler; t; t = NEXT(t) ) bevalf((FUNC)BDY(t),0); - fprintf(stderr, "done.\n"); + if ( !do_terse ) + fprintf(stderr, "done.\n"); } } - if ( read_exec_file ) { - read_exec_file = 0; + if ( read_exec_file ) resetenv("initialization aborted; return to toplevel"); - } else + else resetenv("return to toplevel"); break; case 'd': @@ -699,8 +712,6 @@ void error(char *s) if ( CPVS != GPVS ) if ( !no_debug_on_error && (do_server_in_X11 || isatty(0)) ) bp(error_snode); - if ( read_exec_file ) - read_exec_file = 0; resetenv("return to toplevel"); } @@ -720,8 +731,6 @@ void toplevel(char *s) showpos_to_string(errbuf+strlen(errbuf)); ExitAsir(); } - if ( read_exec_file ) - read_exec_file = 0; resetenv("return to toplevel"); } @@ -762,10 +771,11 @@ char *get_pariversion() { #if PARI #if 0 - return "PARI 2.2.4, copyright (C) 2002 The PARI Group.\nPARI 2.0.17, copyright 1989-1999, C. Batut, K. Belabas, D. Bernardi,\n H. Cohen and M. Olivier.\n"; -#endif + return PARIVERSION", Copyright (C) 2000-2005 The PARI Group.\n"; +#else return "PARI 2.0.17, copyright 1989-1999, C. Batut, K. Belabas, D. Bernardi,\n H. Cohen and M. Olivier.\n"; #endif +#endif return ""; } @@ -780,7 +790,7 @@ char *get_intervalversion() void copyright() { - char *format = "This is Risa/Asir%s, Version %d (%s Distribution).\nCopyright (C) 1994-2000, all rights reserved, FUJITSU LABORATORIES LIMITED.\nCopyright 2000-2004, Risa/Asir committers, http://www.openxm.org/.\nGC 6.2(alpha6) copyright 1988-2003, H-J. Boehm, A. J. Demers, Xerox, SGI, HP.\n%s"; + char *format = "This is Risa/Asir%s, Version %d (%s Distribution).\nCopyright (C) 1994-2000, all rights reserved, FUJITSU LABORATORIES LIMITED.\nCopyright 2000-2005, Risa/Asir committers, http://www.openxm.org/.\nGC 6.5 Copyright 1988-2005, H-J. Boehm, A. J. Demers, Xerox, SGI, HP.\n%s"; printf(format, get_intervalversion(), get_asir_version(), get_asir_distribution(), get_pariversion()); } @@ -789,7 +799,7 @@ char *scopyright() static char *notice; char *s1, *s2, *s3; int d, len; - char *format = "This is Risa/Asir%s, Version %d (%s Distribution).\nCopyright (C) 1994-2000, all rights reserved, FUJITSU LABORATORIES LIMITED.\nCopyright 2000-2003, Risa/Asir committers, http://www.openxm.org/.\nGC 6.2(alpha6) copyright 1988-2003, H-J. Boehm, A. J. Demers, Xerox, SGI, HP.\n%s"; + char *format = "This is Risa/Asir%s, Version %d (%s Distribution).\nCopyright (C) 1994-2000, all rights reserved, FUJITSU LABORATORIES LIMITED.\nCopyright 2000-2005, Risa/Asir committers, http://www.openxm.org/.\nGC 6.5 copyright 1988-2005, H-J. Boehm, A. J. Demers, Xerox, SGI, HP.\n%s"; if (!notice) { s1 = get_intervalversion(); s2 = get_asir_distribution();