# 2.11BSD#431 - /usr/src/usr.bin/refer/refer8.c

##### Functions

    addch             X
    input             X
    lookat            X

       1: #ifndef lint
       2: static char *sccsid = "@(#)refer8.c	4.1 (Berkeley) 5/6/83";
       3: #endif
       4:
       5: #include "refer..c"
       6:
       7: static char ahead[1024];
       8: static int peeked = 0;
       9: static char *noteof = (char *) 1;
      10:
      11: char *
      12: input(s)
      13: char *s;
      14: {
      15:     if (peeked) {
      16:         peeked = 0;
      17:         if (noteof == 0)
      18:             return(0);
      19:         strcpy(s, ahead);
      20:         return(s);
      21:     }
      22:     return(fgets(s, 1000, in));
      23: }
      24:
      25: char *
      26: lookat()
      27: {
      28:     if (peeked)
      29:         return(ahead);
      30:     noteof = input(ahead);
      31:     peeked = 1;
      32:     return(noteof);
      33: }
      34:
      35: addch(s, c)
      36: char *s;
      37: {
      38:     while (*s)
      39:         s++;
      40:     *s++ = c;
      41:     *s = 0;
      42: }

#### Defined functions

addch defined in line 35; used 1 times

- in /usr/src/usr.bin/refer/refer5.c line 72

input defined in line 11; used 4 times

- in line 30
- in /usr/src/usr.bin/refer/refer..c line 43
- in /usr/src/usr.bin/refer/refer1.c line 114
- in /usr/src/usr.bin/refer/refer2.c line 26

lookat defined in line 25; used 2 times

- in /usr/src/usr.bin/refer/refer..c line 43
- in /usr/src/usr.bin/refer/refer5.c line 82

#### Defined variables

ahead defined in line 7; used 3 times

- in line 19, 29-30(2)

noteof defined in line 9; used 3 times

- in line 17, 30-32(2)

peeked defined in line 8; used 4 times

- in line 15-16(2), 28-31(2)

sccsid defined in line 2; never used

Last modified: 1987-02-17 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 523 |