📄 filesystemsrc.c
字号:
if (retval == FS_NO_ERROR)
/* succeed */
{
return 1;
}
else
/* fail */
{
return 0;
}
}
/*****************************************************************************
* FUNCTION
* pFindFirstEx
* DESCRIPTION
*
* PARAMETERS
* x1 [IN]
* x2 [IN]
* x3 [IN]
* x4 [?]
* x5 [IN]
* x6 [IN]
* RETURNS
*
*****************************************************************************/
FILE_HANDLE pFindFirstEx(const PS8 x1, U8 x2, U8 x3, void *x4, PS8 x5, U32 x6)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return 0;
}
/*****************************************************************************
* FUNCTION
* pFindNextEx
* DESCRIPTION
*
* PARAMETERS
* x1 [IN]
* x2 [?]
* x3 [IN]
* x4 [IN]
* RETURNS
*
*****************************************************************************/
U8 pFindNextEx(FILE_HANDLE x1, void *x2, PS8 x3, U32 x4)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return -1;
}
/*****************************************************************************
* FUNCTION
* CloseFileFS
* DESCRIPTION
*
* PARAMETERS
* f [IN]
* RETURNS
* void
*****************************************************************************/
void CloseFileFS(FILE_HANDLE f)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
FS_Close(f);
}
/*****************************************************************************
* FUNCTION
* WriteFileFS
* DESCRIPTION
*
* PARAMETERS
* buffer [IN]
* size [IN]
* count [IN]
* f [IN]
* RETURNS
*
*****************************************************************************/
size_t WriteFileFS(const void *buffer, size_t size, size_t count, FILE_HANDLE f)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U32 write;
int retval;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
retval = FS_Write(f, (void*)buffer, size * count, &write);
if (retval == FS_NO_ERROR)
/* succeed */
{
return write;
}
else
/* fail */
{
return 0;
}
}
/*****************************************************************************
* FUNCTION
* ReadFileFS
* DESCRIPTION
*
* PARAMETERS
* buffer [?]
* size [IN]
* count [IN]
* f [IN]
* read [?]
* RETURNS
*
*****************************************************************************/
size_t ReadFileFS(void *buffer, size_t size, size_t count, FILE_HANDLE f, size_t *read)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U32 dummyread;
int retval;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (read == NULL)
{
read = &dummyread;
}
retval = FS_Read(f, buffer, size * count, read);
if (retval != FS_NO_ERROR)
/* fail */
{
*read = EOF;
}
return *read;
}
/*****************************************************************************
* FUNCTION
* CreateDir
* DESCRIPTION
*
* PARAMETERS
* pPath [?]
* RETURNS
*
*****************************************************************************/
S32 CreateDir(U8 *pPath)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 nLen = 0;
S32 nCount = 0;
S32 nRetVal;
U16 nFirstTime = TRUE;
U8 aTempPath[150];
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
nLen = UCS2Strlen((PS8) pPath);
nLen *= ENCODING_LENGTH;
while (nCount < nLen)
{
if (pPath[nCount] == '\\' && pPath[nCount + 1] == '\0')
{
if (!nFirstTime)
{
aTempPath[nCount] = '\0';
aTempPath[nCount + 1] = '\0';
nRetVal = FS_CreateDir((U16*) aTempPath);
//if(nRetVal<FS_NO_ERROR) // vikram...08/11/2003
// return nRetVal;
}
else
{
nFirstTime = FALSE;
}
}
aTempPath[nCount] = pPath[nCount];
aTempPath[nCount + 1] = pPath[nCount + 1];
nCount += 2;
}
aTempPath[nCount] = '\0';
aTempPath[nCount + 1] = '\0';
nRetVal = FS_CreateDir((U16*) aTempPath);
return nRetVal;
}
/*****************************************************************************
* FUNCTION
* OpenCache
* DESCRIPTION
*
* PARAMETERS
* pFileName [?]
* nType [?]
* RETURNS
*
*****************************************************************************/
FILE_HANDLE OpenCache(U8 *pFileName, U8 *nType)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
FILE_HANDLE file;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
file = pfopen(pFileName, nType);
if (pfOpenError(file))
{
return 0;
}
else
{
StartFileRead(file, 0);
}
return file;
}
#endif /* MMI_ON_WIN32 */
#ifndef MMI_ON_WIN32
/*****************************************************************************
* FUNCTION
* CreateDir
* DESCRIPTION
*
* PARAMETERS
* pPath [?]
* RETURNS
*
*****************************************************************************/
S32 CreateDir(U8 *pPath)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 nLen = 0;
S32 nCount = 0;
S32 nRetVal;
U16 nFirstTime = TRUE;
U8 aTempPath[150];
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
nLen = UCS2Strlen((PS8) pPath);
nLen *= ENCODING_LENGTH;
while (nCount < nLen)
{
if (pPath[nCount] == '\\' && pPath[nCount + 1] == '\0')
{
if (!nFirstTime)
{
aTempPath[nCount] = '\0';
aTempPath[nCount + 1] = '\0';
nRetVal = FS_CreateDir((U16*) aTempPath);
//if(nRetVal<FS_NO_ERROR) // vikram...08/11/2003
// return nRetVal;
}
else
{
nFirstTime = FALSE;
}
}
aTempPath[nCount] = pPath[nCount];
aTempPath[nCount + 1] = pPath[nCount + 1];
nCount += 2;
}
aTempPath[nCount] = '\0';
aTempPath[nCount + 1] = '\0';
nRetVal = FS_CreateDir((U16*) aTempPath);
return nRetVal;
}
/*****************************************************************************
* FUNCTION
* OpenCache
* DESCRIPTION
*
* PARAMETERS
* pFileName [?]
* nType [IN]
* RETURNS
*
*****************************************************************************/
FILE_HANDLE OpenCache(U8 *pFileName, S32 nType)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
FILE_HANDLE file;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
file = pfopen(pFileName, nType);
if (pfOpenError(file))
{
return NULL;
}
else
{
StartFileRead(file, 0);
}
return file;
}
#endif /* MMI_ON_WIN32 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -