home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Assembler / CODEXASSEMBLERDEVSYSV1.1.DMS / in.adf / include / libraries / dosextens.i < prev    next >
Encoding:
Text File  |  1988-09-19  |  8.6 KB  |  235 lines

  1.    IFND  LIBRARIES_DOSEXTENS_I
  2.  
  3. LIBRARIES_DOSEXTENS_I   SET   1
  4. ********************************************************************
  5. *               Commodore-Amiga, Inc.                              *
  6. *               dosextens.i                                        *
  7. ********************************************************************
  8. * DOS structures not needed for the casual DOS user
  9.  
  10.  
  11.      IFND  EXEC_TYPES_I
  12.      INCLUDE "exec/types.i"
  13.      ENDC
  14.      IFND  EXEC_TASKS_I
  15.      INCLUDE "exec/tasks.i"
  16.      ENDC
  17.      IFND  EXEC_PORTS_I
  18.      INCLUDE "exec/ports.i"
  19.      ENDC
  20.      IFND  EXEC_LIBRARIES_I
  21.      INCLUDE "exec/libraries.i"
  22.      ENDC
  23.  
  24.      IFND  LIBRARIES_DOS_I
  25.      INCLUDE "libraries/dos.i"
  26.      ENDC
  27.  
  28.  
  29. * All DOS processes have this STRUCTure
  30. * Create and DeviceProc returns pointer to the MsgPort in this STRUCTure
  31. * Process_addr = DeviceProc(..) - TC_SIZE
  32.  
  33.  STRUCTURE Process,0
  34.     STRUCT  pr_Task,TC_SIZE
  35.     STRUCT  pr_MsgPort,MP_SIZE  * This is BPTR address from DOS functions
  36.     WORD    pr_Pad              * Remaining variables on 4 byte boundaries
  37.     BPTR    pr_SegList          * Array of seg lists used by this process
  38.     LONG    pr_StackSize        * Size of process stack in bytes
  39.     APTR    pr_GlobVec          * Global vector for this process (BCPL)
  40.     LONG    pr_TaskNum          * CLI task number of zero if not a CLI
  41.     BPTR    pr_StackBase        * Ptr to high memory end of process stack
  42.     LONG    pr_Result2          * Value of secondary result from last call
  43.     BPTR    pr_CurrentDir       * Lock associated with current directory
  44.     BPTR    pr_CIS              * Current CLI Input Stream
  45.     BPTR    pr_COS              * Current CLI Output Stream
  46.     APTR    pr_ConsoleTask      * Console handler process for current window
  47.     APTR    pr_FileSystemTask   * File handler process for current drive
  48.     BPTR    pr_CLI              * pointer to ConsoleLineInterpreter
  49.     APTR    pr_ReturnAddr       * pointer to previous stack frame
  50.     APTR    pr_PktWait          * Function to be called when awaiting msg
  51.     APTR    pr_WindowPtr        * Window pointer for errors
  52.     LABEL   pr_SIZEOF           * Process
  53.  
  54. * The long word address (BPTR) of this STRUCTure is returned by
  55. * Open() and other routines that return a file.  You need only worry
  56. * about this STRUCT to do async io's via PutMsg() instead of
  57. * standard file system calls
  58.  
  59.  STRUCTURE FileHandle,0
  60.    APTR   fh_Link          * pointer to EXEC message
  61.    APTR   fh_Interactive   * Boolean; TRUE if interactive handle
  62.    APTR   fh_Type          * Port to do PutMsg() to
  63.    LONG   fh_Buf
  64.    LONG   fh_Pos
  65.    LONG   fh_End
  66.    LONG   fh_Funcs
  67. fh_Func1 EQU fh_Funcs
  68.    LONG   fh_Func2
  69.    LONG   fh_Func3
  70.    LONG   fh_Args
  71. fh_Arg1 EQU fh_Args
  72.    LONG   fh_Arg2
  73.    LABEL  fh_SIZEOF * FileHandle
  74.  
  75. * This is the extension to EXEC Messages used by DOS
  76.  STRUCTURE DosPacket,0
  77.    APTR   dp_Link         * pointer to EXEC message
  78.    APTR   dp_Port         * pointer to Reply port for the packet
  79. *                         * Must be filled in each send.
  80.    LONG   dp_Type         * See ACTION_... below and
  81. *                         * 'R' means Read, 'W' means Write to the file system
  82.    LONG   dp_Res1         * For file system calls this is the result
  83. *                         * that would have been returned by the
  84. *                         * function, e.g. Write ('W') returns actual
  85. *                         * length written
  86.    LONG   dp_Res2         * For file system calls this is what would
  87. *                         * have been returned by IoErr()
  88.    LONG   dp_Arg1
  89. *  Device packets common equivalents
  90. dp_Action  EQU  dp_Type
  91. dp_Status  EQU  dp_Res1
  92. dp_Status2 EQU  dp_Res2
  93. dp_BufAddr EQU  dp_Arg1
  94.    LONG   dp_Arg2
  95.    LONG   dp_Arg3
  96.    LONG   dp_Arg4
  97.    LONG   dp_Arg5
  98.    LONG   dp_Arg6
  99.    LONG   dp_Arg7
  100.    LABEL  dp_SIZEOF * DosPacket
  101.  
  102. * A Packet does not require the Message to before it in memory, but
  103. * for convenience it is useful to associate the two.
  104. * Also see the function init_std_pkt for initializing this STRUCTure
  105.  
  106.  STRUCTURE StandardPacket,0
  107.    STRUCT sp_Msg,MN_SIZE
  108.    STRUCT sp_Pkt,dp_SIZEOF
  109.    LABEL  sp_SIZEOF * StandardPacket
  110.  
  111.  
  112. * Packet types
  113. ACTION_NIL              EQU   0
  114. ACTION_GET_BLOCK        EQU   2
  115. ACTION_SET_MAP          EQU   4
  116. ACTION_DIE              EQU   5
  117. ACTION_EVENT            EQU   6
  118. ACTION_CURRENT_VOLUME   EQU   7
  119. ACTION_LOCATE_OBJECT    EQU   8
  120. ACTION_RENAME_DISK      EQU   9
  121. ACTION_WRITE            EQU   'W'
  122. ACTION_READ             EQU   'R'
  123. ACTION_FREE_LOCK        EQU   15
  124. ACTION_DELETE_OBJECT    EQU   16
  125. ACTION_RENAME_OBJECT    EQU   17
  126.  
  127. ACTION_COPY_DIR         EQU   19
  128. ACTION_WAIT_CHAR        EQU   20
  129. ACTION_SET_PROTECT      EQU   21
  130. ACTION_CREATE_DIR       EQU   22
  131. ACTION_EXAMINE_OBJECT   EQU   23
  132. ACTION_EXAMINE_NEXT     EQU   24
  133. ACTION_DISK_INFO        EQU   25
  134. ACTION_INFO             EQU   26
  135.  
  136. ACTION_SET_COMMENT      EQU   28
  137. ACTION_PARENT           EQU   29
  138. ACTION_TIMER            EQU   30
  139. ACTION_INHIBIT          EQU   31
  140. ACTION_DISK_TYPE        EQU   32
  141. ACTION_DISK_CHANGE      EQU   33
  142.  
  143.  
  144. * DOS library node structure.
  145. * This is the data at positive offsets from the library node.
  146. * Negative offsets from the node is the jump table to DOS functions
  147. * node = (STRUCT DosLibrary *) OpenLibrary( "dos.library" .. )
  148.  
  149.  STRUCTURE DosLibrary,0
  150.     STRUCT  dl_lib,LIB_SIZE
  151.     APTR    dl_Root          * Pointer to RootNode, described below
  152.     APTR    dl_GV            * Pointer to BCPL global vector
  153.     LONG    dl_A2            * Private register dump of DOS
  154.     LONG    dl_A5
  155.     LONG    dl_A6
  156.     LABEL   dl_SIZEOF *  DosLibrary
  157.  
  158. *
  159.  
  160.  STRUCTURE RootNode,0
  161.     BPTR    rn_TaskArray       * [0] is max number of CLI's
  162. *                              * [1] is APTR to process id of CLI 1
  163. *                              * [n] is APTR to process id of CLI n
  164.     BPTR    rn_ConsoleSegment  * SegList for the CLI
  165.     STRUCT  rn_Time,ds_SIZEOF  * Current time
  166.     LONG    rn_RestartSeg      * SegList for the disk validator process
  167.     BPTR    rn_Info            * Pointer ot the Info structure
  168.     LABEL   rn_SIZEOF          * RootNode
  169.  
  170.  STRUCTURE DosInfo,0
  171.     BPTR    di_McName          * Network name of this machine currently 0
  172.     BPTR    di_DevInfo         * Device List
  173.     BPTR    di_Devices         * Currently zero
  174.     BPTR    di_Handlers        * Currently zero
  175.     APTR    di_NetHand         * Network handler processid currently zero
  176.     LABEL   di_SIZEOF          * DosInfo
  177.  
  178. * DOS Processes started from the CLI via RUN or NEWCLI have this additional
  179. * set to data associated with them
  180.  
  181.  STRUCTURE CommandLineInterface,0
  182.     LONG   cli_Result2         * Value of IoErr from last command
  183.     BSTR   cli_SetName         * Name of current directory
  184.     BPTR   cli_CommandDir      * Lock associated with command directory
  185.     LONG   cli_ReturnCode      * Return code from last command
  186.     BSTR   cli_CommandName     * Name of current command
  187.     LONG   cli_FailLevel       * Fail level (set by FAILAT)
  188.     BSTR   cli_Prompt          * Current prompt (set by PROMPT)
  189.     BPTR   cli_StandardInput   * Default (terminal) CLI input
  190.     BPTR   cli_CurrentInput    * Current CLI input
  191.     BSTR   cli_CommandFile     * Name of EXECUTE command file
  192.     LONG   cli_Interactive     * Boolean True if prompts required
  193.     LONG   cli_Background      * Boolean True if CLI created by RUN
  194.     BPTR   cli_CurrentOutput   * Current CLI output
  195.     LONG   cli_DefaultStack    * Stack size to be obtained in long words
  196.     BPTR   cli_StandardOutput  * Default (terminal) CLI output
  197.     BPTR   cli_Module          * SegList of currently loaded command
  198.     LABEL  cli_SIZEOF          * CommandLineInterface
  199.  
  200.  
  201. *
  202. * this structure needs some work.  It should really be a union, because
  203. * it can take on different valued depending on whether it is a device,
  204. * an assigned directory, or a volume.
  205. * For now, it reflects a volume.
  206. *
  207.  STRUCTURE DevList,0
  208.     BPTR dl_Next                    ; bptr to next device list
  209.     LONG dl_Type                    ; see DLT below
  210.     APTR dl_Task                    ; ptr to handler task
  211.     BPTR dl_Lock                    ; not for volumes
  212.     STRUCT  dl_VolumeDate,ds_SIZEOF ; creation date
  213.     BPTR dl_LockList                ; outstanding locks
  214.     LONG dl_DiskType                ; 'DOS', etc
  215.     LONG dl_unused
  216.     BSTR dl_Name                    ; bptr to bcpl name
  217.     LABEL   DevList_SIZEOF
  218.  
  219. * definitions for dl_Type
  220. DLT_DEVICE     EQU   0
  221. DLT_DIRECTORY  EQU   1
  222. DLT_VOLUME     EQU   2
  223.  
  224.  
  225. * a lock structure, as returned by Lock() or DupLock()
  226.  STRUCTURE FileLock,0
  227.     BPTR fl_Link        ; bcpl pointer to next lock
  228.     LONG fl_Key         ; disk block number
  229.     LONG fl_Access      ; exclusive or shared
  230.     APTR fl_Task        ; handler task's port
  231.     BPTR fl_Volume      ; bptr to a DeviceList
  232.     LABEL   fl_SIZEOF
  233.  
  234.    ENDC  LIBRARIES_DOSEXTENS_I
  235.