headers/bsd: Add sys/queue.h.
[haiku.git] / src / system / boot / loader / file_systems / fat / fatfs.h
blob2ab1643ad77e080676d60dbe16e423a67ab97194
1 /*
2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the MIT License.
4 */
5 #ifndef FATFS_H
6 #define FATFS_H
9 #include <SupportDefs.h>
10 #include <ByteOrder.h>
12 namespace FATFS {
14 class Volume;
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
24 #define read32(buffer,off) \
25 B_LENDIAN_TO_HOST_INT32(*(uint32 *)&buffer[off])
27 #define read16(buffer,off) \
28 B_LENDIAN_TO_HOST_INT16(*(uint16 *)&buffer[off])
30 #define write32(buffer, off, value) \
31 *(uint32*)&buffer[off] = B_HOST_TO_LENDIAN_INT32(value)
33 #define write16(buffer, off, value) \
34 *(uint16*)&buffer[off] = B_HOST_TO_LENDIAN_INT16(value)
36 enum name_lengths {
37 FATFS_BASENAME_LENGTH = 8,
38 FATFS_EXTNAME_LENGTH = 3,
39 FATFS_NAME_LENGTH = 12,
42 status_t get_root_block(int fDevice, char *buffer, int32 blockSize, off_t partitionSize);
45 } // namespace FATFS
47 #endif /* FATFS_H */