1 /*****************************************************************************
2 * FullFAT - High Performance, Thread-Safe Embedded FAT File-System *
3 * Copyright (C) 2009 James Walmsley (james@worm.me.uk) *
5 * This program is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 3 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
20 * Alternative Licensing is available directly from the Copyright holder, *
21 * (James Walmsley). For more information consult LICENSING.TXT to obtain *
22 * a Commercial license. *
24 * See RESTRICTIONS.TXT for extra restrictions on the use of FullFAT. *
26 * Removing the above notice is illegal and will invalidate this license. *
27 *****************************************************************************
28 * See http://worm.me.uk/fullfat for more information. *
29 * Or http://fullfat.googlecode.com/ for latest releases and the wiki. *
30 *****************************************************************************/
34 * @author James Walmsley
41 #include "ff_config.h"
47 #include "ff_memory.h"
55 FF_T_INT8 FileName
[FF_MAX_FILENAME
];
58 FF_T_UINT32 ObjectCluster
;
60 #ifdef FF_TIME_SUPPORT
61 FF_SYSTEMTIME CreateTime
; ///< Date and Time Created.
62 FF_SYSTEMTIME ModifiedTime
; ///< Date and Time Modified.
63 FF_SYSTEMTIME AccessedTime
; ///< Date of Last Access.
66 //---- Book Keeping for FF_Find Functions
67 FF_T_UINT16 CurrentItem
;
68 FF_T_UINT32 DirCluster
;
69 FF_T_UINT32 CurrentCluster
;
70 FF_T_UINT32 AddrCurrentCluster
;
74 FF_ERROR
FF_GetEntry (FF_IOMAN
*pIoman
, FF_T_UINT16 nEntry
, FF_T_UINT32 DirCluster
, FF_DIRENT
*pDirent
);
75 FF_T_SINT8
FF_PutEntry (FF_IOMAN
*pIoman
, FF_T_UINT16 Entry
, FF_T_UINT32 DirCluster
, FF_DIRENT
*pDirent
);
76 FF_T_SINT8
FF_FindEntry (FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
, FF_T_INT8
*Name
, FF_DIRENT
*pDirent
, FF_T_BOOL LFNs
);
77 FF_ERROR
FF_FindFirst (FF_IOMAN
*pIoman
, FF_DIRENT
*pDirent
, const FF_T_INT8
*path
);
78 FF_ERROR
FF_FindNext (FF_IOMAN
*pIoman
, FF_DIRENT
*pDirent
);
79 void FF_PopulateShortDirent(FF_IOMAN
*pIoman
, FF_DIRENT
*pDirent
, FF_T_UINT8
*EntryBuffer
);
80 FF_T_SINT8
FF_PopulateLongDirent(FF_IOMAN
*pIoman
, FF_DIRENT
*pDirent
, FF_T_UINT32 DirCluster
, FF_T_UINT16 nEntry
);
81 FF_T_SINT8
FF_FetchEntry (FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
, FF_T_UINT16 nEntry
, FF_T_UINT8
*buffer
);
82 FF_T_SINT8
FF_PushEntry (FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
, FF_T_UINT16 nEntry
, FF_T_UINT8
*buffer
);
83 FF_T_BOOL
FF_isEndOfDir (FF_T_UINT8
*EntryBuffer
);
84 FF_T_SINT8
FF_FindNextInDir(FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
, FF_DIRENT
*pDirent
);
85 FF_T_UINT32
FF_FindEntryInDir(FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
, FF_T_INT8
*name
, FF_T_UINT8 pa_Attrib
, FF_DIRENT
*pDirent
);
86 FF_T_SINT8
FF_CreateShortName(FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
, FF_T_INT8
*ShortName
, FF_T_INT8
*LongName
);
88 void FF_lockDIR (FF_IOMAN
*pIoman
);
89 void FF_unlockDIR (FF_IOMAN
*pIoman
);
90 FF_T_UINT32
FF_CreateFile(FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
, FF_T_INT8
*FileName
, FF_DIRENT
*pDirent
);
91 FF_ERROR
FF_MkDir(FF_IOMAN
*pIoman
, const FF_T_INT8
*Path
);
92 FF_T_SINT8
FF_CreateDirent(FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
, FF_DIRENT
*pDirent
);
93 FF_T_SINT8
FF_ExtendDirectory(FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
);
94 FF_T_UINT32
FF_FindDir(FF_IOMAN
*pIoman
, const FF_T_INT8
*path
, FF_T_UINT16 pathLen
);
97 FF_T_BOOL
FF_CheckDirentHash(FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
, FF_T_UINT32 nHash
);
98 FF_T_BOOL
FF_DirHashed(FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
);
99 FF_ERROR
FF_AddDirentHash(FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
, FF_T_UINT32 nHash
);
100 void FF_SetDirHashed(FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
);
102 void FF_RmLFNs(FF_IOMAN
*pIoman
, FF_T_UINT32 DirCluster
, FF_T_UINT16 DirEntry
);