home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROS_m68k_bin.lha / AROS / include / dos / dos.h next >
Encoding:
C/C++ Source or Header  |  1997-02-08  |  5.9 KB  |  244 lines

  1. #ifndef DOS_DOS_H
  2. #define DOS_DOS_H
  3.  
  4. #ifndef EXEC_TYPES_H
  5. #   include <exec/types.h>
  6. #endif
  7. #ifndef AROS_MACHINE_H
  8. #   include <aros/machine.h>
  9. #endif
  10.  
  11. /*
  12.     Replace BPTRs by simple APTRs for some machines. On Amiga with binary
  13.     compatibility, this would look like this:
  14.  
  15.     typedef ULONG BPTR;
  16.     #define MKBADDR(a)      (((BPTR)(a))>>2)
  17.     #define BADDR(a)        (((APTR)(a))<<2)
  18. */
  19. #ifndef AROS_BPTR_TYPE
  20. #   define AROS_FAST_BPTR
  21. #   define AROS_BPTR_TYPE   APTR
  22. #   define MKBADDR(a)       ((APTR)(a))
  23. #   define BADDR(a)         (a)
  24. #endif
  25. #ifndef AROS_BSTR_TYPE
  26. #   define AROS_BSTR_TYPE   STRPTR
  27. #endif
  28.  
  29. #ifndef __typedef_BPTR
  30. #   define __typedef_BPTR
  31.     typedef AROS_BPTR_TYPE BPTR;
  32. #endif
  33. #ifndef __typedef_BSTR
  34. #   define __typedef_BSTR
  35.     typedef AROS_BSTR_TYPE BSTR;
  36. #endif
  37.  
  38. #define DOSNAME "dos.library"
  39.  
  40. struct DateStamp
  41. {
  42.    LONG ds_Days;
  43.    LONG ds_Minute;
  44.    LONG ds_Tick;
  45. };
  46.  
  47. struct FileInfoBlock
  48. {
  49.     LONG fib_DiskKey;
  50.     LONG fib_DirEntryType;
  51.     UBYTE fib_FileName[108];
  52.     LONG fib_Protection;
  53.     LONG fib_EntryType;
  54.     LONG fib_Size;
  55.     LONG fib_NumBlocks;
  56.     struct DateStamp fib_Date;
  57.     UBYTE fib_Comment[80];
  58.     UWORD fib_OwnerUID;
  59.     UWORD fib_OwnerGID;
  60.     UBYTE fib_Reserved[32];
  61. };
  62.  
  63. #define DOSTRUE         (-1L)
  64. #define DOSFALSE        (0L)
  65.  
  66. #define MODE_OLDFILE        1005
  67. #define MODE_NEWFILE        1006
  68. #define MODE_READWRITE        1004
  69.  
  70. #define SHARED_LOCK        -2
  71. #define ACCESS_READ        SHARED_LOCK
  72. #define EXCLUSIVE_LOCK        -1
  73. #define ACCESS_WRITE        EXCLUSIVE_LOCK
  74.  
  75. #ifndef BITSPERBYTE
  76. #   define BITSPERBYTE        8
  77. #endif
  78. #ifndef BYTESPERLONG
  79. #   define BYTESPERLONG     4
  80. #endif
  81. #define BITSPERLONG        32 /* This is (U)LONG, not long ! */
  82. #ifndef MAXINT
  83. #   define MAXINT        0x7FFFFFFF
  84. #endif
  85. #ifndef MININT
  86. #   define MININT        0x80000000
  87. #endif
  88.  
  89. #define OFFSET_BEGINNING    -1
  90. #define OFFSET_CURRENT        0
  91. #define OFFSET_END        1
  92.  
  93. #define RETURN_OK        0
  94. #define RETURN_WARN        5
  95. #define RETURN_ERROR        10
  96. #define RETURN_FAIL        20
  97.  
  98. #define SIGBREAKB_CTRL_C    12
  99. #define SIGBREAKB_CTRL_D    13
  100. #define SIGBREAKB_CTRL_E    14
  101. #define SIGBREAKB_CTRL_F    15
  102. #define SIGBREAKF_CTRL_C    0x1000L
  103. #define SIGBREAKF_CTRL_D    0x2000L
  104. #define SIGBREAKF_CTRL_E    0x4000L
  105. #define SIGBREAKF_CTRL_F    0x8000L
  106.  
  107. #define ITEM_EQUAL        -2
  108. #define ITEM_ERROR        -1
  109. #define ITEM_NOTHING        0
  110. #define ITEM_UNQUOTED        1
  111. #define ITEM_QUOTED        2
  112.  
  113. #define DOS_FILEHANDLE        0
  114. #define DOS_EXALLCONTROL    1
  115. #define DOS_FIB         2
  116. #define DOS_STDPKT        3
  117. #define DOS_CLI         4
  118. #define DOS_RDARGS        5
  119.  
  120. #define TICKS_PER_SECOND    50
  121.  
  122. #define FIBB_DELETE        0
  123. #define FIBB_EXECUTE        1
  124. #define FIBB_WRITE        2
  125. #define FIBB_READ        3
  126. #define FIBB_ARCHIVE        4
  127. #define FIBB_PURE        5
  128. #define FIBB_SCRIPT        6
  129. #define FIBB_GRP_DELETE     8
  130. #define FIBB_GRP_EXECUTE    9
  131. #define FIBB_GRP_WRITE        10
  132. #define FIBB_GRP_READ        11
  133. #define FIBB_OTR_DELETE     12
  134. #define FIBB_OTR_EXECUTE    13
  135. #define FIBB_OTR_WRITE        14
  136. #define FIBB_OTR_READ        15
  137. #define FIBF_DELETE        0x1
  138. #define FIBF_EXECUTE        0x2
  139. #define FIBF_WRITE        0x4
  140. #define FIBF_READ        0x8
  141. #define FIBF_ARCHIVE        0x10
  142. #define FIBF_PURE        0x20
  143. #define FIBF_SCRIPT        0x40
  144. #define FIBF_GRP_DELETE     0x100
  145. #define FIBF_GRP_EXECUTE    0x200
  146. #define FIBF_GRP_WRITE        0x400
  147. #define FIBF_GRP_READ        0x800
  148. #define FIBF_OTR_DELETE     0x1000
  149. #define FIBF_OTR_EXECUTE    0x2000
  150. #define FIBF_OTR_WRITE        0x4000
  151. #define FIBF_OTR_READ        0x8000
  152.  
  153. #define ERROR_NO_FREE_STORE        103
  154. #define ERROR_TASK_TABLE_FULL        105
  155. #define ERROR_BAD_TEMPLATE        114
  156. #define ERROR_BAD_NUMBER        115
  157. #define ERROR_REQUIRED_ARG_MISSING    116
  158. #define ERROR_KEY_NEEDS_ARG        117
  159. #define ERROR_TOO_MANY_ARGS        118
  160. #define ERROR_UNMATCHED_QUOTES        119
  161. #define ERROR_LINE_TOO_LONG        120
  162. #define ERROR_FILE_NOT_OBJECT        121
  163. #define ERROR_INVALID_RESIDENT_LIBRARY    122
  164. #define ERROR_NO_DEFAULT_DIR        201
  165. #define ERROR_OBJECT_IN_USE        202
  166. #define ERROR_OBJECT_EXISTS        203
  167. #define ERROR_DIR_NOT_FOUND        204
  168. #define ERROR_OBJECT_NOT_FOUND        205
  169. #define ERROR_BAD_STREAM_NAME        206
  170. #define ERROR_OBJECT_TOO_LARGE        207
  171. #define ERROR_ACTION_NOT_KNOWN        209
  172. #define ERROR_INVALID_COMPONENT_NAME    210
  173. #define ERROR_INVALID_LOCK        211
  174. #define ERROR_OBJECT_WRONG_TYPE     212
  175. #define ERROR_DISK_NOT_VALIDATED    213
  176. #define ERROR_DISK_WRITE_PROTECTED    214
  177. #define ERROR_RENAME_ACROSS_DEVICES    215
  178. #define ERROR_DIRECTORY_NOT_EMPTY    216
  179. #define ERROR_TOO_MANY_LEVELS        217
  180. #define ERROR_DEVICE_NOT_MOUNTED    218
  181. #define ERROR_SEEK_ERROR        219
  182. #define ERROR_COMMENT_TOO_BIG        220
  183. #define ERROR_DISK_FULL         221
  184. #define ERROR_DELETE_PROTECTED        222
  185. #define ERROR_WRITE_PROTECTED        223
  186. #define ERROR_READ_PROTECTED        224
  187. #define ERROR_NOT_A_DOS_DISK        225
  188. #define ERROR_NO_DISK            226
  189. #define ERROR_NO_MORE_ENTRIES        232
  190. #define ERROR_IS_SOFT_LINK        233
  191. #define ERROR_OBJECT_LINKED        234
  192. #define ERROR_BAD_HUNK            235
  193. #define ERROR_NOT_IMPLEMENTED        236
  194. #define ERROR_RECORD_NOT_LOCKED     240
  195. #define ERROR_LOCK_COLLISION        241
  196. #define ERROR_LOCK_TIMEOUT        242
  197. #define ERROR_UNLOCK_ERROR        243
  198.  
  199. #define FAULT_MAX        82
  200.  
  201. struct InfoData
  202. {
  203.     LONG id_NumSoftErrors;
  204.     LONG id_UnitNumber;
  205.     LONG id_DiskState;
  206.     LONG id_NumBlocks;
  207.     LONG id_NumBlocksUsed;
  208.     LONG id_BytesPerBlock;
  209.     LONG id_DiskType;
  210.     BPTR id_VolumeNode;
  211.     LONG id_InUse;
  212. };
  213.  
  214. #define ID_WRITE_PROTECTED    80
  215. #define ID_VALIDATING        81
  216. #define ID_VALIDATED        82
  217.  
  218. /* Filesystem types (multi-character constants of identifier strings) */
  219. #define ID_NO_DISK_PRESENT    (-1L)
  220. #define ID_UNREADABLE_DISK    (0x42414400L)   /* 'BAD\0' */
  221. #define ID_DOS_DISK        (0x444F5300L)   /* 'DOS\0' */
  222. #define ID_FFS_DISK        (0x444F5301L)   /* 'DOS\1' */
  223. #define ID_INTER_DOS_DISK    (0x444F5302L)   /* 'DOS\2' */
  224. #define ID_INTER_FFS_DISK    (0x444F5303L)   /* 'DOS\3' */
  225. #define ID_FASTDIR_DOS_DISK    (0x444F5304L)   /* 'DOS\4' */
  226. #define ID_FASTDIR_FFS_DISK    (0x444F5305L)   /* 'DOS\5' */
  227. #define ID_NOT_REALLY_DOS    (0x4E444F53L)   /* 'NDOS'  */
  228. #define ID_KICKSTART_DISK    (0x4B49434BL)   /* 'KICK'  */
  229. #define ID_MSDOS_DISK        (0x4d534400L)   /* 'MSD\0' */
  230.  
  231. #define LOCK_DIFFERENT        -1
  232. #define LOCK_SAME        0
  233. #define LOCK_SAME_VOLUME    1
  234.  
  235. #define CHANGE_LOCK        0
  236. #define CHANGE_FH        1
  237.  
  238. #define LINK_HARD        0
  239. #define LINK_SOFT        1
  240.  
  241.  
  242.  
  243. #endif
  244.