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

  1. #ifndef _INLINE_KEYMAP_H
  2. #define _INLINE_KEYMAP_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 * KeymapBase;
  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 KeymapBase
  19. #endif
  20.  
  21. BASE_EXT_DECL0
  22.  
  23. extern __inline struct KeyMap *
  24. AskKeyMapDefault (BASE_PAR_DECL0)
  25. {
  26.   BASE_EXT_DECL
  27.   register struct KeyMap * _res  __asm("d0");
  28.   register struct Library *a6 __asm("a6") = BASE_NAME;
  29.   __asm __volatile ("jsr a6@(-0x24)"
  30.   : "=r" (_res)
  31.   : "r" (a6)
  32.   : "a0","a1","d0","d1", "memory");
  33.   return _res;
  34. }
  35. extern __inline LONG 
  36. MapANSI (BASE_PAR_DECL STRPTR string,long count,STRPTR buffer,long length,struct KeyMap *keyMap)
  37. {
  38.   BASE_EXT_DECL
  39.   register LONG  _res  __asm("d0");
  40.   register struct Library *a6 __asm("a6") = BASE_NAME;
  41.   register STRPTR a0 __asm("a0") = string;
  42.   register long d0 __asm("d0") = count;
  43.   register STRPTR a1 __asm("a1") = buffer;
  44.   register long d1 __asm("d1") = length;
  45.   register struct KeyMap *a2 __asm("a2") = keyMap;
  46.   __asm __volatile ("jsr a6@(-0x30)"
  47.   : "=r" (_res)
  48.   : "r" (a6), "r" (a0), "r" (d0), "r" (a1), "r" (d1), "r" (a2)
  49.   : "a0","a1","a2","d0","d1", "memory");
  50.   return _res;
  51. }
  52. extern __inline WORD 
  53. MapRawKey (BASE_PAR_DECL struct InputEvent *event,STRPTR buffer,long length,struct KeyMap *keyMap)
  54. {
  55.   BASE_EXT_DECL
  56.   register WORD  _res  __asm("d0");
  57.   register struct Library *a6 __asm("a6") = BASE_NAME;
  58.   register struct InputEvent *a0 __asm("a0") = event;
  59.   register STRPTR a1 __asm("a1") = buffer;
  60.   register long d1 __asm("d1") = length;
  61.   register struct KeyMap *a2 __asm("a2") = keyMap;
  62.   __asm __volatile ("jsr a6@(-0x2a)"
  63.   : "=r" (_res)
  64.   : "r" (a6), "r" (a0), "r" (a1), "r" (d1), "r" (a2)
  65.   : "a0","a1","a2","d0","d1", "memory");
  66.   return _res;
  67. }
  68. extern __inline void 
  69. SetKeyMapDefault (BASE_PAR_DECL struct KeyMap *keyMap)
  70. {
  71.   BASE_EXT_DECL
  72.   register struct Library *a6 __asm("a6") = BASE_NAME;
  73.   register struct KeyMap *a0 __asm("a0") = keyMap;
  74.   __asm __volatile ("jsr a6@(-0x1e)"
  75.   : /* no output */
  76.   : "r" (a6), "r" (a0)
  77.   : "a0","a1","d0","d1", "memory");
  78. }
  79.  
  80. #undef BASE_EXT_DECL
  81. #undef BASE_EXT_DECL0
  82. #undef BASE_PAR_DECL
  83. #undef BASE_PAR_DECL0
  84. #undef BASE_NAME
  85.  
  86. __END_DECLS
  87.  
  88. #endif /* _INLINE_KEYMAP_H */
  89.