home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 110_01 / see.c < prev    next >
Text File  |  1984-03-03  |  768b  |  42 lines

  1. #include "A:BDSCIO.H"
  2. /*
  3.  * see prints one or more ufn's unambiguously
  4.  * Chuck Forsberg Computer Development Inc
  5.  */
  6. int c;
  7. FILE in;
  8.  
  9. main(argc,argv)
  10. int argc;
  11. char *argv[];
  12. {
  13.     int ac;
  14.     for (ac=1;ac < argc;ac++) {
  15.         if(fopen(argv[ac],in)==ERROR)
  16.             continue;
  17.         else
  18.             printf("Listing '%s'\n", argv[ac]);
  19.         for(;;) {
  20.             c=getc(in);
  21. next:
  22.             if(c == EOF || c == CPMEOF)
  23.                 break;
  24.             if(c >= 040 && c < 0177 )
  25.                 putchar(c);
  26.             else
  27.                 switch(c) {
  28.                 case 012:
  29.                     printf("<012>\n"); continue;
  30.                 case 015:
  31.                     if((c=getc(in))==012) {
  32.                         printf("$\n"); continue;
  33.                     } else {
  34.                         printf("<015>"); goto next;
  35.                     }
  36.                 default:
  37.                     printf("<%o>", c); continue;
  38.                 }
  39.         }
  40.     }
  41. }
  42. ├╗:*▀;δ!∩Ez│╚╒^#V#~#σfoδ═    ;ß#╤├±:DM*