Start of port of AsyncIO library.
[AROS-Contrib.git] / workbench / libs / asyncio / include / libraries / asyncio.h
blob9e4ffa3d98774971219f8e81a2e22e1c98f03340
1 #ifndef LIBRARIES_ASYNCIO_H
2 #define LIBRARIES_ASYNCIO_H
5 /*****************************************************************************/
8 #ifndef EXEC_TYPES_H
9 #include <exec/types.h>
10 #endif
12 #ifndef EXEC_PORTS_H
13 #include <exec/ports.h>
14 #endif
16 #ifndef DOS_DOS_H
17 #include <dos/dos.h>
18 #endif
20 #ifndef DOS_DOSEXTENS_H
21 #include <dos/dosextens.h>
22 #endif
25 /*****************************************************************************/
28 /* This structure is public only by necessity, don't muck with it yourself, or
29 * you're looking for trouble
31 typedef struct AsyncFile
33 BPTR af_File;
34 ULONG af_BlockSize;
35 struct MsgPort *af_Handler;
36 UBYTE *af_Offset;
37 LONG af_BytesLeft;
38 ULONG af_BufferSize;
39 UBYTE *af_Buffers[2];
40 struct StandardPacket af_Packet;
41 struct MsgPort af_PacketPort;
42 ULONG af_CurrentBuf;
43 ULONG af_SeekOffset;
44 #ifdef ASIO_NOEXTERNALS
45 struct ExecBase *af_SysBase;
46 struct DosLibrary *af_DOSBase;
47 #endif
48 UBYTE af_PacketPending;
49 UBYTE af_ReadMode;
50 UBYTE af_CloseFH;
51 UBYTE af_SeekPastEOF;
52 ULONG af_LastRes1;
53 ULONG af_LastBytesLeft;
54 } AsyncFile;
57 /*****************************************************************************/
60 typedef enum OpenModes
62 MODE_READ, /* read an existing file */
63 MODE_WRITE, /* create a new file, delete existing file if needed */
64 MODE_APPEND /* append to end of existing file, or create new */
65 } OpenModes;
68 typedef enum SeekModes
70 MODE_START = -1, /* relative to start of file */
71 MODE_CURRENT, /* relative to current file position */
72 MODE_END /* relative to end of file */
73 } SeekModes;
76 /*****************************************************************************/
79 #if defined(__SASC) && defined(ASIO_SHARED_LIB)
80 extern long __asiolibversion; /* Minimum version of asyncio.library */
81 #endif
84 #endif /* ASYNCIO_H */