home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / BC_DICE2.DMS / in.adf / INCLUDE / dos / dosextens.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-10  |  7.7 KB  |  456 lines

  1. #ifndef DOS_DOSEXTENS_H
  2. #define DOS_DOSEXTENS_H
  3. /*
  4. ** $Filename: dos/dosextens.h $
  5. ** $Release: 2.04 Includes, V37.4 $
  6. ** $Revision: 36.38 $
  7. ** $Date: 91/11/08 $
  8. **
  9. ** DOS structures not needed for the casual AmigaDOS user
  10. **
  11. ** (C) Copyright 1985-1991 Commodore-Amiga, Inc.
  12. ** All Rights Reserved
  13. */
  14.  
  15. #ifndef EXEC_TASKS_H
  16. #include "exec/tasks.h"
  17. #endif
  18. #ifndef EXEC_PORTS_H
  19. #include "exec/ports.h"
  20. #endif
  21. #ifndef EXEC_LIBRARIES_H
  22. #include "exec/libraries.h"
  23. #endif
  24. #ifndef EXEC_SEMAPHORES_H
  25. #include "exec/semaphores.h"
  26. #endif
  27. #ifndef DEVICES_TIMER_H
  28. #include "devices/timer.h"
  29. #endif
  30.  
  31. #ifndef DOS_DOS_H
  32. #include "dos/dos.h"
  33. #endif
  34.  
  35.  
  36.  
  37.  
  38.  
  39. struct Process {
  40.  struct Task pr_Task;
  41.  struct MsgPort pr_MsgPort; 
  42.  WORD pr_Pad; 
  43.  BPTR pr_SegList; 
  44.  LONG pr_StackSize; 
  45.  APTR pr_GlobVec; 
  46.  LONG pr_TaskNum; 
  47.  BPTR pr_StackBase; 
  48.  LONG pr_Result2; 
  49.  BPTR pr_CurrentDir; 
  50.  BPTR pr_CIS; 
  51.  BPTR pr_COS; 
  52.  APTR pr_ConsoleTask; 
  53.  APTR pr_FileSystemTask; 
  54.  BPTR pr_CLI; 
  55.  APTR pr_ReturnAddr; 
  56.  APTR pr_PktWait; 
  57.  APTR pr_WindowPtr; 
  58.  
  59.  
  60.  BPTR pr_HomeDir; 
  61.  LONG pr_Flags; 
  62.  void (*pr_ExitCode)(); 
  63.  LONG pr_ExitData; 
  64.  UBYTE *pr_Arguments; 
  65.  struct MinList pr_LocalVars; 
  66.  ULONG pr_ShellPrivate; 
  67.  BPTR pr_CES; 
  68. }; 
  69.  
  70.  
  71. #define PRB_FREESEGLIST 0
  72. #define PRF_FREESEGLIST 1
  73. #define PRB_FREECURRDIR 1
  74. #define PRF_FREECURRDIR 2
  75. #define PRB_FREECLI 2
  76. #define PRF_FREECLI 4
  77. #define PRB_CLOSEINPUT 3
  78. #define PRF_CLOSEINPUT 8
  79. #define PRB_CLOSEOUTPUT 4
  80. #define PRF_CLOSEOUTPUT 16
  81. #define PRB_FREEARGS 5
  82. #define PRF_FREEARGS 32
  83.  
  84.  
  85.  
  86. struct FileHandle {
  87.  struct Message *fh_Link; 
  88.  struct MsgPort *fh_Port; 
  89.  struct MsgPort *fh_Type; 
  90.  LONG fh_Buf;
  91.  LONG fh_Pos;
  92.  LONG fh_End;
  93.  LONG fh_Funcs;
  94. #define fh_Func1 fh_Funcs
  95.  LONG fh_Func2;
  96.  LONG fh_Func3;
  97.  LONG fh_Args;
  98. #define fh_Arg1 fh_Args
  99.  LONG fh_Arg2;
  100. }; 
  101.  
  102.  
  103.  
  104. struct DosPacket {
  105.  struct Message *dp_Link; 
  106.  struct MsgPort *dp_Port; 
  107.  
  108.  LONG dp_Type; 
  109.  LONG dp_Res1; 
  110.  LONG dp_Res2; 
  111.  
  112. #define dp_Action dp_Type
  113. #define dp_Status dp_Res1
  114. #define dp_Status2 dp_Res2
  115. #define dp_BufAddr dp_Arg1
  116.  LONG dp_Arg1;
  117.  LONG dp_Arg2;
  118.  LONG dp_Arg3;
  119.  LONG dp_Arg4;
  120.  LONG dp_Arg5;
  121.  LONG dp_Arg6;
  122.  LONG dp_Arg7;
  123. }; 
  124.  
  125.  
  126.  
  127. struct StandardPacket {
  128.  struct Message sp_Msg;
  129.  struct DosPacket sp_Pkt;
  130. }; 
  131.  
  132.  
  133. #define ACTION_NIL 0
  134. #define ACTION_STARTUP 0
  135. #define ACTION_GET_BLOCK 2 
  136. #define ACTION_SET_MAP 4
  137. #define ACTION_DIE 5
  138. #define ACTION_EVENT 6
  139. #define ACTION_CURRENT_VOLUME 7
  140. #define ACTION_LOCATE_OBJECT 8
  141. #define ACTION_RENAME_DISK 9
  142. #define ACTION_WRITE 'W'
  143. #define ACTION_READ 'R'
  144. #define ACTION_FREE_LOCK 15
  145. #define ACTION_DELETE_OBJECT 16
  146. #define ACTION_RENAME_OBJECT 17
  147. #define ACTION_MORE_CACHE 18
  148. #define ACTION_COPY_DIR 19
  149. #define ACTION_WAIT_CHAR 20
  150. #define ACTION_SET_PROTECT 21
  151. #define ACTION_CREATE_DIR 22
  152. #define ACTION_EXAMINE_OBJECT 23
  153. #define ACTION_EXAMINE_NEXT 24
  154. #define ACTION_DISK_INFO 25
  155. #define ACTION_INFO 26
  156. #define ACTION_FLUSH 27
  157. #define ACTION_SET_COMMENT 28
  158. #define ACTION_PARENT 29
  159. #define ACTION_TIMER 30
  160. #define ACTION_INHIBIT 31
  161. #define ACTION_DISK_TYPE 32
  162. #define ACTION_DISK_CHANGE 33
  163. #define ACTION_SET_DATE 34
  164.  
  165. #define ACTION_SCREEN_MODE 994
  166.  
  167. #define ACTION_READ_RETURN 1001
  168. #define ACTION_WRITE_RETURN 1002
  169. #define ACTION_SEEK 1008
  170. #define ACTION_FINDUPDATE 1004
  171. #define ACTION_FINDINPUT 1005
  172. #define ACTION_FINDOUTPUT 1006
  173. #define ACTION_END 1007
  174. #define ACTION_SET_FILE_SIZE 1022 
  175. #define ACTION_WRITE_PROTECT 1023 
  176.  
  177.  
  178. #define ACTION_SAME_LOCK 40
  179. #define ACTION_CHANGE_SIGNAL 995
  180. #define ACTION_FORMAT 1020
  181. #define ACTION_MAKE_LINK 1021
  182.  
  183.  
  184. #define ACTION_READ_LINK 1024
  185. #define ACTION_FH_FROM_LOCK 1026
  186. #define ACTION_IS_FILESYSTEM 1027
  187. #define ACTION_CHANGE_MODE 1028
  188.  
  189. #define ACTION_COPY_DIR_FH 1030
  190. #define ACTION_PARENT_FH 1031
  191. #define ACTION_EXAMINE_ALL 1033
  192. #define ACTION_EXAMINE_FH 1034
  193.  
  194. #define ACTION_LOCK_RECORD 2008
  195. #define ACTION_FREE_RECORD 2009
  196.  
  197. #define ACTION_ADD_NOTIFY 4097
  198. #define ACTION_REMOVE_NOTIFY 4098
  199.  
  200.  
  201. #define ACTION_SERIALIZE_DISK 4200
  202.  
  203.  
  204. struct ErrorString {
  205.  LONG *estr_Nums;
  206.  UBYTE *estr_Strings;
  207. };
  208.  
  209.  
  210.  
  211. struct DosLibrary {
  212.  struct Library dl_lib;
  213.  struct RootNode *dl_Root; 
  214.  APTR dl_GV; 
  215.  LONG dl_A2; 
  216.  LONG dl_A5;
  217.  LONG dl_A6;
  218.  struct ErrorString *dl_Errors; 
  219.  struct timerequest *dl_TimeReq; 
  220.  struct Library *dl_UtilityBase; 
  221.  struct Library *dl_IntuitionBase; 
  222. }; 
  223.  
  224.  
  225.  
  226. struct RootNode {
  227.  BPTR rn_TaskArray; 
  228.  BPTR rn_ConsoleSegment; 
  229.  struct DateStamp rn_Time; 
  230.  LONG rn_RestartSeg; 
  231.  BPTR rn_Info; 
  232.  BPTR rn_FileHandlerSegment; 
  233.  struct MinList rn_CliList; 
  234.  
  235.  struct MsgPort *rn_BootProc; 
  236.  BPTR rn_ShellSegment; 
  237.  LONG rn_Flags; 
  238. }; 
  239.  
  240. #define RNB_WILDSTAR 24
  241. #define RNF_WILDSTAR (1L<<24)
  242. #define RNB_PRIVATE1 1 
  243. #define RNF_PRIVATE1 2
  244.  
  245.  
  246. struct CliProcList {
  247.  struct MinNode cpl_Node;
  248.  LONG cpl_First; 
  249.  struct MsgPort **cpl_Array;
  250.  
  251. };
  252.  
  253. struct DosInfo {
  254.  BPTR di_McName; 
  255. #define di_ResList di_McName
  256.  BPTR di_DevInfo; 
  257.  BPTR di_Devices; 
  258.  BPTR di_Handlers; 
  259.  APTR di_NetHand; 
  260.  struct SignalSemaphore di_DevLock; 
  261.  struct SignalSemaphore di_EntryLock; 
  262.  struct SignalSemaphore di_DeleteLock; 
  263. }; 
  264.  
  265.  
  266.  
  267.  
  268. struct Segment {
  269.  BPTR seg_Next;
  270.  LONG seg_UC;
  271.  BPTR seg_Seg;
  272.  UBYTE seg_Name[4]; 
  273. };
  274.  
  275. #define CMD_SYSTEM -1
  276. #define CMD_INTERNAL -2
  277. #define CMD_DISABLED -999
  278.  
  279.  
  280.  
  281.  
  282. struct CommandLineInterface {
  283.  LONG cli_Result2; 
  284.  BSTR cli_SetName; 
  285.  BPTR cli_CommandDir; 
  286.  LONG cli_ReturnCode; 
  287.  BSTR cli_CommandName; 
  288.  LONG cli_FailLevel; 
  289.  BSTR cli_Prompt; 
  290.  BPTR cli_StandardInput; 
  291.  BPTR cli_CurrentInput; 
  292.  BSTR cli_CommandFile; 
  293.  LONG cli_Interactive; 
  294.  LONG cli_Background; 
  295.  BPTR cli_CurrentOutput; 
  296.  LONG cli_DefaultStack; 
  297.  BPTR cli_StandardOutput; 
  298.  BPTR cli_Module; 
  299. }; 
  300.  
  301.  
  302.  
  303.  
  304.  
  305. struct DeviceList {
  306.  BPTR dl_Next; 
  307.  LONG dl_Type; 
  308.  struct MsgPort * dl_Task; 
  309.  BPTR dl_Lock; 
  310.  struct DateStamp dl_VolumeDate; 
  311.  BPTR dl_LockList; 
  312.  LONG dl_DiskType; 
  313.  LONG dl_unused;
  314.  BSTR dl_Name; 
  315. };
  316.  
  317.  
  318.  
  319. struct DevInfo {
  320.  BPTR dvi_Next;
  321.  LONG dvi_Type;
  322.  APTR dvi_Task;
  323.  BPTR dvi_Lock;
  324.  BSTR dvi_Handler;
  325.  LONG dvi_StackSize;
  326.  LONG dvi_Priority;
  327.  LONG dvi_Startup;
  328.  BPTR dvi_SegList;
  329.  BPTR dvi_GlobVec;
  330.  BSTR dvi_Name;
  331. };
  332.  
  333.  
  334.  
  335. struct DosList {
  336.  BPTR dol_Next; 
  337.  LONG dol_Type; 
  338.  struct MsgPort *dol_Task; 
  339.  BPTR dol_Lock;
  340.  union {
  341.  struct {
  342.  BSTR dol_Handler; 
  343.  LONG dol_StackSize; 
  344.  LONG dol_Priority; 
  345.  ULONG dol_Startup; 
  346.  BPTR dol_SegList; 
  347.  BPTR dol_GlobVec; 
  348.  } dol_handler;
  349.  
  350.  struct {
  351.  struct DateStamp dol_VolumeDate; 
  352.  BPTR dol_LockList; 
  353.  LONG dol_DiskType; 
  354.  } dol_volume;
  355.  
  356.  struct {
  357.  UBYTE *dol_AssignName; 
  358.  struct AssignList *dol_List; 
  359.  } dol_assign;
  360.  
  361.  } dol_misc;
  362.  
  363.  BSTR dol_Name; 
  364.  };
  365.  
  366.  
  367.  
  368. struct AssignList {
  369.  struct AssignList *al_Next;
  370.  BPTR al_Lock;
  371. };
  372.  
  373.  
  374. #define DLT_DEVICE 0
  375. #define DLT_DIRECTORY 1 
  376. #define DLT_VOLUME 2
  377. #define DLT_LATE 3 
  378. #define DLT_NONBINDING 4 
  379. #define DLT_PRIVATE -1 
  380.  
  381.  
  382. struct DevProc {
  383.  struct MsgPort *dvp_Port;
  384.  BPTR dvp_Lock;
  385.  ULONG dvp_Flags;
  386.  struct DosList *dvp_DevNode; 
  387. };
  388.  
  389.  
  390. #define DVPB_UNLOCK 0
  391. #define DVPF_UNLOCK (1L << DVPB_UNLOCK)
  392. #define DVPB_ASSIGN 1
  393. #define DVPF_ASSIGN (1L << DVPB_ASSIGN)
  394.  
  395.  
  396. #define LDB_DEVICES 2
  397. #define LDF_DEVICES (1L << LDB_DEVICES)
  398. #define LDB_VOLUMES 3
  399. #define LDF_VOLUMES (1L << LDB_VOLUMES)
  400. #define LDB_ASSIGNS 4
  401. #define LDF_ASSIGNS (1L << LDB_ASSIGNS)
  402. #define LDB_ENTRY 5
  403. #define LDF_ENTRY (1L << LDB_ENTRY)
  404. #define LDB_DELETE 6
  405. #define LDF_DELETE (1L << LDB_DELETE)
  406.  
  407.  
  408. #define LDB_READ 0
  409. #define LDF_READ (1L << LDB_READ)
  410. #define LDB_WRITE 1
  411. #define LDF_WRITE (1L << LDB_WRITE)
  412.  
  413.  
  414. #define LDF_ALL (LDF_DEVICES|LDF_VOLUMES|LDF_ASSIGNS)
  415.  
  416.  
  417. struct FileLock {
  418.  BPTR fl_Link; 
  419.  LONG fl_Key; 
  420.  LONG fl_Access; 
  421.  struct MsgPort * fl_Task; 
  422.  BPTR fl_Volume; 
  423. };
  424.  
  425.  
  426. #define REPORT_STREAM 0 
  427. #define REPORT_TASK 1 
  428. #define REPORT_LOCK 2 
  429. #define REPORT_VOLUME 3 
  430. #define REPORT_INSERT 4 
  431.  
  432.  
  433. #define ABORT_DISK_ERROR 296 
  434. #define ABORT_BUSY 288 
  435.  
  436.  
  437.  
  438. #define RUN_EXECUTE -1
  439. #define RUN_SYSTEM -2
  440. #define RUN_SYSTEM_ASYNCH -3
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447. #define ST_ROOT 1
  448. #define ST_USERDIR 2
  449. #define ST_SOFTLINK 3 
  450. #define ST_LINKDIR 4 
  451. #define ST_FILE -3 
  452. #define ST_LINKFILE -4 
  453. #define ST_PIPEFILE -5 
  454.  
  455. #endif 
  456.