=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/ox_asir.c,v retrieving revision 1.59 retrieving revision 1.65 diff -u -p -r1.59 -r1.65 --- OpenXM_contrib2/asir2000/io/ox_asir.c 2006/02/08 02:11:19 1.59 +++ OpenXM_contrib2/asir2000/io/ox_asir.c 2006/09/29 09:02:49 1.65 @@ -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_contrib2/asir2000/io/ox_asir.c,v 1.58 2005/07/26 00:58:50 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/io/ox_asir.c,v 1.64 2006/09/26 05:35:26 noro Exp $ */ #include "ca.h" #include "parse.h" @@ -191,6 +191,7 @@ void ox_main(int argc,char **argv) { asir_push_one((Obj)err); while ( NEXT(asir_infile) ) closecurrentinput(); + resetpvs(); } break; } @@ -596,6 +597,14 @@ void asir_pushCMOtag(unsigned int serial) } } +void print_to_wfep(Obj obj) +{ + asir_push_one(obj); + asir_popString(); +} + +extern int wfep_mode; + void asir_popString() { Obj val; @@ -606,7 +615,10 @@ void asir_popString() val = asir_pop_one(); if ( !val ) buf = "0"; - else { + else if ( wfep_mode && OID(val) == O_ERR ) { + /* XXX : for wfep */ + ox_send_data(0,val); return; + } else { l = estimate_length(CO,val); buf = (char *)ALLOCA(l+1); soutput_init(buf); @@ -703,6 +715,7 @@ int asir_executeString() #else parse_strp = cmd; #endif + asir_infile->ln = 1; if ( mainparse(&snode) ) { return -1; } @@ -858,6 +871,7 @@ void ox_asir_init(int argc,char **argv,char *servernam FILE *ifp; char *homedir; char *ptr; + int do_server_sav; #if !defined(VISUAL) int tmp; #endif @@ -916,7 +930,11 @@ void ox_asir_init(int argc,char **argv,char *servernam if ( do_asirrc && (ifp = fopen(ifname,"r")) ) { fclose(ifp); - execasirfile(ifname); + do_server_sav = do_server_in_X11; + do_server_in_X11 = 0; + if ( !SETJMP(main_env) ) + execasirfile(ifname); + do_server_in_X11 = do_server_sav; } /* XXX Windows compatibility */ @@ -1179,16 +1197,13 @@ int asir_ox_init(int byteorder) #if defined(UINIT) reg_sysf(); #endif + input_init(0,"string"); sprintf(ifname,"%s/.asirrc",getenv("HOME")); if ( do_asirrc && (ifp = fopen(ifname,"r")) ) { - input_init(ifp,ifname); - if ( !SETJMP(asir_infile->jmpbuf) ) { - asir_infile->ready_for_longjmp; - read_eval_loop(); - } fclose(ifp); + if ( !SETJMP(main_env) ) + execasirfile(ifname); } - input_init(0,"string"); asir_OperandStackSize = BUFSIZ; asir_OperandStack = (Obj *)CALLOC(asir_OperandStackSize,sizeof(Obj));