来帮忙看下怎么改.
UINT32 Register( char* file_uri, char* param, UINT32 reserve ){
UINT32 status = RESULT_OK;
UINT8 *bufR;
char bufVal[10];
WCHAR* buf = suAllocMem( 100, NULL );
FILE_HANDLE_T f;
BOOL bValue = TRUE;
UINT32 readen;
UINT32 fSize,m=0;
evcode_base = reserve;
for (i=0; i < strlen(file_uri)-3; i++)
{
nameCfgFile[i] = file_uri[i];
}
strcat(nameCfgFile, "txt");
u_atou(nameCfgFile, buf);
if (DL_FsFFileExist(buf ) == TRUE ) //
{
PFprintf("*ELF* FileExist:%x\n",evcode_base);
f = DL_FsOpenFile(buf, FILE_READ_MODE, 0);
fSize = DL_FsGetFileSize(f);
bufR = (UINT8*) suAllocMem( fSize, NULL );
DL_FsReadFile( bufR,fSize, 1, f, &readen );
for (j=0; j < fSize; j++)
{
if(bufR[j]==0x3b)
{
bValue=FALSE;
continue;
}
if(bValue==TRUE)
{
bufVal[j]=bufR[j];
}
else
{
name[m]=bufR[j];
m=m+1;
}
}
PFprintf("*ELF* bufVal:%x\n",strtoul(bufVal,NULL,16));
PFprintf("*ELF* name:%s\n",name);
DL_FsCloseFile(f);
suFreeMem(bufR);
}
这一段只能读取配置文件一行内容.
如何改成可以读取两行?