1: #ifndef lint
   2: static  char *sccsid = "@(#)what.c	4.1 (Berkeley) 10/15/80";
   3: #endif
   4: #include <stdio.h>
   5: 
   6: /*
   7:  * what
   8:  */
   9: 
  10: char    *infile = "Standard input";
  11: 
  12: main(argc, argv)
  13:     int argc;
  14:     char *argv[];
  15: {
  16: 
  17:     argc--, argv++;
  18:     do {
  19:         if (argc > 0) {
  20:             if (freopen(argv[0], "r", stdin) == NULL) {
  21:                 perror(argv[0]);
  22:                 exit(1);
  23:             }
  24:             infile = argv[0];
  25:             printf("%s\n", infile);
  26:             argc--, argv++;
  27:         }
  28:         fseek(stdin, (long) 0, 0);
  29:         find();
  30:     } while (argc > 0);
  31: }
  32: 
  33: find()
  34: {
  35:     register int c;
  36:     register char *pat;
  37: 
  38: contin:
  39:     while ((c = getchar()) != EOF)
  40:         if (c == '@') {
  41:             for (pat = "(#)"; *pat; pat++)
  42:                 if ((c = getchar()) != *pat)
  43:                     goto contin;
  44:             putchar('\t');
  45:             while ((c = getchar()) != EOF && c && c != '"' &&
  46:                 c != '>' && c != '\n')
  47:                 putchar(c);
  48:             putchar('\n');
  49:         }
  50: }

Defined functions

find defined in line 33; used 1 times
  • in line 29
main defined in line 12; never used

Defined variables

infile defined in line 10; used 2 times
sccsid defined in line 2; never used
Last modified: 1982-09-04
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 607
Valid CSS Valid XHTML 1.0 Strict