********************************************************************
*               Commodore-Amiga, Inc.                              *
*               ComalDos.i                                         *
********************************************************************
* Standard assembler header for Amiga DOS on the MC68000
* Modified for use in Comal source files

DOSNAME     MACRO
      DC.B  'dos.library',0
      ENDM

* Predefined Amiga DOS global constants 

* Mode parameter to Open() 
MODE_READWRITE       EQU   1004   * Open existing file for read/write
*                                 * positioned at beginning of file.
MODE_OLDFILE         EQU   1005   * Open existing file for read
*                                 * positioned at beginning of file. 
MODE_NEWFILE         EQU   1006   * Open freshly created file (delete 
*                                 * old file) read/write            

* Relative position to Seek() 
OFFSET_BEGINNING     EQU   -1     * relative to Beginning Of File 
OFFSET_CURRENT       EQU    0     * relative to Current file position 
OFFSET_END           EQU    1     * relative to End Of File    

OFFSET_BEGINING      EQU   OFFSET_BEGINNING     * Ancient compatibility

BITSPERBYTE          EQU   8
BYTESPERLONG         EQU   4
BITSPERLONG          EQU   32
MAXINT               EQU   $7FFFFFFF
MININT               EQU   $80000000

* Passed as type to Lock() 
SHARED_LOCK          EQU   -2    ; File is readable by others 
ACCESS_READ          EQU   -2    ; Synonym
EXCLUSIVE_LOCK       EQU   -1    ; No other access allowed    
ACCESS_WRITE         EQU   -1    ; Synonym

TICKS_PER_SECOND     EQU   50    ; Number of ticks in one second

* Errors from IoErr(), etc. 
ERROR_NO_FREE_STORE               EQU  103
ERROR_OBJECT_IN_USE               EQU  202
ERROR_OBJECT_EXISTS               EQU  203
ERROR_OBJECT_NOT_FOUND            EQU  205
ERROR_ACTION_NOT_KNOWN            EQU  209
ERROR_INVALID_COMPONENT_NAME      EQU  210
ERROR_INVALID_LOCK                EQU  211
ERROR_OBJECT_WRONG_TYPE           EQU  212
ERROR_DISK_NOT_VALIDATED          EQU  213
ERROR_DISK_WRITE_PROTECTED        EQU  214
ERROR_RENAME_ACROSS_DEVICES       EQU  215
ERROR_DIRECTORY_NOT_EMPTY         EQU  216
ERROR_DEVICE_NOT_MOUNTED          EQU  218
ERROR_SEEK_ERROR                  EQU  219
ERROR_COMMENT_TOO_BIG             EQU  220   
ERROR_DISK_FULL                   EQU  221
ERROR_DELETE_PROTECTED            EQU  222
ERROR_WRITE_PROTECTED             EQU  223 
ERROR_READ_PROTECTED              EQU  224
ERROR_NOT_A_DOS_DISK              EQU  225
ERROR_NO_DISK                     EQU  226
ERROR_NO_MORE_ENTRIES             EQU  232

* These are the return codes used by convention by AmigaDOS commands 
* See FAILAT and IF for relvance to EXECUTE files                    
RETURN_OK                         EQU    0  * No problems, success 
RETURN_WARN                       EQU    5  * A warning only 
RETURN_ERROR                      EQU   10  * Something wrong 
RETURN_FAIL                       EQU   20  * Complete or severe failure

