|
|
1.1 root 1: # include "refer..c"
2: static char ahead[1000];
3: static int peeked = 0;
4: static char * noteof = (char *)1;
5: char *
6: input (s)
7: char *s;
8: {
9: if (peeked)
10: {
11: peeked=0;
12: if (noteof==0) return(0);
13: strcpy (s, ahead);
14: return(s);
15: }
16: return(fgets(s, 1000, in));
17: }
18: char *
19: lookat()
20: {
21: char *input();
22: if (peeked) return(ahead);
23: noteof = input(ahead);
24: peeked=1;
25: return(noteof);
26: }
27: addch(s, c)
28: char *s;
29: {
30: while (*s) s++;
31: *s++ = c;
32: *s = 0;
33: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.