home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / c / gcc233.lha / os-include / inline / keymap.h < prev    next >
C/C++ Source or Header  |  1992-12-29  |  2KB  |  84 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 extern struct Device*  KeymapBase;
  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 KeymapBase
  18. #endif
  19.  
  20. static __inline struct KeyMap *
  21. AskKeyMapDefault (BASE_PAR_DECL0)
  22. {
  23.   BASE_EXT_DECL
  24.   register struct KeyMap * _res  __asm("d0");
  25.   register struct Device* a6 __asm("a6") = BASE_NAME;
  26.   __asm __volatile ("jsr a6@(-0x24)"
  27.   : "=r" (_res)
  28.   : "r" (a6)
  29.   : "a0","a1","d0","d1", "memory");
  30.   return _res;
  31. }
  32. static __inline LONG 
  33. MapANSI (BASE_PAR_DECL STRPTR string,long count,STRPTR buffer,long length,struct KeyMap *keyMap)
  34. {
  35.   BASE_EXT_DECL
  36.   register LONG  _res  __asm("d0");
  37.   register struct Device* a6 __asm("a6") = BASE_NAME;
  38.   register STRPTR a0 __asm("a0") = string;
  39.   register long d0 __asm("d0") = count;
  40.   register STRPTR a1 __asm("a1") = buffer;
  41.   register long d1 __asm("d1") = length;
  42.   register struct KeyMap *a2 __asm("a2") = keyMap;
  43.   __asm __volatile ("jsr a6@(-0x30)"
  44.   : "=r" (_res)
  45.   : "r" (a6), "r" (a0), "r" (d0), "r" (a1), "r" (d1), "r" (a2)
  46.   : "a0","a1","a2","d0","d1", "memory");
  47.   return _res;
  48. }
  49. static __inline WORD 
  50. MapRawKey (BASE_PAR_DECL struct InputEvent *event,STRPTR buffer,long length,struct KeyMap *keyMap)
  51. {
  52.   BASE_EXT_DECL
  53.   register WORD  _res  __asm("d0");
  54.   register struct Device* a6 __asm("a6") = BASE_NAME;
  55.   register struct InputEvent *a0 __asm("a0") = event;
  56.   register STRPTR a1 __asm("a1") = buffer;
  57.   register long d1 __asm("d1") = length;
  58.   register struct KeyMap *a2 __asm("a2") = keyMap;
  59.   __asm __volatile ("jsr a6@(-0x2a)"
  60.   : "=r" (_res)
  61.   : "r" (a6), "r" (a0), "r" (a1), "r" (d1), "r" (a2)
  62.   : "a0","a1","a2","d0","d1", "memory");
  63.   return _res;
  64. }
  65. static __inline void 
  66. SetKeyMapDefault (BASE_PAR_DECL struct KeyMap *keyMap)
  67. {
  68.   BASE_EXT_DECL
  69.   register struct Device* a6 __asm("a6") = BASE_NAME;
  70.   register struct KeyMap *a0 __asm("a0") = keyMap;
  71.   __asm __volatile ("jsr a6@(-0x1e)"
  72.   : /* no output */
  73.   : "r" (a6), "r" (a0)
  74.   : "a0","a1","d0","d1", "memory");
  75. }
  76. #undef BASE_EXT_DECL
  77. #undef BASE_PAR_DECL
  78. #undef BASE_PAR_DECL0
  79. #undef BASE_NAME
  80.  
  81. __END_DECLS
  82.  
  83. #endif /* _INLINE_KEYMAP_H */
  84.