=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/builtin/miscf.c,v retrieving revision 1.11 retrieving revision 1.17 diff -u -p -r1.11 -r1.17 --- OpenXM_contrib2/asir2000/builtin/miscf.c 2001/03/08 07:49:11 1.11 +++ OpenXM_contrib2/asir2000/builtin/miscf.c 2003/04/02 06:48:19 1.17 @@ -45,15 +45,20 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/builtin/miscf.c,v 1.10 2000/12/05 01:24:50 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/builtin/miscf.c,v 1.16 2003/03/07 06:39:55 noro Exp $ */ #include "ca.h" #include "parse.h" -#if !defined(VISUAL) +#if !defined(VISUAL) && defined(DO_PLOT) #include #include #endif +#if defined(VISUAL) +#include +#include +#endif + void Pquit(), Pdebug(), Pnmono(), Pnez(), Popt(), Pshell(), Pheap(); void Perror(), Perror3(), Pversion(), Pflist(), Pdelete_history(), Ppause(), Pxpause(); void Pr2g(), Pread_cmo(), Pwrite_cmo(); @@ -62,10 +67,12 @@ void Pnull_command(); void Pgetenv(); void Pget_addr(),Phex_dump(); void Ppeek(),Ppoke(); +void Psleep(); void delete_history(int,int); struct ftab misc_tab[] = { + {"sleep",Psleep,1}, {"null_command",Pnull_command,-99999}, {"getenv",Pgetenv,1}, {"end",Pquit,0}, @@ -88,7 +95,7 @@ struct ftab misc_tab[] = { {"hex_dump",Phex_dump,2}, {"peek",Ppeek,1}, {"poke",Ppoke,2}, -#if !defined(VISUAL) && DO_PLOT +#if !defined(VISUAL) && defined(DO_PLOT) {"xpause",Pxpause,0}, #endif #if 0 @@ -97,6 +104,21 @@ struct ftab misc_tab[] = { {0,0,0}, }; +void Psleep(arg,rp) +NODE arg; +Q *rp; +{ + int ms; + + ms = QTOS((Q)ARG0(arg)); +#if defined(VISUAL) + Sleep(ms); +#else + usleep(ms*1000); +#endif + *rp = ONE; +} + void Pgetenv(arg,rp) NODE arg; STRING *rp; @@ -211,7 +233,7 @@ Obj *rp; version = get_asir_version(); distribution = get_asir_distribution(); - STOQ(version,q); + UTOQ(version,q); if ( !argc(arg) ) *rp = (Obj)q; else { @@ -249,7 +271,6 @@ void Perror3(arg,rp) NODE arg; Q *rp; { - char s[BUFSIZ]; int code; char *reason,*action; @@ -349,7 +370,7 @@ Q *rp; STOQ(ret,*rp); } -#if !defined(VISUAL) && DO_PLOT +#if !defined(VISUAL) && defined(DO_PLOT) void Pxpause(rp) Q *rp; {