summaryrefslogtreecommitdiff
path: root/components/dfs/include
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-08-03 08:47:09 +0000
committerbernard.xiong <[email protected]>2010-08-03 08:47:09 +0000
commit8772a35e3b05db97e5674bb0be85716dca8644c8 (patch)
tree4ca72de0a02e68452cb605cb329cf944b0f6986d /components/dfs/include
parent7f5d09c9294d5c328e48c3a7caf6910c85752146 (diff)
change dfs_stat/dfs_statfs to _stat/_statfs.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@822 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/dfs/include')
-rw-r--r--components/dfs/include/dfs_def.h7
-rw-r--r--components/dfs/include/dfs_file.h4
-rw-r--r--components/dfs/include/dfs_fs.h8
-rw-r--r--components/dfs/include/dfs_posix.h18
4 files changed, 16 insertions, 21 deletions
diff --git a/components/dfs/include/dfs_def.h b/components/dfs/include/dfs_def.h
index e3c52dd957..e220487043 100644
--- a/components/dfs/include/dfs_def.h
+++ b/components/dfs/include/dfs_def.h
@@ -111,7 +111,7 @@
#define DEVICE_FORMAT 2
#define DEVICE_CLEAN_SECTOR 3
-struct dfs_stat
+struct _stat
{
rt_device_t st_dev;
rt_uint16_t st_mode;
@@ -120,7 +120,7 @@ struct dfs_stat
rt_uint32_t st_blksize;
};
-struct dfs_statfs
+struct _statfs
{
rt_size_t f_bsize; /* block size */
rt_size_t f_blocks; /* total data blocks in file system */
@@ -153,13 +153,12 @@ struct dfs_fd
#define DFS_DT_REG 0x01
#define DFS_DT_DIR 0x02
-struct dfs_dirent
+struct _dirent
{
rt_uint8_t d_type; /* The type of the file */
rt_uint8_t d_namlen; /* The length of the not including the terminating null file name */
rt_uint16_t d_reclen; /* length of this record */
char d_name[DFS_PATH_MAX]; /* The null-terminated file name */
};
-#define dirent dfs_dirent
#endif
diff --git a/components/dfs/include/dfs_file.h b/components/dfs/include/dfs_file.h
index 4987201aa4..e0455e00c9 100644
--- a/components/dfs/include/dfs_file.h
+++ b/components/dfs/include/dfs_file.h
@@ -24,11 +24,11 @@ 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_getdents(struct dfs_fd* fd, struct _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_stat(const char *path, struct _stat *buf);
int dfs_file_rename(const char* oldpath, const char* newpath);
#endif
diff --git a/components/dfs/include/dfs_fs.h b/components/dfs/include/dfs_fs.h
index 8c0a2b04d9..d47e5c93cf 100644
--- a/components/dfs/include/dfs_fs.h
+++ b/components/dfs/include/dfs_fs.h
@@ -33,7 +33,7 @@ struct dfs_filesystem_operation
/* make a file system */
int (*mkfs) (const char* device_name);
- int (*statfs) (struct dfs_filesystem* fs, struct dfs_statfs *buf);
+ int (*statfs) (struct dfs_filesystem* fs, struct _statfs *buf);
int (*open) (struct dfs_fd* fd);
int (*close) (struct dfs_fd* fd);
@@ -42,10 +42,10 @@ struct dfs_filesystem_operation
int (*write) (struct dfs_fd* fd, const void* buf, rt_size_t count);
int (*flush) (struct dfs_fd* fd);
int (*lseek) (struct dfs_fd* fd, rt_off_t offset);
- int (*getdents) (struct dfs_fd* fd, struct dfs_dirent* dirp, rt_uint32_t count);
+ int (*getdents) (struct dfs_fd* fd, struct _dirent* dirp, rt_uint32_t count);
int (*unlink) (struct dfs_filesystem* fs, const char* pathname);
- int (*stat) (struct dfs_filesystem* fs, const char* filename, struct dfs_stat* buf);
+ int (*stat) (struct dfs_filesystem* fs, const char* filename, struct _stat* buf);
int (*rename) (struct dfs_filesystem* fs, const char* oldpath, const char* newpath);
};
@@ -86,6 +86,6 @@ extern char working_directory[];
void dfs_lock(void);
void dfs_unlock(void);
-int dfs_statfs(const char* path, struct dfs_statfs* buffer);
+int dfs_statfs(const char* path, struct _statfs* buffer);
#endif
diff --git a/components/dfs/include/dfs_posix.h b/components/dfs/include/dfs_posix.h
index ce1e94028b..502fc87c9d 100644
--- a/components/dfs/include/dfs_posix.h
+++ b/components/dfs/include/dfs_posix.h
@@ -16,6 +16,7 @@
#define __DFS_POSIX_H__
#include <dfs_file.h>
+#include <dfs_def.h>
#define O_RDONLY DFS_O_RDONLY
#define O_WRONLY DFS_O_WRONLY
@@ -74,14 +75,9 @@ typedef struct
int cur;
} DIR;
-struct stat
-{
- struct dfs_stat parent;
-};
-struct statfs
-{
- struct dfs_statfs parent;
-};
+#define stat _stat
+#define statfs _statfs
+#define dirent _dirent
/* file api*/
int open(const char *file, int flags, int mode);
@@ -91,14 +87,14 @@ int write(int fd, char *buf, int len);
int lseek(int fd, int offset, int dir);
int rename(const char* old, const char* new );
int unlink(const char *pathname);
-int stat(const char *file, struct dfs_stat *buf);
-int statfs(const char *path, struct dfs_statfs *buf);
+int stat(const char *file, struct _stat *buf);
+int statfs(const char *path, struct _statfs *buf);
/* directory api*/
int mkdir (const char *path, rt_uint16_t mode);
int rmdir(const char *path);
DIR* opendir(const char* name);
-struct dfs_dirent* readdir(DIR *d);
+struct _dirent* readdir(DIR *d);
rt_off_t telldir(DIR *d);
void seekdir(DIR *d, rt_off_t offset);
void rewinddir(DIR *d);