=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/plot/ox_plot.c,v retrieving revision 1.24 retrieving revision 1.28 diff -u -p -r1.24 -r1.28 --- OpenXM_contrib2/asir2000/plot/ox_plot.c 2013/12/20 02:27:17 1.24 +++ OpenXM_contrib2/asir2000/plot/ox_plot.c 2015/08/08 14:19:42 1.28 @@ -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/plot/ox_plot.c,v 1.23 2013/12/19 05:48:24 saito Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/plot/ox_plot.c,v 1.27 2015/08/06 10:01:53 fujimoto Exp $ */ #include "ca.h" #include "parse.h" @@ -96,7 +96,7 @@ static void asir_do_cmd(unsigned int,unsigned int); static void process_ox(); static void asir_executeFunction(); -#if defined(VISUAL) +#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) void ox_plot_main() #else void ox_plot_main(int argc,char **argv) @@ -107,21 +107,23 @@ void ox_plot_main(int argc,char **argv) int n; int use_x; -#if !defined(VISUAL) +#if !defined(VISUAL) && !defined(__MINGW32__) && !defined(__MINGW64__) ox_asir_init(argc,argv,"ox_plot"); use_x=init_plot_display(argc,argv); if(use_x) ds=ConnectionNumber(display); else fprintf(stderr,"Entering no X mode\n"); #endif if(do_message)fprintf(stderr,"I'm an ox_plot, Version %d.\n",ASIR_VERSION); - +#if defined(__MINGW32__) || defined(__MINGW64__) + fflush(stderr); +#endif if(SETJMP(ox_env)){ while(NEXT(asir_infile))closecurrentinput(); reset_current_computation(); ox_send_sync(0); } while (1){ -#if defined(VISUAL) +#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) process_ox(); #else if(ox_data_is_available(0)) process_ox(); @@ -151,7 +153,8 @@ static void process_ox(){ cmd=((USINT)obj)->body; if(ox_flushing) break; if(do_message) fprintf(stderr," %s\n",name_of_cmd(cmd)); - if(ret=SETJMP(main_env)){ + ret=SETJMP(main_env); + if(ret){ if(ret==1){ create_error(&err,serial,LastError,0); asir_push_one((Obj)err); @@ -173,6 +176,9 @@ static void process_ox(){ break; } if(do_message)fprintf(stderr,"\n"); +#if defined(__MINGW32__) || defined(__MINGW64__) + fflush(stderr); +#endif } static void asir_do_cmd(unsigned int cmd,unsigned int serial){ @@ -231,9 +237,9 @@ static void asir_do_cmd(unsigned int cmd,unsigned int } } -static void asir_executeFunction(int serial){ +static void asir_executeFunction(int serial){ char *fn; - int argc,id; + int argc,id,fno; FUNC f; Q ret; VL vl; @@ -249,74 +255,105 @@ static void asir_executeFunction(int serial){ } if(n)NEXT(n1)=0; id=-1; - if(!strcmp(fn,"plot")){ - id=plot(n,MODE_PLOT); + fno=modeNO(fn); + switch (fno){ + case 0://IFPLOT + id=plot(n,fno); STOQ(id,ret); asir_push_one((Obj)ret); - } else if(!strcmp(fn,"ifplot")){ - id=plot(n,MODE_IFPLOT); + break; + case 1://CONPLOT + id=plot(n,fno); STOQ(id,ret); asir_push_one((Obj)ret); - } else if(!strcmp(fn,"conplot")){ - id=plot(n,MODE_CONPLOT); + break; + case 2://PLOT + id=plot(n,fno); STOQ(id,ret); asir_push_one((Obj)ret); - } else if(!strcmp(fn,"polarplot")){ - id=plot(n,MODE_POLARPLOT); + break; + case 4://POLARPLOT + id=plot(n,fno); STOQ(id,ret); asir_push_one((Obj)ret); - } else if(!strcmp(fn,"memory_plot")){ + break; + case 30://MEMORY_PLOT memory_plot(n,&bytes); asir_push_one((Obj)bytes); - } else if(!strcmp(fn,"arrayplot")){ + break; + case 31://ARRAYPLOT id=arrayplot(n); STOQ(id,ret); asir_push_one((Obj)ret); - } else if(!strcmp(fn,"open_canvas")){ + break; + case 32://OPEN_CANVAS id=open_canvas(n); STOQ(id,ret); asir_push_one((Obj)ret); - } else if(!strcmp(fn,"plotover")){ + break; + case 5://PLOTOVER plotover(n); - } else if(!strcmp(fn,"drawcircle")){ + break; + case 33://DRAWCIRCLE drawcircle(n); - } else if(!strcmp(fn,"draw_obj")){ + break; + case 34://DRAW_OBJ if(draw_obj(n) < 0 ){ create_error(&err,serial,LastError,0); asir_push_one((Obj)err); } - } else if(!strcmp(fn,"draw_string")){ - if(draw_string(n) < 0 ){ + break; + case 35://DRAW_STRING + if(draw_string(n)<0){ create_error(&err,serial,LastError,0); asir_push_one((Obj)err); } - } else if(!strcmp(fn,"clear_canvas")){ + break; + case 37://CLEAR_CANVAS clear_canvas(n); -#if defined(INTERVAL) + break; // ifplotNG - } else if(!strcmp(fn,"objcp")){ + case 36://OBJ_CP id=objcp(n); STOQ(id,ret); asir_push_one((Obj)ret); - } else if(!( - strcmp(fn,"ifplotD")&strcmp(fn,"ifplotQ")&strcmp(fn,"ifplotB")& - strcmp(fn,"ineqnD")&strcmp(fn,"ineqnQ")&strcmp(fn,"ineqnB")& - strcmp(fn,"conplotD")&strcmp(fn,"conplotQ")&strcmp(fn,"conplotB"))){ - id=ifplotNG(n,fn); + break; + case 6://IFPLOTD + case 7://IFPLOTQ + case 8://IFPLOTB + case 9://INEQND + case 10://INEQNQ + case 11://INEQNB + case 21://CONPLOTD + case 22://CONPLOTQ + case 23://CONPLOTB +#if defined(INTERVAL) + case 24://ITVIFPLOT +#endif + id=ifplotNG(n,fno); STOQ(id,ret); asir_push_one((Obj)ret); - } else if(!( - strcmp(fn,"ineqnandD")&strcmp(fn,"ineqnandQ")&strcmp(fn,"ineqnandB")& - strcmp(fn,"ineqnorD")&strcmp(fn,"ineqnorQ")&strcmp(fn,"ineqnorB")& - strcmp(fn,"ineqnxorD")&strcmp(fn,"ineqnxorQ")&strcmp(fn,"ineqnxorB")& - strcmp(fn,"plotoverD")&strcmp(fn,"plotoverQ")&strcmp(fn,"plotoverB"))){ - id=ifplotOP(n,fn); + break; + case 12://INEQNDAND + case 13://INEQNQAND + case 14://INEQNBAND + case 15://INEQNDOR + case 16://INEQNQOR + case 17://INEQNBOR + case 18://INEQNDXOR + case 19://INEQNQXOR + case 20://INEQNBXOR + case 25://PLOTOVERD + case 26://PLOTOVERQ + case 27://PLOTOVERB + id=ifplotOP(n,fno); STOQ(id,ret); asir_push_one((Obj)ret); - } else if(!strcmp(fn,"itvifplot")){ - id=ifplotNG(n,fn); + break; + case 38://POLARPLOTD + id=polarplotNG(n); STOQ(id,ret); asir_push_one((Obj)ret); -#endif + break; } }