home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / cbm / os-include-bin.lha / GNU / os-include / inline / wb.h < prev   
Encoding:
C/C++ Source or Header  |  1994-09-27  |  4.9 KB  |  150 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
  11. #define BASE_EXT_DECL0 extern struct Library * WorkbenchBase;
  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 WorkbenchBase
  19. #endif
  20.  
  21. BASE_EXT_DECL0
  22.  
  23. extern __inline struct AppIcon *
  24. AddAppIconA (BASE_PAR_DECL unsigned long id,unsigned long userdata,UBYTE *text,struct MsgPort *msgport,struct FileLock *lock,struct DiskObject *diskobj,struct TagItem *taglist)
  25. {
  26.   BASE_EXT_DECL
  27.   register struct AppIcon * _res  __asm("d0");
  28.   register struct Library *a6 __asm("a6") = BASE_NAME;
  29.   register unsigned long d0 __asm("d0") = id;
  30.   register unsigned long d1 __asm("d1") = userdata;
  31.   register UBYTE *a0 __asm("a0") = text;
  32.   register struct MsgPort *a1 __asm("a1") = msgport;
  33.   register struct FileLock *a2 __asm("a2") = lock;
  34.   register struct DiskObject *a3 __asm("a3") = diskobj;
  35.   register struct TagItem *d7 __asm("d7") = taglist;
  36.   __asm __volatile ("exg d7,a4\n\tjsr a6@(-0x3c)\n\texg d7,a4"
  37.   : "=r" (_res)
  38.   : "r" (a6), "r" (d0), "r" (d1), "r" (d7), "r" (a0), "r" (a1), "r" (a2), "r" (a3)
  39.   : "a0","a1","a2","a3","d0","d1","d7", "memory");
  40.   return _res;
  41. }
  42. #ifndef NO_INLINE_STDARG
  43. #define AddAppIcon(a0, a1, a2, a3, a4, a5, tags...) \
  44.   ({ struct TagItem _tags[] = { tags }; AddAppIconA ((a0), (a1), (a2), (a3), (a4), (a5), _tags); })
  45. #endif /* not NO_INLINE_STDARG */
  46. extern __inline struct AppMenuItem *
  47. AddAppMenuItemA (BASE_PAR_DECL unsigned long id,unsigned long userdata,UBYTE *text,struct MsgPort *msgport,struct TagItem *taglist)
  48. {
  49.   BASE_EXT_DECL
  50.   register struct AppMenuItem * _res  __asm("d0");
  51.   register struct Library *a6 __asm("a6") = BASE_NAME;
  52.   register unsigned long d0 __asm("d0") = id;
  53.   register unsigned long d1 __asm("d1") = userdata;
  54.   register UBYTE *a0 __asm("a0") = text;
  55.   register struct MsgPort *a1 __asm("a1") = msgport;
  56.   register struct TagItem *a2 __asm("a2") = taglist;
  57.   __asm __volatile ("jsr a6@(-0x48)"
  58.   : "=r" (_res)
  59.   : "r" (a6), "r" (d0), "r" (d1), "r" (a0), "r" (a1), "r" (a2)
  60.   : "a0","a1","a2","d0","d1", "memory");
  61.   return _res;
  62. }
  63. #ifndef NO_INLINE_STDARG
  64. #define AddAppMenuItem(a0, a1, a2, a3, tags...) \
  65.   ({ struct TagItem _tags[] = { tags }; AddAppMenuItemA ((a0), (a1), (a2), (a3), _tags); })
  66. #endif /* not NO_INLINE_STDARG */
  67. extern __inline struct AppWindow *
  68. AddAppWindowA (BASE_PAR_DECL unsigned long id,unsigned long userdata,struct Window *window,struct MsgPort *msgport,struct TagItem *taglist)
  69. {
  70.   BASE_EXT_DECL
  71.   register struct AppWindow * _res  __asm("d0");
  72.   register struct Library *a6 __asm("a6") = BASE_NAME;
  73.   register unsigned long d0 __asm("d0") = id;
  74.   register unsigned long d1 __asm("d1") = userdata;
  75.   register struct Window *a0 __asm("a0") = window;
  76.   register struct MsgPort *a1 __asm("a1") = msgport;
  77.   register struct TagItem *a2 __asm("a2") = taglist;
  78.   __asm __volatile ("jsr a6@(-0x30)"
  79.   : "=r" (_res)
  80.   : "r" (a6), "r" (d0), "r" (d1), "r" (a0), "r" (a1), "r" (a2)
  81.   : "a0","a1","a2","d0","d1", "memory");
  82.   return _res;
  83. }
  84. #ifndef NO_INLINE_STDARG
  85. #define AddAppWindow(a0, a1, a2, a3, tags...) \
  86.   ({ struct TagItem _tags[] = { tags }; AddAppWindowA ((a0), (a1), (a2), (a3), _tags); })
  87. #endif /* not NO_INLINE_STDARG */
  88. extern __inline BOOL 
  89. RemoveAppIcon (BASE_PAR_DECL struct AppIcon *appIcon)
  90. {
  91.   BASE_EXT_DECL
  92.   register BOOL  _res  __asm("d0");
  93.   register struct Library *a6 __asm("a6") = BASE_NAME;
  94.   register struct AppIcon *a0 __asm("a0") = appIcon;
  95.   __asm __volatile ("jsr a6@(-0x42)"
  96.   : "=r" (_res)
  97.   : "r" (a6), "r" (a0)
  98.   : "a0","a1","d0","d1", "memory");
  99.   return _res;
  100. }
  101. extern __inline BOOL 
  102. RemoveAppMenuItem (BASE_PAR_DECL struct AppMenuItem *appMenuItem)
  103. {
  104.   BASE_EXT_DECL
  105.   register BOOL  _res  __asm("d0");
  106.   register struct Library *a6 __asm("a6") = BASE_NAME;
  107.   register struct AppMenuItem *a0 __asm("a0") = appMenuItem;
  108.   __asm __volatile ("jsr a6@(-0x4e)"
  109.   : "=r" (_res)
  110.   : "r" (a6), "r" (a0)
  111.   : "a0","a1","d0","d1", "memory");
  112.   return _res;
  113. }
  114. extern __inline BOOL 
  115. RemoveAppWindow (BASE_PAR_DECL struct AppWindow *appWindow)
  116. {
  117.   BASE_EXT_DECL
  118.   register BOOL  _res  __asm("d0");
  119.   register struct Library *a6 __asm("a6") = BASE_NAME;
  120.   register struct AppWindow *a0 __asm("a0") = appWindow;
  121.   __asm __volatile ("jsr a6@(-0x36)"
  122.   : "=r" (_res)
  123.   : "r" (a6), "r" (a0)
  124.   : "a0","a1","d0","d1", "memory");
  125.   return _res;
  126. }
  127. extern __inline void 
  128. WBInfo (BASE_PAR_DECL BPTR lock,STRPTR name,struct Screen *screen)
  129. {
  130.   BASE_EXT_DECL
  131.   register struct Library *a6 __asm("a6") = BASE_NAME;
  132.   register BPTR a0 __asm("a0") = lock;
  133.   register STRPTR a1 __asm("a1") = name;
  134.   register struct Screen *a2 __asm("a2") = screen;
  135.   __asm __volatile ("jsr a6@(-0x5a)"
  136.   : /* no output */
  137.   : "r" (a6), "r" (a0), "r" (a1), "r" (a2)
  138.   : "a0","a1","a2","d0","d1", "memory");
  139. }
  140.  
  141. #undef BASE_EXT_DECL
  142. #undef BASE_EXT_DECL0
  143. #undef BASE_PAR_DECL
  144. #undef BASE_PAR_DECL0
  145. #undef BASE_NAME
  146.  
  147. __END_DECLS
  148.  
  149. #endif /* _INLINE_WB_H */
  150.