|
@@ -17,7 +17,6 @@
|
|
#define __DFS_DEF_H__
|
|
#define __DFS_DEF_H__
|
|
|
|
|
|
#include <rtthread.h>
|
|
#include <rtthread.h>
|
|
-#include <dfs_config.h>
|
|
|
|
|
|
|
|
#ifndef __D_FS__
|
|
#ifndef __D_FS__
|
|
#define __D_FS__
|
|
#define __D_FS__
|
|
@@ -34,6 +33,32 @@
|
|
#define DFS_F_EOF 0x04000000
|
|
#define DFS_F_EOF 0x04000000
|
|
#define DFS_F_ERR 0x08000000
|
|
#define DFS_F_ERR 0x08000000
|
|
|
|
|
|
|
|
+#ifndef DFS_PATH_MAX
|
|
|
|
+#define DFS_PATH_MAX 256
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifndef SECTOR_SIZE
|
|
|
|
+#define SECTOR_SIZE 512
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifndef DFS_FILESYSTEM_TYPES_MAX
|
|
|
|
+#define DFS_FILESYSTEM_TYPES_MAX 4
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#define DFS_DEBUG_INFO 0x01
|
|
|
|
+#define DFS_DEBUG_WARNING 0x02
|
|
|
|
+#define DFS_DEBUG_ERROR 0x04
|
|
|
|
+#define DFS_DEBUG_LEVEL (DFS_DEBUG_INFO | DFS_DEBUG_WARNING | DFS_DEBUG_ERROR)
|
|
|
|
+
|
|
|
|
+/* #define DFS_DEBUG */
|
|
|
|
+#ifdef DFS_DEBUG
|
|
|
|
+#define dfs_log(level, x) do { if (level & DFS_DEBUG_LEVEL) \
|
|
|
|
+ {rt_kprintf("DFS %s, %d:", __FUNCTION__, __LINE__); rt_kprintf x; \
|
|
|
|
+ rt_kprintf ("\n");}}while (0)
|
|
|
|
+#else
|
|
|
|
+#define dfs_log(level, x)
|
|
|
|
+#endif
|
|
|
|
+
|
|
#if defined(RT_USING_NEWLIB)
|
|
#if defined(RT_USING_NEWLIB)
|
|
#include <string.h>
|
|
#include <string.h>
|
|
#include <sys/stat.h> /* used for struct stat */
|
|
#include <sys/stat.h> /* used for struct stat */
|
|
@@ -165,17 +190,17 @@
|
|
#define DFS_F_EOF 0x04000000
|
|
#define DFS_F_EOF 0x04000000
|
|
#define DFS_F_ERR 0x08000000
|
|
#define DFS_F_ERR 0x08000000
|
|
|
|
|
|
-/* Seek flags */
|
|
|
|
-#ifdef __CC_ARM
|
|
|
|
-#include <stdio.h>
|
|
|
|
-#define DFS_SEEK_SET SEEK_SET
|
|
|
|
-#define DFS_SEEK_CUR SEEK_CUR
|
|
|
|
-#define DFS_SEEK_END SEEK_END
|
|
|
|
|
|
+/* Seek flags */
|
|
|
|
+#ifdef __CC_ARM
|
|
|
|
+#include <stdio.h>
|
|
|
|
+#define DFS_SEEK_SET SEEK_SET
|
|
|
|
+#define DFS_SEEK_CUR SEEK_CUR
|
|
|
|
+#define DFS_SEEK_END SEEK_END
|
|
#else
|
|
#else
|
|
#define DFS_SEEK_SET 0
|
|
#define DFS_SEEK_SET 0
|
|
#define DFS_SEEK_CUR 1
|
|
#define DFS_SEEK_CUR 1
|
|
#define DFS_SEEK_END 2
|
|
#define DFS_SEEK_END 2
|
|
-#endif
|
|
|
|
|
|
+#endif
|
|
|
|
|
|
/* Stat codes */
|
|
/* Stat codes */
|
|
#define DFS_S_IFMT 00170000
|
|
#define DFS_S_IFMT 00170000
|