//#include "graphics.h" #include "fcntl.h" #include "stdio.h" #define N 30 int hzk_p; void open_hzk(void); void get_mat(char hz_code[ ],unsigned char buff[ ]); void creatclib(char *name); void sort( ); void writeclib(char *name); unsigned char bytes[32]; unsigned *point1[2]; struct hz_mat{ unsigned incode; unsigned char mat[32]; }; struct hzlib { int n; struct hz_mat lib[N]; }clib; main( ) { open_hzk( ); creatclib("hz.txt"); writeclib("mylib.h"); } void creatclib(char *name ) { register i,j,found,n; FILE *fp; n=0; fp=fopen("li.txt","rt"); rewind(fp); printf("%x ",fp); if(fp==NULL) { printf("li.txt not exist!ENTER to system"); exit(1); } while(!feof(fp)) { fread(point1,2,1,fp); printf("%x %x ",*point1,fp); found=0; for(i=0;i=a;--b) { if(clib.lib[b-1].incode>clib.lib[b ].incode) {t=clib.lib[b-1].incode; clib.lib[b-1].incode=clib.lib[b ].incode; clib.lib[b ].incode=t; for(i=0;i<32;i++) { buffer[i ]=clib.lib[b-1].mat[ i]; clib.lib[b-1].mat[i ]=clib.lib[b ].mat[i ]; clib.lib[b ].mat[i ]=buffer[i ]; } } } }