home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / gnuc / inline-2.0 / wb.h < prev   
Encoding:
C/C++ Source or Header  |  1992-06-14  |  4.2 KB  |  126 lines

  1. #ifndef _INLINE_WB_H
  2. #define _INLINE_WB_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 WorkbenchBase*  WorkbenchBase;
  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 WorkbenchBase
  18. #endif
  19.  
  20. static __inline struct AppIcon *
  21. AddAppIconA (BASE_PAR_DECL unsigned long id,unsigned long userdata,UBYTE *text,struct MsgPort *msgport,struct FileLock *lock,struct DiskObject *diskobj,struct TagItem *taglist)
  22. {
  23.   BASE_EXT_DECL
  24.   register struct AppIcon * _res  __asm("d0");
  25.   register struct WorkbenchBase* a6 __asm("a6") = BASE_NAME;
  26.   register unsigned long d0 __asm("d0") = id;
  27.   register unsigned long d1 __asm("d1") = userdata;
  28.   register UBYTE *a0 __asm("a0") = text;
  29.   register struct MsgPort *a1 __asm("a1") = msgport;
  30.   register struct FileLock *a2 __asm("a2") = lock;
  31.   register struct DiskObject *a3 __asm("a3") = diskobj;
  32.   register struct TagItem *a4 __asm("d2") = taglist;
  33.   __asm __volatile ("movel a4,sp@-; movel d2,a4; jsr a6@(-0x42); movel sp@+,a4"
  34.   : "=r" (_res)
  35.   : "r" (a6), "r" (d0), "r" (d1), "r" (a0), "r" (a1), "r" (a2), "r" (a3), "r" (a4)
  36.   : "a0","a1","a2","a3","d0","d1","d2");
  37.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;  *(char *)a2 = *(char *)a2;  *(char *)a3 = *(char *)a3;  *(char *)a4 = *(char *)a4;
  38.   return _res;
  39. }
  40. static __inline struct AppMenuItem *
  41. AddAppMenuItemA (BASE_PAR_DECL unsigned long id,unsigned long userdata,UBYTE *text,struct MsgPort *msgport,struct TagItem *taglist)
  42. {
  43.   BASE_EXT_DECL
  44.   register struct AppMenuItem * _res  __asm("d0");
  45.   register struct WorkbenchBase* a6 __asm("a6") = BASE_NAME;
  46.   register unsigned long d0 __asm("d0") = id;
  47.   register unsigned long d1 __asm("d1") = userdata;
  48.   register UBYTE *a0 __asm("a0") = text;
  49.   register struct MsgPort *a1 __asm("a1") = msgport;
  50.   register struct TagItem *a2 __asm("a2") = taglist;
  51.   __asm __volatile ("jsr a6@(-0x48)"
  52.   : "=r" (_res)
  53.   : "r" (a6), "r" (d0), "r" (d1), "r" (a0), "r" (a1), "r" (a2)
  54.   : "a0","a1","a2","d0","d1");
  55.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;  *(char *)a2 = *(char *)a2;
  56.   return _res;
  57. }
  58. static __inline struct AppWindow *
  59. AddAppWindowA (BASE_PAR_DECL unsigned long id,unsigned long userdata,struct Window *window,struct MsgPort *msgport,struct TagItem *taglist)
  60. {
  61.   BASE_EXT_DECL
  62.   register struct AppWindow * _res  __asm("d0");
  63.   register struct WorkbenchBase* a6 __asm("a6") = BASE_NAME;
  64.   register unsigned long d0 __asm("d0") = id;
  65.   register unsigned long d1 __asm("d1") = userdata;
  66.   register struct Window *a0 __asm("a0") = window;
  67.   register struct MsgPort *a1 __asm("a1") = msgport;
  68.   register struct TagItem *a2 __asm("a2") = taglist;
  69.   __asm __volatile ("jsr a6@(-0x30)"
  70.   : "=r" (_res)
  71.   : "r" (a6), "r" (d0), "r" (d1), "r" (a0), "r" (a1), "r" (a2)
  72.   : "a0","a1","a2","d0","d1");
  73.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;  *(char *)a2 = *(char *)a2;
  74.   return _res;
  75. }
  76. static __inline BOOL 
  77. RemoveAppIcon (BASE_PAR_DECL struct AppIcon *appIcon)
  78. {
  79.   BASE_EXT_DECL
  80.   register BOOL  _res  __asm("d0");
  81.   register struct WorkbenchBase* a6 __asm("a6") = BASE_NAME;
  82.   register struct AppIcon *a0 __asm("a0") = appIcon;
  83.   __asm __volatile ("jsr a6@(-0x42)"
  84.   : "=r" (_res)
  85.   : "r" (a6), "r" (a0)
  86.   : "a0","a1","d0","d1");
  87.   *(char *)a0 = *(char *)a0;
  88.   return _res;
  89. }
  90. static __inline BOOL 
  91. RemoveAppMenuItem (BASE_PAR_DECL struct AppMenuItem *appMenuItem)
  92. {
  93.   BASE_EXT_DECL
  94.   register BOOL  _res  __asm("d0");
  95.   register struct WorkbenchBase* a6 __asm("a6") = BASE_NAME;
  96.   register struct AppMenuItem *a0 __asm("a0") = appMenuItem;
  97.   __asm __volatile ("jsr a6@(-0x4e)"
  98.   : "=r" (_res)
  99.   : "r" (a6), "r" (a0)
  100.   : "a0","a1","d0","d1");
  101.   *(char *)a0 = *(char *)a0;
  102.   return _res;
  103. }
  104. static __inline BOOL 
  105. RemoveAppWindow (BASE_PAR_DECL struct AppWindow *appWindow)
  106. {
  107.   BASE_EXT_DECL
  108.   register BOOL  _res  __asm("d0");
  109.   register struct WorkbenchBase* a6 __asm("a6") = BASE_NAME;
  110.   register struct AppWindow *a0 __asm("a0") = appWindow;
  111.   __asm __volatile ("jsr a6@(-0x36)"
  112.   : "=r" (_res)
  113.   : "r" (a6), "r" (a0)
  114.   : "a0","a1","d0","d1");
  115.   *(char *)a0 = *(char *)a0;
  116.   return _res;
  117. }
  118. #undef BASE_EXT_DECL
  119. #undef BASE_PAR_DECL
  120. #undef BASE_PAR_DECL0
  121. #undef BASE_NAME
  122.  
  123. __END_DECLS
  124.  
  125. #endif /* _INLINE_WB_H */
  126.