Annotation of 41BSD/cmd/refer/refer8.c, revision 1.1

1.1     ! root        1: # include "refer..c"
        !             2: static char ahead[1000];
        !             3: static int peeked = 0;
        !             4: static int noteof = 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: if (peeked) return(ahead);
        !            22: noteof=input(ahead);
        !            23: peeked=1;
        !            24: return(noteof);
        !            25: }
        !            26: addch(s, c)
        !            27:        char *s;
        !            28: {
        !            29: while (*s) s++;
        !            30: *s++ = c;
        !            31: *s = 0;
        !            32: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.