Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenff_dir.h
Go to the documentation of this file.
00001 /***************************************************************************** 00002 * FullFAT - High Performance, Thread-Safe Embedded FAT File-System * 00003 * Copyright (C) 2009 James Walmsley (james@worm.me.uk) * 00004 * * 00005 * This program is free software: you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation, either version 3 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 00017 * * 00018 * IMPORTANT NOTICE: * 00019 * ================= * 00020 * Alternative Licensing is available directly from the Copyright holder, * 00021 * (James Walmsley). For more information consult LICENSING.TXT to obtain * 00022 * a Commercial license. * 00023 * * 00024 * See RESTRICTIONS.TXT for extra restrictions on the use of FullFAT. * 00025 * * 00026 * Removing the above notice is illegal and will invalidate this license. * 00027 ***************************************************************************** 00028 * See http://worm.me.uk/fullfat for more information. * 00029 * Or http://fullfat.googlecode.com/ for latest releases and the wiki. * 00030 *****************************************************************************/ 00031 00037 #ifndef _FF_DIR_H_ 00038 #define _FF_DIR_H_ 00039 00040 #include "ff_types.h" 00041 #include "ff_config.h" 00042 #include "ff_error.h" 00043 #include "ff_ioman.h" 00044 #include "ff_blk.h" 00045 #include "ff_fat.h" 00046 #include "ff_fatdef.h" 00047 #include "ff_memory.h" 00048 #include "ff_time.h" 00049 #include "ff_hash.h" 00050 #include "ff_crc.h" 00051 #include "ff_file.h" 00052 #include <string.h> 00053 00054 typedef struct { 00055 FF_T_UINT32 ulChainLength; 00056 FF_T_UINT32 ulDirCluster; 00057 FF_T_UINT32 ulCurrentClusterLCN; 00058 FF_T_UINT32 ulCurrentClusterNum; 00059 FF_T_UINT32 ulCurrentEntry; 00060 FF_BUFFER *pBuffer; 00061 } FF_FETCH_CONTEXT; 00062 00063 typedef struct { 00064 FF_T_UINT32 Filesize; 00065 FF_T_UINT32 ObjectCluster; 00066 00067 // Book Keeping 00068 FF_T_UINT32 CurrentCluster; 00069 FF_T_UINT32 AddrCurrentCluster; 00070 FF_T_UINT32 DirCluster; 00071 FF_T_UINT16 CurrentItem; 00072 // End Book Keeping 00073 00074 #ifdef FF_TIME_SUPPORT 00075 FF_SYSTEMTIME CreateTime; 00076 FF_SYSTEMTIME ModifiedTime; 00077 FF_SYSTEMTIME AccessedTime; 00078 #endif 00079 00080 #ifdef FF_FINDAPI_ALLOW_WILDCARDS 00081 #ifdef FF_UNICODE_SUPPORT 00082 FF_T_WCHAR szWildCard[FF_MAX_FILENAME]; 00083 #else 00084 FF_T_INT8 szWildCard[FF_MAX_FILENAME]; 00085 #endif 00086 #endif 00087 00088 #ifdef FF_UNICODE_SUPPORT 00089 FF_T_WCHAR FileName[FF_MAX_FILENAME]; 00090 #else 00091 FF_T_INT8 FileName[FF_MAX_FILENAME]; 00092 #endif 00093 00094 #if defined(FF_LFN_SUPPORT) && defined(FF_INCLUDE_SHORT_NAME) 00095 FF_T_INT8 ShortName[13]; 00096 #endif 00097 FF_T_UINT8 Attrib; 00098 FF_FETCH_CONTEXT FetchContext; 00099 } FF_DIRENT; 00100 00101 00102 00103 // PUBLIC API 00104 #ifdef FF_UNICODE_SUPPORT 00105 FF_ERROR FF_FindFirst (FF_IOMAN *pIoman, FF_DIRENT *pDirent, const FF_T_WCHAR *path); 00106 FF_ERROR FF_MkDir (FF_IOMAN *pIoman, const FF_T_WCHAR *Path); 00107 #else 00108 FF_ERROR FF_FindFirst (FF_IOMAN *pIoman, FF_DIRENT *pDirent, const FF_T_INT8 *path); 00109 FF_ERROR FF_MkDir (FF_IOMAN *pIoman, const FF_T_INT8 *Path); 00110 #endif 00111 00112 FF_ERROR FF_FindNext (FF_IOMAN *pIoman, FF_DIRENT *pDirent); 00113 00114 00115 // INTERNAL API 00116 FF_ERROR FF_GetEntry (FF_IOMAN *pIoman, FF_T_UINT16 nEntry, FF_T_UINT32 DirCluster, FF_DIRENT *pDirent); 00117 FF_ERROR FF_PutEntry (FF_IOMAN *pIoman, FF_T_UINT16 Entry, FF_T_UINT32 DirCluster, FF_DIRENT *pDirent); 00118 FF_T_SINT8 FF_FindEntry (FF_IOMAN *pIoman, FF_T_UINT32 DirCluster, FF_T_INT8 *Name, FF_DIRENT *pDirent, FF_T_BOOL LFNs); 00119 00120 void FF_PopulateShortDirent (FF_IOMAN *pIoman, FF_DIRENT *pDirent, FF_T_UINT8 *EntryBuffer); 00121 FF_ERROR FF_PopulateLongDirent (FF_IOMAN *pIoman, FF_DIRENT *pDirent, FF_T_UINT16 nEntry, FF_FETCH_CONTEXT *pFetchContext); 00122 00123 FF_ERROR FF_InitEntryFetch (FF_IOMAN *pIoman, FF_T_UINT32 ulDirCluster, FF_FETCH_CONTEXT *pContext); 00124 FF_ERROR FF_FetchEntryWithContext (FF_IOMAN *pIoman, FF_T_UINT32 ulEntry, FF_FETCH_CONTEXT *pContext, FF_T_UINT8 *pEntryBuffer); 00125 FF_ERROR FF_PushEntryWithContext (FF_IOMAN *pIoman, FF_T_UINT32 ulEntry, FF_FETCH_CONTEXT *pContext, FF_T_UINT8 *pEntryBuffer); 00126 void FF_CleanupEntryFetch (FF_IOMAN *pIoman, FF_FETCH_CONTEXT *pContext); 00127 00128 FF_T_SINT8 FF_PushEntry (FF_IOMAN *pIoman, FF_T_UINT32 DirCluster, FF_T_UINT16 nEntry, FF_T_UINT8 *buffer, void *pParam); 00129 FF_T_BOOL FF_isEndOfDir (FF_T_UINT8 *EntryBuffer); 00130 FF_ERROR FF_FindNextInDir (FF_IOMAN *pIoman, FF_DIRENT *pDirent, FF_FETCH_CONTEXT *pFetchContext); 00131 00132 #ifdef FF_UNICODE_SUPPORT 00133 FF_T_UINT32 FF_FindEntryInDir (FF_IOMAN *pIoman, FF_T_UINT32 DirCluster, const FF_T_WCHAR *name, FF_T_UINT8 pa_Attrib, FF_DIRENT *pDirent, FF_ERROR *pError); 00134 FF_T_SINT8 FF_CreateShortName (FF_IOMAN *pIoman, FF_T_UINT32 DirCluster, FF_T_WCHAR *ShortName, FF_T_WCHAR *LongName); 00135 #else 00136 FF_T_UINT32 FF_FindEntryInDir (FF_IOMAN *pIoman, FF_T_UINT32 DirCluster, const FF_T_INT8 *name, FF_T_UINT8 pa_Attrib, FF_DIRENT *pDirent, FF_ERROR *pError); 00137 FF_T_SINT8 FF_CreateShortName (FF_IOMAN *pIoman, FF_T_UINT32 DirCluster, FF_T_INT8 *ShortName, FF_T_INT8 *LongName); 00138 #endif 00139 00140 00141 void FF_lockDIR (FF_IOMAN *pIoman); 00142 void FF_unlockDIR (FF_IOMAN *pIoman); 00143 00144 #ifdef FF_UNICODE_SUPPORT 00145 FF_T_UINT32 FF_CreateFile(FF_IOMAN *pIoman, FF_T_UINT32 DirCluster, FF_T_WCHAR *FileName, FF_DIRENT *pDirent, FF_ERROR *pError); 00146 #else 00147 FF_T_UINT32 FF_CreateFile(FF_IOMAN *pIoman, FF_T_UINT32 DirCluster, FF_T_INT8 *FileName, FF_DIRENT *pDirent, FF_ERROR *pError); 00148 #endif 00149 00150 FF_ERROR FF_CreateDirent (FF_IOMAN *pIoman, FF_T_UINT32 DirCluster, FF_DIRENT *pDirent); 00151 FF_ERROR FF_ExtendDirectory (FF_IOMAN *pIoman, FF_T_UINT32 DirCluster); 00152 00153 #ifdef FF_UNICODE_SUPPORT 00154 FF_T_UINT32 FF_FindDir (FF_IOMAN *pIoman, const FF_T_WCHAR *path, FF_T_UINT16 pathLen, FF_ERROR *pError); 00155 #else 00156 FF_T_UINT32 FF_FindDir (FF_IOMAN *pIoman, const FF_T_INT8 *path, FF_T_UINT16 pathLen, FF_ERROR *pError); 00157 #endif 00158 00159 #ifdef FF_HASH_CACHE 00160 FF_T_BOOL FF_CheckDirentHash (FF_IOMAN *pIoman, FF_T_UINT32 DirCluster, FF_T_UINT32 nHash); 00161 FF_T_BOOL FF_DirHashed (FF_IOMAN *pIoman, FF_T_UINT32 DirCluster); 00162 FF_ERROR FF_AddDirentHash (FF_IOMAN *pIoman, FF_T_UINT32 DirCluster, FF_T_UINT32 nHash); 00163 FF_ERROR FF_HashDir (FF_IOMAN *pIoman, FF_T_UINT32 ulDirCluster); 00164 #endif 00165 00166 FF_ERROR FF_RmLFNs(FF_IOMAN *pIoman, FF_T_UINT16 usDirEntry, FF_FETCH_CONTEXT *pContext); 00167 00168 #endif 00169 Generated on Mon May 28 2012 04:32:56 for ReactOS by
1.7.6.1
|