Debian Codegraph @

texk/cjkutils/sjisconv.c

raw
1 #define banner \
2 "sjisconv (CJK ver. 4.8.5)" \
3
4 /*2:*/
5 #line 96 "./cjkutils-src/SJISconv/sjisconv.w"
6
7 #include <stdio.h>
8 #include <stdlib.h>
9 #ifdef WIN32
10 #include <fcntl.h>
11 #include <io.h>
12 #endif
13
14
15 int main(int argc,char*argv[])
16 {int ch;
17
18 #ifdef WIN32
19 setmode(fileno(stdout),_O_BINARY);
20 #endif
21 fprintf(stdout,"\\def\\CJKpreproc{%s}",banner);
22
23 ch= fgetc(stdin);
24
25 while(!feof(stdin))
26 {if((ch>=0x81&&ch<=0x9F)||(ch>=0xE0&&ch<=0xEF))
27 {fprintf(stdout,"\177%c\177",ch);
28
29 ch= fgetc(stdin);
30 if(!feof(stdin))
31 fprintf(stdout,"%d\177",ch);
32 }
33 else
34 fputc(ch,stdout);
35
36 ch= fgetc(stdin);
37 }
38 exit(EXIT_SUCCESS);
39 return 0;
40 }/*:2*/