=================================================================== RCS file: /home/cvs/OpenXM_contrib2/windows/engine2000/plot.c,v retrieving revision 1.6 retrieving revision 1.14 diff -u -p -r1.6 -r1.14 --- OpenXM_contrib2/windows/engine2000/plot.c 2002/08/02 09:30:23 1.6 +++ OpenXM_contrib2/windows/engine2000/plot.c 2020/02/01 14:19:01 1.14 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/windows/engine2000/plot.c,v 1.5 2002/08/02 02:48:22 noro Exp $ + * $OpenXM: OpenXM_contrib2/windows/engine2000/plot.c,v 1.13 2019/03/28 07:04:13 noro Exp $ */ #include "ca.h" #include "parse.h" @@ -69,7 +69,7 @@ extern jmp_buf ox_env; extern MATHCAP my_mathcap; extern char LastError[]; -void create_error(ERR *,unsigned int ,char *); +void create_error(ERR *,unsigned int ,char *,LIST); void ox_io_init(); void ox_asir_init(int,char **,char *); @@ -91,6 +91,7 @@ static void asir_do_cmd(unsigned int,unsigned int); static void process_ox(); static void asir_executeFunction(); static void process_resize(struct canvas *can,POINT startp,POINT endp); +int Im_ox_plot; #if defined(VISUAL) @@ -128,6 +129,7 @@ void ox_plot_main(int argc,char **argv) #endif if ( do_message ) fprintf(stderr,"I'm an ox_plot, Version %d.\n",ASIR_VERSION); + Im_ox_plot=1; /* XXX: dummy */ MKUSINT(ui,0); GC_free(ui); @@ -184,19 +186,8 @@ static void process_ox(int id, Obj obj, unsigned int s ERR err; int ret; extern char LastError[]; - extern int recv_intr; -#if defined(VISUAL) - if ( recv_intr ) { - if ( recv_intr == 1 ) { - recv_intr = 0; - int_handler(SIGINT); - } else { - recv_intr = 0; - ox_usr1_handler(0); - } - } -#endif + check_intr(); if ( do_message ) fprintf(stderr,"#%d Got %s",serial,name_of_id(id)); switch ( id ) { @@ -208,7 +199,7 @@ static void process_ox(int id, Obj obj, unsigned int s fprintf(stderr," %s\n",name_of_cmd(cmd)); if ( ret = setjmp(main_env) ) { if ( ret == 1 ) { - create_error(&err,serial,LastError); + create_error(&err,serial,LastError,0); asir_push_one((Obj)err); } break; @@ -235,13 +226,17 @@ static void process_ox(int id, Obj obj, unsigned int s static void process_resize(struct canvas *can,POINT startp,POINT endp) { - if ( can->mode == MODE_INTERACTIVE || can->mode == MODE_POLARPLOT ) + if ( can->mode == modeNO(INTERACTIVE) || can->mode == modeNO(POLARPLOT) ) return; - if ( can->mode == MODE_PLOT ) +#if 0 + if ( can->mode == modeNO(PLOT) ) plot_resize(can,startp,endp); else ifplot_resize(can,startp,endp); +#else + plot_resize(can,startp,endp); +#endif } static void asir_do_cmd(unsigned int cmd,unsigned int serial) @@ -249,7 +244,7 @@ static void asir_do_cmd(unsigned int cmd,unsigned int MATHCAP client_mathcap; LIST list; int i; - Q q; + Z q; switch ( cmd ) { case SM_dupErrors: @@ -258,7 +253,7 @@ static void asir_do_cmd(unsigned int cmd,unsigned int break; case SM_getsp: i = asir_OperandStackPtr+1; - STOQ(i,q); + STOZ(i,q); asir_push_one((Obj)q); break; case SM_popSerializedLocalObject: @@ -283,7 +278,8 @@ static void asir_do_cmd(unsigned int cmd,unsigned int asir_executeFunction(); break; case SM_shutdown: - asir_terminate(2); + asir_infile = 0; + asir_terminate(3); break; case SM_pops: asir_pops(); @@ -305,7 +301,7 @@ static void asir_executeFunction(int serial) char *func; int argc; int id; - Q ret; + Z ret; ERR err; NODE n,n1; @@ -320,26 +316,29 @@ static void asir_executeFunction(int serial) NEXT(n1) = 0; id = -1; if ( !strcmp(func,"plot") ) { - id = plot(n); - STOQ(id,ret); asir_push_one((Obj)ret); + id = plot(n,modeNO(PLOT)); + STOZ(id,ret); asir_push_one((Obj)ret); + }else if ( !strcmp(func,"ifplot") ) { + id = plot(n,modeNO(IFPLOT)); + STOZ(id,ret); asir_push_one((Obj)ret); } else if ( !strcmp(func,"arrayplot") ) { id = arrayplot(n); - STOQ(id,ret); asir_push_one((Obj)ret); + STOZ(id,ret); asir_push_one((Obj)ret); } else if ( !strcmp(func,"open_canvas") ) { id = open_canvas(n); - STOQ(id,ret); asir_push_one((Obj)ret); + STOZ(id,ret); asir_push_one((Obj)ret); } else if ( !strcmp(func,"plotover") ) { plotover(n); } else if ( !strcmp(func,"drawcircle") ) { drawcircle(n); } else if ( !strcmp(func,"draw_obj") ) { if ( draw_obj(n) < 0 ) { - create_error(&err,serial,LastError); + create_error(&err,serial,LastError,0); asir_push_one((Obj)err); } } else if ( !strcmp(func,"draw_string") ) { if ( draw_string(n) < 0 ) { - create_error(&err,serial,LastError); + create_error(&err,serial,LastError,0); asir_push_one((Obj)err); } } else if ( !strcmp(func,"clear_canvas") ) {