diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/tspell/chk.c |
Initial commit
Diffstat (limited to 'support/tspell/chk.c')
-rw-r--r-- | support/tspell/chk.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/support/tspell/chk.c b/support/tspell/chk.c new file mode 100644 index 0000000000..c256557a86 --- /dev/null +++ b/support/tspell/chk.c @@ -0,0 +1,39 @@ +% Save file as: CHK.C Source: FILESERV@SHSU.BITNET +#include <stdio.h> +main(argc,argv) +int argc,*argv[]; +{char ch; + int check; + FILE *fp1,*fp2,*fopen(); + if(argc<3) +{printf("useage: chk inputfile outputfile"); +exit(1); +} + fp1=fopen(argv[1],"r"); + fp2=fopen(argv[2],"w"); + if(fp1==NULL){printf("chk:input file not found");exit(1);} + if(fp2==NULL){printf("chk:output file cannot be created");exit(1);} +/* printf("%s",argv[2]);*/ + for(;ch!=EOF;) +{ ch=fgetc(fp1); + switch(ch) + {case '\\': + fputc(ch,fp2); + check=1; + while(check!=0) + {ch=fgetc(fp1); + switch(ch) + {case ' ':fputc(ch,fp2);check=0; break; + case '{':fputc(ch,fp2);check=0; break; + case '\n':fputc(ch,fp2);check=0;break; + case '\t':fputc(ch,fp2);check=0;break; + case '\\':fputc(ch,fp2); + case EOF:break; + } + } + break; + default:fputc(ch,fp2); + } +} + +} |