12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #ifndef ZEPHYR_INCLUDE_FS_FS_SYS_H_
- #define ZEPHYR_INCLUDE_FS_FS_SYS_H_
- #ifdef __cplusplus
- extern "C" {
- #endif
- struct fs_file_system_t {
-
- int (*open)(struct fs_file_t *filp, const char *fs_path,
- fs_mode_t flags);
- ssize_t (*read)(struct fs_file_t *filp, void *dest, size_t nbytes);
- ssize_t (*write)(struct fs_file_t *filp,
- const void *src, size_t nbytes);
- int (*lseek)(struct fs_file_t *filp, off_t off, int whence);
- off_t (*tell)(struct fs_file_t *filp);
- int (*truncate)(struct fs_file_t *filp, off_t length);
- int (*sync)(struct fs_file_t *filp);
- int (*close)(struct fs_file_t *filp);
-
- int (*opendir)(struct fs_dir_t *dirp, const char *fs_path);
- int (*readdir)(struct fs_dir_t *dirp, struct fs_dirent *entry);
- int (*closedir)(struct fs_dir_t *dirp);
-
- int (*mount)(struct fs_mount_t *mountp);
- int (*unmount)(struct fs_mount_t *mountp);
- int (*unlink)(struct fs_mount_t *mountp, const char *name);
- int (*rename)(struct fs_mount_t *mountp, const char *from,
- const char *to);
- int (*mkdir)(struct fs_mount_t *mountp, const char *name);
- int (*stat)(struct fs_mount_t *mountp, const char *path,
- struct fs_dirent *entry);
- int (*statvfs)(struct fs_mount_t *mountp, const char *path,
- struct fs_statvfs *stat);
- int (*disk_detect)(struct fs_mount_t *mountp, const char *path,
- uint8_t *state);
- int (*open_cluster)(struct fs_file_t *zfp, char *dir,
- uint32_t cluster, uint32_t blk_ofs);
- int (*opendir_cluster)(struct fs_dir_t *zdp, const char *path,
- uint32_t cluster, uint32_t blk_ofs);
- };
- #ifdef __cplusplus
- }
- #endif
- #endif
|