home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / reference / amiga_mail_vol2 / ii-77 / asyncio.h < prev   
C/C++ Source or Header  |  1992-12-21  |  2KB  |  57 lines

  1. /* ASyncIO.h - Header File for ASyncIO.c */
  2.  
  3. #ifndef ASYNCIO_H
  4. #define ASYNCIO_H
  5.  
  6.  
  7. /*****************************************************************************/
  8.  
  9.  
  10. #include <exec/types.h>
  11. #include <exec/ports.h>
  12. #include <dos/dos.h>
  13.  
  14.  
  15. /*****************************************************************************/
  16.  
  17.  
  18. struct AsyncFile
  19. {
  20.     BPTR                  af_File;
  21.     struct MsgPort       *af_Handler;
  22.     APTR                  af_Offset;
  23.     LONG                  af_BytesLeft;
  24.     ULONG                 af_BufferSize;
  25.     APTR                  af_Buffers[2];
  26.     struct StandardPacket af_Packet;
  27.     struct MsgPort        af_PacketPort;
  28.     ULONG                 af_CurrentBuf;
  29.     UBYTE                 af_PacketPending;
  30.     UBYTE                 af_ReadMode;
  31. };
  32.  
  33.  
  34. /*****************************************************************************/
  35.  
  36.  
  37. #define MODE_READ   0  /* read an existing file                             */
  38. #define MODE_WRITE  1  /* create a new file, delete existing file if needed */
  39. #define MODE_APPEND 2  /* append to end of existing file, or create new     */
  40.  
  41.  
  42. /*****************************************************************************/
  43.  
  44.  
  45. struct AsyncFile *OpenAsync(STRPTR fileName, UBYTE mode, LONG bufferSize);
  46. LONG CloseAsync(struct AsyncFile *file);
  47. LONG ReadAsync(struct AsyncFile *file, APTR buf, LONG numBytes);
  48. LONG ReadCharAsync(struct AsyncFile *file);
  49. LONG WriteAsync(struct AsyncFile *file, APTR buf, LONG numBytes);
  50. LONG WriteCharAsync(struct AsyncFile *file, char ch);
  51.  
  52.  
  53. /*****************************************************************************/
  54.  
  55.  
  56. #endif /* ASYNCIO_H */
  57.