1: int open[9] { 1 };
   2: int n 1;
   3: int t 0;
   4: 
   5: char in[512];
   6: 
   7: char out[512];
   8: 
   9: main(argc,argv)
  10: char **argv;
  11: {
  12:     int register r,w,p;
  13:     struct { int x1[2], type, x2[15]; } buf;
  14:     fstat(1,&buf);
  15:     t = (buf.type&060000)==020000;
  16:     while(argc-->1) {
  17:         open[n++] = creat(argv[1],0666);
  18:         if(stat(argv[1],&buf)>=0)
  19:             if((buf.type&060000)==020000)
  20:                 t++;
  21:         argv++;
  22:     }
  23:     r = w = 0;
  24:     for(;;) {
  25:         for(p=0;p<512;) {
  26:             if(r>=w) {
  27:                 if(t>0&&p>0) break;
  28:                 w = read(0,in,512);
  29:                 r = 0;
  30:                 if(w<=0) {
  31:                     stash(p);
  32:                     return;
  33:                 }
  34:             }
  35:             out[p++] = in[r++];
  36:         }
  37:         stash(p);
  38:     }
  39: }
  40: 
  41: stash(p)
  42: {
  43:     int k;
  44:     int i;
  45:     int d;
  46:     d = t ? 10 : p;
  47:     for(i=0; i<p; i=+d)
  48:         for(k=0;k<n;k++)
  49:             write(open[k], out+i, d<p-i?d:p-i);
  50: }

Defined functions

main defined in line 9; never used
stash defined in line 41; used 2 times

Defined variables

in defined in line 5; used 2 times
n defined in line 2; used 2 times
out defined in line 7; used 2 times
t defined in line 3; used 4 times
Last modified: 1975-05-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 964
Valid CSS Valid XHTML 1.0 Strict