XFusion API v1.3.0
|
VFS definition structure 更多...
#include <xf_vfs_types.h>
成员变量 | ||
int | flags | |
union { | ||
xf_vfs_ssize_t(* write_p )(void *p, int fd, const void *data, size_t size) | ||
xf_vfs_ssize_t(* write )(int fd, const void *data, size_t size) | ||
}; | ||
union { | ||
xf_vfs_off_t(* lseek_p )(void *p, int fd, xf_vfs_off_t size, int mode) | ||
xf_vfs_off_t(* lseek )(int fd, xf_vfs_off_t size, int mode) | ||
}; | ||
union { | ||
xf_vfs_ssize_t(* read_p )(void *ctx, int fd, void *dst, size_t size) | ||
xf_vfs_ssize_t(* read )(int fd, void *dst, size_t size) | ||
}; | ||
union { | ||
xf_vfs_ssize_t(* pread_p )(void *ctx, int fd, void *dst, size_t size, xf_vfs_off_t offset) | ||
xf_vfs_ssize_t(* pread )(int fd, void *dst, size_t size, xf_vfs_off_t offset) | ||
}; | ||
union { | ||
xf_vfs_ssize_t(* pwrite_p )(void *ctx, int fd, const void *src, size_t size, xf_vfs_off_t offset) | ||
xf_vfs_ssize_t(* pwrite )(int fd, const void *src, size_t size, xf_vfs_off_t offset) | ||
}; | ||
union { | ||
int(* open_p )(void *ctx, const char *path, int flags, int mode) | ||
int(* open )(const char *path, int flags, int mode) | ||
}; | ||
union { | ||
int(* close_p )(void *ctx, int fd) | ||
int(* close )(int fd) | ||
}; | ||
union { | ||
int(* fstat_p )(void *ctx, int fd, xf_vfs_stat_t *st) | ||
int(* fstat )(int fd, xf_vfs_stat_t *st) | ||
}; | ||
union { | ||
int(* stat_p )(void *ctx, const char *path, xf_vfs_stat_t *st) | ||
int(* stat )(const char *path, xf_vfs_stat_t *st) | ||
}; | ||
union { | ||
int(* link_p )(void *ctx, const char *n1, const char *n2) | ||
int(* link )(const char *n1, const char *n2) | ||
}; | ||
union { | ||
int(* unlink_p )(void *ctx, const char *path) | ||
int(* unlink )(const char *path) | ||
}; | ||
union { | ||
int(* rename_p )(void *ctx, const char *src, const char *dst) | ||
int(* rename )(const char *src, const char *dst) | ||
}; | ||
union { | ||
xf_vfs_dir_t *(* opendir_p )(void *ctx, const char *name) | ||
xf_vfs_dir_t *(* opendir )(const char *name) | ||
}; | ||
union { | ||
xf_vfs_dirent_t *(* readdir_p )(void *ctx, xf_vfs_dir_t *pdir) | ||
xf_vfs_dirent_t *(* readdir )(xf_vfs_dir_t *pdir) | ||
}; | ||
union { | ||
int(* readdir_r_p )(void *ctx, xf_vfs_dir_t *pdir, xf_vfs_dirent_t *entry, xf_vfs_dirent_t **out_dirent) | ||
int(* readdir_r )(xf_vfs_dir_t *pdir, xf_vfs_dirent_t *entry, xf_vfs_dirent_t **out_dirent) | ||
}; | ||
union { | ||
long(* telldir_p )(void *ctx, xf_vfs_dir_t *pdir) | ||
long(* telldir )(xf_vfs_dir_t *pdir) | ||
}; | ||
union { | ||
void(* seekdir_p )(void *ctx, xf_vfs_dir_t *pdir, long offset) | ||
void(* seekdir )(xf_vfs_dir_t *pdir, long offset) | ||
}; | ||
union { | ||
int(* closedir_p )(void *ctx, xf_vfs_dir_t *pdir) | ||
int(* closedir )(xf_vfs_dir_t *pdir) | ||
}; | ||
union { | ||
int(* mkdir_p )(void *ctx, const char *name, xf_vfs_mode_t mode) | ||
int(* mkdir )(const char *name, xf_vfs_mode_t mode) | ||
}; | ||
union { | ||
int(* rmdir_p )(void *ctx, const char *name) | ||
int(* rmdir )(const char *name) | ||
}; | ||
union { | ||
int(* fcntl_p )(void *ctx, int fd, int cmd, int arg) | ||
int(* fcntl )(int fd, int cmd, int arg) | ||
}; | ||
union { | ||
int(* ioctl_p )(void *ctx, int fd, int cmd, va_list args) | ||
int(* ioctl )(int fd, int cmd, va_list args) | ||
}; | ||
union { | ||
int(* fsync_p )(void *ctx, int fd) | ||
int(* fsync )(int fd) | ||
}; | ||
union { | ||
int(* access_p )(void *ctx, const char *path, int amode) | ||
int(* access )(const char *path, int amode) | ||
}; | ||
union { | ||
int(* truncate_p )(void *ctx, const char *path, xf_vfs_off_t length) | ||
int(* truncate )(const char *path, xf_vfs_off_t length) | ||
}; | ||
union { | ||
int(* ftruncate_p )(void *ctx, int fd, xf_vfs_off_t length) | ||
int(* ftruncate )(int fd, xf_vfs_off_t length) | ||
}; | ||
union { | ||
int(* utime_p )(void *ctx, const char *path, const xf_vfs_utimbuf_t *times) | ||
int(* utime )(const char *path, const xf_vfs_utimbuf_t *times) | ||
}; | ||
xf_err_t(* | start_select )(int nfds, xf_fd_set *readfds, xf_fd_set *writefds, xf_fd_set *exceptfds, xf_vfs_select_sem_t sem, void **end_select_args) | |
int(* | socket_select )(int nfds, xf_fd_set *readfds, xf_fd_set *writefds, xf_fd_set *errorfds, xf_vfs_timeval_t *timeout) | |
void(* | stop_socket_select )(void *sem) | |
void(* | stop_socket_select_isr )(void *sem, int *woken) | |
void *(* | get_socket_select_semaphore )(void) | |
xf_err_t(* | end_select )(void *end_select_args) | |
VFS definition structure
This structure should be filled with pointers to corresponding FS driver functions.
VFS component will translate all FDs so that the filesystem implementation sees them starting at zero. The caller sees a global FD which is prefixed with an pre-filesystem-implementation.
Some FS implementations expect some state (e.g. pointer to some structure) to be passed in as a first argument. For these implementations, populate the members of this structure which have _p suffix, set flags member to XF_VFS_FLAG_CONTEXT_PTR and provide the context pointer to xf_vfs_register function. If the implementation doesn't use this extra argument, populate the members without _p suffix and set flags member to XF_VFS_FLAG_DEFAULT.
If the FS driver doesn't provide some of the functions, set corresponding members to NULL.
在文件 xf_vfs_types.h 第 124 行定义.
int flags |
XF_VFS_FLAG_CONTEXT_PTR and/or XF_VFS_FLAG_READONLY_FS or XF_VFS_FLAG_DEFAULT
在文件 xf_vfs_types.h 第 126 行定义.
xf_vfs_ssize_t(* write_p) (void *p, int fd, const void *data, size_t size) |
Write with context pointer
在文件 xf_vfs_types.h 第 128 行定义.
xf_vfs_ssize_t(* write) (int fd, const void *data, size_t size) |
Write without context pointer
在文件 xf_vfs_types.h 第 129 行定义.
union { ... } |
xf_vfs_off_t(* lseek_p) (void *p, int fd, xf_vfs_off_t size, int mode) |
Seek with context pointer
在文件 xf_vfs_types.h 第 132 行定义.
xf_vfs_off_t(* lseek) (int fd, xf_vfs_off_t size, int mode) |
Seek without context pointer
在文件 xf_vfs_types.h 第 133 行定义.
union { ... } |
xf_vfs_ssize_t(* read_p) (void *ctx, int fd, void *dst, size_t size) |
Read with context pointer
在文件 xf_vfs_types.h 第 136 行定义.
xf_vfs_ssize_t(* read) (int fd, void *dst, size_t size) |
Read without context pointer
在文件 xf_vfs_types.h 第 137 行定义.
union { ... } |
xf_vfs_ssize_t(* pread_p) (void *ctx, int fd, void *dst, size_t size, xf_vfs_off_t offset) |
pread with context pointer
在文件 xf_vfs_types.h 第 140 行定义.
xf_vfs_ssize_t(* pread) (int fd, void *dst, size_t size, xf_vfs_off_t offset) |
pread without context pointer
在文件 xf_vfs_types.h 第 141 行定义.
union { ... } |
xf_vfs_ssize_t(* pwrite_p) (void *ctx, int fd, const void *src, size_t size, xf_vfs_off_t offset) |
pwrite with context pointer
在文件 xf_vfs_types.h 第 144 行定义.
xf_vfs_ssize_t(* pwrite) (int fd, const void *src, size_t size, xf_vfs_off_t offset) |
pwrite without context pointer
在文件 xf_vfs_types.h 第 145 行定义.
union { ... } |
open with context pointer
在文件 xf_vfs_types.h 第 148 行定义.
int(* open) (const char *path, int flags, int mode) |
open without context pointer
在文件 xf_vfs_types.h 第 149 行定义.
union { ... } |
int(* close_p) (void *ctx, int fd) |
close with context pointer
在文件 xf_vfs_types.h 第 152 行定义.
int(* close) (int fd) |
close without context pointer
在文件 xf_vfs_types.h 第 153 行定义.
union { ... } |
int(* fstat_p) (void *ctx, int fd, xf_vfs_stat_t *st) |
fstat with context pointer
在文件 xf_vfs_types.h 第 156 行定义.
int(* fstat) (int fd, xf_vfs_stat_t *st) |
fstat without context pointer
在文件 xf_vfs_types.h 第 157 行定义.
union { ... } |
int(* stat_p) (void *ctx, const char *path, xf_vfs_stat_t *st) |
stat with context pointer
在文件 xf_vfs_types.h 第 161 行定义.
int(* stat) (const char *path, xf_vfs_stat_t *st) |
stat without context pointer
在文件 xf_vfs_types.h 第 162 行定义.
union { ... } |
int(* link_p) (void *ctx, const char *n1, const char *n2) |
link with context pointer
在文件 xf_vfs_types.h 第 165 行定义.
int(* link) (const char *n1, const char *n2) |
link without context pointer
在文件 xf_vfs_types.h 第 166 行定义.
union { ... } |
int(* unlink_p) (void *ctx, const char *path) |
unlink with context pointer
在文件 xf_vfs_types.h 第 169 行定义.
int(* unlink) (const char *path) |
unlink without context pointer
在文件 xf_vfs_types.h 第 170 行定义.
union { ... } |
int(* rename_p) (void *ctx, const char *src, const char *dst) |
rename with context pointer
在文件 xf_vfs_types.h 第 173 行定义.
int(* rename) (const char *src, const char *dst) |
rename without context pointer
在文件 xf_vfs_types.h 第 174 行定义.
union { ... } |
xf_vfs_dir_t *(* opendir_p) (void *ctx, const char *name) |
opendir with context pointer
在文件 xf_vfs_types.h 第 177 行定义.
xf_vfs_dir_t *(* opendir) (const char *name) |
opendir without context pointer
在文件 xf_vfs_types.h 第 178 行定义.
union { ... } |
xf_vfs_dirent_t *(* readdir_p) (void *ctx, xf_vfs_dir_t *pdir) |
readdir with context pointer
在文件 xf_vfs_types.h 第 181 行定义.
xf_vfs_dirent_t *(* readdir) (xf_vfs_dir_t *pdir) |
readdir without context pointer
在文件 xf_vfs_types.h 第 182 行定义.
union { ... } |
int(* readdir_r_p) (void *ctx, xf_vfs_dir_t *pdir, xf_vfs_dirent_t *entry, xf_vfs_dirent_t **out_dirent) |
readdir_r with context pointer
在文件 xf_vfs_types.h 第 185 行定义.
int(* readdir_r) (xf_vfs_dir_t *pdir, xf_vfs_dirent_t *entry, xf_vfs_dirent_t **out_dirent) |
readdir_r without context pointer
在文件 xf_vfs_types.h 第 186 行定义.
union { ... } |
long(* telldir_p) (void *ctx, xf_vfs_dir_t *pdir) |
telldir with context pointer
在文件 xf_vfs_types.h 第 189 行定义.
long(* telldir) (xf_vfs_dir_t *pdir) |
telldir without context pointer
在文件 xf_vfs_types.h 第 190 行定义.
union { ... } |
void(* seekdir_p) (void *ctx, xf_vfs_dir_t *pdir, long offset) |
seekdir with context pointer
在文件 xf_vfs_types.h 第 193 行定义.
void(* seekdir) (xf_vfs_dir_t *pdir, long offset) |
seekdir without context pointer
在文件 xf_vfs_types.h 第 194 行定义.
union { ... } |
int(* closedir_p) (void *ctx, xf_vfs_dir_t *pdir) |
closedir with context pointer
在文件 xf_vfs_types.h 第 197 行定义.
int(* closedir) (xf_vfs_dir_t *pdir) |
closedir without context pointer
在文件 xf_vfs_types.h 第 198 行定义.
union { ... } |
int(* mkdir_p) (void *ctx, const char *name, xf_vfs_mode_t mode) |
mkdir with context pointer
在文件 xf_vfs_types.h 第 201 行定义.
int(* mkdir) (const char *name, xf_vfs_mode_t mode) |
mkdir without context pointer
在文件 xf_vfs_types.h 第 202 行定义.
union { ... } |
int(* rmdir_p) (void *ctx, const char *name) |
rmdir with context pointer
在文件 xf_vfs_types.h 第 205 行定义.
int(* rmdir) (const char *name) |
rmdir without context pointer
在文件 xf_vfs_types.h 第 206 行定义.
union { ... } |
int(* fcntl_p) (void *ctx, int fd, int cmd, int arg) |
fcntl with context pointer
在文件 xf_vfs_types.h 第 210 行定义.
int(* fcntl) (int fd, int cmd, int arg) |
fcntl without context pointer
在文件 xf_vfs_types.h 第 211 行定义.
union { ... } |
int(* ioctl_p) (void *ctx, int fd, int cmd, va_list args) |
ioctl with context pointer
在文件 xf_vfs_types.h 第 214 行定义.
int(* ioctl) (int fd, int cmd, va_list args) |
ioctl without context pointer
在文件 xf_vfs_types.h 第 215 行定义.
union { ... } |
int(* fsync_p) (void *ctx, int fd) |
fsync with context pointer
在文件 xf_vfs_types.h 第 218 行定义.
int(* fsync) (int fd) |
fsync without context pointer
在文件 xf_vfs_types.h 第 219 行定义.
union { ... } |
int(* access_p) (void *ctx, const char *path, int amode) |
access with context pointer
在文件 xf_vfs_types.h 第 223 行定义.
int(* access) (const char *path, int amode) |
access without context pointer
在文件 xf_vfs_types.h 第 224 行定义.
union { ... } |
int(* truncate_p) (void *ctx, const char *path, xf_vfs_off_t length) |
truncate with context pointer
在文件 xf_vfs_types.h 第 227 行定义.
int(* truncate) (const char *path, xf_vfs_off_t length) |
truncate without context pointer
在文件 xf_vfs_types.h 第 228 行定义.
union { ... } |
int(* ftruncate_p) (void *ctx, int fd, xf_vfs_off_t length) |
ftruncate with context pointer
在文件 xf_vfs_types.h 第 231 行定义.
int(* ftruncate) (int fd, xf_vfs_off_t length) |
ftruncate without context pointer
在文件 xf_vfs_types.h 第 232 行定义.
union { ... } |
int(* utime_p) (void *ctx, const char *path, const xf_vfs_utimbuf_t *times) |
utime with context pointer
在文件 xf_vfs_types.h 第 235 行定义.
int(* utime) (const char *path, const xf_vfs_utimbuf_t *times) |
utime without context pointer
在文件 xf_vfs_types.h 第 236 行定义.
union { ... } |
xf_err_t(* start_select) (int nfds, xf_fd_set *readfds, xf_fd_set *writefds, xf_fd_set *exceptfds, xf_vfs_select_sem_t sem, void **end_select_args) |
start_select is called for setting up synchronous I/O multiplexing of the desired file descriptors in the given VFS
在文件 xf_vfs_types.h 第 241 行定义.
int(* socket_select) (int nfds, xf_fd_set *readfds, xf_fd_set *writefds, xf_fd_set *errorfds, xf_vfs_timeval_t *timeout) |
socket select function for socket FDs with the functionality of POSIX select(); this should be set only for the socket VFS
在文件 xf_vfs_types.h 第 243 行定义.
void(* stop_socket_select) (void *sem) |
called by VFS to interrupt the socket_select call when select is activated from a non-socket VFS driver; set only for the socket driver
在文件 xf_vfs_types.h 第 245 行定义.
void(* stop_socket_select_isr) (void *sem, int *woken) |
stop_socket_select which can be called from ISR; set only for the socket driver
在文件 xf_vfs_types.h 第 247 行定义.
void *(* get_socket_select_semaphore) (void) |
end_select is called to stop the I/O multiplexing and deinitialize the environment created by start_select for the given VFS
在文件 xf_vfs_types.h 第 249 行定义.
xf_err_t(* end_select) (void *end_select_args) |
get_socket_select_semaphore returns semaphore allocated in the socket driver; set only for the socket driver
在文件 xf_vfs_types.h 第 251 行定义.