=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/parse/glob.c,v retrieving revision 1.21 retrieving revision 1.29 diff -u -p -r1.21 -r1.29 --- OpenXM_contrib2/asir2000/parse/glob.c 2001/08/20 09:03:27 1.21 +++ OpenXM_contrib2/asir2000/parse/glob.c 2002/12/09 00:42:15 1.29 @@ -45,15 +45,16 @@ * 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.20 2001/06/27 09:14:08 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/parse/glob.c,v 1.28 2002/09/11 08:57:21 noro Exp $ */ #include "ca.h" #include "al.h" #include "parse.h" +#include "ox.h" #if PARI #include "genpari.h" #endif -#if !defined(VISUAL) && !defined(_PA_RISC1_1) && !defined(linux) && !defined(SYSV) +#if !defined(VISUAL) && !defined(_PA_RISC1_1) && !defined(linux) && !defined(SYSV) && !defined(__CYGWIN__) #include #endif @@ -76,15 +77,15 @@ extern int GC_free_space_divisor; extern int GC_free_space_numerator; extern FILE *asir_out; -IN asir_infile; -jmp_buf main_env,debug_env,timer_env,exec_env; +INFILE asir_infile; +JMP_BUF main_env,debug_env,timer_env,exec_env; int little_endian,debug_mode; char *asir_libdir; char *asir_pager; NODE usrf,sysf,noargsysf,ubinf,parif; NODE ONENODE; -int main_parser, ox_do_copy, ox_do_count, ox_count_length; +int main_parser, allow_create_var, ox_do_copy, ox_do_count, ox_count_length; int ox_file_io, ox_need_conv; char *ox_copy_bptr; char *parse_strp; @@ -132,7 +133,7 @@ F F_FALSE = &oF_FALSE; #if defined(__SVR4) && defined(sun) char cppname[BUFSIZ] = "/usr/ccs/lib/cpp "; #else -#if defined(__FreeBSD__) || defined(__NetBSD__) || (defined(__MACH__) && defined(__ppc__)) +#if defined(__FreeBSD__) || defined(__NetBSD__) || (defined(__MACH__) && defined(__ppc__)) || defined(__CYGWIN__) char cppname[BUFSIZ] = "/usr/bin/cpp "; #else #if defined(VISUAL) @@ -163,20 +164,15 @@ void glob_init() { sprintf(asirname,"%s/asir_symtab",asir_libdir); } -void input_init(fp,name) -FILE *fp; -char *name; +void input_init(FILE *fp,char *name) { - asir_infile = (IN)CALLOC(sizeof(struct oIN),1); + asir_infile = (INFILE)CALLOC(sizeof(struct oINFILE),1); asir_infile->name = name; asir_infile->fp = fp; asir_infile->ln = 1; NEXT(asir_infile) = 0; } -void notdef(vl,a,b,c) -VL vl; -Obj a,b,*c; +void notdef(VL vl,Obj a,Obj b,Obj *c) { - *c = 0; error("undefined arithmetic operation."); } @@ -202,8 +198,7 @@ void ExitAsir() { * status = 2 normal termination (end(), quit() etc.) */ -void asir_terminate(status) -int status; +void asir_terminate(int status) { int t; @@ -211,9 +206,9 @@ int status; t = read_exec_file; read_exec_file = 0; if ( t == 1 ) - longjmp(main_env,status); + LONGJMP(main_env,status); else - longjmp(exec_env,status); + LONGJMP(exec_env,status); } else { tty_reset(); #if MPI @@ -253,17 +248,14 @@ void prompt() { fflush(asir_out); } -void sprompt(ptr) -char *ptr; +void sprompt(char *ptr) { sprintf(ptr,"[%d] ",APVS->n); } FILE *in_fp; -void process_args(ac,av) -int ac; -char **av; +void process_args(int ac,char **av) { do_asirrc = 1; #if !MPI @@ -344,19 +336,21 @@ void sig_init() { #if !defined(VISUAL) signal(SIGINT,int_handler); #else + void register_ctrlc_handler(); + register_ctrlc_handler(); #endif signal(SIGSEGV,segv_handler); -#if defined SIGFPE +#if defined(SIGFPE) signal(SIGFPE,fpe_handler); #endif -#if defined SIGPIPE +#if defined(SIGPIPE) signal(SIGPIPE,pipe_handler); #endif -#if defined SIGILL +#if defined(SIGILL) signal(SIGILL,ill_handler); #endif @@ -380,8 +374,7 @@ void asir_reset_handler() { signal(SIGINT,old_int); } -void resetenv(s) -char *s; +void resetenv(char *s) { extern FILE *outfile; @@ -406,11 +399,10 @@ char *s; #if !defined(VISUAL) reset_timer(); #endif - longjmp(main_env,1); + LONGJMP(main_env,1); } -void fatal(n) -int n; +void fatal(int n) { resetenv("return to toplevel"); } @@ -418,8 +410,7 @@ int n; FUNC registered_handler; extern int ox_int_received, critical_when_signal; -void int_handler(sig) -int sig; +void int_handler(int sig) { extern NODE PVSS; @@ -530,8 +521,7 @@ void restore_handler() { #endif } -void segv_handler(sig) -int sig; +void segv_handler(int sig) { #if defined(SIGSEGV) signal(SIGSEGV,segv_handler); @@ -539,8 +529,7 @@ int sig; #endif } -void ill_handler(sig) -int sig; +void ill_handler(int sig) { #if defined(SIGILL) signal(SIGILL,ill_handler); @@ -548,15 +537,13 @@ int sig; #endif } -void alrm_handler(sig) -int sig; +void alrm_handler(int sig) { fprintf(stderr,"interval timer expired (VTALRM)\n"); - longjmp(timer_env,1); + LONGJMP(timer_env,1); } -void bus_handler(sig) -int sig; +void bus_handler(int sig) { #if defined(SIGBUS) signal(SIGBUS,bus_handler); @@ -564,8 +551,7 @@ int sig; #endif } -void fpe_handler(sig) -int sig; +void fpe_handler(int sig) { #if defined(SIGFPE) signal(SIGFPE,fpe_handler); @@ -573,8 +559,7 @@ int sig; #endif } -void pipe_handler(sig) -int sig; +void pipe_handler(int sig) { #if defined(SIGPIPE) signal(SIGPIPE,pipe_handler); @@ -595,8 +580,7 @@ void tty_reset() { extern int evalstatline; -void set_lasterror(s) -char *s; +void set_lasterror(char *s) { strncpy(LastError,s,BUFSIZ); LastError[BUFSIZ-1] = 0; @@ -604,8 +588,7 @@ char *s; SNODE error_snode; -void error(s) -char *s; +void error(char *s) { SNODE *snp; @@ -633,7 +616,7 @@ char *s; ExitAsir(); } if ( debug_mode ) - longjmp(debug_env,1); + LONGJMP(debug_env,1); if ( CPVS != GPVS ) if ( do_server_in_X11 || isatty(0) ) bp(error_snode); @@ -645,8 +628,7 @@ char *s; #if !defined(VISUAL) #include -void set_timer(interval) -int interval; +void set_timer(int interval) { struct itimerval it; @@ -686,9 +668,8 @@ void copyright() { #endif printf("Copyright (C) 1994-2000, all rights reserved, FUJITSU LABORATORIES LIMITED.\n"); printf("Copyright 2000,2001, Risa/Asir committers, http://www.openxm.org/.\n"); - printf("GC 5.3, copyright 1999, H-J. Boehm, A. J. Demers, Xerox, SGI, HP.\n"); - printf("PARI 2.0.17(beta), copyright (C) 1989-1999,\n"); - printf(" C. Batut, K. Belabas, D. Bernardi, H. Cohen and M. Olivier.\n"); + printf("GC 6.1(alpha5) copyright 2001, H-J. Boehm, A. J. Demers, Xerox, SGI, HP.\n"); + printf("PARI 2.2.4, copyright (C) 2002 The PARI Group.\n"); }