1: int bct[4];
   2: int optr[4];
   3: char    bsp[2048];
   4: 
   5: char    *obuf[4]    {bsp,
   6:             bsp + 512,
   7:             bsp + 1024,
   8:             bsp + 1536
   9:             };
  10: 
  11: int nflush;
  12: 
  13: put(fil,string,n)
  14:     char    *string;
  15: {
  16:     extern  utmp;
  17:     int i;
  18:     char    *o;
  19: 
  20: /*printf("%d %c %d\n",fil,*string,n);/*DEBUG*/
  21: 
  22:     string--;
  23: 
  24:     if((i = optr[fil] + n - 512) >= 0) {
  25:         n =- i;
  26:         o = &obuf[fil][optr[fil]] -1;
  27:         while(--n >= 0)
  28:             *++o = *++string;
  29:         optr[fil] = 512;
  30:         flsh(fil);
  31:         n = i;
  32:     }
  33: 
  34:     o = &obuf[fil][optr[fil]] - 1;
  35:     optr[fil] =+ n;
  36: 
  37:     while(--n >= 0) {
  38:         *++o = *++string;
  39:     }
  40:     return(0);
  41: }
  42: 
  43: flsh(fil)
  44: {
  45:     extern  tp[],utmp;
  46: 
  47:     if(optr[fil] <= 0)  return(optr[fil]);
  48: 
  49:     if(bct[fil]++ >= 128 && utmp == 0) {
  50:         printf("Wraparound temp file %d\n",fil);
  51:         dexit();
  52:     }
  53:     nflush++;
  54:     if(write(tp[fil],obuf[fil],optr[fil]) != optr[fil])
  55:         return(-1);
  56:     optr[fil] = 0;
  57:     return(0);
  58: }

Defined functions

flsh defined in line 43; used 1 times
  • in line 30
put defined in line 13; never used

Defined variables

bct defined in line 1; used 1 times
  • in line 49
bsp defined in line 3; used 4 times
  • in line 5-8(4)
nflush defined in line 11; used 1 times
  • in line 53
obuf defined in line 5; used 3 times
optr defined in line 2; used 10 times
Last modified: 1975-05-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 550
Valid CSS Valid XHTML 1.0 Strict