home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Inc&AD2.1 / includes / dos / dos.i < prev    next >
Encoding:
Text File  |  1992-09-11  |  7.6 KB  |  233 lines

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