1: # include "refer.h" 2: static char ahead[LLINE]; 3: static int peeked 0; 4: static int noteof 1; 5: 6: char * 7: input (s) 8: char *s; 9: { 10: if (peeked) 11: { 12: peeked=0; 13: if (noteof==0) return(0); 14: strcpy (s, ahead); 15: return(s); 16: } 17: return(fgets(s, LLINE, in)); 18: } 19: char * 20: lookat() 21: { 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: }