{FULLFAT]
[reactos.git] / reactos / include / reactos / libs / fullfat / ff_fat.h
1 /*****************************************************************************
2 * FullFAT - High Performance, Thread-Safe Embedded FAT File-System *
3 * Copyright (C) 2009 James Walmsley (james@worm.me.uk) *
4 * *
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. *
9 * *
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. *
14 * *
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/>. *
17 * *
18 * IMPORTANT NOTICE: *
19 * ================= *
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. *
23 * *
24 * See RESTRICTIONS.TXT for extra restrictions on the use of FullFAT. *
25 * *
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 *****************************************************************************/
31
32 /**
33 * @file ff_fat.h
34 * @author James Walmsley
35 * @ingroup FAT
36 **/
37
38 #ifndef _FF_FAT_H_
39 #define _FF_FAT_H_
40
41 #include "ff_config.h"
42 #include "ff_fatdef.h"
43 #include "ff_ioman.h"
44 #include "ff_blk.h"
45 #include "ff_types.h"
46
47 //---------- ERROR CODES
48
49
50 //---------- PROTOTYPES
51
52 FF_T_UINT32 FF_getRealLBA (FF_IOMAN *pIoman, FF_T_UINT32 LBA);
53 FF_T_UINT32 FF_Cluster2LBA (FF_IOMAN *pIoman, FF_T_UINT32 Cluster);
54 FF_T_UINT32 FF_LBA2Cluster (FF_IOMAN *pIoman, FF_T_UINT32 Address);
55 FF_T_SINT32 FF_getFatEntry (FF_IOMAN *pIoman, FF_T_UINT32 nCluster);
56 FF_T_BOOL FF_isEndOfChain (FF_IOMAN *pIoman, FF_T_UINT32 fatEntry);
57 FF_T_SINT8 FF_putFatEntry (FF_IOMAN *pIoman, FF_T_UINT32 nCluster, FF_T_UINT32 Value);
58 FF_T_UINT32 FF_FindFreeCluster (FF_IOMAN *pIoman);
59 FF_T_UINT32 FF_ExtendClusterChain (FF_IOMAN *pIoman, FF_T_UINT32 StartCluster, FF_T_UINT32 Count);
60 FF_T_SINT8 FF_UnlinkClusterChain (FF_IOMAN *pIoman, FF_T_UINT32 StartCluster, FF_T_UINT16 Count);
61 FF_T_UINT32 FF_TraverseFAT (FF_IOMAN *pIoman, FF_T_UINT32 Start, FF_T_UINT32 Count);
62 FF_T_UINT32 FF_CreateClusterChain (FF_IOMAN *pIoman);
63 FF_T_UINT32 FF_GetChainLength (FF_IOMAN *pIoman, FF_T_UINT32 pa_nStartCluster, FF_T_UINT32 *piEndOfChain);
64 FF_T_UINT32 FF_FindEndOfChain (FF_IOMAN *pIoman, FF_T_UINT32 Start);
65 FF_T_SINT8 FF_ClearCluster (FF_IOMAN *pIoman, FF_T_UINT32 nCluster);
66 #ifdef FF_64_NUM_SUPPORT
67 FF_T_UINT64 FF_GetFreeSize (FF_IOMAN *pIoman);
68 #else
69 FF_T_UINT32 FF_GetFreeSize (FF_IOMAN *pIoman);
70 #endif
71 FF_T_UINT32 FF_FindFreeCluster (FF_IOMAN *pIoman);
72 FF_T_UINT32 FF_CountFreeClusters (FF_IOMAN *pIoman);
73 void FF_lockFAT (FF_IOMAN *pIoman);
74 void FF_unlockFAT (FF_IOMAN *pIoman);
75
76 #endif
77