6 int main(int argc, char** argv)
11 unsigned char ver_array[256]={0};
15 unsigned long end_code=0x48945489;
17 if(!(fp = fopen(argv[1], "r")))
19 fprintf(stderr,"Can not find version configuration file!\n");
20 fprintf(stderr,"Usage: mkver <ver.conf>!\n");
25 while(fgets(str, 80, fp))
28 if ((str[0]=='#')||(str[0]=='\n'))
33 //This is the string info
36 // printf("str %s: len = %d\n", str, strlen(str));
44 //This is the version info
46 ver_array[index++] = (unsigned char)atoi(str);
47 //printf("\n%d\n",ver_array[index-1]);
52 ver_array[index++] = 0x98;
53 ver_array[index] = 0x76;
58 printf("Version generation failed!.\n");
63 out = fopen("version.bin","w");
64 fwrite(&ver_array, sizeof(ver_array), 1, out);
67 //the end signature file
68 end = fopen("end.bin","w");
69 fwrite(&end_code, sizeof(end_code), 1, end);