xref: /haiku/src/system/boot/loader/file_systems/fat/fatfs.h (revision 893988af824e65e49e55f517b157db8386e8002b)
1 /*
2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the OpenBeOS License.
4 */
5 #ifndef FATFS_H
6 #define FATFS_H
7 
8 
9 #include <SupportDefs.h>
10 #include <ByteOrder.h>
11 
12 namespace FATFS {
13 
14 class Volume;
15 
16 // mode bits
17 #define FAT_READ_ONLY   1
18 #define FAT_HIDDEN              2
19 #define FAT_SYSTEM              4
20 #define FAT_VOLUME              8
21 #define FAT_SUBDIR              16
22 #define FAT_ARCHIVE             32
23 
24 #define read32(buffer,off) \
25         B_LENDIAN_TO_HOST_INT32(*(uint32 *)&buffer[off])
26 
27 #define read16(buffer,off) \
28         B_LENDIAN_TO_HOST_INT16(*(uint16 *)&buffer[off])
29 
30 enum name_lengths {
31 	FATFS_BASENAME_LENGTH	= 8,
32 	FATFS_EXTNAME_LENGTH	= 3,
33 	FATFS_NAME_LENGTH	= 12,
34 };
35 
36 status_t get_root_block(int fDevice, char *buffer, int32 blockSize, off_t partitionSize);
37 
38 
39 }	// namespace FATFS
40 
41 #endif	/* FATFS_H */
42 
43