home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / biblioteki / asyncio / src / async.h next >
C/C++ Source or Header  |  1997-02-19  |  2KB  |  90 lines

  1. #include <exec/types.h>
  2. #include <exec/memory.h>
  3. #include <dos/dos.h>
  4. #include <dos/dosextens.h>
  5.  
  6. #include <clib/asyncio_protos.h>
  7. #include <clib/exec_protos.h>
  8. #include <clib/dos_protos.h>
  9.  
  10. #include <pragmas/exec_sysbase_pragmas.h>
  11. #include <pragmas/dos_pragmas.h>
  12.  
  13. #include <string.h>
  14.  
  15.  
  16. /*****************************************************************************/
  17.  
  18.  
  19. #ifdef _DCC
  20.  
  21. #ifdef ASIO_SHARED_LIB
  22. #define _LIBCALL __geta4 _ASM _ARGS
  23. #else
  24. #define _LIBCALL _ASM _ARGS
  25. #endif
  26.  
  27. #else
  28.  
  29. #ifdef __GNUC__
  30.  
  31. #define _LIBCALL
  32.  
  33. #else /* __SASC__ */
  34.  
  35. #ifdef ASIO_SHARED_LIB
  36. #define _LIBCALL __saveds _ASM _ARGS
  37. #else
  38. #define _LIBCALL _ASM _ARGS
  39. #endif
  40.  
  41. #endif /* _ GNUC_  */
  42.  
  43. #endif /* _DCC */
  44.  
  45. #define _CALL _ASM _ARGS
  46.  
  47.  
  48. /*****************************************************************************/
  49.  
  50.  
  51. #ifndef ASIO_NOEXTERNALS
  52. extern struct DosLibrary    *DOSBase;
  53. extern struct ExecBase        *SysBase;
  54. #endif
  55.  
  56. #ifdef ASIO_SHARED_LIB
  57. extern struct ExecBase        *SysBase;
  58. extern struct Library        *UtilityBase;
  59. extern struct DosLibrary    *DOSBase;
  60. #endif
  61.  
  62.  
  63. /*****************************************************************************/
  64.  
  65.  
  66. /* this macro lets us long-align structures on the stack */
  67. #define D_S(type,name) char a_##name[ sizeof( type ) + 3 ]; \
  68.             type *name = ( type * ) ( ( LONG ) ( a_##name + 3 ) & ~3 );
  69.  
  70. #ifndef MIN
  71. #define MIN(a,b) ( ( a ) < ( b ) ? ( a ) : ( b ) )
  72. #endif
  73.  
  74.  
  75. /*****************************************************************************/
  76.  
  77.  
  78. #ifdef ASIO_NOEXTERNALS
  79. AsyncFile *
  80. AS_OpenAsyncFH( BPTR handle, OpenModes mode, LONG bufferSize, BOOL closeIt, struct ExecBase *SysBase, struct DosLibrary *DOSBase );
  81. #else
  82. AsyncFile *
  83. AS_OpenAsyncFH( BPTR handle, OpenModes mode, LONG bufferSize, BOOL closeIt );
  84. #endif
  85. VOID AS_SendPacket( AsyncFile *file, APTR arg2 );
  86. LONG AS_WaitPacket( AsyncFile *file );
  87. VOID AS_RequeuePacket( AsyncFile *file );
  88. VOID AS_RecordSyncFailure( AsyncFile *file );
  89.  
  90.