home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / comm / tcp / amitcp / src / l / inet-handler / inl_dos.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-05  |  2.3 KB  |  94 lines

  1. #ifndef _INL_DOS_H_
  2. #define _INL_DOS_H_
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. __BEGIN_DECLS
  8.  
  9. #ifndef BASE_EXT_DECL
  10. #define BASE_EXT_DECL extern struct DosLibrary * DOSBase;
  11. #endif
  12. #ifndef BASE_PAR_DECL
  13. #define BASE_PAR_DECL
  14. #define BASE_PAR_DECL0 void
  15. #endif
  16. #ifndef BASE_NAME
  17. #define BASE_NAME DOSBase
  18. #endif
  19.  
  20. static __inline void 
  21. FreeArgs (BASE_PAR_DECL struct RDArgs *args)
  22. {
  23.   BASE_EXT_DECL
  24.   register struct DosLibrary *a6 __asm("a6") = BASE_NAME;
  25.   register struct RDArgs *d1 __asm("d1") = args;
  26.   __asm __volatile ("jsr a6@(-0x35a)"
  27.   : /* no output */
  28.   : "r" (a6), "r" (d1)
  29.   : "a0","a1","d0","d1", "memory");
  30. }
  31. static __inline LONG 
  32. IoErr (BASE_PAR_DECL0)
  33. {
  34.   BASE_EXT_DECL
  35.   register LONG  _res  __asm("d0");
  36.   register struct DosLibrary *a6 __asm("a6") = BASE_NAME;
  37.   __asm __volatile ("jsr a6@(-0x84)"
  38.   : "=r" (_res)
  39.   : "r" (a6)
  40.   : "a0","a1","d0","d1", "memory");
  41.   return _res;
  42. }
  43. static __inline struct RDArgs *
  44. ReadArgs (BASE_PAR_DECL STRPTR _template,LONG *array,struct RDArgs *args)
  45. {
  46.   BASE_EXT_DECL
  47.   register struct RDArgs * _res  __asm("d0");
  48.   register struct DosLibrary *a6 __asm("a6") = BASE_NAME;
  49.   register STRPTR d1 __asm("d1") = _template;
  50.   register LONG *d2 __asm("d2") = array;
  51.   register struct RDArgs *d3 __asm("d3") = args;
  52.   __asm __volatile ("jsr a6@(-0x31e)"
  53.   : "=r" (_res)
  54.   : "r" (a6), "r" (d1), "r" (d2), "r" (d3)
  55.   : "a0","a1","d0","d1","d2","d3", "memory");
  56.   return _res;
  57. }
  58. static __inline void 
  59. ReplyPkt (BASE_PAR_DECL struct DosPacket *dp,long res1,long res2)
  60. {
  61.   BASE_EXT_DECL
  62.   register struct DosLibrary *a6 __asm("a6") = BASE_NAME;
  63.   register struct DosPacket *d1 __asm("d1") = dp;
  64.   register long d2 __asm("d2") = res1;
  65.   register long d3 __asm("d3") = res2;
  66.   __asm __volatile ("jsr a6@(-0x102)"
  67.   : /* no output */
  68.   : "r" (a6), "r" (d1), "r" (d2), "r" (d3)
  69.   : "a0","a1","d0","d1","d2","d3", "memory");
  70. }
  71. static __inline struct DosPacket *
  72. WaitPkt (BASE_PAR_DECL0)
  73. {
  74.   BASE_EXT_DECL
  75.   register struct DosPacket * _res  __asm("d0");
  76.   register struct DosLibrary *a6 __asm("a6") = BASE_NAME;
  77.   __asm __volatile ("jsr a6@(-0xfc)"
  78.   : "=r" (_res)
  79.   : "r" (a6)
  80.   : "a0","a1","d0","d1", "memory");
  81.   return _res;
  82. }
  83.  
  84. #undef BASE_EXT_DECL
  85. #undef BASE_PAR_DECL
  86. #undef BASE_PAR_DECL0
  87. #undef BASE_NAME
  88.  
  89. __END_DECLS
  90.  
  91. #endif /* _INL_DOS_H_ */
  92.   
  93.   
  94.