1 #ifndef LIBRARIES_ASYNCIO_H
    2 #define LIBRARIES_ASYNCIO_H
    3 
    4 
    5 /*****************************************************************************/
    6 
    7 
    8 #ifndef EXEC_TYPES_H
    9 #include <exec/types.h>
   10 #endif
   11 
   12 #ifndef EXEC_PORTS_H
   13 #include <exec/ports.h>
   14 #endif
   15 
   16 #ifndef DOS_DOS_H
   17 #include <dos/dos.h>
   18 #endif
   19 
   20 #ifndef DOS_DOSEXTENS_H
   21 #include <dos/dosextens.h>
   22 #endif
   23 
   24 #pragma pack(2)
   25 
   26 
   27 /*****************************************************************************/
   28 
   29 
   30 /* This structure is public only by necessity, don't muck with it yourself, or
   31  * you're looking for trouble
   32  */
   33 typedef struct AsyncFile
   34 {
   35 	BPTR			af_File;
   36 	ULONG			af_BlockSize;
   37 	struct MsgPort		*af_Handler;
   38 	UBYTE			*af_Offset;
   39 	LONG			af_BytesLeft;
   40 	ULONG			af_BufferSize;
   41 	UBYTE			*af_Buffers[2];
   42 	struct StandardPacket	af_Packet;
   43 	struct MsgPort		af_PacketPort;
   44 	ULONG			af_CurrentBuf;
   45 	ULONG			af_SeekOffset;
   46 #ifdef ASIO_NOEXTERNALS
   47 	struct ExecBase		*af_SysBase;
   48 	struct DosLibrary	*af_DOSBase;
   49 #endif
   50 	UBYTE			af_PacketPending;
   51 	UBYTE			af_ReadMode;
   52 	UBYTE			af_CloseFH;
   53 	UBYTE			af_SeekPastEOF;
   54 	ULONG			af_LastRes1;
   55 	ULONG			af_LastBytesLeft;
   56 } AsyncFile;
   57 
   58 
   59 /*****************************************************************************/
   60 
   61 
   62 typedef enum OpenModes
   63 {
   64 	MODE_READ,	/* read an existing file                             */
   65 	MODE_WRITE,	/* create a new file, delete existing file if needed */
   66 	MODE_APPEND	/* append to end of existing file, or create new     */
   67 } OpenModes;
   68 
   69 
   70 typedef enum SeekModes
   71 {
   72 	MODE_START = -1,	/* relative to start of file         */
   73 	MODE_CURRENT,		/* relative to current file position */
   74 	MODE_END		/* relative to end of file           */
   75 } SeekModes;
   76 
   77 
   78 /*****************************************************************************/
   79 
   80 
   81 typedef struct AsyncReadHookMsg
   82 {
   83 	APTR   Buffer;
   84 	ULONG  BytesInBuffer;
   85 } AsyncReadHookMsg;
   86 
   87 
   88 /*****************************************************************************/
   89 
   90 
   91 #pragma pack()
   92 
   93 #endif /* ASYNCIO_H */
   94