Source code of Windows XP (NT5)
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.

143 lines
7.2 KiB

  1. /*
  2. * $Log: V:/Flite/archives/TrueFFS5/Src/FLREQ.H_V $
  3. *
  4. * Rev 1.3 Jan 29 2002 20:09:12 oris
  5. * Changed LOW_LEVEL compilation flag with FL_LOW_LEVEL to prevent definition clashes.
  6. *
  7. * Rev 1.2 Apr 01 2001 07:46:16 oris
  8. * Updated copywrite notice
  9. *
  10. * Rev 1.1 Feb 18 2001 12:07:24 oris
  11. * Added VOLUME_ACCUPIED volume flag.
  12. *
  13. * Rev 1.0 Feb 04 2001 11:42:12 oris
  14. * Initial revision.
  15. *
  16. */
  17. /***********************************************************************************/
  18. /* M-Systems Confidential */
  19. /* Copyright (C) M-Systems Flash Disk Pioneers Ltd. 1995-2001 */
  20. /* All Rights Reserved */
  21. /***********************************************************************************/
  22. /* NOTICE OF M-SYSTEMS OEM */
  23. /* SOFTWARE LICENSE AGREEMENT */
  24. /* */
  25. /* THE USE OF THIS SOFTWARE IS GOVERNED BY A SEPARATE LICENSE */
  26. /* AGREEMENT BETWEEN THE OEM AND M-SYSTEMS. REFER TO THAT AGREEMENT */
  27. /* FOR THE SPECIFIC TERMS AND CONDITIONS OF USE, */
  28. /* OR CONTACT M-SYSTEMS FOR LICENSE ASSISTANCE: */
  29. /* E-MAIL = [email protected] */
  30. /***********************************************************************************/
  31. #ifndef FLREQ_H
  32. #define FLREQ_H
  33. #include "flbase.h"
  34. #define VOLUME_LOW_LVL_MOUNTED 1 /* Volume is mounted for low level operations */
  35. #define VOLUME_MOUNTED 2 /* Volume is mounted */
  36. #define VOLUME_12BIT_FAT 4 /* Volume uses 12-bit FAT */
  37. #define VOLUME_ABS_MOUNTED 8 /* Volume is mounted for abs calls */
  38. #define VOLUME_WRITE_PROTECTED 16 /* Volume is write protected */
  39. #define VOLUME_ACCUPIED 32 /* Volume record bellongs to a volume */
  40. typedef unsigned FLHandle; /* Handle of an open file or drive. */
  41. /* Actually an index to file table or */
  42. /* drive table. */
  43. /*----------------------------------------------------------------------*/
  44. /* P a t h - N a m e s */
  45. /* */
  46. /* A path-name is represented as an array of SimplePath records. */
  47. /* Each SimplePath record holds a directory or file name segment, with */
  48. /* the full 8.3 (spaces not compressed) name. */
  49. /* */
  50. /* Path-names always start at the root directory. There is no current */
  51. /* directory. The directories pointers '.' and '..' can be specified */
  52. /* as the 'name' part of the path-segment, except at the root-directory.*/
  53. /* */
  54. /* Lower-case letters are different from upper-case. To be compatible */
  55. /* with DOS, file-names should be upper-case. File names may contain */
  56. /* any character, but files starting with hex E5 are considered deleted */
  57. /* according to DOS convention. */
  58. /* */
  59. /* A null (hex 0) in the first byte of the name field denotes that the */
  60. /* path ends here. */
  61. /* */
  62. /* Note that paths can be specified as strings: For example: */
  63. /* */
  64. /* "UTIL FATLITE H " ===> "\UTIL\FATLITE.H". */
  65. /* "" ===> "\" (root directory) */
  66. /* "AUTOEXECBAT" ===> "\AUTOEXEC.BAT" */
  67. /* "UTIL .. " ===> "\UTIL\.." (root directory) */
  68. /* */
  69. /* The optional service flParsePath may be used to convert regular */
  70. /* string paths to this format. */
  71. /*----------------------------------------------------------------------*/
  72. typedef struct {
  73. char name[8]; /* name part of path segment */
  74. /* A hex 0 in 1st character indicates end of path */
  75. char ext[3]; /* extension part of path segment */
  76. } FLSimplePath;
  77. /*----------------------------------------------------------------------*/
  78. /* I O r e q */
  79. /* */
  80. /* IOreq is a common structure passed to all file-system functions. */
  81. /* Refer to the description of individual functions for specific usage */
  82. /* of fields. Some fields have different names when used by different */
  83. /* functions, hence the use of unions. */
  84. /* */
  85. /*----------------------------------------------------------------------*/
  86. typedef struct {
  87. FLHandle irHandle; /* Handle of file or drive for operation*/
  88. unsigned irFlags; /* function-specific flags */
  89. FLSimplePath FAR1 * irPath; /* path of file for operation */
  90. void FAR1 * irData; /* Pointer to user-buffer for operation */
  91. long irLength; /* No. of bytes, size or position for */
  92. /* operation */
  93. #if defined(ABS_READ_WRITE) || defined(FL_LOW_LEVEL)
  94. long irCount; /* Count or offset for operaion */
  95. #endif
  96. } IOreq;
  97. /* definiftions for absolute read & write */
  98. #define irSectorCount irCount
  99. #define irSectorNo irLength
  100. /* definitions for physical read & write */
  101. #define irByteCount irCount
  102. #define irAddress irLength
  103. /* definitions for physical erase */
  104. #define irUnitCount irCount
  105. #define irUnitNo irLength
  106. /* definitions for writing exb file */
  107. #define irWindowBase irCount
  108. /*----------------------------------------------------------------------*/
  109. /* f l I n i t */
  110. /* */
  111. /* Initializes the FLite system. */
  112. /* */
  113. /* Calling this function is optional. If it is not called, */
  114. /* initialization will be done automatically on the first FLite call. */
  115. /* This function is provided for those applications who want to */
  116. /* explicitly initialize the system and get an initialization status. */
  117. /* */
  118. /* Calling flInit after initialization was done has no effect. */
  119. /* */
  120. /* Parameters: */
  121. /* None */
  122. /* */
  123. /* Returns: */
  124. /* FLStatus : 0 on success, otherwise failed */
  125. /*----------------------------------------------------------------------*/
  126. extern FLStatus flInit(void);
  127. #endif