libdragon
dfsinternal.h
Go to the documentation of this file.
1
6#ifndef __LIBDRAGON_DFSINTERNAL_H
7#define __LIBDRAGON_DFSINTERNAL_H
8
15#define ROOT_FLAGS 0xFFFFFFFF
17#define ROOT_NEXT_ENTRY 0xDEADBEEF
19#define ROOT_PATH "DragonFS 2.0"
20
22#define SECTOR_SIZE 256
24#define SECTOR_PAYLOAD 252
25
28{
30 uint32_t next_entry;
32 uint32_t flags;
36 uint32_t file_pointer;
37} __attribute__((__packed__));
38
39_Static_assert(sizeof(struct directory_entry) == SECTOR_SIZE, "invalid directory_entry size");
40
42typedef struct directory_entry directory_entry_t;
43
45typedef struct dfs_open_file_s
46{
48 uint32_t size;
50 uint32_t loc;
54 /* dfs */
56
57#endif
uint32_t size
The size in bytes of this file.
Definition: dfsinternal.h:48
uint32_t cart_start_loc
The offset within the filesystem where the file is stored.
Definition: dfsinternal.h:52
uint32_t flags
File size and flags. See FLAGS_FILE, FLAGS_DIR and FLAGS_EOF.
Definition: dfsinternal.h:32
uint32_t next_entry
Offset to next directory entry.
Definition: dfsinternal.h:30
uint32_t file_pointer
Offset to start sector of the file.
Definition: dfsinternal.h:36
uint32_t loc
The offset of the current location in the file.
Definition: dfsinternal.h:50
char path[MAX_FILENAME_LEN+1]
The file or directory name.
Definition: dfsinternal.h:34
#define SECTOR_SIZE
The size of a sector.
Definition: dfsinternal.h:22
#define MAX_FILENAME_LEN
Maximum filename length.
Definition: dragonfs.h:27
Open file handle structure.
Definition: dfsinternal.h:46
Representation of a directory entry.
Definition: dfsinternal.h:28