Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

219 lines
5.2 KiB

  1. /*** filelist.h - Definitions for File List Manager
  2. *
  3. * Microsoft Confidential
  4. * Copyright (C) Microsoft Corporation 1993-1994
  5. * All Rights Reserved.
  6. *
  7. * Author:
  8. * Benjamin W. Slivka
  9. *
  10. * History:
  11. * 20-Aug-1993 bens Initial version
  12. * 21-Aug-1993 bens Add more set/query operations
  13. * 01-Apr-1994 bens Added FLSetSource() message
  14. *
  15. * Exported Functions:
  16. * FLCreateList - Create a file list
  17. * FLDestroyList - Destroy a file list
  18. *
  19. * FLAddFile - Add file spec to a file list
  20. *
  21. * FLFirstFile - Get first file spec from a file list
  22. * FLNextFile - Get next file spec
  23. * FLPreviousFile - Get previous file spec
  24. *
  25. * FLGetDestination - Get destination file name
  26. * FLGetGroup - Get group/disk number for a file spec
  27. * FLGetSource - Get source file name
  28. *
  29. * FLSetSource - Change source file name
  30. * FLSetDestination - Change destination file name
  31. * FLSetGroup - Set group/disk number for a file spec
  32. */
  33. #include "error.h"
  34. //** PUBLIC definitions
  35. typedef int GROUP; /* grp */
  36. #define grpBAD 0 // Bad group value
  37. #define grpNONE -1 // File is not in a group
  38. #define grpSTART -2 // File is first file in a group
  39. #define grpMIDDLE -3 // File is in a group
  40. #define grpEND -4 // File is last file in a group
  41. typedef void *HFILESPEC; /* hfspec */
  42. typedef void *HFILELIST; /* hflist */
  43. /*** FLAddFile - Add file spec to a file list
  44. *
  45. * Entry:
  46. * hflist - List to add to
  47. * pszSrc - Source file name
  48. * pszDst - Destination file name (NULL if not specified)
  49. * perr - ERROR structure
  50. *
  51. * Exit-Success:
  52. * Returns HFILESPEC of newly added file spec
  53. *
  54. * Exit-Failure:
  55. * Returns NULL; perr filled in with error.
  56. */
  57. HFILESPEC FLAddFile(HFILELIST hflist,char *pszSrc,char *pszDst,PERROR perr);
  58. /*** FLCreateList - Create a file list
  59. *
  60. * Entry:
  61. * perr - ERROR structure
  62. *
  63. * Exit-Success:
  64. * Returns HFILELIST of newly created file list
  65. *
  66. * Exit-Failure:
  67. * Returns NULL; perr filled in with error.
  68. */
  69. HFILELIST FLCreateList(PERROR perr);
  70. /*** FLDestroyList - Destroy a file list
  71. *
  72. * Entry:
  73. * hflist - List to destroy
  74. * perr - ERROR structure
  75. *
  76. * Exit-Success:
  77. * Returns TRUE; file list destroyed
  78. *
  79. * Exit-Failure:
  80. * Returns NULL; perr filled in with error.
  81. */
  82. BOOL FLDestroyList(HFILELIST hflist,PERROR perr);
  83. /*** FLFirstFile - Get first file spec from a file list
  84. *
  85. * Entry:
  86. * hflist - List to Get
  87. *
  88. * Exit-Success:
  89. * Returns HFILESPEC of first file spec in file list.
  90. *
  91. * Exit-Failure:
  92. * Returns NULL; hflist is bad or empty.
  93. */
  94. HFILESPEC FLFirstFile(HFILELIST hflist);
  95. /*** FLNextFile - Get next file spec
  96. *
  97. * Entry:
  98. * hfspec - File spec
  99. *
  100. * Exit-Success:
  101. * Returns HFILESPEC of next file spec following hfspec.
  102. *
  103. * Exit-Failure:
  104. * Returns NULL; no more file specs, or hfspec is bad.
  105. */
  106. HFILESPEC FLNextFile(HFILESPEC hfspec);
  107. /*** FLPreviousFile - Get previous file spec
  108. *
  109. * Entry:
  110. * hfspec - File spec
  111. *
  112. * Exit-Success:
  113. * Returns HFILESPEC of file spec immediately preceding hfspec.
  114. *
  115. * Exit-Failure:
  116. * Returns NULL; no more file specs, or hfspec is bad.
  117. */
  118. HFILESPEC FLPreviousFile(HFILESPEC hfspec);
  119. /*** FLGetGroup - Get group/disk number for a file spec
  120. *
  121. * Entry:
  122. * hfspec - File spec to get
  123. *
  124. * Exit-Success:
  125. * Returns GROUP (or disk number) of file spec.
  126. *
  127. * Exit-Failure:
  128. * Returns grpBAD; hfspec was bad
  129. */
  130. GROUP FLGetGroup(HFILESPEC hfspec);
  131. /*** FLGetDestination - Get destination file name
  132. *
  133. * Entry:
  134. * hfspec - File spec to get
  135. *
  136. * Exit-Success:
  137. * Returns destination file name
  138. *
  139. * Exit-Failure:
  140. * Returns NULL; no destination file name specified
  141. */
  142. char *FLGetDestination(HFILESPEC hfspec);
  143. /*** FLGetSource - Get source file name
  144. *
  145. * Entry:
  146. * hfspec - File spec to get
  147. *
  148. * Exit-Success:
  149. * Returns source file name
  150. *
  151. * Exit-Failure:
  152. * Returns NULL; no source file name specified
  153. */
  154. char *FLGetSource(HFILESPEC hfspec);
  155. /*** FLSetGroup - Set group/disk number for a file spec
  156. *
  157. * Entry:
  158. * hfspec - File spec
  159. *
  160. * Exit-Success:
  161. * Group/Disk number updated
  162. */
  163. void FLSetGroup(HFILESPEC hfspec,GROUP grp);
  164. /*** FLSetSource - Change source file name
  165. *
  166. * Entry:
  167. * hfspec - File spec to change
  168. * pszSrc - New source file name
  169. * perr - ERROR structure
  170. *
  171. * Exit-Success:
  172. * Returns TRUE; destination updated.
  173. *
  174. * Exit-Failure:
  175. * Returns FALSE; perr filled in with error.
  176. */
  177. BOOL FLSetSource(HFILESPEC hfspec, char *pszSrc, PERROR perr);
  178. /*** FLSetDestination - Change destination file name
  179. *
  180. * Entry:
  181. * hfspec - File spec to change
  182. * pszDst - New destination file name
  183. * perr - ERROR structure
  184. *
  185. * Exit-Success:
  186. * Returns TRUE; destination updated.
  187. *
  188. * Exit-Failure:
  189. * Returns FALSE; perr filled in with error.
  190. */
  191. BOOL FLSetDestination(HFILESPEC hfspec, char *pszDst, PERROR perr);