⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 generate_philips_list.c

📁 一个手机平台的字体现实标准库转平台c源字库的脚本程序。
💻 C
字号:
#include <stdio.h>
#include <string.h>
#define SIZE  512

void gen_index_file(void)
{
FILE * finp, * fout;	
char * p1, * p2, * p3;
char str[SIZE];
char str1[128];

memset(str, 0, SIZE);
memset(str1, 0, sizeof(str1));	

p1=p2=p3=NULL;	

if((finp=fopen("ph_in.h","r"))==NULL)
{
	printf("input file err!\n");
	exit(0);	
}
	
if((fout=fopen("index.h","w+"))==NULL)
{
	printf("output file err!\n");
	exit(0);	
}

// /* ¤ */  {/*0x00a4,*/  

fputs("int data_index[]={",fout);
fputc('\n',fout);
while(fgets(str,sizeof(str),finp))
{
	p1=strstr(str,"/*");
	if(!p1)
	continue;
	p2=strstr(str,"*/");
	p2++,p2++;

	memcpy(str1,p1,(p2-p1));
	
	fputs(str1,fout);
	memset(str1, 0, sizeof(str1));	
	p1=strstr(str,"{/*");
	p2=strstr(p1,"*/");
	p1+=3;

	memcpy(str1,p1,(p2-p1));
	fputs(str1,fout);
	fputc('\n',fout);
	
}
fputc('}',fout);
fputc(';',fout);






fclose(finp);
fclose(fout);

	
}

main()
{
gen_index_file();	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -