35 #define vfs_load_plugin(x)
38 #define bcopy(src, dest, len) memmove(dest, src, len)
41 #if !(defined(__time_t_defined) || defined(_TIME_H_) || defined(__MSP432P401R__) || defined(PART_TM4C123GH6PM))
104 const uint8_t data[];
107 typedef vfs_file_t *(*vfs_open_ptr)(
const char *filename,
const char *mode);
108 typedef char *(*vfs_getcwd_ptr)(
char *buf,
size_t size);
121 typedef vfs_dir_t *(*vfs_opendir_ptr)(
const char *path);
213 int vfs_rename (
const char *from,
const char *to);
223 int vfs_utime (
const char *filename,
struct tm *modified);
size_t size
Definition: vfs.h:103
const char * name
Definition: vfs.h:102
short time
Definition: vfs.h:44
short date
Definition: vfs.h:43
int tm_mday
Definition: vfs.h:50
int tm_sec
Definition: vfs.h:53
int tm_hour
Definition: vfs.h:51
int tm_min
Definition: vfs.h:52
int tm_year
Definition: vfs.h:48
int tm_mon
Definition: vfs.h:49
const void * fs
Definition: vfs.h:193
vfs_mount_ll_entry_t * mounts
Definition: vfs.h:194
uint8_t handle __attribute__((aligned(4)))
vfs_st_mode_t st_mode
Definition: vfs.h:93
size_t size
Definition: vfs.h:92
bool removable
Definition: vfs.h:187
const void * fs
Definition: vfs.h:189
const char * path
Definition: vfs.h:186
const char * name
Definition: vfs.h:185
vfs_st_mode_t mode
Definition: vfs.h:188
vfs_mount_t * mount
Definition: vfs.h:181
on_vfs_unmount_ptr on_unmount
Called when a file system is unmounted.
Definition: vfs.h:162
on_vfs_changed_ptr on_fs_changed
Called when file system content is changed.
Definition: vfs.h:163
on_vfs_mount_ptr on_mount
Called when a file system is mounted.
Definition: vfs.h:161
const void * fs
Definition: vfs.h:81
size_t size
Definition: vfs.h:82
bool update
Definition: vfs.h:83
uint8_t handle __attribute__((aligned(4)))
uint64_t used
Definition: vfs.h:98
uint64_t size
Definition: vfs.h:97
struct vfs_mount_ll_entry * next
Definition: vfs.h:177
vfs_mount_t * mount
Definition: vfs.h:176
struct vfs_mount * next
Definition: vfs.h:171
const vfs_t * vfs
Definition: vfs.h:169
vfs_st_mode_t mode
Definition: vfs.h:170
char path[64]
Definition: vfs.h:168
vfs_st_mode_t st_mode
Definition: vfs.h:72
size_t st_size
Definition: vfs.h:71
time_t st_mtime
Definition: vfs.h:76
vfs_open_ptr fopen
Definition: vfs.h:134
vfs_getfree_ptr fgetfree
Definition: vfs.h:152
bool removable
Definition: vfs.h:133
vfs_format_ptr format
Definition: vfs.h:153
vfs_chdir_ptr fchdir
Definition: vfs.h:144
vfs_write_ptr fwrite
Definition: vfs.h:137
vfs_stat_ptr fstat
Definition: vfs.h:149
vfs_eof_ptr feof
Definition: vfs.h:140
vfs_mkdir_ptr fmkdir
Definition: vfs.h:143
const char * fs_name
Definition: vfs.h:132
vfs_close_ptr fclose
Definition: vfs.h:135
vfs_getcwd_ptr fgetcwd
Definition: vfs.h:151
vfs_fseek_ptr fseek
Definition: vfs.h:139
vfs_readdir_ptr readdir
Definition: vfs.h:147
vfs_unlink_ptr funlink
Definition: vfs.h:142
vfs_rename_ptr frename
Definition: vfs.h:141
vfs_opendir_ptr fopendir
Definition: vfs.h:146
vfs_read_ptr fread
Definition: vfs.h:136
vfs_ftell_ptr ftell
Definition: vfs.h:138
vfs_utime_ptr futime
Definition: vfs.h:150
vfs_rmdir_ptr frmdir
Definition: vfs.h:145
vfs_closedir_ptr fclosedir
Definition: vfs.h:148
uint8_t directory
Definition: vfs.h:65
uint8_t system
Definition: vfs.h:63
uint8_t mode
Definition: vfs.h:59
uint8_t hidden
Definition: vfs.h:62
uint8_t read_only
Definition: vfs.h:61
uint8_t archive
Definition: vfs.h:66
uint8_t unused
Definition: vfs.h:64
vfs_free_t * vfs_drive_getfree(vfs_drive_t *drive)
Definition: vfs.c:621
struct vfs_mount vfs_mount_t
void(* vfs_closedir_ptr)(vfs_dir_t *dir)
Definition: vfs.h:123
int vfs_rename(const char *from, const char *to)
Definition: vfs.c:269
void(* on_vfs_unmount_ptr)(const char *path)
Definition: vfs.h:158
size_t(* vfs_read_ptr)(void *buffer, size_t size, size_t count, vfs_file_t *file)
Definition: vfs.h:109
vfs_free_t * vfs_fgetfree(const char *path)
Definition: vfs.c:480
int(* vfs_rename_ptr)(const char *from, const char *to)
Definition: vfs.h:115
int(* vfs_mkdir_ptr)(const char *path)
Definition: vfs.h:118
vfs_dir_t *(* vfs_opendir_ptr)(const char *path)
Definition: vfs.h:121
int vfs_puts(const char *s, vfs_file_t *file)
Definition: vfs.c:236
void vfs_closedir(vfs_dir_t *dir)
Definition: vfs.c:417
bool vfs_eof(vfs_file_t *file)
Definition: vfs.c:262
vfs_dir_t * vfs_opendir(const char *path)
Definition: vfs.c:361
vfs_drive_t * vfs_drives_read(vfs_drives_t *handle, bool add_hidden)
Definition: vfs.c:591
size_t vfs_read(void *buffer, size_t size, size_t count, vfs_file_t *file)
Definition: vfs.c:222
char * vfs_fixpath(char *path)
Definition: vfs.c:137
bool(* vfs_getfree_ptr)(vfs_free_t *free)
Definition: vfs.h:127
void(* on_vfs_mount_ptr)(const char *path, const vfs_t *fs)
Definition: vfs.h:157
vfs_drive_t * vfs_get_drive(const char *path)
Definition: vfs.c:553
int(* vfs_unlink_ptr)(const char *filename)
Definition: vfs.h:116
char *(* vfs_readdir_ptr)(vfs_dir_t *dir, vfs_dirent_t *dirent)
Definition: vfs.h:122
int vfs_rmdir(const char *path)
Definition: vfs.c:309
size_t(* vfs_ftell_ptr)(vfs_file_t *file)
Definition: vfs.h:112
int vfs_stat(const char *filename, vfs_stat_t *st)
Definition: vfs.c:445
int vfs_mkdir(const char *path)
Definition: vfs.c:297
vfs_drives_t * vfs_drives_open(void)
Definition: vfs.c:567
int vfs_drive_format(vfs_drive_t *drive)
Definition: vfs.c:630
struct vfs_mount_ll_entry vfs_mount_ll_entry_t
bool(* vfs_eof_ptr)(vfs_file_t *file)
Definition: vfs.h:114
int vfs_seek(vfs_file_t *file, size_t offset)
Definition: vfs.c:255
int(* vfs_rmdir_ptr)(const char *path)
Definition: vfs.h:120
char *(* vfs_getcwd_ptr)(char *buf, size_t size)
Definition: vfs.h:108
int(* vfs_chdir_ptr)(const char *path)
Definition: vfs.h:119
bool vfs_mount(const char *path, const vfs_t *fs, vfs_st_mode_t mode)
Definition: vfs.c:492
int(* vfs_stat_ptr)(const char *filename, vfs_stat_t *st)
Definition: vfs.h:124
void vfs_close(vfs_file_t *file)
Definition: vfs.c:212
int(* vfs_fseek_ptr)(vfs_file_t *file, size_t offset)
Definition: vfs.h:113
vfs_events_t vfs
Definition: vfs.c:134
void(* vfs_close_ptr)(vfs_file_t *file)
Definition: vfs.h:111
char * vfs_getcwd(char *buf, size_t len)
Definition: vfs.c:430
size_t(* vfs_write_ptr)(const void *buffer, size_t size, size_t count, vfs_file_t *file)
Definition: vfs.h:110
int vfs_utime(const char *filename, struct tm *modified)
Definition: vfs.c:473
int vfs_chdir(const char *path)
Definition: vfs.c:321
bool vfs_unmount(const char *path)
Definition: vfs.c:523
vfs_file_t *(* vfs_open_ptr)(const char *filename, const char *mode)
Definition: vfs.h:107
int vfs_errno
Definition: vfs.c:133
vfs_file_t * vfs_open(const char *filename, const char *mode)
Definition: vfs.c:199
void(* on_vfs_changed_ptr)(const vfs_t *fs)
Definition: vfs.h:156
void vfs_drives_close(vfs_drives_t *handle)
Definition: vfs.c:616
int(* vfs_utime_ptr)(const char *filename, struct tm *modified)
Definition: vfs.h:125
int(* vfs_format_ptr)(void)
Definition: vfs.h:128
int vfs_unlink(const char *filename)
Definition: vfs.c:285
vfs_dirent_t * vfs_readdir(vfs_dir_t *dir)
Definition: vfs.c:391
size_t vfs_write(const void *buffer, size_t size, size_t count, vfs_file_t *file)
Definition: vfs.c:229
size_t vfs_tell(vfs_file_t *file)
Definition: vfs.c:248