Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
fs_interface.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
8#define ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
9
10#include <stdint.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#if defined(CONFIG_FILE_SYSTEM_MAX_FILE_NAME) && (CONFIG_FILE_SYSTEM_MAX_FILE_NAME - 0) > 0
17#define MAX_FILE_NAME CONFIG_FILE_SYSTEM_MAX_FILE_NAME
18
19#else /* CONFIG_FILE_SYSTEM_MAX_FILE_NAME */
20/* Select from enabled file systems */
21
22#if defined(CONFIG_FAT_FILESYSTEM_ELM)
23
24#if defined(CONFIG_FS_FATFS_LFN)
25#define MAX_FILE_NAME CONFIG_FS_FATFS_MAX_LFN
26#else /* CONFIG_FS_FATFS_LFN */
27#define MAX_FILE_NAME 12 /* Uses 8.3 SFN */
28#endif /* CONFIG_FS_FATFS_LFN */
29
30#endif
31
32#if !defined(MAX_FILE_NAME) && defined(CONFIG_FILE_SYSTEM_EXT2)
33#define MAX_FILE_NAME 255
34#endif
35
36#if !defined(MAX_FILE_NAME) && defined(CONFIG_FILE_SYSTEM_LITTLEFS)
37#define MAX_FILE_NAME 256
38#endif
39
40#if !defined(MAX_FILE_NAME) /* filesystem selection */
41/* Use standard 8.3 when no filesystem is explicitly selected */
42#define MAX_FILE_NAME 12
43#endif /* filesystem selection */
44
45#endif /* CONFIG_FILE_SYSTEM_MAX_FILE_NAME */
46
47
48/* Type for fs_open flags */
50
51struct fs_mount_t;
52
63struct fs_file_t {
65 void *filep;
67 const struct fs_mount_t *mp;
70};
71
77struct fs_dir_t {
79 void *dirp;
81 const struct fs_mount_t *mp;
82};
83
88#ifdef __cplusplus
89}
90#endif
91
92#endif /* ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_ */
uint8_t fs_mode_t
Definition: fs_interface.h:49
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
Directory object representing an open directory.
Definition: fs_interface.h:77
const struct fs_mount_t * mp
Pointer to mount point structure.
Definition: fs_interface.h:81
void * dirp
Pointer to directory object structure.
Definition: fs_interface.h:79
File object representing an open file.
Definition: fs_interface.h:63
fs_mode_t flags
Open/create flags.
Definition: fs_interface.h:69
void * filep
Pointer to file object structure.
Definition: fs_interface.h:65
const struct fs_mount_t * mp
Pointer to mount point structure.
Definition: fs_interface.h:67
File system mount info structure.
Definition: fs.h:91