DWORD WINAPI GetStockDrvInfo(int nInfo,void * pBuf) { switch( nInfo ) { case RI_IDSTRING: strcpy( (char*)pBuf, "Ninebulles_NET_Tongshi_3.00" ); break; case RI_IDCODE: strcpy( (char*)pBuf, "88888888" ); break; case RI_VERSION: strcpy( (char*)pBuf, "3.00" ); break; case RI_ERRRATE: strcpy( (char*)pBuf, "0" ); break; case RI_STKNUM: return GetTotalNumber(); case RI_SUPPORTEXTHQ: return -1; case RI_ENABLEDZHTRANS: return -1; case RI_ENABLETS3FILE: return -1; default: return -1; } return 1; }
static void create_configuration(void){ FILE *fp_configuration; fp_configuration=fopen("configuration.txt","w"); printf("Create configuration...\n"); fprintf(fp_configuration,"[Configuration From File] = 1\n"); fprintf(fp_configuration,"[Total Number] = %d\n",GetTotalNumber()); fprintf(fp_configuration,"[L_MIT] = 5000\n"); fprintf(fp_configuration,"[R_MIT] = 9999\n"); fprintf(fp_configuration,"[BITWIDTH] = 3\n"); fclose(fp_configuration); printf("configuration done !\n"); }
static bool check_primer_number(void){ FILE *fp_primer_number; fp_primer_number = Sfopen("primer_number.txt"); int max = GetTotalNumber(); char primer_number[max][5]; //避免数据中未初始化的值对计算的影响 //要保证数据填满数组 ,或者进行初始化 for(int i = 0;i<max;i++){ fgets(primer_number[i],6,fp_primer_number); } char * str = primer_number[0]; unsigned int answer = BKDRHash(str); return answer == PRIMER_HASH; }