Bell 32V development
[unix-history] / usr / src / cmd / refer / refer8.c
CommitLineData
2b1a705e
TL
1# include "refer..c"
2static char ahead[1000];
3static int peeked = 0;
4static int noteof = 1;
5char *
6input (s)
7 char *s;
8{
9if (peeked)
10 {
11 peeked=0;
12 if (noteof==0) return(0);
13 strcpy (s, ahead);
14 return(s);
15 }
16return(fgets(s, 1000, in));
17}
18char *
19lookat()
20{
21if (peeked) return(ahead);
22noteof=input(ahead);
23peeked=1;
24return(noteof);
25}
26addch(s, c)
27 char *s;
28{
29while (*s) s++;
30*s++ = c;
31*s = 0;
32}