home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
TELECOM
/
OSKBox.lzh
/
MAILBOX
/
CC
/
evstat.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-06-09
|
981b
|
56 lines
#include <stdio.h>
#include <module.h>
#include <events.h>
#include <signal.h>
char *sign (i)
{
static char str[10];
sprintf (str, "%d", i);
if (i > 0) {
movmem (str, str+1, strlen (str) + 1);
str[0] = '+';
}
while (strlen (str) < 3) {
movmem (str, str+1, strlen (str) + 1);
str[0] = ' ';
}
return (str);
}
movmem (from, to, count)
register char *from, *to;
register int count;
{
if (from > to)
while (count--)
*to++ = *from++;
else {
from += count;
to += count;
while (count--)
*--to = *--from;
}
}
main ()
{
int ev;
event info;
char str1[10], str2[10];
printf ("Event Name Value Wait Sig. Link\n");
ev = 0;
ev = _ev_info (ev, &info) + 1;
while (ev) {
strcpy (str1, sign (info._ev_winc));
strcpy (str2, sign (info._ev_sinc));
printf (" %2d %-11.11s %3d %s %s %2d\n",
info._ev_eid, info._ev_name, info._ev_value,
str1, str2, info._ev_link);
ev = _ev_info (ev, &info) + 1;
}
}