XFusion API v1.3.0
载入中...
搜索中...
未找到
xf_vfs_private.h
浏览该文件的文档.
1
9/*
10 * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
11 *
12 * SPDX-License-Identifier: Apache-2.0
13 */
14
27#ifndef __XF_VFS_PRIVATE_H__
28#define __XF_VFS_PRIVATE_H__
29
30/* ==================== [Includes] ========================================== */
31
32#include "xf_vfs_types.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
45/* ==================== [Defines] =========================================== */
46
47/* ==================== [Typedefs] ========================================== */
48
49typedef struct _xf_vfs_entry_t {
50 int flags;
51 const xf_vfs_fs_ops_t *vfs; // contains pointers to VFS functions
52 char path_prefix[XF_VFS_PATH_MAX]; // path prefix mapped to this VFS
53 size_t path_prefix_len; // micro-optimization to avoid doing extra strlen
54 void *ctx; // optional pointer which can be passed to VFS
55 int offset; // index of this structure in s_vfs array
57
84xf_err_t xf_vfs_register_common(const char *base_path, size_t len, const xf_vfs_t *vfs, void *ctx, int *vfs_index);
85
93const xf_vfs_entry_t *xf_vfs_get_vfs_for_path(const char *path);
94
103
104/* ==================== [Global Prototypes] ================================= */
105
106/* ==================== [Macros] ============================================ */
107
113#ifdef __cplusplus
114} /* extern "C" */
115#endif
116
117#endif /* __XF_VFS_PRIVATE_H__ */
int32_t xf_err_t
整形错误类型。 错误码具体值见 xf_err_code_t.
Definition xf_err.h:69
void * ctx
const xf_vfs_fs_ops_t * vfs
int flags
size_t path_prefix_len
char path_prefix[XF_VFS_PATH_MAX]
int offset
Main struct of the minified vfs API, containing basic function pointers as well as pointers to the ot...
Definition xf_vfs_ops.h:188
VFS definition structure
static ex_scan_ctx_t ctx
Definition xf_main.c:69
#define XF_VFS_PATH_MAX
const xf_vfs_entry_t * xf_vfs_get_vfs_for_index(int index)
Definition xf_vfs.c:405
xf_err_t xf_vfs_register_common(const char *base_path, size_t len, const xf_vfs_t *vfs, void *ctx, int *vfs_index)
Definition xf_vfs.c:146
struct _xf_vfs_entry_t xf_vfs_entry_t
const xf_vfs_entry_t * xf_vfs_get_vfs_for_path(const char *path)
Definition xf_vfs.c:414