# 2.11BSD#431 - /usr/src/old/prep/prep2.c

##### Functions

    flsh              X
    put               X

##### Variables

    nflush            X
    obuf              X
    optr              X

       1: int optr;
       2:
       3: char    obuf[512];
       4:
       5: int nflush;
       6:
       7: put(string,n)
       8:     char    *string;
       9: {
      10:     int i;
      11:     char    *o;
      12:
      13: /*printf("%c %d\n",*string,n);/*DEBUG*/
      14:
      15:     string--;
      16:
      17:     if((i = optr + n - 512) >= 0) {
      18:         n -= i;
      19:         o = &obuf[optr] -1;
      20:         while(--n >= 0)
      21:             *++o = *++string;
      22:         optr = 512;
      23:         flsh();
      24:         n = i;
      25:     }
      26:
      27:     o = &obuf[optr] - 1;
      28:     optr += n;
      29:
      30:     while(--n >= 0) {
      31:         *++o = *++string;
      32:     }
      33:     return(0);
      34: }
      35:
      36: flsh()
      37: {
      38:
      39:     if(optr <= 0)   return(optr);
      40:
      41:     nflush++;
      42:     if(write(1,obuf,optr) != optr)
      43:         return(-1);
      44:     optr = 0;
      45:     return(0);
      46: }

#### Defined functions

flsh defined in line 36; used 2 times

- in line 23
- in /usr/src/old/prep/prep0.c line 105

put defined in line 7; used 3 times

- in /usr/src/old/prep/prep1.c line 69, 82-83(2)

#### Defined variables

nflush defined in line 5; used 1 times

- in line 41

obuf defined in line 3; used 3 times

- in line 19, 27, 42

optr defined in line 1; used 10 times

- in line 17-28(5), 39-44(5)

Last modified: 1981-07-10 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 443 |