home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / inc&ad2.0 / includes / dos / dos.i < prev    next >
Text File  |  1992-09-01  |  8KB  |  235 lines

  1.     IFND    DOS_DOS_I
  2. DOS_DOS_I SET    1
  3. **    $Filename: dos/dos.i $
  4. **    $Release: 2.04 Includes, V37.4 $
  5. **    $Revision: 36.24 $
  6. **    $Date: 91/05/16 $
  7. **
  8. **    Standard asm header for AmigaDOS
  9. **
  10. **    (C) Copyright 1985-1991 Commodore-Amiga, Inc.
  11. **        All Rights Reserved
  12. **
  13.  
  14.     IFND    EXEC_TYPES_I
  15.     INCLUDE    "exec/types.i"
  16.     ENDC
  17.  
  18. DOSNAME        MACRO
  19.       DC.B  'dos.library',0
  20.       ENDM
  21.  
  22. * Predefined Amiga DOS global constants
  23.  
  24. DOSTRUE          EQU     -1
  25. DOSFALSE      EQU      0
  26.  
  27. * Mode parameter to Open()
  28. MODE_OLDFILE         EQU   1005      * Open existing file read/write
  29. *                  * positioned at beginning of file.
  30. MODE_NEWFILE         EQU   1006      * Open freshly created file (delete
  31. *                  * old file) read/write
  32. MODE_READWRITE         EQU   1004      * Open old file w/shared lock,
  33. *                  * creates file if doesn't exist.
  34.  
  35. * Relative position to Seek() 
  36. OFFSET_BEGINNING     EQU   -1      * relative to Beginning Of File 
  37. OFFSET_CURRENT         EQU    0      * relative to Current file position 
  38. OFFSET_END         EQU    1      * relative to End Of File    
  39.  
  40. OFFSET_BEGINING        EQU      OFFSET_BEGINNING     * Ancient compatibility
  41.  
  42. BITSPERBYTE         EQU   8
  43. BYTESPERLONG         EQU   4
  44. BITSPERLONG         EQU   32
  45. MAXINT             EQU   $7FFFFFFF
  46. MININT             EQU   $80000000
  47.  
  48. * Passed as type to Lock() 
  49. SHARED_LOCK         EQU   -2    ; File is readable by others 
  50. ACCESS_READ         EQU   -2    ; Synonym
  51. EXCLUSIVE_LOCK         EQU   -1    ; No other access allowed    
  52. ACCESS_WRITE         EQU   -1    ; Synonym
  53.  
  54.  
  55.  STRUCTURE DateStamp,0 
  56.    LONG     ds_Days        ; Number of days since Jan. 1, 1978
  57.    LONG     ds_Minute        ; Number of minutes past midnight 
  58.    LONG     ds_Tick        ; Number of ticks past minute 
  59.    LABEL ds_SIZEOF        ; DateStamp 
  60.  
  61. TICKS_PER_SECOND EQU 50        ; Number of ticks in one second 
  62.  
  63. * Returned by Examine() and ExInfo() 
  64.  STRUCTURE FileInfoBlock,0
  65.    LONG      fib_DiskKey
  66.    LONG      fib_DirEntryType    ; Type of Directory. If < 0, then a plain file.
  67.                 ; If > 0 a directory 
  68.    STRUCT fib_FileName,108    ; Null terminated. Max 30 chars used for now 
  69.    LONG      fib_Protection    ; bit mask of protection, rwxd are 3-0.         
  70.    LONG      fib_EntryType
  71.    LONG      fib_Size        ; Number of bytes in file 
  72.    LONG      fib_NumBlocks        ; Number of blocks in file 
  73.    STRUCT fib_DateStamp,ds_SIZEOF ; Date file last changed.
  74.    STRUCT fib_Comment,80    ; Null terminated. Comment associated with file 
  75.    STRUCT fib_Reserved,36
  76.    LABEL  fib_SIZEOF        ; FileInfoBlock 
  77.  
  78. * FIB stands for FileInfoBlock 
  79. * FIBB are bit definitions, FIBF are field definitions 
  80.    BITDEF   FIB,SCRIPT,6    ; program is an execute script
  81.    BITDEF   FIB,PURE,5        ; program is reentrant and reexecutable
  82.    BITDEF   FIB,ARCHIVE,4    ; cleared whenever file is changed
  83.    BITDEF   FIB,READ,3        ; ignored by the system
  84.    BITDEF   FIB,WRITE,2        ; ignored by the system
  85.    BITDEF   FIB,EXECUTE,1    ; ignored by the system
  86.    BITDEF   FIB,DELETE,0    ; prevent file from being deleted
  87.  
  88. * Standard maximum length for an error string from fault.  However, most
  89. * error strings should be kept under 60 characters if possible.  Don't
  90. * forget space for the header you pass in.
  91. FAULT_MAX    EQU    82
  92.  
  93. * All BCPL data must be long word aligned.  BCPL pointers are the long word
  94. * address (i.e byte address divided by 4 (>>2))
  95.  
  96. * Macro to indicate BCPL pointers
  97. BPTR     MACRO                * Long word pointer
  98.      LONG      \1
  99.      ENDM
  100. BSTR     MACRO                * Long word pointer to BCPL string.
  101.      LONG      \1
  102.      ENDM
  103.  
  104. * #define BADDR( bptr ) (bptr << 2) * Convert BPTR to byte addressed pointer
  105.  
  106. * BCPL strings have a length in the first byte and then the characters.
  107. * For example:    s[0]=3 s[1]=S s[2]=Y s[3]=S
  108.  
  109. * returned by Info()
  110.  STRUCTURE InfoData,0
  111.    LONG id_NumSoftErrors    * number of soft errors on disk
  112.    LONG id_UnitNumber        * Which unit disk is (was) mounted on
  113.    LONG id_DiskState        * See defines below
  114.    LONG id_NumBlocks        * Number of blocks on disk
  115.    LONG id_NumBlocksUsed    * Number of block in use
  116.    LONG id_BytesPerBlock
  117.    LONG id_DiskType        * Disk Type code
  118.    BPTR id_VolumeNode        * BCPL pointer to volume node
  119.    LONG id_InUse        * Flag, zero if not in use
  120.    LABEL id_SIZEOF        * InfoData
  121.  
  122. * ID stands for InfoData
  123. *         Disk states
  124. ID_WRITE_PROTECTED    EQU    80    * Disk is write protected
  125. ID_VALIDATING        EQU    81    * Disk is currently being validated
  126. ID_VALIDATED        EQU    82    * Disk is consistent and writeable
  127.  
  128. *       Disk types
  129. * ID_INTER_* use international case comparison routines for hashing
  130. ID_NO_DISK_PRESENT    EQU -1
  131. ID_UNREADABLE_DISK    EQU  ('B'<<24)!('A'<<16)!('D'<<8)
  132. ID_NOT_REALLY_DOS    EQU  ('N'<<24)!('D'<<16)!('O'<<8)!('S')
  133. ID_DOS_DISK        EQU  ('D'<<24)!('O'<<16)!('S'<<8)
  134. ID_FFS_DISK        EQU  ('D'<<24)!('O'<<16)!('S'<<8)!(1)
  135. ID_INTER_DOS_DISK    EQU  ('D'<<24)!('O'<<16)!('S'<<8)!(2)
  136. ID_INTER_FFS_DISK    EQU  ('D'<<24)!('O'<<16)!('S'<<8)!(3)
  137. ID_KICKSTART_DISK    EQU  ('K'<<24)!('I'<<16)!('C'<<8)!('K')
  138. ID_MSDOS_DISK        EQU  ('M'<<24)!('S'<<16)!('D'<<8)
  139.  
  140. * Errors from IoErr(), etc.
  141. ERROR_NO_FREE_STORE          EQU  103
  142. ERROR_TASK_TABLE_FULL          EQU  105
  143. ERROR_BAD_TEMPLATE          EQU  114
  144. ERROR_BAD_NUMBER          EQU  115
  145. ERROR_REQUIRED_ARG_MISSING      EQU  116
  146. ERROR_KEY_NEEDS_ARG          EQU  117
  147. ERROR_TOO_MANY_ARGS          EQU  118
  148. ERROR_UNMATCHED_QUOTES          EQU  119
  149. ERROR_LINE_TOO_LONG          EQU  120
  150. ERROR_FILE_NOT_OBJECT          EQU  121
  151. ERROR_INVALID_RESIDENT_LIBRARY      EQU  122
  152. ERROR_NO_DEFAULT_DIR          EQU  201
  153. ERROR_OBJECT_IN_USE          EQU  202
  154. ERROR_OBJECT_EXISTS          EQU  203
  155. ERROR_DIR_NOT_FOUND          EQU  204
  156. ERROR_OBJECT_NOT_FOUND          EQU  205
  157. ERROR_BAD_STREAM_NAME          EQU  206
  158. ERROR_OBJECT_TOO_LARGE          EQU  207
  159. ERROR_ACTION_NOT_KNOWN          EQU  209
  160. ERROR_INVALID_COMPONENT_NAME      EQU  210
  161. ERROR_INVALID_LOCK          EQU  211
  162. ERROR_OBJECT_WRONG_TYPE          EQU  212
  163. ERROR_DISK_NOT_VALIDATED      EQU  213
  164. ERROR_DISK_WRITE_PROTECTED      EQU  214
  165. ERROR_RENAME_ACROSS_DEVICES      EQU  215
  166. ERROR_DIRECTORY_NOT_EMPTY      EQU  216
  167. ERROR_TOO_MANY_LEVELS          EQU  217
  168. ERROR_DEVICE_NOT_MOUNTED      EQU  218
  169. ERROR_SEEK_ERROR          EQU  219
  170. ERROR_COMMENT_TOO_BIG          EQU  220
  171. ERROR_DISK_FULL              EQU  221
  172. ERROR_DELETE_PROTECTED          EQU  222
  173. ERROR_WRITE_PROTECTED          EQU  223
  174. ERROR_READ_PROTECTED          EQU  224
  175. ERROR_NOT_A_DOS_DISK          EQU  225
  176. ERROR_NO_DISK              EQU  226
  177. ERROR_NO_MORE_ENTRIES          EQU  232
  178. * added for 1.4
  179. ERROR_IS_SOFT_LINK          EQU  233
  180. ERROR_OBJECT_LINKED          EQU  234
  181. ERROR_BAD_HUNK              EQU  235
  182. ERROR_NOT_IMPLEMENTED          EQU  236
  183. ERROR_RECORD_NOT_LOCKED          EQU  240
  184. ERROR_LOCK_COLLISION          EQU  241
  185. ERROR_LOCK_TIMEOUT          EQU  242
  186. ERROR_UNLOCK_ERROR          EQU  243
  187.  
  188. * error codes 303-305 are defined in dosasl.i
  189.  
  190. * These are the return codes used by convention by AmigaDOS commands
  191. * See FAILAT and IF for relvance to EXECUTE files
  192. RETURN_OK              EQU     0  * No problems, success
  193. RETURN_WARN              EQU     5  * A warning only
  194. RETURN_ERROR              EQU    10  * Something wrong
  195. RETURN_FAIL              EQU    20  * Complete or severe failure
  196.  
  197. * Bit numbers that signal you that a user has issued a break
  198. * for example: if (SetSignal(0,0) & SIGBREAKF_CTRL_C) cleanup_and_exit();
  199.     BITDEF    SIGBREAK,CTRL_C,12
  200.     BITDEF    SIGBREAK,CTRL_D,13
  201.     BITDEF    SIGBREAK,CTRL_E,14
  202.     BITDEF    SIGBREAK,CTRL_F,15
  203.  
  204. * Values returned by SameLock()
  205. LOCK_DIFFERENT        EQU    -1
  206. LOCK_SAME        EQU    0
  207. LOCK_SAME_VOLUME    EQU    1    ; locks are on same volume
  208. LOCK_SAME_HANDLER    EQU    LOCK_SAME_VOLUME
  209. * LOCK_SAME_HANDLER was a misleading name, def kept for src compatibility
  210.  
  211. * types for ChangeMode()
  212. CHANGE_LOCK    EQU    0
  213. CHANGE_FH    EQU    1
  214.  
  215. * Values for MakeLink()
  216. LINK_HARD    EQU    0
  217. LINK_SOFT    EQU    1        ; softlinks are not fully supported yet
  218.  
  219. * values returned by ReadItem
  220. ITEM_EQUAL    EQU    -2        ; "=" Symbol
  221. ITEM_ERROR    EQU    -1        ; error
  222. ITEM_NOTHING    EQU    0        ; *N, ;, endstreamch
  223. ITEM_UNQUOTED    EQU    1        ; unquoted item
  224. ITEM_QUOTED    EQU    2        ; quoted item
  225.  
  226. * types for AllocDosObject/FreeDosObject
  227. DOS_FILEHANDLE        EQU    0    ; few people should use this
  228. DOS_EXALLCONTROL    EQU    1    ; Must be used to allocate this!
  229. DOS_FIB            EQU    2    ; useful
  230. DOS_STDPKT        EQU    3    ; for doing packet-level I/O
  231. DOS_CLI            EQU    4    ; for shell-writers, etc
  232. DOS_RDARGS        EQU    5    ; for ReadArgs if you pass it in
  233.  
  234.     ENDC    ; DOS_DOS_I
  235.