⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filesystemdef.h

📁 MTK手机平台的MMI部分的源代码
💻 H
字号:
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2005
*
*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
*
*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/

/*****************************************************************************
 *
 * Filename:
 * ---------
 *  FileSystemGProt.h
 *
 * Project:
 * --------
 *  MAUI
 *
 * Description:
 * ------------
 *  This file defines type, data structure, constant of File System Simulation.
 *
 * Author:
 * -------
 * -------
 *
 *============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *------------------------------------------------------------------------------
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *============================================================================
 ****************************************************************************/
#ifndef _MMI_FILESYSTEMDEF_H
#define _MMI_FILESYSTEMDEF_H

#include "L4Dr.h"
#include "FileManagerGProt.h"
#include "MMI_features.h"
/***************************************************************************** 
* Define
*****************************************************************************/
#define  MAX_BUFF_SIZE        512
#define  MAX_FILE_NAME        200

extern S32 CreateDir(U8 *pPath);

#ifndef MMI_ON_WIN32
/* Opens for reading. If the file does not exist or cannot be found.Fails Returned To Call */
#define FILE_HANDLE        FS_HANDLE
extern FILE_HANDLE OpenCache(U8 *pFileName, S32 nType);

#define PFS_READ           FS_READ_ONLY
#define PFS_READ_BINARY    PFS_READ

/* Opens an empty file for writing. If the given file exists, its contents are destroyed. */
#define PFS_WRITE          FS_READ_WRITE|FS_CREATE_ALWAYS
/* Opens for writing and Reading; creates the file first if it doesn抰 exist. */
#define PFS_WRITE_READ     FS_READ_WRITE|FS_CREATE

#define pfopen(x,y)        FS_Open((U16 *)x,y)
#define pfclose(x)         { FS_Commit(x); FS_Close(x); }

#define pfwrite(x1,x2,x3,x4,x5) FS_Write(x4,x1,x3,(U32 *)x5)
#define pfread(x1,x2,x3,x4,x5)  FS_Read(x4,x1,x3,(U32 *)x5)

#define pfseek             FS_Seek
#define pfdelete(x)        FS_Delete((U16 *)x)
#define pfrename(x,y)      FS_Rename((U16 *)x,(U16 *)y)
#define pcreateDir(x)      CreateDir((U8*)x)

#define pfindfirst(x1, x2, x3, x4, x5, x6)      FS_FindFirst((PU16)x1, (U8)x2, (U8)x3, (FS_DOSDirEntry*)x4, (PU16)x5, (U32)x6 )
#define pfindnext(x1, x2, x3, x4)               FS_FindNext((FILE_HANDLE)x1, (FS_DOSDirEntry*)x2, (PU16)x3, (U32)x4 )

#else /* MMI_ON_WIN32 */ 

   /*
    * NoteXX: i have change some definitions and declarations here
    *         for integration of File System Simulation.
    *         (Originally most functions are connected to C Run-time
    *         library.)
    */

#define FILE_HANDLE int

extern FILE_HANDLE OpenCache(U8 *pFileName, U8 *pType);
extern FILE_HANDLE OpenFileFS(U8 *pFileName, U8 *pType);
extern FILE_HANDLE pFindFirstEx(const PS8 x1, U8 x2, U8 x3, void *x4, PS8 x5, U32 x6);
extern U8 pFindNextEx(FILE_HANDLE x1, void *x2, PS8 x3, U32 x4);
extern void CloseFileFS(FILE_HANDLE f);
extern size_t ReadFileFS(void *buffer, size_t size, size_t count, FILE_HANDLE f, size_t *read);
extern size_t WriteFileFS(const void *buffer, size_t size, size_t count, FILE_HANDLE f);

/* Opens for reading. If the file does not exist or cannot be found.Fails Returned To Call */
#define PFS_READ _T("r")
/* Opens an empty file for writing. If the given file exists, its contents are destroyed. */
#define PFS_WRITE _T("w")
/* Opens for writing and Reading; File Pointer at EOF.creates the file first if it doesn抰 exist. */
#define PFS_WRITE_READ _T("a+")
#define PFS_READ_BINARY _T("rb")

#define pfopen(x,y)  OpenFileFS(x,y)
#define pfclose CloseFileFS
#define pfwrite(x1,x2,x3,x4,x5) WriteFileFS(x1, x2, x3, x4)
#define pfread(x1,x2,x3,x4,x5) ReadFileFS(x1, x2, x3, x4, x5)
#define pfseek SeekFileFS
#define pfdelete fdelete
#define pfrename frename
#define pcreateDir(x) CreateDir(x)
#define pfindfirst(x1, x2, x3, x4, x5, x6) pFindFirstEx((const PS8)x1, (U8)x2, (U8)x3, (void*)x4, (PS8)x5, (U32)x6 )
#define pfindnext(x1, x2, x3, x4) pFindNextEx((FILE_HANDLE)x1, (void*)x2, (PS8)x3, (U32)x4 )

#endif /* MMI_ON_WIN32 */ 

#define PFS_READ_WRITE PFS_WRITE_READ
#define  pfOpenCache OpenCache

/***************************************************************************** 
* Typedef 
*****************************************************************************/

/***************************************************************************** 
* Extern Global Variable
*****************************************************************************/

/***************************************************************************** 
* Extern Global Function
*****************************************************************************/
/* Leo add for DLT */
extern S32 Searchfile(FILE_HANDLE);

/* Leo end */

extern S32 GetFSFileSize(FILE_HANDLE handle);
extern S32 StartFileRead(FILE_HANDLE handle, U32 nIndex);
extern S32 pfgetc(FILE_HANDLE handle);
extern pBOOL IsEndOfCurrentFile(void);
extern S32 pCacheFileRead(FILE_HANDLE handle, S32 nBufferSize, S32 *nRead, U8 *pBuffer);
extern S32 pCacheFileSeek(FILE_HANDLE handle, S32 nBytes, S32 nType);
extern S32 pCopyFile(PU8 pSourceFile, PU8 pDestFile, pBOOL bFailIfExists);

#ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
extern S32 pCopyFileFromOffset(FILE_HANDLE fSourceFile, PU8 pDestFile, U32 offset, U32 size);
#endif 

#endif /* _MMI_FILESYSTEMDEF_H */ 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -