diff options
| author | [email protected] <[email protected]> | 2010-07-18 16:35:56 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2010-07-18 16:35:56 +0000 |
| commit | 26aa51e8a6de6601a480797b09a2c10f39845338 (patch) | |
| tree | 71d22b43f84f08beaef68fa6e2f7e950f32cb0b0 /components/dfs/include | |
| parent | bddebf340811e574c08d005cb17d49e1a212ab93 (diff) | |
add flush, statfs, mkfs to device file system interface.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@804 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/dfs/include')
| -rw-r--r-- | components/dfs/include/dfs.h | 37 | ||||
| -rw-r--r-- | components/dfs/include/dfs_file.h | 35 |
2 files changed, 72 insertions, 0 deletions
diff --git a/components/dfs/include/dfs.h b/components/dfs/include/dfs.h new file mode 100644 index 0000000000..dc5d311bc6 --- /dev/null +++ b/components/dfs/include/dfs.h @@ -0,0 +1,37 @@ +/*
+ * File : dfs.h
+ * This file is part of Device File System in RT-Thread RTOS
+ * COPYRIGHT (C) 2004-2010, RT-Thread Development Team
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rt-thread.org/license/LICENSE.
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2005-02-22 Bernard The first version.
+ */
+
+#ifndef __DFS_H__
+#define __DFS_H__
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char* dfs_normalize_path(const char* directory, const char* filename);
+const char* dfs_subdir(const char* directory, const char* filename);
+
+/* FD APIs */
+int fd_new(void);
+struct dfs_fd* fd_get(int fd);
+void fd_put(struct dfs_fd* fd);
+int fd_is_open(const char* pathname);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/dfs/include/dfs_file.h b/components/dfs/include/dfs_file.h new file mode 100644 index 0000000000..4987201aa4 --- /dev/null +++ b/components/dfs/include/dfs_file.h @@ -0,0 +1,35 @@ +/*
++------------------------------------------------------------------------------
+| Project : Device Filesystem
++------------------------------------------------------------------------------
+| Copyright 2004, 2005 www.fayfayspace.org.
+| All rights reserved.
+|------------------------------------------------------------------------------
+| File : dfs_raw.h, the raw APIs of Device FileSystem
+|------------------------------------------------------------------------------
+| Chang Logs:
+| Date Author Notes
+| 2005-01-26 ffxz The first version
++------------------------------------------------------------------------------
+*/
+
+#ifndef __DFS_RAW_H__
+#define __DFS_RAW_H__
+
+#include <dfs_def.h>
+#include <dfs.h>
+#include <dfs_fs.h>
+
+int dfs_file_open(struct dfs_fd* fd, const char *path, int flags);
+int dfs_file_close(struct dfs_fd* fd);
+int dfs_file_ioctl(struct dfs_fd* fd, int cmd, void *args);
+int dfs_file_read(struct dfs_fd* fd, void *buf, rt_size_t len);
+int dfs_file_getdents(struct dfs_fd* fd, struct dfs_dirent* dirp, rt_size_t nbytes);
+int dfs_file_unlink(const char *path);
+int dfs_file_write(struct dfs_fd* fd, const void *buf, rt_size_t len);
+int dfs_file_lseek(struct dfs_fd* fd, rt_off_t offset);
+int dfs_file_stat(const char *path, struct dfs_stat *buf);
+int dfs_file_rename(const char* oldpath, const char* newpath);
+
+#endif
+
|
