home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 4
/
FreshFish_May-June1994.bin
/
bbs
/
cbm
/
nduk-v37.lha
/
V37
/
include
/
dos
/
dosextens.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-11-27
|
17KB
|
493 lines
#ifndef DOS_DOSEXTENS_H
#define DOS_DOSEXTENS_H
/*
** $Filename: dos/dosextens.h $
** $Release: 2.04 Includes, V37.4 $
** $Revision: 36.38 $
** $Date: 91/11/08 $
**
** DOS structures not needed for the casual AmigaDOS user
**
** (C) Copyright 1985-1991 Commodore-Amiga, Inc.
** All Rights Reserved
*/
#ifndef EXEC_TASKS_H
#include "exec/tasks.h"
#endif
#ifndef EXEC_PORTS_H
#include "exec/ports.h"
#endif
#ifndef EXEC_LIBRARIES_H
#include "exec/libraries.h"
#endif
#ifndef EXEC_SEMAPHORES_H
#include "exec/semaphores.h"
#endif
#ifndef DEVICES_TIMER_H
#include "devices/timer.h"
#endif
#ifndef DOS_DOS_H
#include "dos/dos.h"
#endif
/* All DOS processes have this structure */
/* Create and Device Proc returns pointer to the MsgPort in this structure */
/* dev_proc = (struct Process *) (DeviceProc(..) - sizeof(struct Task)); */
struct Process {
struct Task pr_Task;
struct MsgPort pr_MsgPort; /* This is BPTR address from DOS functions */
WORD pr_Pad; /* Remaining variables on 4 byte boundaries */
BPTR pr_SegList; /* Array of seg lists used by this process */
LONG pr_StackSize; /* Size of process stack in bytes */
APTR pr_GlobVec; /* Global vector for this process (BCPL) */
LONG pr_TaskNum; /* CLI task number of zero if not a CLI */
BPTR pr_StackBase; /* Ptr to high memory end of process stack */
LONG pr_Result2; /* Value of secondary result from last call */
BPTR pr_CurrentDir; /* Lock associated with current directory */
BPTR pr_CIS; /* Current CLI Input Stream */
BPTR pr_COS; /* Current CLI Output Stream */
APTR pr_ConsoleTask; /* Console handler process for current window*/
APTR pr_FileSystemTask; /* File handler process for current drive */
BPTR pr_CLI; /* pointer to CommandLineInterface */
APTR pr_ReturnAddr; /* pointer to previous stack frame */
APTR pr_PktWait; /* Function to be called when awaiting msg */
APTR pr_WindowPtr; /* Window for error printing */
/* following definitions are new with 2.0 */
BPTR pr_HomeDir; /* Home directory of executing program */
LONG pr_Flags; /* flags telling dos about process */
void (*pr_ExitCode)(); /* code to call on exit of program or NULL */
LONG pr_ExitData; /* Passed as an argument to pr_ExitCode. */
UBYTE *pr_Arguments; /* Arguments passed to the process at start */
struct MinList pr_LocalVars; /* Local environment variables */
ULONG pr_ShellPrivate; /* for the use of the current shell */
BPTR pr_CES; /* Error stream - if NULL, use pr_COS */
}; /* Process */
/*
* Flags for pr_Flags
*/
#define PRB_FREESEGLIST 0
#define PRF_FREESEGLIST 1
#define PRB_FREECURRDIR 1
#define PRF_FREECURRDIR 2
#define PRB_FREECLI 2
#define PRF_FREECLI 4
#define PRB_CLOSEINPUT 3
#define PRF_CLOSEINPUT 8
#define PRB_CLOSEOUTPUT 4
#define PRF_CLOSEOUTPUT 16
#define PRB_FREEARGS 5
#define PRF_FREEARGS 32
/* The long word address (BPTR) of this structure is returned by
* Open() and other routines that return a file. You need only worry
* about this struct to do async io's via PutMsg() instead of
* standard file system calls */
struct FileHandle {
struct Message *fh_Link; /* EXEC message */
struct MsgPort *fh_Port; /* Reply port for the packet */
struct MsgPort *fh_Type; /* Port to do PutMsg() to
* Address is negative if a plain file */
LONG fh_Buf;
LONG fh_Pos;
LONG fh_End;
LONG fh_Funcs;
#define fh_Func1 fh_Funcs
LONG fh_Func2;
LONG fh_Func3;
LONG fh_Args;
#define fh_Arg1 fh_Args
LONG fh_Arg2;
}; /* FileHandle */
/* This is the extension to EXEC Messages used by DOS */
struct DosPacket {
struct Message *dp_Link; /* EXEC message */
struct MsgPort *dp_Port; /* Reply port for the packet */
/* Must be filled in each send. */
LONG dp_Type; /* See ACTION_... below and
* 'R' means Read, 'W' means Write to the
* file system */
LONG dp_Res1; /* For file system calls this is the result
* that would have been returned by the
* function, e.g. Write ('W') returns actual
* length written */
LONG dp_Res2; /* For file system calls this is what would
* have been returned by IoErr() */
/* Device packets common equivalents */
#define dp_Action dp_Type
#define dp_Status dp_Res1
#define dp_Status2 dp_Res2
#define dp_BufAddr dp_Arg1
LONG dp_Arg1;
LONG dp_Arg2;
LONG dp_Arg3;
LONG dp_Arg4;
LONG dp_Arg5;
LONG dp_Arg6;
LONG dp_Arg7;
}; /* DosPacket */
/* A Packet does not require the Message to be before it in memory, but
* for convenience it is useful to associate the two.
* Also see the function init_std_pkt for initializing this structure */
struct StandardPacket {
struct Message sp_Msg;
struct DosPacket sp_Pkt;
}; /* StandardPacket */
/* Packet types */
#define ACTION_NIL 0
#define ACTION_STARTUP 0
#define ACTION_GET_BLOCK 2 /* OBSOLETE */
#define ACTION_SET_MAP 4
#define ACTION_DIE 5
#define ACTION_EVENT 6
#define ACTION_CURRENT_VOLUME 7
#define ACTION_LOCATE_OBJECT 8
#define ACTION_RENAME_DISK 9
#define ACTION_WRITE 'W'
#define ACTION_READ 'R'
#define ACTION_FREE_LOCK 15
#define ACTION_DELETE_OBJECT 16
#define ACTION_RENAME_OBJECT 17
#define ACTION_MORE_CACHE 18
#define ACTION_COPY_DIR 19
#define ACTION_WAIT_CHAR 20
#define ACTION_SET_PROTECT 21
#define ACTION_CREATE_DIR 22
#define ACTION_EXAMINE_OBJECT 23
#define ACTION_EXAMINE_NEXT 24
#define ACTION_DISK_INFO 25
#define ACTION_INFO 26
#define ACTION_FLUSH 27
#define ACTION_SET_COMMENT 28
#define ACTION_PARENT 29
#define ACTION_TIMER 30
#define ACTION_INHIBIT 31
#define ACTION_DISK_TYPE 32
#define ACTION_DISK_CHANGE 33
#define ACTION_SET_DATE 34
#define ACTION_SCREEN_MODE 994
#define ACTION_READ_RETURN 1001
#define ACTION_WRITE_RETURN 1002
#define ACTION_SEEK 1008
#define ACTION_FINDUPDATE 1004
#define ACTION_FINDINPUT 1005
#define ACTION_FINDOUTPUT 1006
#define ACTION_END 1007
#define ACTION_SET_FILE_SIZE 1022 /* fast file system only in 1.3 */
#define ACTION_WRITE_PROTECT 1023 /* fast file system only in 1.3 */
/* new 2.0 packets */
#define ACTION_SAME_LOCK 40
#define ACTION_CHANGE_SIGNAL 995
#define ACTION_FORMAT 1020
#define ACTION_MAKE_LINK 1021
/**/
/**/
#define ACTION_READ_LINK 1024
#define ACTION_FH_FROM_LOCK 1026
#define ACTION_IS_FILESYSTEM 1027
#define ACTION_CHANGE_MODE 1028
/**/
#define ACTION_COPY_DIR_FH 1030
#define ACTION_PARENT_FH 1031
#define ACTION_EXAMINE_ALL 1033
#define ACTION_EXAMINE_FH 1034
#define ACTION_LOCK_RECORD 2008
#define ACTION_FREE_RECORD 2009
#define ACTION_ADD_NOTIFY 4097
#define ACTION_REMOVE_NOTIFY 4098
/* Tell a file system to serialize the current volume. This is typically
* done by changing the creation date of the disk. This packet does not take
* any arguments. NOTE: be prepared to handle failure of this packet for
* V37 ROM filesystems.
*/
#define ACTION_SERIALIZE_DISK 4200
/*
* A structure for holding error messages - stored as array with error == 0
* for the last entry.
*/
struct ErrorString {
LONG *estr_Nums;
UBYTE *estr_Strings;
};
/* DOS library node structure.
* This is the data at positive offsets from the library node.
* Negative offsets from the node is the jump table to DOS functions
* node = (struct DosLibrary *) OpenLibrary( "dos.library" .. ) */
struct DosLibrary {
struct Library dl_lib;
struct RootNode *dl_Root; /* Pointer to RootNode, described below */
APTR dl_GV; /* Pointer to BCPL global vector */
LONG dl_A2; /* BCPL standard register values */
LONG dl_A5;
LONG dl_A6;
struct ErrorString *dl_Errors; /* PRIVATE pointer to array of error msgs */
struct timerequest *dl_TimeReq; /* PRIVATE pointer to timer request */
struct Library *dl_UtilityBase; /* PRIVATE ptr to utility library */
struct Library *dl_IntuitionBase; /* PRIVATE ptr to intuition library */
}; /* DosLibrary */
/* */
struct RootNode {
BPTR rn_TaskArray; /* [0] is max number of CLI's