dfs_file.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * File : dfs_file.h
  3. * This file is part of Device File System in RT-Thread RTOS
  4. * COPYRIGHT (C) 2004-2012, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2005-01-26 Bernard The first version.
  23. */
  24. #ifndef __DFS_FILE_H__
  25. #define __DFS_FILE_H__
  26. #include <dfs_def.h>
  27. #include <dfs.h>
  28. #include <dfs_fs.h>
  29. int dfs_file_open(struct dfs_fd *fd, const char *path, int flags);
  30. int dfs_file_close(struct dfs_fd *fd);
  31. int dfs_file_ioctl(struct dfs_fd *fd, int cmd, void *args);
  32. int dfs_file_read(struct dfs_fd *fd, void *buf, rt_size_t len);
  33. int dfs_file_getdents(struct dfs_fd *fd, struct dirent *dirp, rt_size_t nbytes);
  34. int dfs_file_unlink(const char *path);
  35. int dfs_file_write(struct dfs_fd *fd, const void *buf, rt_size_t len);
  36. int dfs_file_flush(struct dfs_fd *fd);
  37. int dfs_file_lseek(struct dfs_fd *fd, rt_off_t offset);
  38. int dfs_file_stat(const char *path, struct stat *buf);
  39. int dfs_file_rename(const char *oldpath, const char *newpath);
  40. #endif