change dfs_stat/dfs_statfs to _stat/_statfs.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@822 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong
2010-08-03 08:47:09 +00:00
parent 7f5d09c929
commit 8772a35e3b
10 changed files with 48 additions and 62 deletions
+3 -4
View File
@@ -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
+2 -2
View File
@@ -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
+4 -4
View File
@@ -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
+7 -11
View File
@@ -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);