BSB Developer Docs
Loading...
Searching...
No Matches
filesystem_api_defines.h
1#pragma once
2#include <stdint.h>
3#include <stdbool.h>
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
10typedef enum {
11 FSAM_READ = (1 << 0),
12 FSAM_WRITE = (1 << 1),
13 FSAM_READ_WRITE = FSAM_READ | FSAM_WRITE,
14} FS_AccessMode;
15
17typedef enum {
18 FSOM_OPEN_EXISTING = (1 << 0),
19 FSOM_OPEN_ALWAYS = (1 << 1),
20 FSOM_OPEN_APPEND =
21 (1 << 2),
22 FSOM_CREATE_NEW = (1 << 3),
23 FSOM_CREATE_ALWAYS = (1 << 4),
24 FSOM_NONBLOCKING = (1 << 5),
25} FS_OpenMode;
26
28typedef enum {
29 FSE_OK,
30 FSE_NOT_READY,
31 FSE_EXIST,
32 FSE_NOT_EXIST,
33 FSE_INVALID_PARAMETER,
34 FSE_DENIED,
35 FSE_INVALID_NAME,
36 FSE_INTERNAL,
37 FSE_NOT_IMPLEMENTED,
38 FSE_ALREADY_OPEN,
39} FS_Error;
40
42typedef enum {
43 FSF_DIRECTORY = (1 << 0),
44} FS_Flags;
45
47typedef struct File File;
48
50typedef struct {
51 uint8_t flags;
52 uint64_t size;
53} FileInfo;
54
59const char* filesystem_api_error_get_desc(FS_Error error_id);
60
65bool file_info_is_dir(const FileInfo* file_info);
66
67#ifdef __cplusplus
68}
69#endif
Structure that hold file index and returned api errors.
Definition filesystem_api_internal.h:18
Structure that hold file info.
Definition filesystem_api_defines.h:50
uint8_t flags
flags from FS_Flags enum
Definition filesystem_api_defines.h:51
uint64_t size
file size
Definition filesystem_api_defines.h:52