home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / os-include / inline / translator.h < prev    next >
C/C++ Source or Header  |  1994-09-22  |  1KB  |  49 lines

  1. #ifndef _INLINE_TRANSLATOR_H
  2. #define _INLINE_TRANSLATOR_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
  11. #define BASE_EXT_DECL0 extern struct Library * TranslatorBase;
  12. #endif
  13. #ifndef BASE_PAR_DECL
  14. #define BASE_PAR_DECL
  15. #define BASE_PAR_DECL0 void
  16. #endif
  17. #ifndef BASE_NAME
  18. #define BASE_NAME TranslatorBase
  19. #endif
  20.  
  21. BASE_EXT_DECL0
  22.  
  23. extern __inline LONG 
  24. Translate (BASE_PAR_DECL STRPTR inputString,long inputLength,STRPTR outputBuffer,long bufferSize)
  25. {
  26.   BASE_EXT_DECL
  27.   register LONG  _res  __asm("d0");
  28.   register struct Library *a6 __asm("a6") = BASE_NAME;
  29.   register STRPTR a0 __asm("a0") = inputString;
  30.   register long d0 __asm("d0") = inputLength;
  31.   register STRPTR a1 __asm("a1") = outputBuffer;
  32.   register long d1 __asm("d1") = bufferSize;
  33.   __asm __volatile ("jsr a6@(-0x1e)"
  34.   : "=r" (_res)
  35.   : "r" (a6), "r" (a0), "r" (d0), "r" (a1), "r" (d1)
  36.   : "a0","a1","d0","d1", "memory");
  37.   return _res;
  38. }
  39.  
  40. #undef BASE_EXT_DECL
  41. #undef BASE_EXT_DECL0
  42. #undef BASE_PAR_DECL
  43. #undef BASE_PAR_DECL0
  44. #undef BASE_NAME
  45.  
  46. __END_DECLS
  47.  
  48. #endif /* _INLINE_TRANSLATOR_H */
  49.