1: #ifndef lint
   2: static char sccsid[] = "@(#)tee.c	4.2	(Berkeley)	4/25/83";
   3: #endif not lint
   4: 
   5: #include <stdio.h>
   6: main()
   7: {
   8:     int f, c;
   9: 
  10:     f = creat(".ocopy", 0666);
  11:     while (read(0, &c, 1) == 1) {
  12:         write (1, &c, 1);
  13:         put(c, f);
  14:     }
  15:     fl(f);
  16:     close(f);
  17: }
  18: 
  19: static char ln[BUFSIZ];
  20: char *p = ln;
  21: put(c, f)
  22: {
  23:     *p++ = c;
  24:     if (c == '\n') {
  25:         fl(f);
  26:         p=ln;
  27:     }
  28: }
  29: fl(f)
  30: {
  31:     register char *s;
  32: 
  33:     s = ln;
  34:     while (*s == '$' && *(s+1) == ' ')
  35:         s += 2;
  36:     write(f, s, p-s);
  37: }

Defined functions

fl defined in line 29; used 2 times
main defined in line 6; never used
put defined in line 21; used 1 times
  • in line 13

Defined variables

ln defined in line 19; used 3 times
p defined in line 20; used 3 times
sccsid defined in line 2; never used
Last modified: 1985-03-28
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2548
Valid CSS Valid XHTML 1.0 Strict