~kris/9p

9hist

ref: 536ac6b0bc69df0e43e5e1fde208e9866d36b926 9hist/pc/main.c -rw-r--r-- 443 bytes
536ac6b0 — David du Colombier Plan 9 from Bell Labs 1991-07-02 35 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include	"u.h"
#include	"lib.h"
#include	"dat.h"
#include	"fns.h"

main(void)
{
	for(;;){
		print("%x ", kbdc());
	}
}

void
delay(int l)
{
	int i;

	while(--l){
		for(i=0; i < 10000; i++)
			;
	}
}

int
sprint(char *s, char *fmt, ...)
{
	return doprint(s, s+PRINTSIZE, fmt, (&fmt+1)) - s;
}

int
print(char *fmt, ...)
{
	char buf[PRINTSIZE];
	int n;

	n = doprint(buf, buf+sizeof(buf), fmt, (&fmt+1)) - buf;
	screenputs(buf, n);
	return n;
}