home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fonts 1 / freshfonts1.bin / programs / amiga / pastex / pastex14-beta-6 / specialhost / source / asyncio.h < prev    next >
C/C++ Source or Header  |  1993-08-27  |  3KB  |  81 lines

  1. /* (c)  Copyright 1993 Commodore-Amiga, Inc.   All rights reserved. */
  2. /* The information contained herein is subject to change without    */
  3. /* notice, and is provided "as is" without warranty of any kind,    */
  4. /* either expressed or implied.  The entire risk as to the use of   */
  5. /* this information is assumed by the user.                         */
  6.  
  7. #ifndef ASYNCIO_H
  8. #define ASYNCIO_H
  9.  
  10.  
  11. /*****************************************************************************/
  12.  
  13.  
  14. #ifndef EXEC_TYPES_H
  15. #include <exec/types.h>
  16. #endif
  17.  
  18. #ifndef EXEC_PORTS_H
  19. #include <exec/ports.h>
  20. #endif
  21.  
  22. #ifndef DOS_DOSEXTENS_H
  23. #include <dos/dosextens.h>
  24. #endif
  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. struct AsyncFile
  34. {
  35.     BPTR                  af_File;
  36.     ULONG                 af_BlockSize;
  37.     struct MsgPort       *af_Handler;
  38.     APTR                  af_Offset;
  39.     LONG                  af_BytesLeft;
  40.     ULONG                 af_BufferSize;
  41.     APTR                  af_Buffers[2];
  42.     struct StandardPacket af_Packet;
  43.     struct MsgPort        af_PacketPort;
  44.     ULONG                 af_CurrentBuf;
  45.     ULONG                 af_SeekOffset;
  46.     UBYTE                 af_PacketPending;
  47.     UBYTE                 af_ReadMode;
  48.  
  49.     UBYTE                 af_Resync;
  50. };
  51.  
  52.  
  53. /*****************************************************************************/
  54.  
  55.  
  56. #define MODE_READ   0  /* read an existing file                             */
  57. #define MODE_WRITE  1  /* create a new file, delete existing file if needed */
  58. #define MODE_APPEND 2  /* append to end of existing file, or create new     */
  59.  
  60. #define MODE_START   -1   /* relative to start of file         */
  61. #define MODE_CURRENT  0   /* relative to current file position */
  62. #define MODE_END      1   /* relative to end of file         */
  63.  
  64.  
  65. /*****************************************************************************/
  66.  
  67.  
  68. struct AsyncFile * __regargs OpenAsync(const STRPTR fileName, UBYTE accessMode, LONG bufferSize);
  69. LONG __regargs CloseAsync(struct AsyncFile *file);
  70. LONG __regargs ReadAsync(struct AsyncFile *file, APTR buffer, LONG numBytes);
  71. LONG __regargs ReadCharAsync(struct AsyncFile *file);
  72. LONG __regargs WriteAsync(struct AsyncFile *file, APTR buffer, LONG numBytes);
  73. LONG __regargs WriteCharAsync(struct AsyncFile *file, UBYTE ch);
  74. LONG __regargs SeekAsync(struct AsyncFile *file, LONG position, BYTE mode);
  75.  
  76.  
  77. /*****************************************************************************/
  78.  
  79.  
  80. #endif /* ASYNCIO_H */
  81.