fs.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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.3 2006/01/05 16:45:25 haraldkipp
  43. * New ioctl functions.
  44. *
  45. * Revision 1.2 2005/08/05 11:28:25 olereinhardt
  46. * Corrected typo
  47. *
  48. * Revision 1.1 2005/02/05 20:37:18 haraldkipp
  49. * Peanut added
  50. *
  51. *
  52. * \endverbatim
  53. */
  54. #include <sys/file.h>
  55. /*!
  56. * \addtogroup xgFS
  57. */
  58. /*@{*/
  59. /*!
  60. * \name File System I/O Control Codes
  61. */
  62. /*@{*/
  63. /*!
  64. * \brief Obtain information about a specified file entry.
  65. */
  66. #define FS_STATUS 0x1101
  67. /*!
  68. * \brief Create a new directory entry.
  69. */
  70. #define FS_DIR_CREATE 0x1111
  71. /*!
  72. * \brief Remove a previously created directory entry.
  73. */
  74. #define FS_DIR_REMOVE 0x1112
  75. /*!
  76. * \brief Open a directory stream.
  77. */
  78. #define FS_DIR_OPEN 0x1113
  79. /*!
  80. * \brief Close a directory stream.
  81. */
  82. #define FS_DIR_CLOSE 0x1114
  83. /*!
  84. * \brief Read the next directory entry.
  85. */
  86. #define FS_DIR_READ 0x1115
  87. /*!
  88. * \brief Obtain information about an opened file.
  89. */
  90. #define FS_FILE_STATUS 0x1121
  91. /*!
  92. * \brief Remove a previously created file.
  93. */
  94. #define FS_FILE_DELETE 0x1122
  95. /*!
  96. * \brief Set a file pointer position.
  97. */
  98. #define FS_FILE_SEEK 0x1123
  99. /*@}*/
  100. #define FS_VOL_MOUNT 0x1130
  101. #define FS_VOL_UNMOUNT 0x1131
  102. #define FS_RENAME 0x1132
  103. #define NUTFS_UNLINK 0x1133
  104. #define NUTFS_MKDIR 0x1134
  105. #define NUTFS_RMDIR 0x1135
  106. /*!
  107. * \brief General structure for two arguments.
  108. *
  109. * Used to pass two arguments to an I/O control function.
  110. */
  111. typedef struct {
  112. void *arg1;
  113. void *arg2;
  114. } IOCTL_ARG2;
  115. /*!
  116. * \brief General structure for three arguments.
  117. *
  118. * Used to pass three arguments to an I/O control function.
  119. */
  120. typedef struct {
  121. void *arg1;
  122. void *arg2;
  123. void *arg3;
  124. } IOCTL_ARG3;
  125. typedef struct _FSCP_VOL_MOUNT {
  126. /*! \brief Block device mount. */
  127. NUTFILE *fscp_bmnt;
  128. /*! \brief Partition type. */
  129. u_char fscp_part_type;
  130. } FSCP_VOL_MOUNT;
  131. typedef struct _FSCP_RENAME {
  132. char *par_old;
  133. char *par_new;
  134. } FSCP_RENAME;
  135. typedef struct _FSCP_STATUS {
  136. CONST char *par_path;
  137. struct stat *par_stp;
  138. } FSCP_STATUS;
  139. /*@}*/
  140. #endif