home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / BC_DICE2.DMS / in.adf / INCLUDE / dos / dos.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-10  |  4.8 KB  |  245 lines

  1. #ifndef DOS_DOS_H
  2. #define DOS_DOS_H
  3. /*
  4. ** $Filename: dos/dos.h $
  5. ** $Release: 2.04 Includes, V37.4 $
  6. ** $Revision: 36.24 $
  7. ** $Date: 91/10/29 $
  8. **
  9. ** Standard C header for AmigaDOS
  10. **
  11. ** (C) Copyright 1985-1991 Commodore-Amiga, Inc.
  12. ** All Rights Reserved
  13. */
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include "exec/types.h"
  17. #endif
  18.  
  19.  
  20. #define DOSNAME "dos.library"
  21.  
  22.  
  23.  
  24. #define DOSTRUE (-1L)
  25. #define DOSFALSE (0L)
  26.  
  27.  
  28. #define MODE_OLDFILE 1005 
  29. #define MODE_NEWFILE 1006 
  30. #define MODE_READWRITE 1004 
  31.  
  32.  
  33. #define OFFSET_BEGINNING -1 
  34. #define OFFSET_CURRENT 0 
  35. #define OFFSET_END 1 
  36.  
  37. #define OFFSET_BEGINING OFFSET_BEGINNING 
  38.  
  39. #define BITSPERBYTE 8
  40. #define BYTESPERLONG 4
  41. #define BITSPERLONG 32
  42. #define MAXINT 0x7FFFFFFF
  43. #define MININT 0x80000000
  44.  
  45.  
  46. #define SHARED_LOCK -2 
  47. #define ACCESS_READ -2 
  48. #define EXCLUSIVE_LOCK -1 
  49. #define ACCESS_WRITE -1 
  50.  
  51. struct DateStamp {
  52.  LONG ds_Days; 
  53.  LONG ds_Minute; 
  54.  LONG ds_Tick; 
  55. }; 
  56.  
  57. #define TICKS_PER_SECOND 50 
  58.  
  59.  
  60. struct FileInfoBlock {
  61.  LONG fib_DiskKey;
  62.  LONG fib_DirEntryType; 
  63.  char fib_FileName[108]; 
  64.  LONG fib_Protection; 
  65.  LONG fib_EntryType;
  66.  LONG fib_Size; 
  67.  LONG fib_NumBlocks; 
  68.  struct DateStamp fib_Date;
  69.  char fib_Comment[80]; 
  70.  char fib_Reserved[36];
  71. }; 
  72.  
  73.  
  74.  
  75.  
  76. #define FIBB_SCRIPT 6 
  77. #define FIBB_PURE 5 
  78. #define FIBB_ARCHIVE 4 
  79. #define FIBB_READ 3 
  80. #define FIBB_WRITE 2 
  81. #define FIBB_EXECUTE 1 
  82. #define FIBB_DELETE 0 
  83. #define FIBF_SCRIPT (1<<FIBB_SCRIPT)
  84. #define FIBF_PURE (1<<FIBB_PURE)
  85. #define FIBF_ARCHIVE (1<<FIBB_ARCHIVE)
  86. #define FIBF_READ (1<<FIBB_READ)
  87. #define FIBF_WRITE (1<<FIBB_WRITE)
  88. #define FIBF_EXECUTE (1<<FIBB_EXECUTE)
  89. #define FIBF_DELETE (1<<FIBB_DELETE)
  90.  
  91.  
  92.  
  93.  
  94. #define FAULT_MAX 82
  95.  
  96.  
  97. typedef long BPTR; 
  98. typedef long BSTR; 
  99.  
  100.  
  101. #ifdef OBSOLETE_LIBRARIES_DOS_H
  102. #define BADDR( bptr ) (((ULONG)bptr) << 2)
  103. #else
  104.  
  105. #define BADDR(x) ((APTR)((ULONG)(x) << 2))
  106. #endif
  107.  
  108. #define MKBADDR(x) (((LONG)(x)) >> 2)
  109.  
  110.  
  111.  
  112.  
  113. struct InfoData {
  114.  LONG id_NumSoftErrors; 
  115.  LONG id_UnitNumber; 
  116.  LONG id_DiskState; 
  117.  LONG id_NumBlocks; 
  118.  LONG id_NumBlocksUsed; 
  119.  LONG id_BytesPerBlock;
  120.  LONG id_DiskType; 
  121.  BPTR id_VolumeNode; 
  122.  LONG id_InUse; 
  123. }; 
  124.  
  125.  
  126.  
  127. #define ID_WRITE_PROTECTED 80 
  128. #define ID_VALIDATING 81 
  129. #define ID_VALIDATED 82 
  130.  
  131.  
  132.  
  133. #define ID_NO_DISK_PRESENT (-1)
  134. #define ID_UNREADABLE_DISK (0x42414400L) 
  135. #define ID_DOS_DISK (0x444F5300L) 
  136. #define ID_FFS_DISK (0x444F5301L) 
  137. #define ID_INTER_DOS_DISK (0x444F5302L) 
  138. #define ID_INTER_FFS_DISK (0x444F5303L) 
  139. #define ID_NOT_REALLY_DOS (0x4E444F53L) 
  140. #define ID_KICKSTART_DISK (0x4B49434BL) 
  141. #define ID_MSDOS_DISK (0x4d534400L) 
  142.  
  143.  
  144. #define ERROR_NO_FREE_STORE 103
  145. #define ERROR_TASK_TABLE_FULL 105
  146. #define ERROR_BAD_TEMPLATE 114
  147. #define ERROR_BAD_NUMBER 115
  148. #define ERROR_REQUIRED_ARG_MISSING 116
  149. #define ERROR_KEY_NEEDS_ARG 117
  150. #define ERROR_TOO_MANY_ARGS 118
  151. #define ERROR_UNMATCHED_QUOTES 119
  152. #define ERROR_LINE_TOO_LONG 120
  153. #define ERROR_FILE_NOT_OBJECT 121
  154. #define ERROR_INVALID_RESIDENT_LIBRARY 122
  155. #define ERROR_NO_DEFAULT_DIR 201
  156. #define ERROR_OBJECT_IN_USE 202
  157. #define ERROR_OBJECT_EXISTS 203
  158. #define ERROR_DIR_NOT_FOUND 204
  159. #define ERROR_OBJECT_NOT_FOUND 205
  160. #define ERROR_BAD_STREAM_NAME 206
  161. #define ERROR_OBJECT_TOO_LARGE 207
  162. #define ERROR_ACTION_NOT_KNOWN 209
  163. #define ERROR_INVALID_COMPONENT_NAME 210
  164. #define ERROR_INVALID_LOCK 211
  165. #define ERROR_OBJECT_WRONG_TYPE 212
  166. #define ERROR_DISK_NOT_VALIDATED 213
  167. #define ERROR_DISK_WRITE_PROTECTED 214
  168. #define ERROR_RENAME_ACROSS_DEVICES 215
  169. #define ERROR_DIRECTORY_NOT_EMPTY 216
  170. #define ERROR_TOO_MANY_LEVELS 217
  171. #define ERROR_DEVICE_NOT_MOUNTED 218
  172. #define ERROR_SEEK_ERROR 219
  173. #define ERROR_COMMENT_TOO_BIG 220
  174. #define ERROR_DISK_FULL 221
  175. #define ERROR_DELETE_PROTECTED 222
  176. #define ERROR_WRITE_PROTECTED 223
  177. #define ERROR_READ_PROTECTED 224
  178. #define ERROR_NOT_A_DOS_DISK 225
  179. #define ERROR_NO_DISK 226
  180. #define ERROR_NO_MORE_ENTRIES 232
  181.  
  182. #define ERROR_IS_SOFT_LINK 233
  183. #define ERROR_OBJECT_LINKED 234
  184. #define ERROR_BAD_HUNK 235
  185. #define ERROR_NOT_IMPLEMENTED 236
  186. #define ERROR_RECORD_NOT_LOCKED 240
  187. #define ERROR_LOCK_COLLISION 241
  188. #define ERROR_LOCK_TIMEOUT 242
  189. #define ERROR_UNLOCK_ERROR 243
  190.  
  191.  
  192.  
  193.  
  194.  
  195. #define RETURN_OK 0 
  196. #define RETURN_WARN 5 
  197. #define RETURN_ERROR 10 
  198. #define RETURN_FAIL 20 
  199.  
  200.  
  201. #define SIGBREAKB_CTRL_C 12
  202. #define SIGBREAKB_CTRL_D 13
  203. #define SIGBREAKB_CTRL_E 14
  204. #define SIGBREAKB_CTRL_F 15
  205.  
  206.  
  207.  
  208. #define SIGBREAKF_CTRL_C (1<<SIGBREAKB_CTRL_C)
  209. #define SIGBREAKF_CTRL_D (1<<SIGBREAKB_CTRL_D)
  210. #define SIGBREAKF_CTRL_E (1<<SIGBREAKB_CTRL_E)
  211. #define SIGBREAKF_CTRL_F ((long)1<<SIGBREAKB_CTRL_F)
  212.  
  213.  
  214. #define LOCK_DIFFERENT -1
  215. #define LOCK_SAME 0
  216. #define LOCK_SAME_VOLUME 1 
  217. #define LOCK_SAME_HANDLER LOCK_SAME_VOLUME
  218.  
  219.  
  220.  
  221. #define CHANGE_LOCK 0
  222. #define CHANGE_FH 1
  223.  
  224.  
  225. #define LINK_HARD 0
  226. #define LINK_SOFT 1 
  227.  
  228.  
  229. #define ITEM_EQUAL -2 
  230. #define ITEM_ERROR -1 
  231. #define ITEM_NOTHING 0 
  232. #define ITEM_UNQUOTED 1 
  233. #define ITEM_QUOTED 2 
  234.  
  235.  
  236. #define DOS_FILEHANDLE 0 
  237. #define DOS_EXALLCONTROL 1 
  238. #define DOS_FIB 2 
  239. #define DOS_STDPKT 3 
  240. #define DOS_CLI 4 
  241. #define DOS_RDARGS 5 
  242.  
  243. #endif 
  244.  
  245.