=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/tcpf.c,v retrieving revision 1.3 retrieving revision 1.6 diff -u -p -r1.3 -r1.6 --- OpenXM_contrib2/asir2000/io/tcpf.c 1999/12/21 04:20:42 1.3 +++ OpenXM_contrib2/asir2000/io/tcpf.c 2000/01/26 02:05:34 1.6 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/io/tcpf.c,v 1.2 1999/12/13 01:56:04 noro Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/io/tcpf.c,v 1.5 2000/01/11 06:43:36 noro Exp $ */ #if INET #include "ca.h" #include "parse.h" @@ -45,7 +45,7 @@ void Pox_launch(),Pox_launch_nox(),Pox_launch_main(); void Pox_launch_generic(); void Pox_shutdown(); -void Pox_rpc(),Pox_cmo_rpc(),Pox_reset(),Pox_sync(),Pox_select(); +void Pox_rpc(),Pox_cmo_rpc(),Pox_reset(),Pox_intr(),Pox_sync(),Pox_select(); void Pox_push_local(),Pox_push_cmo(),Pox_push_vl(),Pox_push_cmd(); @@ -84,6 +84,7 @@ struct ftab tcp_tab[] = { {"ox_sync",Pox_sync,1}, #if !MPI {"ox_reset",Pox_reset,-2}, + {"ox_intr",Pox_intr,1}, {"ox_select",Pox_select,-2}, #endif @@ -113,6 +114,7 @@ struct ftab tcp_tab[] = { extern struct IOFP iofp[]; extern MATHCAP my_mathcap; +extern int ox_exchange_mathcap; char *getenv(); @@ -282,18 +284,19 @@ Q *rp; /* register server to the server list */ ind = register_server(use_unix,cn,sn); - /* request remote mathcap */ - ox_send_cmd(sn,SM_mathcap); - ox_send_cmd(sn,SM_popCMO); - ox_flush_stream_force(sn); - ox_recv(sn,&id,&server_mathcap); - store_remote_mathcap(sn,server_mathcap); - - /* send my mathcap */ - create_my_mathcap("asir"); - ox_send_data(sn,my_mathcap); - ox_send_cmd(sn,SM_setMathcap); - + if ( ox_exchange_mathcap ) { + /* request remote mathcap */ + ox_send_cmd(sn,SM_mathcap); + ox_send_cmd(sn,SM_popCMO); + ox_flush_stream_force(sn); + ox_recv(sn,&id,&server_mathcap); + store_remote_mathcap(sn,server_mathcap); + + /* send my mathcap */ + create_my_mathcap("asir"); + ox_send_data(sn,my_mathcap); + ox_send_cmd(sn,SM_setMathcap); + } /* return the server id */ STOQ(ind,*rp); } @@ -370,18 +373,19 @@ Q *rp; /* register server to the server list */ ind = register_server(use_unix,cn,sn); - /* request remote mathcap */ - ox_send_cmd(sn,SM_mathcap); - ox_send_cmd(sn,SM_popCMO); - ox_flush_stream_force(sn); - ox_recv(sn,&id,&server_mathcap); - store_remote_mathcap(sn,server_mathcap); - - /* send my mathcap */ - create_my_mathcap("asir"); - ox_send_data(sn,my_mathcap); - ox_send_cmd(sn,SM_setMathcap); - + if ( ox_exchange_mathcap ) { + /* request remote mathcap */ + ox_send_cmd(sn,SM_mathcap); + ox_send_cmd(sn,SM_popCMO); + ox_flush_stream_force(sn); + ox_recv(sn,&id,&server_mathcap); + store_remote_mathcap(sn,server_mathcap); + + /* send my mathcap */ + create_my_mathcap("asir"); + ox_send_data(sn,my_mathcap); + ox_send_cmd(sn,SM_setMathcap); + } /* return the server id */ STOQ(ind,*rp); } @@ -401,6 +405,7 @@ char *control_port_str,*server_port_str; conn_str = conn_to_serv ? "1" : "0"; rsh = use_ssh ? "ssh" : RSH; gethostname(localhost,BUFSIZ); +#if !defined(VISUAL) if ( use_unix ) { if ( !fork() ) { setpgid(0,getpid()); @@ -426,7 +431,9 @@ char *control_port_str,*server_port_str; fprintf(stderr,"%s\n",cmd); sleep(20); /* system(cmd); */ - } else { + } else +#endif /* VISUAL */ + { if ( dname ) sprintf(cmd, "%s -n %s \"xterm -name %s -display %s -geometry 60x10 -e %s %s %s %s %s %s %s>&/dev/null&\">/dev/null", @@ -917,6 +924,26 @@ Q *rp; break; } ox_send_sync(c); + } else + *rp = 0; +} + +void Pox_intr(arg,rp) +NODE arg; +Q *rp; +{ + int m; + Obj obj; + int index = QTOS((Q)ARG0(arg)); + + valid_mctab_index(index); + m = m_c_tab[index].m; + if ( m >= 0 ) { + if ( argc(arg) == 1 ) { + ox_send_cmd(m,SM_control_intr); + ox_flush_stream_force(m); + } + *rp = ONE; } else *rp = 0; }