XFusion API v1.3.0
|
xf_vfs 虚拟文件系统 (Virtual File System). 更多...
结构体 | |
struct | xf_vfs_dir_ops_t |
Struct containing function pointers to directory related functionality. 更多... | |
struct | xf_vfs_fs_ops_t |
Main struct of the minified vfs API, containing basic function pointers as well as pointers to the other subcomponents. 更多... | |
struct | xf_vfs_select_sem_t |
VFS semaphore type for select() 更多... | |
struct | xf_vfs_t |
VFS definition structure 更多... | |
struct | xf_vfs_select_ops_t |
Struct containing function pointers to select related functionality. 更多... | |
宏定义 | |
#define | XF_VFS_PATH_PREFIX_LEN_IGNORED (~(size_t)0) |
#define | XF_VFS_FLAG_DEFAULT (1 << 0) |
#define | XF_VFS_FLAG_CONTEXT_PTR (1 << 1) |
#define | XF_VFS_FLAG_READONLY_FS (1 << 2) |
#define | XF_VFS_FLAG_STATIC (1 << 3) |
类型定义 | |
typedef int(* | xf_vfs_stat_ctx_op_t) (void *ctx, const char *path, xf_vfs_stat_t *st) |
typedef int(* | xf_vfs_stat_op_t) (const char *path, xf_vfs_stat_t *st) |
typedef int(* | xf_vfs_link_ctx_op_t) (void *ctx, const char *n1, const char *n2) |
typedef int(* | xf_vfs_link_op_t) (const char *n1, const char *n2) |
typedef int(* | xf_vfs_unlink_ctx_op_t) (void *ctx, const char *path) |
typedef int(* | xf_vfs_unlink_op_t) (const char *path) |
typedef int(* | xf_vfs_rename_ctx_op_t) (void *ctx, const char *src, const char *dst) |
typedef int(* | xf_vfs_rename_op_t) (const char *src, const char *dst) |
typedef xf_vfs_dir_t *(* | xf_vfs_opendir_ctx_op_t) (void *ctx, const char *name) |
typedef xf_vfs_dir_t *(* | xf_vfs_opendir_op_t) (const char *name) |
typedef xf_vfs_dirent_t *(* | xf_vfs_readdir_ctx_op_t) (void *ctx, xf_vfs_dir_t *pdir) |
typedef xf_vfs_dirent_t *(* | xf_vfs_readdir_op_t) (xf_vfs_dir_t *pdir) |
typedef int(* | xf_vfs_readdir_r_ctx_op_t) (void *ctx, xf_vfs_dir_t *pdir, xf_vfs_dirent_t *entry, xf_vfs_dirent_t **out) |
typedef int(* | xf_vfs_readdir_r_op_t) (xf_vfs_dir_t *pdir, xf_vfs_dirent_t *entry, xf_vfs_dirent_t **out) |
typedef long(* | xf_vfs_telldir_ctx_op_t) (void *ctx, xf_vfs_dir_t *pdir) |
typedef long(* | xf_vfs_telldir_op_t) (xf_vfs_dir_t *pdir) |
typedef void(* | xf_vfs_seekdir_ctx_op_t) (void *ctx, xf_vfs_dir_t *pdir, long offset) |
typedef void(* | xf_vfs_seekdir_op_t) (xf_vfs_dir_t *pdir, long offset) |
typedef int(* | xf_vfs_closedir_ctx_op_t) (void *ctx, xf_vfs_dir_t *pdir) |
typedef int(* | xf_vfs_closedir_op_t) (xf_vfs_dir_t *pdir) |
typedef int(* | xf_vfs_mkdir_ctx_op_t) (void *ctx, const char *name, xf_vfs_mode_t mode) |
typedef int(* | xf_vfs_mkdir_op_t) (const char *name, xf_vfs_mode_t mode) |
typedef int(* | xf_vfs_rmdir_ctx_op_t) (void *ctx, const char *name) |
typedef int(* | xf_vfs_rmdir_op_t) (const char *name) |
typedef int(* | xf_vfs_access_ctx_op_t) (void *ctx, const char *path, int amode) |
typedef int(* | xf_vfs_access_op_t) (const char *path, int amode) |
typedef int(* | xf_vfs_truncate_ctx_op_t) (void *ctx, const char *path, xf_vfs_off_t length) |
typedef int(* | xf_vfs_truncate_op_t) (const char *path, xf_vfs_off_t length) |
typedef int(* | xf_vfs_ftruncate_ctx_op_t) (void *ctx, int fd, xf_vfs_off_t length) |
typedef int(* | xf_vfs_ftruncate_op_t) (int fd, xf_vfs_off_t length) |
typedef int(* | xf_vfs_utime_ctx_op_t) (void *ctx, const char *path, const xf_vfs_utimbuf_t *times) |
typedef int(* | xf_vfs_utime_op_t) (const char *path, const xf_vfs_utimbuf_t *times) |
typedef xf_vfs_ssize_t(* | xf_vfs_write_ctx_op_t) (void *ctx, int fd, const void *data, size_t size) |
typedef xf_vfs_ssize_t(* | xf_vfs_write_op_t) (int fd, const void *data, size_t size) |
typedef xf_vfs_off_t(* | xf_vfs_lseek_ctx_op_t) (void *ctx, int fd, xf_vfs_off_t size, int mode) |
typedef xf_vfs_off_t(* | xf_vfs_lseek_op_t) (int fd, xf_vfs_off_t size, int mode) |
typedef xf_vfs_ssize_t(* | xf_vfs_read_ctx_op_t) (void *ctx, int fd, void *dst, size_t size) |
typedef xf_vfs_ssize_t(* | xf_vfs_read_op_t) (int fd, void *dst, size_t size) |
typedef xf_vfs_ssize_t(* | xf_vfs_pread_ctx_op_t) (void *ctx, int fd, void *dst, size_t size, xf_vfs_off_t offset) |
typedef xf_vfs_ssize_t(* | xf_vfs_pread_op_t) (int fd, void *dst, size_t size, xf_vfs_off_t offset) |
typedef xf_vfs_ssize_t(* | xf_vfs_pwrite_ctx_op_t) (void *ctx, int fd, const void *src, size_t size, xf_vfs_off_t offset) |
typedef xf_vfs_ssize_t(* | xf_vfs_pwrite_op_t) (int fd, const void *src, size_t size, xf_vfs_off_t offset) |
typedef int(* | xf_vfs_open_ctx_op_t) (void *ctx, const char *path, int flags, int mode) |
typedef int(* | xf_vfs_open_op_t) (const char *path, int flags, int mode) |
typedef int(* | xf_vfs_close_ctx_op_t) (void *ctx, int fd) |
typedef int(* | xf_vfs_close_op_t) (int fd) |
typedef int(* | xf_vfs_fstat_ctx_op_t) (void *ctx, int fd, xf_vfs_stat_t *st) |
typedef int(* | xf_vfs_fstat_op_t) (int fd, xf_vfs_stat_t *st) |
typedef int(* | xf_vfs_fcntl_ctx_op_t) (void *ctx, int fd, int cmd, int arg) |
typedef int(* | xf_vfs_fcntl_op_t) (int fd, int cmd, int arg) |
typedef int(* | xf_vfs_ioctl_ctx_op_t) (void *ctx, int fd, int cmd, va_list args) |
typedef int(* | xf_vfs_ioctl_op_t) (int fd, int cmd, va_list args) |
typedef int(* | xf_vfs_fsync_ctx_op_t) (void *ctx, int fd) |
typedef int(* | xf_vfs_fsync_op_t) (int fd) |
typedef int | xf_vfs_id_t |
typedef xf_err_t(* | xf_vfs_start_select_op_t) (int nfds, xf_fd_set *readfds, xf_fd_set *writefds, xf_fd_set *exceptfds, xf_vfs_select_sem_t sem, void **end_select_args) |
typedef int(* | xf_vfs_socket_select_op_t) (int nfds, xf_fd_set *readfds, xf_fd_set *writefds, xf_fd_set *errorfds, xf_vfs_timeval_t *timeout) |
typedef void(* | xf_vfs_stop_socket_select_op_t) (void *sem) |
typedef void(* | xf_vfs_stop_socket_select_isr_op_t) (void *sem, int *woken) |
typedef void *(* | xf_vfs_get_socket_select_semaphore_op_t) (void) |
typedef xf_err_t(* | xf_vfs_end_select_op_t) (void *end_select_args) |
函数 | |
xf_err_t | xf_vfs_register (const char *base_path, const xf_vfs_t *vfs, void *ctx) |
xf_err_t | xf_vfs_register_fd_range (const xf_vfs_t *vfs, void *ctx, int min_fd, int max_fd) |
xf_err_t | xf_vfs_register_with_id (const xf_vfs_t *vfs, void *ctx, xf_vfs_id_t *vfs_id) |
xf_err_t | xf_vfs_unregister (const char *base_path) |
xf_err_t | xf_vfs_unregister_with_id (xf_vfs_id_t vfs_id) |
xf_err_t | xf_vfs_register_fd (xf_vfs_id_t vfs_id, int *fd) |
xf_err_t | xf_vfs_register_fd_with_local_fd (xf_vfs_id_t vfs_id, int local_fd, bool permanent, int *fd) |
xf_err_t | xf_vfs_unregister_fd (xf_vfs_id_t vfs_id, int fd) |
xf_vfs_ssize_t | xf_vfs_pread (int fd, void *dst, size_t size, xf_vfs_off_t offset) |
Implements the VFS layer of POSIX pread() | |
xf_vfs_ssize_t | xf_vfs_pwrite (int fd, const void *src, size_t size, xf_vfs_off_t offset) |
Implements the VFS layer of POSIX pwrite() | |
void | xf_vfs_dump_fds (void) |
Dump the existing VFS FDs data to FILE* fp | |
void | xf_vfs_dump_registered_paths (void) |
Dump all registered FSs to the provided FILE* | |
int | xf_vfs_select (int nfds, xf_fd_set *readfds, xf_fd_set *writefds, xf_fd_set *errorfds, xf_vfs_timeval_t *timeout) |
Synchronous I/O multiplexing which implements the functionality of POSIX select() for VFS | |
void | xf_vfs_select_triggered (xf_vfs_select_sem_t sem) |
Notification from a VFS driver about a read/write/error condition | |
void | xf_vfs_select_triggered_isr (xf_vfs_select_sem_t sem, int *woken) |
Notification from a VFS driver about a read/write/error condition (ISR version) | |
xf_err_t | xf_vfs_register_fs (const char *base_path, const xf_vfs_fs_ops_t *vfs, int flags, void *ctx) |
xf_err_t | xf_vfs_register_fs_with_id (const xf_vfs_fs_ops_t *vfs, int flags, void *ctx, xf_vfs_id_t *id) |
xf_err_t | xf_vfs_unregister_fs (const char *base_path) |
xf_err_t | xf_vfs_unregister_fs_with_id (xf_vfs_id_t id) |
xf_vfs_ssize_t | xf_vfs_write (int fd, const void *data, size_t size) |
xf_vfs_off_t | xf_vfs_lseek (int fd, xf_vfs_off_t size, int mode) |
xf_vfs_ssize_t | xf_vfs_read (int fd, void *dst, size_t size) |
int | xf_vfs_open (const char *path, int flags, int mode) |
int | xf_vfs_close (int fd) |
int | xf_vfs_fstat (int fd, xf_vfs_stat_t *st) |
int | xf_vfs_fcntl_r (int fd, int cmd, int arg) |
int | xf_vfs_ioctl (int fd, int cmd,...) |
int | xf_vfs_fsync (int fd) |
int | xf_vfs_stat (const char *path, xf_vfs_stat_t *st) |
int | xf_vfs_link (const char *n1, const char *n2) |
int | xf_vfs_unlink (const char *path) |
int | xf_vfs_rename (const char *src, const char *dst) |
int | xf_vfs_utime (const char *path, const xf_vfs_utimbuf_t *times) |
xf_vfs_dir_t * | xf_vfs_opendir (const char *name) |
xf_vfs_dirent_t * | xf_vfs_readdir (xf_vfs_dir_t *pdir) |
int | xf_vfs_readdir_r (xf_vfs_dir_t *pdir, xf_vfs_dirent_t *entry, xf_vfs_dirent_t **out_dirent) |
long | xf_vfs_telldir (xf_vfs_dir_t *pdir) |
void | xf_vfs_seekdir (xf_vfs_dir_t *pdir, long loc) |
void | xf_vfs_rewinddir (xf_vfs_dir_t *pdir) |
int | xf_vfs_closedir (xf_vfs_dir_t *pdir) |
int | xf_vfs_mkdir (const char *name, xf_vfs_mode_t mode) |
int | xf_vfs_rmdir (const char *name) |
int | xf_vfs_access (const char *path, int amode) |
int | xf_vfs_truncate (const char *path, xf_vfs_off_t length) |
int | xf_vfs_ftruncate (int fd, xf_vfs_off_t length) |
#define | xf_vfs_fcntl(fd, cmd, arg) xf_vfs_fcntl_r((fd), (cmd), (arg)) |
xf_vfs 虚拟文件系统 (Virtual File System).
Copyright (c) 2024, CorAL. This file has been modified by CorAL under the terms of the Apache License, Version 2.0.
Modifications:
Copyright (c) 2024, CorAL. This file has been modified by CorAL under the terms of the Apache License, Version 2.0.
Modifications:
#define xf_vfs_fcntl | ( | fd, | |
cmd, | |||
arg | |||
) | xf_vfs_fcntl_r((fd), (cmd), (arg)) |
#define XF_VFS_PATH_PREFIX_LEN_IGNORED (~(size_t)0) |
在文件 xf_vfs_types.h 第 61 行定义.
#define XF_VFS_FLAG_DEFAULT (1 << 0) |
Default value of flags member in xf_vfs_t structure.
在文件 xf_vfs_types.h 第 66 行定义.
#define XF_VFS_FLAG_CONTEXT_PTR (1 << 1) |
Flag which indicates that FS needs extra context pointer in syscalls.
在文件 xf_vfs_types.h 第 71 行定义.
#define XF_VFS_FLAG_READONLY_FS (1 << 2) |
Flag which indicates that FS is located on read-only partition.
在文件 xf_vfs_types.h 第 76 行定义.
#define XF_VFS_FLAG_STATIC (1 << 3) |
Flag which indicates that VFS structure should be freed upon unregistering.
在文件 xf_vfs_types.h 第 82 行定义.
typedef int(* xf_vfs_stat_ctx_op_t) (void *ctx, const char *path, xf_vfs_stat_t *st) |
stat with context pointer
在文件 xf_vfs_ops.h 第 54 行定义.
typedef int(* xf_vfs_stat_op_t) (const char *path, xf_vfs_stat_t *st) |
stat without context pointer
在文件 xf_vfs_ops.h 第 55 行定义.
typedef int(* xf_vfs_link_ctx_op_t) (void *ctx, const char *n1, const char *n2) |
link with context pointer
在文件 xf_vfs_ops.h 第 56 行定义.
typedef int(* xf_vfs_link_op_t) (const char *n1, const char *n2) |
link without context pointer
在文件 xf_vfs_ops.h 第 57 行定义.
typedef int(* xf_vfs_unlink_ctx_op_t) (void *ctx, const char *path) |
unlink with context pointer
在文件 xf_vfs_ops.h 第 58 行定义.
typedef int(* xf_vfs_unlink_op_t) (const char *path) |
unlink without context pointer
在文件 xf_vfs_ops.h 第 59 行定义.
typedef int(* xf_vfs_rename_ctx_op_t) (void *ctx, const char *src, const char *dst) |
rename with context pointer
在文件 xf_vfs_ops.h 第 60 行定义.
typedef int(* xf_vfs_rename_op_t) (const char *src, const char *dst) |
rename without context pointer
在文件 xf_vfs_ops.h 第 61 行定义.
typedef xf_vfs_dir_t *(* xf_vfs_opendir_ctx_op_t) (void *ctx, const char *name) |
opendir with context pointer
在文件 xf_vfs_ops.h 第 62 行定义.
typedef xf_vfs_dir_t *(* xf_vfs_opendir_op_t) (const char *name) |
opendir without context pointer
在文件 xf_vfs_ops.h 第 63 行定义.
typedef xf_vfs_dirent_t *(* xf_vfs_readdir_ctx_op_t) (void *ctx, xf_vfs_dir_t *pdir) |
readdir with context pointer
在文件 xf_vfs_ops.h 第 64 行定义.
typedef xf_vfs_dirent_t *(* xf_vfs_readdir_op_t) (xf_vfs_dir_t *pdir) |
readdir without context pointer
在文件 xf_vfs_ops.h 第 65 行定义.
typedef int(* xf_vfs_readdir_r_ctx_op_t) (void *ctx, xf_vfs_dir_t *pdir, xf_vfs_dirent_t *entry, xf_vfs_dirent_t **out) |
readdir_r with context pointer
在文件 xf_vfs_ops.h 第 66 行定义.
typedef int(* xf_vfs_readdir_r_op_t) (xf_vfs_dir_t *pdir, xf_vfs_dirent_t *entry, xf_vfs_dirent_t **out) |
readdir_r without context pointer
在文件 xf_vfs_ops.h 第 67 行定义.
typedef long(* xf_vfs_telldir_ctx_op_t) (void *ctx, xf_vfs_dir_t *pdir) |
telldir with context pointer
在文件 xf_vfs_ops.h 第 68 行定义.
typedef long(* xf_vfs_telldir_op_t) (xf_vfs_dir_t *pdir) |
telldir without context pointer
在文件 xf_vfs_ops.h 第 69 行定义.
typedef void(* xf_vfs_seekdir_ctx_op_t) (void *ctx, xf_vfs_dir_t *pdir, long offset) |
seekdir with context pointer
在文件 xf_vfs_ops.h 第 70 行定义.
typedef void(* xf_vfs_seekdir_op_t) (xf_vfs_dir_t *pdir, long offset) |
seekdir without context pointer
在文件 xf_vfs_ops.h 第 71 行定义.
typedef int(* xf_vfs_closedir_ctx_op_t) (void *ctx, xf_vfs_dir_t *pdir) |
closedir with context pointer
在文件 xf_vfs_ops.h 第 72 行定义.
typedef int(* xf_vfs_closedir_op_t) (xf_vfs_dir_t *pdir) |
closedir without context pointer
在文件 xf_vfs_ops.h 第 73 行定义.
typedef int(* xf_vfs_mkdir_ctx_op_t) (void *ctx, const char *name, xf_vfs_mode_t mode) |
mkdir with context pointer
在文件 xf_vfs_ops.h 第 74 行定义.
typedef int(* xf_vfs_mkdir_op_t) (const char *name, xf_vfs_mode_t mode) |
mkdir without context pointer
在文件 xf_vfs_ops.h 第 75 行定义.
typedef int(* xf_vfs_rmdir_ctx_op_t) (void *ctx, const char *name) |
rmdir with context pointer
在文件 xf_vfs_ops.h 第 76 行定义.
typedef int(* xf_vfs_rmdir_op_t) (const char *name) |
rmdir without context pointer
在文件 xf_vfs_ops.h 第 77 行定义.
typedef int(* xf_vfs_access_ctx_op_t) (void *ctx, const char *path, int amode) |
access with context pointer
在文件 xf_vfs_ops.h 第 78 行定义.
typedef int(* xf_vfs_access_op_t) (const char *path, int amode) |
access without context pointer
在文件 xf_vfs_ops.h 第 79 行定义.
typedef int(* xf_vfs_truncate_ctx_op_t) (void *ctx, const char *path, xf_vfs_off_t length) |
truncate with context pointer
在文件 xf_vfs_ops.h 第 80 行定义.
typedef int(* xf_vfs_truncate_op_t) (const char *path, xf_vfs_off_t length) |
truncate without context pointer
在文件 xf_vfs_ops.h 第 81 行定义.
typedef int(* xf_vfs_ftruncate_ctx_op_t) (void *ctx, int fd, xf_vfs_off_t length) |
ftruncate with context pointer
在文件 xf_vfs_ops.h 第 82 行定义.
typedef int(* xf_vfs_ftruncate_op_t) (int fd, xf_vfs_off_t length) |
ftruncate without context pointer
在文件 xf_vfs_ops.h 第 83 行定义.
typedef int(* xf_vfs_utime_ctx_op_t) (void *ctx, const char *path, const xf_vfs_utimbuf_t *times) |
utime with context pointer
在文件 xf_vfs_ops.h 第 84 行定义.
typedef int(* xf_vfs_utime_op_t) (const char *path, const xf_vfs_utimbuf_t *times) |
utime without context pointer
在文件 xf_vfs_ops.h 第 85 行定义.
typedef xf_vfs_ssize_t(* xf_vfs_write_ctx_op_t) (void *ctx, int fd, const void *data, size_t size) |
Write with context pointer
在文件 xf_vfs_ops.h 第 162 行定义.
typedef xf_vfs_ssize_t(* xf_vfs_write_op_t) (int fd, const void *data, size_t size) |
Write without context pointer
在文件 xf_vfs_ops.h 第 163 行定义.
typedef xf_vfs_off_t(* xf_vfs_lseek_ctx_op_t) (void *ctx, int fd, xf_vfs_off_t size, int mode) |
Seek with context pointer
在文件 xf_vfs_ops.h 第 164 行定义.
typedef xf_vfs_off_t(* xf_vfs_lseek_op_t) (int fd, xf_vfs_off_t size, int mode) |
Seek without context pointer
在文件 xf_vfs_ops.h 第 165 行定义.
typedef xf_vfs_ssize_t(* xf_vfs_read_ctx_op_t) (void *ctx, int fd, void *dst, size_t size) |
Read with context pointer
在文件 xf_vfs_ops.h 第 166 行定义.
typedef xf_vfs_ssize_t(* xf_vfs_read_op_t) (int fd, void *dst, size_t size) |
Read without context pointer
在文件 xf_vfs_ops.h 第 167 行定义.
typedef xf_vfs_ssize_t(* xf_vfs_pread_ctx_op_t) (void *ctx, int fd, void *dst, size_t size, xf_vfs_off_t offset) |
pread with context pointer
在文件 xf_vfs_ops.h 第 168 行定义.
typedef xf_vfs_ssize_t(* xf_vfs_pread_op_t) (int fd, void *dst, size_t size, xf_vfs_off_t offset) |
pread without context pointer
在文件 xf_vfs_ops.h 第 169 行定义.
typedef xf_vfs_ssize_t(* xf_vfs_pwrite_ctx_op_t) (void *ctx, int fd, const void *src, size_t size, xf_vfs_off_t offset) |
pwrite with context pointer
在文件 xf_vfs_ops.h 第 170 行定义.
typedef xf_vfs_ssize_t(* xf_vfs_pwrite_op_t) (int fd, const void *src, size_t size, xf_vfs_off_t offset) |
pwrite without context pointer
在文件 xf_vfs_ops.h 第 171 行定义.
typedef int(* xf_vfs_open_ctx_op_t) (void *ctx, const char *path, int flags, int mode) |
open with context pointer
在文件 xf_vfs_ops.h 第 172 行定义.
typedef int(* xf_vfs_open_op_t) (const char *path, int flags, int mode) |
open without context pointer
在文件 xf_vfs_ops.h 第 173 行定义.
typedef int(* xf_vfs_close_ctx_op_t) (void *ctx, int fd) |
close with context pointer
在文件 xf_vfs_ops.h 第 174 行定义.
typedef int(* xf_vfs_close_op_t) (int fd) |
close without context pointer
在文件 xf_vfs_ops.h 第 175 行定义.
typedef int(* xf_vfs_fstat_ctx_op_t) (void *ctx, int fd, xf_vfs_stat_t *st) |
fstat with context pointer
在文件 xf_vfs_ops.h 第 176 行定义.
typedef int(* xf_vfs_fstat_op_t) (int fd, xf_vfs_stat_t *st) |
fstat without context pointer
在文件 xf_vfs_ops.h 第 177 行定义.
typedef int(* xf_vfs_fcntl_ctx_op_t) (void *ctx, int fd, int cmd, int arg) |
fcntl with context pointer
在文件 xf_vfs_ops.h 第 178 行定义.
typedef int(* xf_vfs_fcntl_op_t) (int fd, int cmd, int arg) |
fcntl without context pointer
在文件 xf_vfs_ops.h 第 179 行定义.
typedef int(* xf_vfs_ioctl_ctx_op_t) (void *ctx, int fd, int cmd, va_list args) |
ioctl with context pointer
在文件 xf_vfs_ops.h 第 180 行定义.
typedef int(* xf_vfs_ioctl_op_t) (int fd, int cmd, va_list args) |
ioctl without context pointer
在文件 xf_vfs_ops.h 第 181 行定义.
typedef int(* xf_vfs_fsync_ctx_op_t) (void *ctx, int fd) |
fsync with context pointer
在文件 xf_vfs_ops.h 第 182 行定义.
typedef int(* xf_vfs_fsync_op_t) (int fd) |
fsync without context pointer
在文件 xf_vfs_ops.h 第 183 行定义.
typedef int xf_vfs_id_t |
在文件 xf_vfs_types.h 第 99 行定义.
typedef xf_err_t(* xf_vfs_start_select_op_t) (int nfds, xf_fd_set *readfds, xf_fd_set *writefds, xf_fd_set *exceptfds, xf_vfs_select_sem_t sem, void **end_select_args) |
在文件 xf_vfs_types.h 第 260 行定义.
typedef int(* xf_vfs_socket_select_op_t) (int nfds, xf_fd_set *readfds, xf_fd_set *writefds, xf_fd_set *errorfds, xf_vfs_timeval_t *timeout) |
在文件 xf_vfs_types.h 第 261 行定义.
typedef void(* xf_vfs_stop_socket_select_op_t) (void *sem) |
在文件 xf_vfs_types.h 第 262 行定义.
typedef void(* xf_vfs_stop_socket_select_isr_op_t) (void *sem, int *woken) |
在文件 xf_vfs_types.h 第 263 行定义.
typedef void *(* xf_vfs_get_socket_select_semaphore_op_t) (void) |
在文件 xf_vfs_types.h 第 264 行定义.
typedef xf_err_t(* xf_vfs_end_select_op_t) (void *end_select_args) |
在文件 xf_vfs_types.h 第 265 行定义.
Register a virtual filesystem for given path prefix.
base_path | file path prefix associated with the filesystem. Must be a zero-terminated C string, may be empty. If not empty, must be up to XF_VFS_PATH_MAX characters long, and at least 2 characters long. Name must start with a "/" and must not end with "/". For example, "/data" or "/dev/spi" are valid. These VFSes would then be called to handle file paths such as "/data/myfile.txt" or "/dev/spi/0". In the special case of an empty base_path, a "fallback" VFS is registered. Such VFS will handle paths which are not matched by any other registered VFS. |
vfs | Pointer to xf_vfs_t, a structure which maps syscalls to the filesystem driver functions. VFS component doesn't assume ownership of this pointer. |
ctx | If vfs->flags has XF_VFS_FLAG_CONTEXT_PTR set, a pointer which should be passed to VFS functions. Otherwise, NULL. |
Special case function for registering a VFS that uses a method other than open() to open new file descriptors from the interval <min_fd; max_fd).
This is a special-purpose function intended for registering LWIP sockets to VFS.
vfs | Pointer to xf_vfs_t. Meaning is the same as for xf_vfs_register(). |
ctx | Pointer to context structure. Meaning is the same as for xf_vfs_register(). |
min_fd | The smallest file descriptor this VFS will use. |
max_fd | Upper boundary for file descriptors this VFS will use (the biggest file descriptor plus one). |
xf_err_t xf_vfs_register_with_id | ( | const xf_vfs_t * | vfs, |
void * | ctx, | ||
xf_vfs_id_t * | vfs_id | ||
) |
Special case function for registering a VFS that uses a method other than open() to open new file descriptors. In comparison with xf_vfs_register_fd_range, this function doesn't pre-registers an interval of file descriptors. File descriptors can be registered later, by using xf_vfs_register_fd.
vfs | Pointer to xf_vfs_t. Meaning is the same as for xf_vfs_register(). |
ctx | Pointer to context structure. Meaning is the same as for xf_vfs_register(). |
vfs_id | Here will be written the VFS ID which can be passed to xf_vfs_register_fd for registering file descriptors. |
xf_err_t xf_vfs_unregister | ( | const char * | base_path | ) |
xf_err_t xf_vfs_unregister_with_id | ( | xf_vfs_id_t | vfs_id | ) |
xf_err_t xf_vfs_register_fd | ( | xf_vfs_id_t | vfs_id, |
int * | fd | ||
) |
Special function for registering another file descriptor for a VFS registered by xf_vfs_register_with_id. This function should only be used to register permanent file descriptors (socket fd) that are not removed after being closed.
vfs_id | VFS identificator returned by xf_vfs_register_with_id. |
fd | The registered file descriptor will be written to this address. |
xf_err_t xf_vfs_register_fd_with_local_fd | ( | xf_vfs_id_t | vfs_id, |
int | local_fd, | ||
bool | permanent, | ||
int * | fd | ||
) |
Special function for registering another file descriptor with given local_fd for a VFS registered by xf_vfs_register_with_id.
vfs_id | VFS identificator returned by xf_vfs_register_with_id. |
local_fd | The fd in the local vfs. Passing -1 will set the local fd as the (*fd) value. |
permanent | Whether the fd should be treated as permannet (not removed after close()) |
fd | The registered file descriptor will be written to this address. |
xf_err_t xf_vfs_unregister_fd | ( | xf_vfs_id_t | vfs_id, |
int | fd | ||
) |
Special function for unregistering a file descriptor belonging to a VFS registered by xf_vfs_register_with_id.
vfs_id | VFS identificator returned by xf_vfs_register_with_id. |
fd | File descriptor which should be unregistered. |
xf_vfs_ssize_t xf_vfs_write | ( | int | fd, |
const void * | data, | ||
size_t | size | ||
) |
xf_vfs_off_t xf_vfs_lseek | ( | int | fd, |
xf_vfs_off_t | size, | ||
int | mode | ||
) |
xf_vfs_ssize_t xf_vfs_read | ( | int | fd, |
void * | dst, | ||
size_t | size | ||
) |
int xf_vfs_fstat | ( | int | fd, |
xf_vfs_stat_t * | st | ||
) |
int xf_vfs_stat | ( | const char * | path, |
xf_vfs_stat_t * | st | ||
) |
int xf_vfs_utime | ( | const char * | path, |
const xf_vfs_utimbuf_t * | times | ||
) |
xf_vfs_dir_t * xf_vfs_opendir | ( | const char * | name | ) |
xf_vfs_dirent_t * xf_vfs_readdir | ( | xf_vfs_dir_t * | pdir | ) |
int xf_vfs_readdir_r | ( | xf_vfs_dir_t * | pdir, |
xf_vfs_dirent_t * | entry, | ||
xf_vfs_dirent_t ** | out_dirent | ||
) |
long xf_vfs_telldir | ( | xf_vfs_dir_t * | pdir | ) |
void xf_vfs_seekdir | ( | xf_vfs_dir_t * | pdir, |
long | loc | ||
) |
void xf_vfs_rewinddir | ( | xf_vfs_dir_t * | pdir | ) |
int xf_vfs_closedir | ( | xf_vfs_dir_t * | pdir | ) |
int xf_vfs_mkdir | ( | const char * | name, |
xf_vfs_mode_t | mode | ||
) |
int xf_vfs_truncate | ( | const char * | path, |
xf_vfs_off_t | length | ||
) |
int xf_vfs_ftruncate | ( | int | fd, |
xf_vfs_off_t | length | ||
) |
xf_vfs_ssize_t xf_vfs_pread | ( | int | fd, |
void * | dst, | ||
size_t | size, | ||
xf_vfs_off_t | offset | ||
) |
Implements the VFS layer of POSIX pread()
fd | File descriptor used for read |
dst | Pointer to the buffer where the output will be written |
size | Number of bytes to be read |
offset | Starting offset of the read |
xf_vfs_ssize_t xf_vfs_pwrite | ( | int | fd, |
const void * | src, | ||
size_t | size, | ||
xf_vfs_off_t | offset | ||
) |
Implements the VFS layer of POSIX pwrite()
fd | File descriptor used for write |
src | Pointer to the buffer from where the output will be read |
size | Number of bytes to write |
offset | Starting offset of the write |
void xf_vfs_dump_fds | ( | void | ) |
Dump the existing VFS FDs data to FILE* fp
Dump the FDs in the format:
<VFS Path Prefix>-<FD seen by App>-<FD seen by driver> where: VFS Path Prefix : file prefix used in the xf_vfs_register call FD seen by App : file descriptor returned by the vfs to the application for the path prefix FD seen by driver : file descriptor used by the driver for the same file prefix.
void xf_vfs_dump_registered_paths | ( | void | ) |
Dump all registered FSs to the provided FILE*
Dump the FSs in the format:
<index>:<VFS Path Prefix> -> <VFS entry ptr> where: index : internal index in the table of registered FSs (the same as returned when registering fd with id) VFS Path Prefix : file prefix used in the xf_vfs_register call or "NULL" VFS entry ptr : pointer to the xf_vfs_fs_ops_t struct used internally when resolving the calls
int xf_vfs_select | ( | int | nfds, |
xf_fd_set * | readfds, | ||
xf_fd_set * | writefds, | ||
xf_fd_set * | errorfds, | ||
xf_vfs_timeval_t * | timeout | ||
) |
Synchronous I/O multiplexing which implements the functionality of POSIX select() for VFS
nfds | Specifies the range of descriptors which should be checked. The first nfds descriptors will be checked in each set. |
readfds | If not NULL, then points to a descriptor set that on input specifies which descriptors should be checked for being ready to read, and on output indicates which descriptors are ready to read. |
writefds | If not NULL, then points to a descriptor set that on input specifies which descriptors should be checked for being ready to write, and on output indicates which descriptors are ready to write. |
errorfds | If not NULL, then points to a descriptor set that on input specifies which descriptors should be checked for error conditions, and on output indicates which descriptors have error conditions. |
timeout | If not NULL, then points to timeval structure which specifies the time period after which the functions should time-out and return. If it is NULL, then the function will not time-out. Note that the timeout period is rounded up to the system tick and incremented by one. |
void xf_vfs_select_triggered | ( | xf_vfs_select_sem_t | sem | ) |
Notification from a VFS driver about a read/write/error condition
This function is called when the VFS driver detects a read/write/error condition as it was requested by the previous call to start_select.
sem | semaphore structure which was passed to the driver by the start_select call |
void xf_vfs_select_triggered_isr | ( | xf_vfs_select_sem_t | sem, |
int * | woken | ||
) |
Notification from a VFS driver about a read/write/error condition (ISR version)
This function is called when the VFS driver detects a read/write/error condition as it was requested by the previous call to start_select.
sem | semaphore structure which was passed to the driver by the start_select call |
woken | is set to pdTRUE if the function wakes up a task with higher priority |
xf_err_t xf_vfs_register_fs | ( | const char * | base_path, |
const xf_vfs_fs_ops_t * | vfs, | ||
int | flags, | ||
void * | ctx | ||
) |
Register a virtual filesystem for given path prefix.
base_path | file path prefix associated with the filesystem. Must be a zero-terminated C string, may be empty. If not empty, must be up to XF_VFS_PATH_MAX characters long, and at least 2 characters long. Name must start with a "/" and must not end with "/". For example, "/data" or "/dev/spi" are valid. These VFSes would then be called to handle file paths such as "/data/myfile.txt" or "/dev/spi/0". In the special case of an empty base_path, a "fallback" VFS is registered. Such VFS will handle paths which are not matched by any other registered VFS. |
vfs | Pointer to xf_vfs_fs_ops_t, a structure which maps syscalls to the filesystem driver functions. VFS component does not assume ownership of this struct, but see flags for more info |
flags | Set of binary flags controlling how the registered FS should be treated
|
ctx | Context pointer for fs operation functions, see the XF_VFS_FLAG_CONTEXT_PTR. Should be NULL if not used. |
xf_err_t xf_vfs_register_fs_with_id | ( | const xf_vfs_fs_ops_t * | vfs, |
int | flags, | ||
void * | ctx, | ||
xf_vfs_id_t * | id | ||
) |
Analog of xf_vfs_register_with_id which accepts xf_vfs_fs_ops_t instead.
xf_err_t xf_vfs_unregister_fs | ( | const char * | base_path | ) |
xf_err_t xf_vfs_unregister_fs_with_id | ( | xf_vfs_id_t | id | ) |