Zephyr Project API  3.3.0
A Scalable Open Source RTOS
fs_sys.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_FS_FS_SYS_H_
8#define ZEPHYR_INCLUDE_FS_FS_SYS_H_
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
45 /* File operations */
46 int (*open)(struct fs_file_t *filp, const char *fs_path,
48 ssize_t (*read)(struct fs_file_t *filp, void *dest, size_t nbytes);
49 ssize_t (*write)(struct fs_file_t *filp,
50 const void *src, size_t nbytes);
51 int (*lseek)(struct fs_file_t *filp, off_t off, int whence);
52 off_t (*tell)(struct fs_file_t *filp);
53 int (*truncate)(struct fs_file_t *filp, off_t length);
54 int (*sync)(struct fs_file_t *filp);
55 int (*close)(struct fs_file_t *filp);
56 /* Directory operations */
57 int (*opendir)(struct fs_dir_t *dirp, const char *fs_path);
58 int (*readdir)(struct fs_dir_t *dirp, struct fs_dirent *entry);
59 int (*closedir)(struct fs_dir_t *dirp);
60 /* File system level operations */
61 int (*mount)(struct fs_mount_t *mountp);
62 int (*unmount)(struct fs_mount_t *mountp);
63 int (*unlink)(struct fs_mount_t *mountp, const char *name);
64 int (*rename)(struct fs_mount_t *mountp, const char *from,
65 const char *to);
66 int (*mkdir)(struct fs_mount_t *mountp, const char *name);
67 int (*stat)(struct fs_mount_t *mountp, const char *path,
68 struct fs_dirent *entry);
69 int (*statvfs)(struct fs_mount_t *mountp, const char *path,
70 struct fs_statvfs *stat);
71#if defined(CONFIG_FILE_SYSTEM_MKFS)
72 int (*mkfs)(uintptr_t dev_id, void *cfg, int flags);
73#endif
74};
75
80#ifdef __cplusplus
81}
82#endif
83
84#endif /* ZEPHYR_INCLUDE_FS_FS_SYS_H_ */
irp nz macro MOVR cc s mov cc s endm endr irp aw macro LDR aa off
Definition: asm-macro-32-bit-gnu.h:17
uint8_t fs_mode_t
Definition: fs_interface.h:36
__SIZE_TYPE__ ssize_t
Definition: types.h:28
__INTPTR_TYPE__ off_t
Definition: types.h:36
flags
Definition: parser.h:96
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:105
Directory object representing an open directory.
Definition: fs_interface.h:67
void * dirp
Definition: fs_interface.h:68
Structure to receive file or directory information.
Definition: fs.h:115
File System interface structure.
Definition: fs_sys.h:44
int(* unmount)(struct fs_mount_t *mountp)
Definition: fs_sys.h:62
int(* lseek)(struct fs_file_t *filp, off_t off, int whence)
Definition: fs_sys.h:51
int(* mount)(struct fs_mount_t *mountp)
Definition: fs_sys.h:61
ssize_t(* write)(struct fs_file_t *filp, const void *src, size_t nbytes)
Definition: fs_sys.h:49
int(* unlink)(struct fs_mount_t *mountp, const char *name)
Definition: fs_sys.h:63
int(* statvfs)(struct fs_mount_t *mountp, const char *path, struct fs_statvfs *stat)
Definition: fs_sys.h:69
off_t(* tell)(struct fs_file_t *filp)
Definition: fs_sys.h:52
int(* opendir)(struct fs_dir_t *dirp, const char *fs_path)
Definition: fs_sys.h:57
int(* open)(struct fs_file_t *filp, const char *fs_path, fs_mode_t flags)
Definition: fs_sys.h:46
int(* stat)(struct fs_mount_t *mountp, const char *path, struct fs_dirent *entry)
Definition: fs_sys.h:67
int(* truncate)(struct fs_file_t *filp, off_t length)
Definition: fs_sys.h:53
ssize_t(* read)(struct fs_file_t *filp, void *dest, size_t nbytes)
Definition: fs_sys.h:48
int(* mkdir)(struct fs_mount_t *mountp, const char *name)
Definition: fs_sys.h:66
int(* readdir)(struct fs_dir_t *dirp, struct fs_dirent *entry)
Definition: fs_sys.h:58
int(* closedir)(struct fs_dir_t *dirp)
Definition: fs_sys.h:59
int(* sync)(struct fs_file_t *filp)
Definition: fs_sys.h:54
int(* close)(struct fs_file_t *filp)
Definition: fs_sys.h:55
int(* rename)(struct fs_mount_t *mountp, const char *from, const char *to)
Definition: fs_sys.h:64
File object representing an open file.
Definition: fs_interface.h:53
File system mount info structure.
Definition: fs.h:91
Structure to receive volume statistics.
Definition: fs.h:132
Definition: stat.h:92