|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ T l ┃
Length: 1129 (0x469) Types: TextFile Names: »lcasep.c«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki └─ ⟦this⟧ »EUUGD11/euug-87hel/sec8/smail/src/lcasep.c«
/* ** convert the host name on a pathalias line to lower case */ #ifndef lint static char *sccsid="@(#)lcasep.c 2.1 (smail) 12/14/86"; #endif #include <stdio.h> #include <ctype.h> # define lower(c) ( isupper(c) ? c-'A'+'a' : c ) main(argc, argv) int argc; char *argv[]; { FILE *ifp, *ofp; char buf[BUFSIZ]; register char *p; int c; extern int optind; extern char *optarg; ifp = stdin; ofp = stdout; while((c = getopt(argc, argv, "f:o:")) != EOF) { switch(c) { case 'f': if((ifp = fopen(optarg, "r")) == NULL) { (void) fprintf(stderr, "%s: can't open %s: ", argv[0], optarg); perror(""); exit(1); } break; case 'o': if((ofp = fopen(optarg, "w+")) == NULL) { (void) fprintf(stderr, "%s: can't open %s: ", argv[0], optarg); perror(""); exit(1); } break; default: (void) fprintf(stderr, "usage: %s [-f file] [-o outfile]\n", argv[0]); exit(1); /* NOTREACHED */ break; } } while(fgets(buf, sizeof(buf), ifp) != NULL) { for(p = buf; *p != '\t' && *p != '\0' ; p++) { (void) fputc(lower(*p), ofp); } (void) fputs(p, ofp); } }