Path: blob/main/chinese/gb2ps/files/patch-gbchar.c
16461 views
--- gbchar.c.orig 1992-08-23 11:37:58.000000000 +08001+++ gbchar.c 2013-09-26 20:54:32.000000000 +08002@@ -26,6 +26,7 @@ int commandcounter=0;3int rotate_flag=FALSE;4int setgray=0;56+void7ASCshow() {8if (ascflag) {9if (!Analyse_flag) fprintf(out,") S\n");10@@ -33,6 +34,7 @@ ASCshow() {11}12}1314+void15newline ()16{17charcount=0; H=_LM;18@@ -82,6 +84,7 @@ newline ()19}20}2122+void23put_ASC(c)24int c;25{26@@ -126,6 +129,7 @@ int c;27newline ();28}2930+void31put_CH(ch1,ch2)32int ch1,ch2;33{34@@ -217,6 +221,7 @@ int ch1,ch2;35return ch2;36}3738+void39putString(st)40char* st;41{42@@ -238,6 +243,7 @@ char* st;4344/*===========================================================================*/4546+void47DefCHdict() {48long i,j,k=0;49char st1[10];50@@ -249,7 +255,7 @@ DefCHdict() {51if (CHcode[i][j]>=CHAR_LIMIT) k++;52}5354- fprintf(out,"/CHdict %d dict def\nCHdict begin\n",k+400);55+ fprintf(out,"/CHdict %ld dict def\nCHdict begin\n",k+400);5657for (i=0;i<94*94;i++)58for (j=0;j<6;j++) {59@@ -257,7 +263,7 @@ DefCHdict() {60fseek(CHFONT[j].fp,offset_CH+i*size_of_CH,0);61fgets(line,size_of_CH,CHFONT[j].fp);62sscanf(line,"%s %s",st1,st2);63- fprintf(out,"/C%1d%s {H {<%s>} I G} def \n",j,st1,st2);64+ fprintf(out,"/C%1ld%s {H {<%s>} I G} def \n",j,st1,st2);65}66}67}68@@ -265,7 +271,8 @@ DefCHdict() {6970/*AnalyseDoc: analyse the input document.*/7172-int AnalyseDoc() {73+void74+AnalyseDoc() {75int ch=0,ch1,ch2,i,j;7677for (i=0;i<94*94;i++)78@@ -326,13 +333,14 @@ int readchar() {79c=fgetc(in);80}8182- if (CH_mode)83- if (((c&0x7f)>=0x21)&&((c&0x7f)<=0x7e))84+ if (CH_mode) {85+ if (((c&0x7f)>=0x21)&&((c&0x7f)<=0x7e)) {86return c|0x80;87- else {88+ } else {89CH_mode=FALSE;90return c;91}92+ }9394if (!format_flag) return c;95969798