=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/ox.c,v retrieving revision 1.14 retrieving revision 1.19 diff -u -p -r1.14 -r1.19 --- OpenXM_contrib2/asir2000/io/ox.c 2002/07/25 04:47:41 1.14 +++ OpenXM_contrib2/asir2000/io/ox.c 2003/02/14 22:29:15 1.19 @@ -44,7 +44,7 @@ * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. - * $OpenXM$ + * $OpenXM: OpenXM_contrib2/asir2000/io/ox.c,v 1.18 2002/12/09 00:42:14 noro Exp $ */ #include "ca.h" #include "parse.h" @@ -125,7 +125,7 @@ static int available_cmo[] = { 0 }; -static int available_sm[] = { +static int asir_available_sm[] = { SM_dupErrors, SM_getsp, SM_popSerializedLocalObject, SM_popCMO, SM_popString, SM_pushCMOtag, SM_setName, SM_evalName, SM_executeStringByLocalParser, @@ -136,6 +136,26 @@ static int available_sm[] = { 0 }; +static int ox_asir_available_sm[] = { + SM_dupErrors, SM_getsp, SM_popSerializedLocalObject, + SM_popCMO, SM_popString, SM_pushCMOtag, SM_setName, + SM_evalName, SM_executeStringByLocalParser, + SM_executeStringByLocalParserInBatchMode, + SM_executeFunction, SM_shutdown, SM_pops, + SM_mathcap, SM_setMathcap, SM_nop, + SM_beginBlock, SM_endBlock, + 0 +}; + +static int ox_plot_available_sm[] = { + SM_dupErrors, SM_getsp, SM_popSerializedLocalObject, + SM_popCMO, SM_popString, SM_setName, + SM_evalName, SM_executeStringByLocalParser, + SM_executeFunction, SM_shutdown, SM_pops, + SM_mathcap, SM_setMathcap, SM_nop, + 0 +}; + /* mathcap = [ @@ -164,11 +184,24 @@ void create_my_mathcap(char *system) MKUSINT(t,OX_VERSION); n0 = mknode(2,t,str); MKLIST(sname,n0); - /* cmo tag */ - for ( n0 = 0, i = 0; k = available_sm[i]; i++ ) { - NEXTNODE(n0,n); MKUSINT(t,k); BDY(n) = (pointer)t; + /* sm tag */ + n0 = 0; + if ( !strcmp(system,"asir") ) { + for ( i = 0; k = asir_available_sm[i]; i++ ) { + NEXTNODE(n0,n); MKUSINT(t,k); BDY(n) = (pointer)t; + } + } else if ( !strcmp(system,"ox_asir") ) { + for ( i = 0; k = ox_asir_available_sm[i]; i++ ) { + NEXTNODE(n0,n); MKUSINT(t,k); BDY(n) = (pointer)t; + } + NEXT(n) = 0; + } else if ( !strcmp(system,"ox_plot") ) { + for ( i = 0; k = ox_plot_available_sm[i]; i++ ) { + NEXTNODE(n0,n); MKUSINT(t,k); BDY(n) = (pointer)t; + } + NEXT(n) = 0; } - NEXT(n) = 0; MKLIST(smlist,n0); + MKLIST(smlist,n0); /* creation of [OX_DATA,CMO list] */ /* ox tag */ @@ -367,6 +400,8 @@ void end_critical() { } } +extern FUNC registered_handler; + void ox_usr1_handler(int sig) { #if !defined(VISUAL) @@ -377,6 +412,12 @@ void ox_usr1_handler(int sig) ox_usr1_sent = 1; } else { ox_flushing = 1; + if ( registered_handler ) { + fprintf(stderr, + "usr1 : calling the registered exception handler..."); + bevalf(registered_handler,0); + fprintf(stderr, "done.\n"); + } ox_resetenv("usr1 : return to toplevel by SIGUSR1"); } } @@ -404,7 +445,7 @@ void clear_readbuffer() */ } -#if MPI +#if defined(MPI) int ox_data_is_available(int s) { return 1; @@ -655,6 +696,12 @@ void ox_get_serverinfo(int s, LIST *rp) } } +char *ox_get_servername(int s) +{ + return (remote_mc && remote_mc[s].servername)?remote_mc[s].servername:0; +} + + int ox_check_cmo_p(int s, P p) { DCP dc; @@ -687,7 +734,7 @@ void ox_flush_stream(int s) if ( _fileno(&iofp[s].out->fp) < 0 ) cflush(iofp[s].out); else -#elif MPI +#elif defined(MPI) if ( (char)fileno(&iofp[s].out->fp) < 0 ) cflush(iofp[s].out); else @@ -701,7 +748,7 @@ void ox_flush_stream_force(int s) if ( _fileno(&iofp[s].out->fp) < 0 ) cflush(iofp[s].out); else -#elif MPI +#elif defined(MPI) if ( (char)fileno(&iofp[s].out->fp) < 0 ) cflush(iofp[s].out); else