summaryrefslogtreecommitdiff
path: root/components/dfs/include
diff options
context:
space:
mode:
authorjonas <[email protected]>2021-09-02 10:36:07 +0800
committerjonas <[email protected]>2021-09-02 10:36:07 +0800
commitd72ee7b6cc19e3b0d5721b2b5fa047ed1a5fc7c4 (patch)
treeab7034a4df4cb5171a68c2236f9f831c8cd27ed0 /components/dfs/include
parentab43390fe2c0e672771b73cf610e739a419aa06f (diff)
parent8d175ab3d237dccc25450a8e12808fc87318eb2f (diff)
Merge branch 'master' of [email protected]:RT-Thread/rt-thread.git into bsp_hk32
# Conflicts: # .ignore_format.yml
Diffstat (limited to 'components/dfs/include')
-rw-r--r--components/dfs/include/dfs.h27
-rw-r--r--components/dfs/include/dfs_posix.h8
2 files changed, 9 insertions, 26 deletions
diff --git a/components/dfs/include/dfs.h b/components/dfs/include/dfs.h
index 80dc433787..0fd8c2dccc 100644
--- a/components/dfs/include/dfs.h
+++ b/components/dfs/include/dfs.h
@@ -15,17 +15,20 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
-
-#include <time.h>
-#include <rtthread.h>
+#include <dirent.h>
+#include <sys/time.h>
#include <rtdevice.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef DFS_FILESYSTEMS_MAX
-#define DFS_FILESYSTEMS_MAX 2
+#define DFS_FILESYSTEMS_MAX 4
#endif
#ifndef DFS_FD_MAX
-#define DFS_FD_MAX 4
+#define DFS_FD_MAX 16
#endif
/*
@@ -36,7 +39,7 @@
#endif
#ifndef DFS_PATH_MAX
-#define DFS_PATH_MAX 256
+#define DFS_PATH_MAX DIRENT_NAME_MAX
#endif
#ifndef SECTOR_SIZE
@@ -63,10 +66,6 @@
#define DFS_F_EOF 0x04000000
#define DFS_F_ERR 0x08000000
-#ifdef __cplusplus
-extern "C" {
-#endif
-
struct statfs
{
size_t f_bsize; /* block size */
@@ -74,14 +73,6 @@ struct statfs
size_t f_bfree; /* free blocks in file system */
};
-struct dirent
-{
- uint8_t d_type; /* The type of the file */
- uint8_t d_namlen; /* The length of the not including the terminating null file name */
- uint16_t d_reclen; /* length of this record */
- char d_name[DFS_PATH_MAX]; /* The null-terminated file name */
-};
-
struct dfs_fdtable
{
uint32_t maxfd;
diff --git a/components/dfs/include/dfs_posix.h b/components/dfs/include/dfs_posix.h
index 0475460d95..ec7cdc9de4 100644
--- a/components/dfs/include/dfs_posix.h
+++ b/components/dfs/include/dfs_posix.h
@@ -21,14 +21,6 @@
extern "C" {
#endif
-typedef struct
-{
- int fd; /* directory file */
- char buf[512];
- int num;
- int cur;
-} DIR;
-
/* directory api*/
int mkdir(const char *path, mode_t mode);
DIR *opendir(const char *name);