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