查汉字的24点阵输入字库名,文本文件名,要生成的文件名
源代码在线查看: cdzuc24.c
/*cdzuc24 *.dot ***.txt ***.obj*/
#include"stdio.h"
main(argc,argv)
int argc;
char *argv[];
{
FILE *in,*out,*in1,*in0;
char *buffer,sh;
unsigned int b,c,d,e,s,ch;
long int q,w,i,j;
long int a;
unsigned int seg,offset;
if(argc!=4)
{
printf("You forgot to enter a filename\n");
exit(1);
}
if((in1=fopen(argv[1]/*"cclibj.dot"*/,"rb"))==NULL)
{
printf("connot open SOURSE file");
exit(1);
}
if((in=fopen(argv[2],"rb"))==NULL)
{
printf("cannot OPEN source file");
exit(1);
}
if((in0=fopen("hzk24t","rb"))==NULL)
{
printf("canNOT OPEN source file");
exit(1);
}
if((out=fopen(argv[3],"wb"))==NULL)
{
exit(1);
}
while(!feof(in))
{
ch=getc(in);
if(ch==0x0d)
{
ch=getc(in);
ch=getc(in);
}
if(ch==0x20)
{
ch=getc(in);
}
if(ch {
q=ch-0xa1;
ch=getc(in);
w=ch-0xa1;
a=(q*94+w)*72;
fseek(in0,a,0);
for(i=0;i {
ch=fgetc(in0);
putc(ch,out);
}
}
else
{
q=ch-0xb0;
ch=getc(in);
w=ch-0xa1;
a=(q*94+w)*72;
fseek(in1,a,0);
for(i=0;i {
ch=fgetc(in1);
putc(ch,out);
}
}
}
fclose(in);
fclose(out);
fclose(in0);
fclose(in1);
}