home *** CD-ROM | disk | FTP | other *** search
- #include "libc.h"
-
- main(argc,argv)
- int argc; char **argv;
- {
- int c, f1, f2, comment, onequote, twoquote;
-
- f1 = fopen(argv[1],"r"); /* open file 1 */
- f2 = fopen(argv[2],"w"); /* open file 2 */
-
- comment = onequote = twoquote = 0;
-
- while((c=agetc(f1))!=EOF) {
- switch (c) {
- case ';' :
- comment = 1;
- break;
- case '\n':
- comment = 0;
- onequote = 0;
- twoquote = 0;
- break;
- case '"' :
- twoquote = ~twoquote;
- break;
- case '\'':
- onequote = ~onequote;
- break;
- default :
- break;
- }
- if (((onequote != 0) | (twoquote != 0)) & (comment == 0))
- aputc(c,f2);
- else if (comment == 0)
- aputc(toupper(c),f2);
- else if (comment == 1)
- aputc(tolower(c),f2);
- }
-
- fclose(f1);
- fclose(f2);
- exit(0);
- }