fs.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. #ifndef _FS_FS_H_
  2. #define _FS_FS_H_
  3. /*
  4. * Copyright (C) 2004-2005 by egnite Software GmbH. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the copyright holders nor the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
  23. * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  29. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. *
  32. * For additional information see http://www.ethernut.de/
  33. *
  34. */
  35. /*!
  36. * \file fs/fs.h
  37. * \brief File system access.
  38. *
  39. * \verbatim
  40. *
  41. * $Log: fs.h,v $
  42. * Revision 1.4 2007/08/29 13:34:14 haraldkipp
  43. * Added function for renaming files (contrib by ZACK).
  44. *
  45. * Revision 1.3 2006/01/05 16:45:25 haraldkipp
  46. * New ioctl functions.
  47. *
  48. * Revision 1.2 2005/08/05 11:28:25 olereinhardt
  49. * Corrected typo
  50. *
  51. * Revision 1.1 2005/02/05 20:37:18 haraldkipp
  52. * Peanut added
  53. *
  54. *
  55. * \endverbatim
  56. */
  57. #include <sys/file.h>
  58. /*!
  59. * \addtogroup xgFS
  60. */
  61. /*@{*/
  62. /*!
  63. * \name File System I/O Control Codes
  64. */
  65. /*@{*/
  66. /*!
  67. * \brief Obtain information about a specified file entry.
  68. */
  69. #define FS_STATUS 0x1101
  70. /*!
  71. * \brief Create a new directory entry.
  72. */
  73. #define FS_DIR_CREATE 0x1111
  74. /*!
  75. * \brief Remove a previously created directory entry.
  76. */
  77. #define FS_DIR_REMOVE 0x1112
  78. /*!
  79. * \brief Open a directory stream.
  80. */
  81. #define FS_DIR_OPEN 0x1113
  82. /*!
  83. * \brief Close a directory stream.
  84. */
  85. #define FS_DIR_CLOSE 0x1114
  86. /*!
  87. * \brief Read the next directory entry.
  88. */
  89. #define FS_DIR_READ 0x1115
  90. /*!
  91. * \brief Obtain information about an opened file.
  92. */
  93. #define FS_FILE_STATUS 0x1121
  94. /*!
  95. * \brief Remove a previously created file.
  96. */
  97. #define FS_FILE_DELETE 0x1122
  98. /*!
  99. * \brief Set a file pointer position.
  100. */
  101. #define FS_FILE_SEEK 0x1123
  102. /*@}*/
  103. #define FS_VOL_MOUNT 0x1130
  104. #define FS_VOL_UNMOUNT 0x1131
  105. #define FS_RENAME 0x1132
  106. #define NUTFS_UNLINK 0x1133
  107. #define NUTFS_MKDIR 0x1134
  108. #define NUTFS_RMDIR 0x1135
  109. /*!
  110. * \brief General structure for two arguments.
  111. *
  112. * Used to pass two arguments to an I/O control function.
  113. */
  114. typedef struct {
  115. void *arg1;
  116. void *arg2;
  117. } IOCTL_ARG2;
  118. /*!
  119. * \brief General structure for three arguments.
  120. *
  121. * Used to pass three arguments to an I/O control function.
  122. */
  123. typedef struct {
  124. void *arg1;
  125. void *arg2;
  126. void *arg3;
  127. } IOCTL_ARG3;
  128. typedef struct _FSCP_VOL_MOUNT {
  129. /*! \brief Block device mount. */
  130. NUTFILE *fscp_bmnt;
  131. /*! \brief Partition type. */
  132. u_char fscp_part_type;
  133. } FSCP_VOL_MOUNT;
  134. typedef struct _FSCP_RENAME {
  135. CONST char *par_old;
  136. CONST char *par_new;
  137. } FSCP_RENAME;
  138. typedef struct _FSCP_STATUS {
  139. CONST char *par_path;
  140. struct stat *par_stp;
  141. } FSCP_STATUS;
  142. /*@}*/
  143. #endif