FileSystem.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:8k
- /****************************************************************************************
- * Copyright (c) 2002 ZORAN Corporation, All Rights Reserved
- * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
- *
- * File: $Workfile: FileSystem.h $
- *
- * Description:
- * ============
- *
- *
- * Log:
- * ====
- * $Revision: 7 $
- * Last Modified by $Author: Jerryc $ at $Modtime: 04-03-19 11:00 $
- ****************************************************************************************
- * Updates:
- ****************************************************************************************
- * $Log: /I76/I76_Common/I76_Reference/Playcore/FileSys/FileSystem.h $
- *
- * 7 04-03-19 11:03 Jerryc
- * replace SUPPORT_FLASH_CARD with ENABLE_FILEX.
- *
- * 6 03-06-02 14:06 Jerryc
- * redefine eFileX to keep compatibility with old nav_dvd lib.
- *
- * 5 03-05-30 11:43 Jerryc
- * fix compile warning.
- *
- * 4 03-05-29 18:11 Jerryc
- * support flash card
- *
- * 3 03-01-10 12:19 Leslie
- * Add builtin unicode support
- *
- * 8 9/05/02 16:16 Nirm
- * - Expanded FileSys_getDVDFileInfo() functionality, to increase
- * efficiency.
- *
- * 7 23/04/02 9:30 Nirm
- * - Added dependency in "Config.h".
- *
- * 6 7/02/02 10:42 Nirm
- * Added FileSys_getPathDelimiter().
- *
- * 5 30/01/02 18:13 Nirm
- * Changed Search-ID to 16 bit.
- *
- * 4 27/01/02 17:48 Nirm
- * - Added automatic selection of the File-System type;
- * - Search-handles are 16-bit long instead of 32 bit.
- *
- * 3 1/09/02 15:24 Idan
- * changed () -> (void) in functions' prototypes.
- *
- * 2 9/01/02 14:58 Nirm
- * Corrected Include-Paths.
- *
- * 1 12/27/01 14:19 Idan
- ****************************************************************************************/
- /////////////////////////////////////////////////////////////////////////////
- // FileSystem.h - Abstract support for File-Systems
- //
- // Author: Nir Milstein
- #include "Config.h" // Global Configuration - do not remove!
- #ifndef __FILESYSTEM_H_
- #define __FILESYSTEM_H_
- #include "IncludeSysDefs.h"
- #ifdef ENABLE_FILEX
- #include "PlaycoreFileSysFileXHeaderFx_api.h"
- typedef FX_FILE STRUCT_FILE;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // Constants and Enumerations
- typedef struct {
- // Revision Number
- UINT16 uRevision;
- // Session information
- DWORD dwSessionStartLBN;
- // Volume information
- DWORD dwLBA_Offset;
- DWORD dwMainPartitionLocation;
- // Short_ad sadMainPartitionUnallocSpaceBitmap;
- #ifdef UDF_SUPPORT_UDF201
- BOOL bUseSparingManagement;
- struct SparingTable *pMainPartitionSparingTable;
- UINT16 uSparingPacketLength;
- #endif //UDF_SUPPORT_UDF201
- DWORD dwRootDirICB;
- DWORD dwCurrDirICB;
- // Current Working-Directory storage
- BOOL bCWDStored;
- DWORD dwCWDStorage;
- }UDFInfo_TAG;// g_UDFInfo;
- typedef struct {
- // Session information
- DWORD dwSessionStartLBN;
- // Unicode support
- BOOL bIsUsingUnicode;
- // Volume information
- DWORD dwRootDirICB;
- DWORD dwCurrDirICB;
- // Current Working-Directory storage
- BOOL bCWDStored;
- DWORD dwCWDStorage;
- // Directory Hierarchy Tree
- UINT16 uDirectoryCnt;
- UINT32 hDirTree;
- } ISO9660_TAG;//g_ISO9660Info;
- typedef union {
- UDFInfo_TAG g_UDFInfo;
- ISO9660_TAG g_ISO9660Info;
- }FileInfo ;
- #ifdef ENABLE_FILEX
- typedef enum { eISO9660, eUDF_Bridge, eUDF_102, eUDF_200, eAny, eUnknown, eFileX } enFileSysType;
- #else
- typedef enum { eISO9660, eUDF_Bridge, eUDF_102, eUDF_200, eAny, eUnknown } enFileSysType;
- #endif
- typedef enum { eFreeEASpace, eCGMS } enDVD_FileInfoType;
- #define FILETYPE_UNKNOWN 0
- #define FILETYPE_UNALLOC 1
- #define FILETYPE_INTEGRITY 2
- #define FILETYPE_INDIRECT 3
- #define FILETYPE_DIRECTORY 4
- #define FILETYPE_NORMAL 5
- #define FILETYPE_BLOCK_DEV 6
- #define FILETYPE_CHAR_DEV 7
- #define FILETYPE_EXT_ATTR 8
- #define FILETYPE_FIFO 9
- #define FILETYPE_C_ISSOCK 10
- #define FILETYPE_TERMINAL 11
- #define FILETYPE_LINK 12
- #define FILETYPE_STREAM 13
- #define FILETYPE_VOLUME 14
- #define FILESYS_WILDCARD_SEARCH L"*"
- #define FILESYS_BLURRED_SEARCH L'*' //MikeX_1213_2004_A
- /////////////////////////////////////////////////////////////////////////////
- // Common Data-Structures
- typedef struct FindData_TAG {
- WCHAR szFileID[65]; // File/Directory Name
- UINT8 uFileType; // Type of this File
- UINT32 cbFileSizeHigh; // File-Size's MS-32-bits (File-Size is given in Bytes)
- UINT32 cbFileSizeLow; // File-Size's LS-32-bits (File-Size is given in Bytes)
- DWORD dwStartAddr; // File's Start-Address
- } FindData, * PFindData;
- typedef struct DVDFileInfo_TAG {
- enDVD_FileInfoType eInfoType;
- union DVDInfo_TAG {
- UINT16 cbFreeEASpace;
- struct CopyrightManagementInfo_TAG {
- BYTE ucCGMSInfo;
- UINT8 uDataStructureType;
- BYTE aProtectionSystemInfo[4];
- BYTE aPadding[2];
- } cmiCGMS;
- } Info;
- } DVDFileInfo, * PDVDFileInfo;
- /////////////////////////////////////////////////////////////////////////////
- // File-System Identification
- enFileSysType FileSys_determineType(void);
- BOOL FileSys_selectType(enFileSysType eCurrentType);
- enFileSysType FileSys_getSelectedType(void);
- /////////////////////////////////////////////////////////////////////////////
- // Initialization
- BOOL FileSys_initialize(BOOL bLongFilenameSupport);
- void FileSys_setPathDelimiter(WCHAR cPathDelimiter);
- WCHAR FileSys_getPathDelimiter(void);
- /////////////////////////////////////////////////////////////////////////////
- // Navigation
- BOOL FileSys_goToRootDir(void);
- BOOL FileSys_changeDir(LPCWSTR i_pszDestDirName);
- BOOL FileSys_goUp(void);
- /////////////////////////////////////////////////////////////////////////////
- // Queries
- void FileSys_getVolumeName(LPCWSTR volumeName);
- void FileSys_getCurrentPath(LPCWSTR currPath);
- BOOL FileSys_fileExists(LPCWSTR i_pszFilename);
- BOOL FileSys_getFileLocation(LPCWSTR i_pszFilename, DWORD *o_pFileLocation);
- BOOL FileSys_getDVDFileInfo(LPCWSTR i_pszFilename, enDVD_FileInfoType eType,
- DVDFileInfo *o_pFileInfo, FindData *o_pFindData);
- UINT16 FileSys_findFirstFile(LPCWSTR i_pszFilename, FindData *o_pFindData);
- BOOL FileSys_findNextFile(UINT16 hFindFile, FindData *o_pFindData);
- BOOL FileSys_findClose(UINT16 hFindFile);
- #ifdef DVD_VR_SUPPORT
- #define DVDVR_PLAY_QUEUE_SIZE 256
- typedef struct _DVDVR_PLAY_QUEUE_NODE
- {
- DWORD dwLength; //by LBN
- DWORD dwStartLBN;
- } DVDVR_PLAY_QUEUE_NODE;
- BOOL FileSys_DVDVR_getFileExtent(LPCWSTR i_pszFilename, DWORD *o_pFileExtent);
- BOOL FileSys_DVDVR_FreeFileExtent(DWORD i_pFileExtent);
- BOOL FileSys_DVDVR_ReadFile(DWORD pFileHandle, DWORD dwOffset, DWORD dwSize, BYTE* o_pBuffer);
- BOOL FileSys_DVDVR_PlayQueue_Construct(void);
- void FileSys_DVDVR_PlayQueue_Clear(void);
- void FileSys_DVDVR_PlayQueue_Destruct(void);
- BOOL FileSys_DVDVR_PlayQueue_NextExtent(void);
- BOOL FileSys_DVDVR_PlayExtents(DWORD pFileHandle, DWORD dwOffset, DWORD dwSize);
- #endif
- #ifdef ENABLE_FILEX
- #ifndef I86_HW_FCU
- #ifdef FILEX_READ_4_SECTORS
- #define FILEX_CACHE_SIZE (2048 + 1024)
- #else
- #define FILEX_CACHE_SIZE 1024
- #endif
- #endif //I86_HW_FCU
- typedef struct STRUCT_FILEX{
- #ifndef I86_HW_FCU
- BYTE ucFileXCacheBuff[FILEX_CACHE_SIZE];
- #endif
- FX_MEDIA FileX_media;
- } FILEX;
- BOOL FileSys_FileOpen(STRUCT_FILE * file, DWORD dwStartAddr, UINT32 cbFileSizeHigh, UINT32 cbFileSizeLow);
- BOOL FileSys_FileSeek(STRUCT_FILE * file, UINT32 cbFileOffsetHigh, UINT32 cbFileOffsetLow);
- UINT16 FileSys_FileRead(STRUCT_FILE * file, BYTE * read_buff, UINT32 size,UINT32 * actual_sizectual_size);
- BOOL FileSys_FileClose(STRUCT_FILE * file);
- BOOL FileSys_IsFileClosed(STRUCT_FILE * file_ptr);
- BOOL FileSys_IsCardAvailable(void);
- BOOL FileX_SetDataSpace(FILEX * pFileX);
- BOOL FileSys_close (void);
- #if 0//jerry temp TODO: remove it later.
- BOOL FileSys_OF(FX_FILE *file_ptr, CHAR *file_name, UINT open_type);
- #endif
- #endif
- #endif //__FILESYSTEM_H_