=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/parse/glob.c,v retrieving revision 1.72 retrieving revision 1.85 diff -u -p -r1.72 -r1.85 --- OpenXM_contrib2/asir2000/parse/glob.c 2007/11/15 05:39:39 1.72 +++ OpenXM_contrib2/asir2000/parse/glob.c 2014/03/30 10:48:16 1.85 @@ -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.71 2007/09/19 05:56:01 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/parse/glob.c,v 1.84 2013/11/29 08:21:29 noro Exp $ */ #include "ca.h" #include "al.h" @@ -54,7 +54,7 @@ #if defined(PARI) #include "genpari.h" #endif -#if !defined(VISUAL) && !defined(_PA_RISC1_1) && !defined(linux) && !defined(SYSV) && !defined(__CYGWIN__) && !defined(__INTERIX) +#if !defined(VISUAL) && !defined(_PA_RISC1_1) && !defined(linux) && !defined(SYSV) && !defined(__CYGWIN__) && !defined(__INTERIX) && !defined(__FreeBSD__) #include #endif @@ -77,8 +77,6 @@ #define MAXHIST 100 -extern int GC_free_space_divisor; -extern int GC_free_space_numerator; extern FILE *asir_out; INFILE asir_infile; @@ -86,6 +84,7 @@ 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_private_dir; char *asir_pager; NODE usrf,sysf,noargsysf,ubinf,parif; @@ -169,7 +168,7 @@ void glob_init() { 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); + MKNODE(ONENODE,mkfnode(1,I_FORMULA,ONE),NULLP); OID(F_TRUE)=O_F; FOP(F_TRUE)=AL_TRUE; F_TRUE->arg.dummy = 0; OID(F_FALSE)=O_F; FOP(F_FALSE)=AL_FALSE; F_FALSE->arg.dummy = 0; OID(Symbol_grlex) = O_SYMBOL; Symbol_grlex->name = "@grlex"; @@ -320,6 +319,19 @@ static int which(char *prog, char *path, char *buf, si void cppname_init() { #if !defined(VISUAL) + char *oxhome; + char oxcpp[BUFSIZ]; +#define OXCPP "/bin/ox_cpp" + + if ( oxhome = getenv("OpenXM_HOME") ) { + if ( strlen(oxhome)+strlen(OXCPP)= 2) ) { char *slash; - slash = strrchr(*(av+1),'/'); if ( slash ) { *slash = 0; - GC_free_space_numerator = atoi(slash+1); + nm = atoi(slash+1); + }else { + nm = 1; } - GC_free_space_divisor = atoi(*(av+1)); + dv = atoi(*(av+1)); + Risa_GC_set_adj(nm,dv); av += 2; ac -= 2; } else if ( !strcmp(*av,"-cpp") && (ac >= 2) ) { strcpy(cppname,*(av+1)); av += 2; ac -= 2; @@ -489,6 +504,7 @@ void fatal(int n) } extern int ox_int_received, critical_when_signal; +extern int in_gc, caught_intr; void int_handler(int sig) { @@ -503,6 +519,10 @@ void int_handler(int sig) ox_int_received = 1; return; } + if ( in_gc ) { + caught_intr = 1; + return; + } #if defined(VISUAL) suspend_timer(); #endif @@ -528,8 +548,12 @@ void int_handler(int sig) fprintf(stderr,"interrupt ?(q/t/c/d/u/w/?) "); fflush(stderr); buf[0] = '\n'; - while ( buf[0] == '\n' ) + while ( !feof(stdin) && buf[0] == '\n' ) fgets(buf,BUFSIZ,stdin); + if ( feof(stdin) ) { + clearerr(stdin); + continue; + } switch ( c = buf[0] ) { case 'q': while ( 1 ) { @@ -772,11 +796,7 @@ char *get_asir_distribution(); char *get_gcversion() { -#if defined(GC7) - return "GC 7.0 copyright 1988-2007, H-J. Boehm, A. J. Demers, Xerox, SGI, HP.\n"; -#else - return "GC 6.5 copyright 1988-2005, H-J. Boehm, A. J. Demers, Xerox, SGI, HP.\n"; -#endif + return "GC 7.2 copyright 1988-2012, H-J. Boehm, A. J. Demers, Xerox, SGI, HP.\n"; } char *get_pariversion() @@ -824,3 +844,19 @@ char *scopyright() } return notice; } + +#if defined(VISUAL) +void check_intr() +{ + extern int recv_intr; + if ( recv_intr ) { + if ( recv_intr == 1 ) { + recv_intr = 0; + int_handler(0); + } else { + recv_intr = 0; + ox_usr1_handler(0); + } + } +} +#endif