=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/builtin/miscf.c,v retrieving revision 1.10 retrieving revision 1.16 diff -u -p -r1.10 -r1.16 --- OpenXM_contrib2/asir2000/builtin/miscf.c 2000/12/05 01:24:50 1.10 +++ OpenXM_contrib2/asir2000/builtin/miscf.c 2003/03/07 06:39:55 1.16 @@ -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/builtin/miscf.c,v 1.9 2000/11/14 08:38:38 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/builtin/miscf.c,v 1.15 2003/03/07 03:12:23 noro Exp $ */ #include "ca.h" #include "parse.h" @@ -54,6 +54,11 @@ #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}, @@ -73,7 +80,7 @@ struct ftab misc_tab[] = { {"debug",Pdebug,0}, {"shell",Pshell,-2}, {"heap",Pheap,-1}, - {"version",Pversion,0}, + {"version",Pversion,-99999}, {"nmono",Pnmono,1}, {"error",Perror,1}, {"error3",Perror3,3}, @@ -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; @@ -196,14 +218,30 @@ Q *rp; } unsigned int get_asir_version(); +char *get_asir_distribution(); -void Pversion(rp) -Q *rp; +void Pversion(arg,rp) +NODE arg; +Obj *rp; { unsigned int version; + char *distribution; + Q q; + STRING str; + NODE n; + LIST l; version = get_asir_version(); - STOQ(version,*rp); + distribution = get_asir_distribution(); + UTOQ(version,q); + if ( !argc(arg) ) + *rp = (Obj)q; + else { + MKSTR(str,distribution); + n = mknode(2,q,str); + MKLIST(l,n); + *rp = (Obj)l; + } } extern int nez; @@ -233,7 +271,6 @@ void Perror3(arg,rp) NODE arg; Q *rp; { - char s[BUFSIZ]; int code; char *reason,*action; @@ -333,7 +370,7 @@ Q *rp; STOQ(ret,*rp); } -#if !defined(VISUAL) && DO_PLOT +#if !defined(VISUAL) && defined(DO_PLOT) void Pxpause(rp) Q *rp; {