1 #ifndef DOS_DOSEXTENS_H
    2 #define DOS_DOSEXTENS_H
    3 
    4 /*
    5 	dos.library extended structures include
    6 
    7 	Copyright © 2002-2003 The MorphOS Development Team, All Rights Reserved.
    8 */
    9 
   10 #ifndef EXEC_TASKS_H
   11 # include <exec/tasks.h>
   12 #endif
   13 
   14 #ifndef EXEC_PORTS_H
   15 # include <exec/ports.h>
   16 #endif
   17 
   18 #ifndef EXEC_LIBRARIES_H
   19 # include <exec/libraries.h>
   20 #endif
   21 
   22 #ifndef EXEC_SEMAPHORES_H
   23 # include <exec/semaphores.h>
   24 #endif
   25 
   26 #ifndef DEVICES_TIMER_H
   27 # include <devices/timer.h>
   28 #endif
   29 
   30 #ifndef DOS_DOS_H
   31 # include <dos/dos.h>
   32 #endif
   33 
   34 #pragma pack(2)
   35 
   36 
   37 struct Process
   38 {
   39 	struct Task      pr_Task;
   40 	struct MsgPort   pr_MsgPort;
   41 	WORD             pr_Pad;
   42 	BPTR             pr_SegList;
   43 	LONG             pr_StackSize;
   44 	APTR             pr_GlobVec;
   45 	LONG             pr_TaskNum;
   46 	BPTR             pr_StackBase;
   47 	LONG             pr_Result2;
   48 	BPTR             pr_CurrentDir;
   49 	BPTR             pr_CIS;
   50 	BPTR             pr_COS;
   51 	APTR             pr_ConsoleTask;
   52 	APTR             pr_FileSystemTask;
   53 	BPTR             pr_CLI;
   54 	APTR             pr_ReturnAddr;
   55 	APTR             pr_PktWait;
   56 	APTR             pr_WindowPtr;
   57 
   58 	BPTR             pr_HomeDir;
   59 	LONG             pr_Flags;
   60 	VOID           (*pr_ExitCode)(VOID);
   61 	LONG             pr_ExitData;
   62 	STRPTR           pr_Arguments;
   63 	struct MinList   pr_LocalVars;
   64 	ULONG            pr_ShellPrivate;
   65 	BPTR             pr_CES;
   66 };
   67 
   68 
   69 #define PRB_FREESEGLIST  0
   70 #define PRF_FREESEGLIST  (1<<PRB_FREESEGLIST)
   71 
   72 #define PRB_FREECURRDIR  1
   73 #define PRF_FREECURRDIR  (1<<PRB_FREECURRDIR)
   74 
   75 #define PRB_FREECLI      2
   76 #define PRF_FREECLI      (1<<PRB_FREECLI)
   77 
   78 #define PRB_CLOSEINPUT   3
   79 #define PRF_CLOSEINPUT   (1<<PRB_CLOSEINPUT)
   80 
   81 #define PRB_CLOSEOUTPUT  4
   82 #define PRF_CLOSEOUTPUT  (1<<PRB_CLOSEOUTPUT)
   83 
   84 #define PRB_FREEARGS     5
   85 #define PRF_FREEARGS     (1<<PRB_FREEARGS)
   86 
   87 #define PRB_CLOSEERROR   6
   88 #define PRF_CLOSEERROR   (1<<PRB_CLOSEERROR)
   89 
   90 
   91 struct FileHandle
   92 {
   93 	ULONG           fh_Flags;       /* Used to be struct Message *fh_Link; */
   94 #	define          fh_Link fh_Flags
   95 
   96 	LONG            fh_Interactive; /* Used to be struct MsgPort *fh_Port; */
   97 #	define          fh_Port fh_Interactive
   98 
   99 	struct MsgPort *fh_Type;
  100 	LONG            fh_Buf;
  101 	LONG            fh_Pos;
  102 	LONG            fh_End;
  103 
  104 	LONG            fh_Funcs;
  105 #	define          fh_Func1 fh_Funcs
  106 
  107 	LONG            fh_Func2;
  108 	LONG            fh_Func3;
  109 
  110 	LONG            fh_Args;
  111 #	define          fh_Arg1 fh_Args
  112 
  113 	LONG            fh_Arg2;
  114 
  115 	/*** V50 (MorphOS) ***/
  116 
  117 	LONG            fh_BufSize;
  118 	LONG            fh_OrigBuf;
  119 };
  120 
  121 
  122 struct DosPacket
  123 {
  124 	struct Message *dp_Link;
  125 	struct MsgPort *dp_Port;
  126 
  127 	LONG            dp_Type;
  128 #	define          dp_Action dp_Type
  129 
  130 	LONG            dp_Res1;
  131 #	define          dp_Status dp_Res1
  132 
  133 	LONG            dp_Res2;
  134 #	define          dp_Status2 dp_Res2
  135 
  136 
  137 	LONG            dp_Arg1;
  138 #	define          dp_BufAddr dp_Arg1
  139 
  140 	LONG            dp_Arg2;
  141 	LONG            dp_Arg3;
  142 	LONG            dp_Arg4;
  143 	LONG            dp_Arg5;
  144 	LONG            dp_Arg6;
  145 	LONG            dp_Arg7;
  146 };
  147 
  148 
  149 struct StandardPacket
  150 {
  151 	struct Message   sp_Msg;
  152 	struct DosPacket sp_Pkt;
  153 };
  154 
  155 
  156 #define ACTION_NIL              0
  157 #define ACTION_STARTUP          0
  158 #define ACTION_GET_BLOCK        2       /*** OBSOLETE ***/
  159 #define ACTION_SET_MAP          4
  160 #define ACTION_DIE              5
  161 #define ACTION_EVENT            6
  162 #define ACTION_CURRENT_VOLUME   7
  163 #define ACTION_LOCATE_OBJECT    8
  164 #define ACTION_RENAME_DISK      9
  165 #define ACTION_WRITE           'W'
  166 #define ACTION_READ            'R'
  167 #define ACTION_FREE_LOCK        15
  168 #define ACTION_DELETE_OBJECT    16
  169 #define ACTION_RENAME_OBJECT    17
  170 #define ACTION_MORE_CACHE       18
  171 #define ACTION_COPY_DIR         19
  172 #define ACTION_WAIT_CHAR        20
  173 #define ACTION_SET_PROTECT      21
  174 #define ACTION_CREATE_DIR       22
  175 #define ACTION_EXAMINE_OBJECT   23
  176 #define ACTION_EXAMINE_NEXT     24
  177 #define ACTION_DISK_INFO        25
  178 #define ACTION_INFO             26
  179 #define ACTION_FLUSH            27
  180 #define ACTION_SET_COMMENT      28
  181 #define ACTION_PARENT           29
  182 #define ACTION_TIMER            30
  183 #define ACTION_INHIBIT          31
  184 #define ACTION_DISK_TYPE        32
  185 #define ACTION_DISK_CHANGE      33
  186 #define ACTION_SET_DATE         34
  187 
  188 #define ACTION_SAME_LOCK        40
  189 
  190 #define ACTION_SCREEN_MODE      994
  191 
  192 #define ACTION_CHANGE_SIGNAL    995
  193 
  194 #define ACTION_READ_RETURN      1001
  195 #define ACTION_WRITE_RETURN     1002
  196 #define ACTION_SEEK             1008
  197 #define ACTION_FINDUPDATE       1004
  198 #define ACTION_FINDINPUT        1005
  199 #define ACTION_FINDOUTPUT       1006
  200 #define ACTION_END              1007
  201 
  202 #define ACTION_FORMAT           1020
  203 #define ACTION_MAKE_LINK        1021
  204 
  205 #define ACTION_SET_FILE_SIZE    1022
  206 #define ACTION_WRITE_PROTECT    1023
  207 
  208 #define ACTION_READ_LINK        1024
  209 #define ACTION_FH_FROM_LOCK     1026
  210 #define ACTION_IS_FILESYSTEM    1027
  211 #define ACTION_CHANGE_MODE      1028
  212 
  213 #define ACTION_COPY_DIR_FH      1030
  214 #define ACTION_PARENT_FH        1031
  215 #define ACTION_EXAMINE_ALL      1033
  216 #define ACTION_EXAMINE_FH       1034
  217 
  218 #define ACTION_EXAMINE_ALL_END  1035
  219 #define ACTION_SET_OWNER        1036
  220 
  221 #define ACTION_LOCK_RECORD      2008
  222 #define ACTION_FREE_RECORD      2009
  223 
  224 #define ACTION_ADD_NOTIFY       4097
  225 #define ACTION_REMOVE_NOTIFY    4098
  226 
  227 #define ACTION_SERIALIZE_DISK   4200
  228 
  229 #define ACTION_GET_DISK_FSSM    4201
  230 #define ACTION_FREE_DISK_FSSM   4202
  231 
  232 
  233 /* 64bit DOS extensions - V51 */
  234 
  235 /* Generic notes:
  236  *
  237  * - If large files are supported, normal ACTION_READ and ACTION_WRITE
  238  *   are used to access them. If ACTION_WRITE would grow the file to
  239  *   larger than the supported size, return code -1 and ioerr of
  240  *   ERROR_OBJECT_TOO_LARGE must be returned.
  241  * - Special attention is needed to make ACTION_SEEK not truncate
  242  *   various values when processing large files. If integer under/over-
  243  *   flow would occur, error should be returned and seek position left
  244  *   unchanged.
  245  * - For safety reasons ACTION_EXAMINE should return fib_Size of 0 for
  246  *   files larger than 2^31-1.
  247  */
  248 
  249 /* ACTION_SEEK64
  250  * dp_Arg1 - LONG fh_Arg1
  251  * dp_Arg2 - QUAD *position
  252  * dp_Arg3 - LONG mode
  253  * dp_Arg4 - QUAD *oldposition
  254  *
  255  * dp_Res1 - DOSFALSE for error (*oldposition is undefined!), dp_Res2 set.
  256  *           DOSTRUE for success (*oldposition is the old seek position).
  257  *
  258  * Implementation notes
  259  * - Notice the different return value to ACTION_SEEK.
  260  * - ACTION_SEEK64 must work for all files.
  261  * - ACTION_SEEK should work for > 2^31-1 files aswell, as long as possible.
  262  *   Largefile ACTION_SEEK must fail with ERROR_SEEK_ERROR if:
  263  *   a) the current seek position before the call is > 2^31-1 or
  264  *   b) OFFSET_BEGINNING is used with position < 0 or
  265  *   c) OFFSET_END is used with position > 0 or
  266  *   d) the seek would result in having seek position in > 2^31-1 area.
  267  */
  268 #define ACTION_SEEK64           26400
  269 
  270 /* ACTION_SET_FILE_SIZE64
  271  * dp_Arg1 - LONG fh_Arg1
  272  * dp_Arg2 - QUAD *position
  273  * dp_Arg3 - LONG mode
  274  * dp_Arg4 - QUAD *newsize
  275  *
  276  * dp_Res1 - DOSFALSE for error (*newsize is undefined!), dp_Res2 set.
  277  *           DOSTRUE for success (*newsize is the new file size).
  278  *
  279  * Implementation notes
  280  * - ACTION_SET_FILE_SIZE64 must work for all files.
  281  * - ACTION_SET_FILE_SIZE should fail for > 2^31-1 files, for security
  282  *   reasons (dataloss is possible with old apps).
  283  * - If the caller tries to make the file larger than the largest
  284  *   supported size, ERROR_OBJECT_TOO_LARGE must be returned.
  285  */
  286 #define ACTION_SET_FILE_SIZE64  26401
  287 
  288 /* ACTION_LOCK_RECORD64
  289  * dp_Arg1 - LONG fh_Arg1
  290  * dp_Arg2 - UQUAD *offset
  291  * dp_Arg3 - UQUAD *length
  292  * dp_Arg4 - ULONG mode
  293  * dp_Arg5 - ULONG timeout
  294  *
  295  * dp_Res1 - DOSFALSE for error, dp_Res2 set.
  296  *           DOSTRUE for success.
  297  *
  298  * Implementation notes
  299  * - ACTION_LOCK_RECORD64 must work for all files .
  300  * - ACTION_LOCK_RECORD must work for > 2^31-1 files aswell,
  301  *   if offset and length are within 31bit range.
  302  * - Record locks are rarely used, so it's not fatal to return DOSFALSE
  303  *   with ERROR_ACTION_NOT_KNOWN.
  304  *
  305  */
  306 #define ACTION_LOCK_RECORD64    26402
  307 
  308 /* ACTION_FREE_RECORD64
  309  * dp_Arg1 - LONG fh_Arg1
  310  * dp_Arg2 - UQUAD *offset
  311  * dp_Arg3 - UQUAD *length
  312  *
  313  * dp_Res1 - DOSFALSE for error, dp_Res2 set.
  314  *           DOSTRUE for success.
  315  *
  316  * Implementation notes
  317  * - ACTION_FREE_RECORD64 must work for all files.
  318  * - ACTION_FREE_RECORD must work for > 2^31-1 files aswell,
  319  *   if offset and length are within 31bit range.
  320  * - Record locks are rarely used, so it's not fatal to return DOSFALSE
  321  *   with ERROR_ACTION_NOT_KNOWN.
  322  */
  323 #define ACTION_FREE_RECORD64    26403
  324 
  325 /* Reserved packet number - do not use
  326  */
  327 #define ACTION_RESERVED_1       26404
  328 
  329 /* Reserved packet number - do not use
  330  */
  331 #define ACTION_RESERVED_2       26405
  332 
  333 /* ACTION_NEW_READ_LINK
  334  * dp_Arg1 - BPTR lock, lock on directory that dp_Arg2 is relative to
  335  * dp_Arg2 - UBYTE *name, path and name of link (relative to dp_Arg1)
  336  * dp_Arg3 - UBYTE *buffer
  337  * dp_Arg4 - LONG buffersize
  338  *
  339  * dp_Res1 - Actual length of returned string, -2 if there isn't
  340  *           enough space in buffer, or -1 for other errors.
  341  *           0 return is error aswell (dp_Res2 is ERROR_ACTION_NOT_KNOWN likely)
  342  * dp_Res2 - 0 for successful return (dp_Res1 > 0), else ioerr code.
  343  *
  344  * Implementation notes
  345  * - ACTION_NEW_READ_LINK cause a linked object to be examined, and
  346  *   the path to the object linked to to be returned. It works both
  347  *   for soft and hard linked objects, as opposed to the original
  348  *   ACTION_READ_LINK packet which only works for soft linked
  349  *   objects.
  350  * - returns required buffer size in dp_Res1 if called with NULL
  351  *   buffer, including storage for string terminating '\0'.
  352  * - ACTION_NEW_READ_LINK should be well behaving, and handling all
  353  *   weird cases properly (see Olaf Barthel's docs and FFS2
  354  *   ACTION_READ_LINK for details).
  355  */
  356 #define ACTION_NEW_READ_LINK    26406
  357 
  358 /* ACTION_QUERY_ATTR
  359  * dp_Arg1 - LONG attr, which attribute you want to know about
  360  * dp_Arg2 - void *storage, memory to hold the return value
  361  * dp_Arg3 - LONG storagesize, size of storage reserved for
  362  *
  363  * dp_Res1 - DOSFALSE for error, dp_Res2 set.
  364  *           DOSTRUE for success.
  365  *
  366  * Implementation notes
  367  * - Unknown/unimplemented attributes must return DOSFALSE and dp_Res2
  368  *   of ERROR_BAD_NUMBER. This instructs dos.library GetFileSysAttr()
  369  *   to fall back to emulation code.
  370  * - If result doesn't fit the storage, must return DOSFALSE
  371  *   and dp_Res2 of ERROR_LINE_TOO_LONG.
  372  * - Largefile filesystems MUST support this packet and
  373  *   FQA_MaxFileSize attribute.
  374  * - Filesystems that can grow larger than 2TB (or actually fs where
  375  *   ACTION_DISK_INFO/ACTION_INFO NumBlocks and NumBlocksUsed can grow
  376  *   past 2^32-1) must implemented this packet and at least
  377  *   FQA_NumBlocks and FQA_NumBlocksUsed attributes.
  378  */
  379 #define ACTION_QUERY_ATTR       26407
  380 
  381 /* ACTION_EXAMINE_OBJECT64
  382  * dp_Arg1 - BPTR to lock to examine
  383  * dp_Arg2 - BPTR to struct FileInfoBlock (see <dos/dos.h>)
  384  *
  385  * dp_Res1 - DOSFALSE for error, dp_Res2 set.
  386  *           DOSTRUE for success.
  387  *
  388  * Implementation notes
  389  * - ACTION_EXAMINE_OBJECT and ACTION_EXAMINE_OBJECT64 must set
  390  *   fib_Size to 0 for files > 2^31-1.
  391  * - ACTION_EXAMINE_OBJECT64 must fill new fields: fib_Size64 and
  392  *   fib_NumBlocks64.
  393  * - Largefile filesystems MUST support this packet, aswell as
  394  *   ACTION_EXAMINE_NEXT64 and ACTION_EXAMINE_FH64.
  395  * - It is recommended that your implementation supports mixing
  396  *   ACTION_EXAMINE_OBJECT64 and ACTION_EXAMINE_NEXT.
  397  * - largefile filesystems must implement ACTION_EXAMINE_ALL with
  398  *   ED_SIZE64 (ed_Size64 field), and set ed_Size to 0 for files >
  399  *   2^31-1. Obviously ed_Size64 must be set for files < 2^31-1
  400  *   aswell.
  401  * - Early documentation incorrectly stated that dp_Arg3 would be
  402  *   a pointer to a tag list. This is not the case.
  403  */
  404 #define ACTION_EXAMINE_OBJECT64 26408
  405 
  406 /* ACTION_EXAMINE_NEXT64
  407  * dp_Arg1 - BPTR to directory lock to examine
  408  * dp_Arg2 - BPTR to struct FileInfoBlock (see <dos/dos.h>)
  409  *
  410  * dp_Res1 - DOSFALSE for error, dp_Res2 set.
  411  *           DOSTRUE for success.
  412  *
  413  * Implementation notes
  414  * - ACTION_EXAMINE_NEXT and ACTION_EXAMINE_NEXT64 must set
  415  *   fib_Size to 0 for files > 2^31-1.
  416  * - ACTION_EXAMINE_NEXT64 must fill a new fields: fib_Size64 and
  417  *   fib_NumBlocks64.
  418  * - Largefile filesystems MUST support this packet, aswell as
  419  *   ACTION_EXAMINE_OBJECT64 and ACTION_EXAMINE_FH64.
  420  * - It is recommended that your implementation supports mixing
  421  *   ACTION_EXAMINE_OBJECT and ACTION_EXAMINE_NEXT64.
  422  * - largefile filesystems must implement ACTION_EXAMINE_ALL with
  423  *   ED_SIZE64 (ed_Size64 field), and set ed_Size to 0 for files >
  424  *   2^31-1. Obviously ed_Size64 must be set for files < 2^31-1
  425  *   aswell.
  426  * - Early documentation incorrectly stated that dp_Arg3 would be
  427  *   a pointer to a tag list. This is not the case.
  428  */
  429 #define ACTION_EXAMINE_NEXT64   26409
  430 
  431 /* ACTION_EXAMINE_FH64
  432  * dp_Arg1 - LONG fh_Arg1
  433  * dp_Arg2 - BPTR to struct FileInfoBlock (see <dos/dos.h>)
  434  *
  435  * dp_Res1 - DOSFALSE for error, dp_Res2 set.
  436  *           DOSTRUE for success.
  437  *
  438  * Implementation notes
  439  * - ACTION_EXAMINE_FH and ACTION_EXAMINE_FH64 must set
  440  *   fib_Size to 0 for files > 2^31-1.
  441  * - ACTION_EXAMINE_FH64 must fill a new field: fib_Size64 and
  442  *   fib_NumBlocks64.
  443  * - Largefile filesystems MUST support this packet, aswell as
  444  *   ACTION_EXAMINE_OBJECT64 and ACTION_EXAMINE_NEXT64.
  445  * - largefile filesystems must implement ACTION_EXAMINE_ALL with
  446  *   ED_SIZE64 (ed_Size64 field), and set ed_Size to 0 for files >
  447  *   2^31-1. Obviously ed_Size64 must be set for files < 2^31-1
  448  *   aswell.
  449  * - Early documentation incorrectly stated that dp_Arg3 would be
  450  *   a pointer to a tag list. This is not the case.
  451  */
  452 #define ACTION_EXAMINE_FH64     26410
  453 
  454 /* GetFileSysAttr attribute types
  455  */
  456 
  457 /* Return the maximum length of a file name (in characters),
  458  * excluding terminating '\0' char.
  459  *
  460  * type: LONG
  461  */
  462 #define FQA_MaxFileNameLength   0
  463 
  464 /* Return the maximum length of the volume name (in characters),
  465  * excluding terminating '\0' char.
  466  *
  467  * type: LONG
  468  */
  469 #define FQA_MaxVolumeNameLength 1
  470 
  471 /* Returns maximum size of the file the filesystem supports.
  472  * This attribute is meant to help system components/applications
  473  * to know if they can create large files or if they need to
  474  * resort to other means (split files). This attribute need not
  475  * account for currently available disk storage.
  476  *
  477  * type: QUAD
  478  */
  479 #define FQA_MaxFileSize         2
  480 
  481 /* If the filesystem names are case sensitive, this attribute must
  482  * return TRUE.
  483  *
  484  * If this attribute return FALSE or is not implemented, filesystem is
  485  * assumed to be case insensitive.
  486  *
  487  * type: LONG
  488  */
  489 #define FQA_IsCaseSensitive     3
  490 
  491 /* Return the type of the medium the filesystem is using, if known.
  492  * Value is one of DG_#? in devices/trackdisk.h.
  493  *
  494  * If this attribute return DG_UNKNOWN or is not implemented, no
  495  * assumption of the device type can be made. DG_COMMUNICATION
  496  * is networked drive.
  497  *
  498  * type: LONG
  499  */
  500 #define FQA_DeviceType          4
  501 
  502 /* This FQA attribute is reserved - do not use
  503  * In filesystem implementation return DOSFALSE with error ERROR_BAD_NUMBER
  504  * (as the filesystem doesn't know about this attribute).
  505  */
  506 #define FQA_ReservedAttr1       5
  507 
  508 /* Return the total number of blocks on the filesystem. The size of a
  509  * block is the filesystem natural block size, also returned in struct
  510  * InfoData id_BytesPerBlock. This allows reporting filesystem capacity
  511  * of over 2TB.
  512  *
  513  * type: QUAD
  514  */
  515 #define FQA_NumBlocks           6
  516 
  517 /* Return the total number of used blocks on the filesystem. The size of
  518  * a block is the filesystem natural block size, also returned in struct
  519  * InfoData id_BytesPerBlock. This allows reporting filesystem capacity
  520  * of over 2TB.
  521  *
  522  * type: QUAD
  523  */
  524 #define FQA_NumBlocksUsed       7
  525 
  526 /* ACTION_SET_POSIXDATE
  527  * dp_Arg1 - BPTR lock
  528  * dp_Arg2 - BSTR name
  529  * dp_Arg3 - struct PosixTimeStamp *date, relative to 1970-01-01
  530  * dp_Arg4 - struct TagItem *tags, no tags defined currently
  531  *
  532  * dp_Res1 - DOSFALSE for error, dp_Res2 set.
  533  *           DOSTRUE for success.
  534  *
  535  * Implementation notes
  536  * - The filesystem might not allow settings nanoseconds in which case
  537  *   the uds_NSec field is ignored.
  538  * - If the date is outside of the range of the filesystem can save,
  539  *   DOSFALSE must be returned. dp_Res2 will be set to ERROR_BAD_NUMBER.
  540  * - If DOSFALSE and dp_Res2 of ACTION_NOT_KNOWN is returned then the
  541  *   filesystem does not support this packet and ACTION_SET_DATE must be
  542  *   used instead.
  543  */
  544 #define ACTION_SET_POSIXDATE    26411
  545 
  546 /*
  547  * Packets to get and set filesystem options runtime
  548  */
  549 #define ACTION_GET_PREFS_TEMPLATE 26500 /* arg1 - STRPTR dest_buff, arg2 - LONG buffer_size */
  550 #define ACTION_GET_CURRENT_PREFS  26501 /* arg1 - STRPTR dest_buff, arg2 - LONG buffer_size */
  551 #define ACTION_SET_PREFS          26502 /* arg1 - STRPTR prefs_string */
  552 
  553 /*
  554  * TrashFS control packets
  555  */
  556 #define ACTION_TRASH_FILE         26600 /* arg1 - BPTR lock to a file/directory to move to Trashcan: */
  557 #define ACTION_RESTORE_FILE       26601 /* arg1 - STRPTR name of a file/directory *in* Trashcan: to be restored */
  558 #define ACTION_RESTORE_PATH       26602 /* arg1 - STRPTR name of a file/directory *in* Trashcan:, arg2 - STRPTR dest_buf, arg3 - LONG buffer_size */
  559 #define ACTION_EMPTY_TRASHCAN     26603
  560 #define ACTION_IS_TRASHCAN_FS     26604
  561 
  562 
  563 struct ErrorString
  564 {
  565 	LONG  *estr_Nums;
  566 	UBYTE *estr_Strings;
  567 };
  568 
  569 
  570 struct DosLibrary
  571 {
  572 	struct Library      dl_lib;
  573 	struct RootNode    *dl_Root;
  574 	APTR                dl_GV;
  575 	LONG                dl_A2;
  576 	LONG                dl_A5;
  577 	LONG                dl_A6;
  578 	struct ErrorString *dl_Errors;
  579 	struct timerequest *dl_TimeReq;
  580 	struct Library     *dl_UtilityBase;
  581 	struct Library     *dl_IntuitionBase;
  582 };
  583 
  584 
  585 
  586 
  587 struct RootNode
  588 {
  589 	BPTR               rn_TaskArray;
  590 	BPTR               rn_ConsoleSegment;
  591 	struct  DateStamp  rn_Time;
  592 	LONG               rn_RestartSeg;
  593 	BPTR               rn_Info;
  594 	BPTR               rn_FileHandlerSegment;
  595 	struct MinList     rn_CliList;
  596 	struct MsgPort    *rn_BootProc;
  597 	BPTR               rn_ShellSegment;
  598 	LONG               rn_Flags;
  599 }
  600 #if __GNUC__ >= 3
  601 __attribute__((deprecated))
  602 #endif
  603 ;
  604 
  605 #define RNB_WILDSTAR  24
  606 #define RNF_WILDSTAR  (1<<RNB_WILDSTAR)
  607 
  608 #define RNB_PRIVATE1  1
  609 #define RNF_PRIVATE1  (1<<RNB_PRIVATE1)
  610 
  611 
  612 
  613 struct CliProcList
  614 {
  615 	struct MinNode   cpl_Node;
  616 	LONG             cpl_First;
  617 	struct MsgPort **cpl_Array;
  618 }
  619 #if __GNUC__ >= 3
  620 __attribute__((deprecated))
  621 #endif
  622 ;
  623 
  624 
  625 struct DosInfo
  626 {
  627 	BPTR                    di_McName;
  628 #	define                  di_ResList di_McName
  629 
  630 	BPTR                    di_DevInfo;
  631 	BPTR                    di_Devices;
  632 	BPTR                    di_Handlers;
  633 	APTR                    di_NetHand;
  634 	struct  SignalSemaphore di_DevLock;
  635 	struct  SignalSemaphore di_EntryLock;
  636 	struct  SignalSemaphore di_DeleteLock;
  637 };
  638 
  639 struct Segment
  640 {
  641 	BPTR  seg_Next;
  642 	LONG  seg_UC;
  643 	BPTR  seg_Seg;
  644 	UBYTE seg_Name[4];
  645 	/* seg_Name continues */
  646 };
  647 
  648 
  649 #define CMD_SYSTEM    -1
  650 #define CMD_INTERNAL  -2
  651 #define CMD_NOTLOADED -998
  652 #define CMD_DISABLED  -999
  653 
  654 
  655 
  656 
  657 struct CommandLineInterface
  658 {
  659 	LONG cli_Result2;
  660 	BSTR cli_SetName;
  661 	BPTR cli_CommandDir;
  662 	LONG cli_ReturnCode;
  663 	BSTR cli_CommandName;
  664 	LONG cli_FailLevel;
  665 	BSTR cli_Prompt;
  666 	BPTR cli_StandardInput;
  667 	BPTR cli_CurrentInput;
  668 	BSTR cli_CommandFile;
  669 	LONG cli_Interactive;
  670 	LONG cli_Background;
  671 	BPTR cli_CurrentOutput;
  672 	LONG cli_DefaultStack;
  673 	BPTR cli_StandardOutput;
  674 	BPTR cli_Module;
  675 };
  676 
  677 
  678 
  679 struct DeviceList
  680 {
  681 	BPTR              dl_Next;
  682 	LONG              dl_Type;
  683 	struct MsgPort   *dl_Task;
  684 	BPTR              dl_Lock;
  685 	struct DateStamp  dl_VolumeDate;
  686 	BPTR              dl_LockList;
  687 	LONG              dl_DiskType;
  688 	LONG              dl_unused;
  689 	BSTR              dl_Name;
  690 };
  691 
  692 
  693 struct DevInfo
  694 {
  695 	BPTR dvi_Next;
  696 	LONG dvi_Type;
  697 	APTR dvi_Task;
  698 	BPTR dvi_Lock;
  699 	BSTR dvi_Handler;
  700 	LONG dvi_StackSize;
  701 	LONG dvi_Priority;
  702 	LONG dvi_Startup;
  703 	BPTR dvi_SegList;
  704 	BPTR dvi_GlobVec;
  705 	BSTR dvi_Name;
  706 };
  707 
  708 
  709 struct DosList
  710 {
  711 	BPTR            dol_Next;
  712 	LONG            dol_Type;
  713 	struct MsgPort *dol_Task;
  714 	BPTR            dol_Lock;
  715 
  716 	union
  717 	{
  718 		struct
  719 		{
  720 			BSTR  dol_Handler;
  721 			LONG  dol_StackSize;
  722 			LONG  dol_Priority;
  723 			ULONG dol_Startup;
  724 			BPTR  dol_SegList;
  725 			BPTR  dol_GlobVec;
  726 		} dol_handler;
  727 
  728 		struct
  729 		{
  730 			struct DateStamp dol_VolumeDate;
  731 			BPTR             dol_LockList;
  732 			LONG             dol_DiskType;
  733 		} dol_volume;
  734 
  735 		struct
  736 		{
  737 			UBYTE             *dol_AssignName;
  738 			struct AssignList *dol_List;
  739 		} dol_assign;
  740 	} dol_misc;
  741 
  742 	BSTR            dol_Name;
  743 };
  744 
  745 
  746 struct AssignList
  747 {
  748 	struct AssignList *al_Next;
  749 	BPTR               al_Lock;
  750 };
  751 
  752 
  753 #define DLT_DEVICE       0
  754 #define DLT_DIRECTORY    1
  755 #define DLT_VOLUME       2
  756 #define DLT_LATE         3
  757 #define DLT_NONBINDING   4
  758 #define DLT_PRIVATE     -1
  759 /*** V51 (MorphOS) ***/
  760 #define DLT_FSCONTEXT    5
  761 
  762 
  763 struct DevProc
  764 {
  765 	struct MsgPort *dvp_Port;
  766 	BPTR            dvp_Lock;
  767 	ULONG           dvp_Flags;
  768 	struct DosList *dvp_DevNode;
  769 };
  770 
  771 
  772 #define DVPB_UNLOCK  0
  773 #define DVPF_UNLOCK  (1<<DVPB_UNLOCK)
  774 
  775 #define DVPB_ASSIGN  1
  776 #define DVPF_ASSIGN  (1<<DVPB_ASSIGN)
  777 /*** V51 (MorphOS) ***/
  778 #define DVPB_FSCONTEXT	2
  779 #define DVPF_FSCONTEXT	(1L << DVPB_FSCONTEXT)
  780 
  781 
  782 #define LDB_READ     0
  783 #define LDF_READ     (1<<LDB_READ)
  784 
  785 #define LDB_WRITE    1
  786 #define LDF_WRITE    (1<<LDB_WRITE)
  787 
  788 #define LDB_DEVICES  2
  789 #define LDF_DEVICES  (1<<LDB_DEVICES)
  790 
  791 #define LDB_VOLUMES  3
  792 #define LDF_VOLUMES  (1<<LDB_VOLUMES)
  793 
  794 #define LDB_ASSIGNS  4
  795 #define LDF_ASSIGNS  (1<<LDB_ASSIGNS)
  796 
  797 #define LDB_ENTRY    5
  798 #define LDF_ENTRY    (1<<LDB_ENTRY)
  799 
  800 #define LDB_DELETE   6
  801 #define LDF_DELETE   (1<<LDB_DELETE)
  802 
  803 #define LDF_ALL      (LDF_DEVICES | LDF_VOLUMES | LDF_ASSIGNS)
  804 
  805 
  806 struct FileLock
  807 {
  808 	BPTR            fl_Link;
  809 	LONG            fl_Key;
  810 	LONG            fl_Access;
  811 	struct MsgPort *fl_Task;
  812 	BPTR            fl_Volume;
  813 };
  814 
  815 
  816 #define REPORT_STREAM  0
  817 #define REPORT_TASK    1
  818 #define REPORT_LOCK    2
  819 #define REPORT_VOLUME  3
  820 #define REPORT_INSERT  4
  821 
  822 
  823 #define ABORT_DISK_ERROR  296
  824 #define ABORT_BUSY        288
  825 
  826 
  827 #define RUN_EXECUTE        -1
  828 #define RUN_SYSTEM         -2
  829 #define RUN_SYSTEM_ASYNCH  -3
  830 
  831 
  832 #define ST_ROOT       1
  833 #define ST_USERDIR    2
  834 #define ST_SOFTLINK   3
  835 #define ST_LINKDIR    4
  836 #define ST_FILE      -3
  837 #define ST_LINKFILE  -4
  838 #define ST_PIPEFILE  -5
  839 
  840 
  841 struct CLIDataItem
  842 {
  843 	LONG  cdi_CLINum;        /* CLI number of the CLI */
  844 	LONG  cdi_DefaultStack;  /* cli_DefaultStack of the CLI */
  845 	LONG  cdi_GlobVec;       /* pr_GlobVec[0] of the CLI */
  846 	ULONG cdi_Future;        /* For future expansion, 0 for now */
  847 	BYTE  cdi_Pri;           /* CLI priority */
  848 	UBYTE cdi_Flags;         /* If bit 0 is set cdi_command is valid */
  849 	UBYTE cdi_Command[1];    /* 0-terminated command being executed */
  850 };
  851 
  852 struct CLIData
  853 {
  854 	ULONG               cd_NumCLIs; /* Number of entries in cd_cli array */
  855 	struct CLIDataItem *cd_CLI[1];
  856 };
  857 
  858 #pragma pack()
  859 
  860 #endif /* DOS_DOSEXTENS_H */