home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROS_m68k_bin.lha / AROS / include / clib / alib_protos.h next >
C/C++ Source or Header  |  1997-02-08  |  4KB  |  134 lines

  1. #ifndef  CLIB_ALIB_PROTOS_H
  2. #define  CLIB_ALIB_PROTOS_H
  3.  
  4. /*
  5.     (C) 1995-97 AROS - The Amiga Replacement OS
  6.     $Id: alib_protos.h,v 1.14 1997/02/04 17:26:32 digulla Exp $
  7.  
  8.     Desc: Prototypes for amiga.lib
  9.     Lang: english
  10. */
  11.  
  12. #ifndef  EXEC_TYPES_H
  13. #   include <exec/types.h>
  14. #endif
  15. #ifndef INTUITION_INTUITION_H
  16. #   include <intuition/intuition.h>
  17. #endif
  18. #ifndef INTUITION_CLASSUSR_H
  19. #   include <intuition/classusr.h>
  20. #endif
  21. #ifndef INTUITION_CLASSES_H
  22. #   include <intuition/classes.h>
  23. #endif
  24. #ifndef LIBRARIES_COMMODITIES_H
  25. #   include <libraries/commodities.h>
  26. #endif
  27. #ifdef AROS_SLOWSTACKTAGS
  28. #   include <stdarg.h>
  29. #   ifndef UTILITY_TAGITEM_H
  30. #    include <utility/tagitem.h>
  31. #   endif
  32. #endif
  33. #ifdef AROS_SLOWSTACKMETHODS
  34. #   ifndef AROS_SLOWSTACKTAGS
  35. #    include <stdarg.h>
  36. #   endif
  37. #endif
  38. #ifndef AROS_ASMCALL_H
  39. #   include <aros/asmcall.h>
  40. #endif
  41.  
  42. /*
  43.     Prototypes
  44. */
  45. IPTR DoMethodA (Object * obj, Msg message);
  46. IPTR DoMethod (Object * obj, ULONG MethodID, ...);
  47. IPTR DoGadgetMethod (struct Gadget * gad, struct Window * win,
  48.             struct Requester * req, ULONG MethodID, ...);
  49. IPTR DoSuperMethodA (Class  * cl, Object * obj, Msg message);
  50. IPTR DoSuperMethod (Class * cl, Object * obj, ULONG MethodID, ...);
  51. IPTR CoerceMethod (Class * cl, Object * obj, ULONG MethodID, ...);
  52. IPTR CoerceMethodA (Class * cl, Object * obj, Msg msg);
  53. ULONG SetAttrs (Object * obj, ULONG tag1, ...);
  54. ULONG SetSuperAttrs (Class * cl, Object * obj, ULONG tag1, ...);
  55. APTR NewObject (struct IClass * classPtr, UBYTE * classID, ULONG tag1, ...);
  56. IPTR CallHookA (struct Hook * hook, APTR obj, APTR param);
  57. IPTR CallHook (struct Hook * hook, APTR obj, ...);
  58.  
  59. struct Window * OpenWindowTags (struct NewWindow * newWindow, ULONG tag1, ...);
  60. struct Screen * OpenScreenTags (struct NewScreen * newScreen, ULONG tag1, ...);
  61.  
  62. /* Exec support */
  63. struct IORequest * CreateExtIO (struct MsgPort * port, ULONG iosize);
  64. struct IOStdReq * CreateStdIO (struct MsgPort * port);
  65. void DeleteExtIO (struct IORequest * ioreq);
  66. void DeleteStdIO (struct IOStdReq * ioreq);
  67. struct MsgPort * CreatePort (STRPTR name, LONG pri);
  68. void DeletePort (struct MsgPort * mp);
  69. struct Task * CreateTask (STRPTR name, LONG pri, APTR initpc, ULONG stacksize);
  70. void DeleteTask (struct Task * task);
  71. void NewList (struct List *);
  72.  
  73. /* Extra */
  74. ULONG RangeRand (ULONG maxValue);
  75. ULONG FastRand (ULONG seed);
  76. LONG TimeDelay (LONG unit, ULONG secs, ULONG microsecs);
  77. void waitbeam (LONG pos);
  78.  
  79. /* Commodities */
  80. CxObj * HotKey (STRPTR description, struct MsgPort *port, LONG id);
  81. void FreeIEvents (volatile struct InputEvent *events);
  82.  
  83. /* Pools */
  84. APTR LibCreatePool (ULONG requirements, ULONG puddleSize, ULONG threshSize);
  85. void LibDeletePool (APTR poolHeader);
  86. APTR LibAllocPooled (APTR poolHeader, ULONG memSize);
  87. void LibFreePooled (APTR poolHeader, APTR memory, ULONG memSize);
  88.  
  89. AROS_UFH3(IPTR, HookEntry,
  90.     AROS_UFHA(struct Hook *, hook,  A0),
  91.     AROS_UFHA(APTR,          obj,   A2),
  92.     AROS_UFHA(APTR,          param, A1)
  93. );
  94.  
  95. #ifndef AROS_METHODRETURNTYPE
  96. #   define AROS_METHODRETURNTYPE IPTR
  97. #endif
  98. #ifdef AROS_SLOWSTACKMETHODS
  99.     Msg  GetMsgFromStack  (ULONG MethodID, va_list args);
  100.     void FreeMsgFromStack (Msg msg);
  101.  
  102. #   define AROS_SLOWSTACKMETHODS_PRE(arg)       \
  103.     AROS_METHODRETURNTYPE retval;        \
  104.                         \
  105.     va_list args;                \
  106.     Msg     msg;                \
  107.                         \
  108.     va_start (args, arg);                       \
  109.                         \
  110.     if ((msg = GetMsgFromStack (arg, args)))    \
  111.     {                        \
  112. #   define AROS_SLOWSTACKMETHODS_ARG(arg) msg
  113. #   define AROS_SLOWSTACKMETHODS_POST        \
  114.     FreeMsgFromStack (msg);                 \
  115.     }                        \
  116.     else                    \
  117.     retval = (AROS_METHODRETURNTYPE)0L;     \
  118.                         \
  119.     va_end (args);                              \
  120.                         \
  121.     return retval;
  122. #else
  123. #   define AROS_SLOWSTACKMETHODS_PRE(arg)   AROS_METHODRETURNTYPE retval;
  124. #   define AROS_SLOWSTACKMETHODS_ARG(arg)   ((Msg)&(arg))
  125. #   define AROS_SLOWSTACKMETHODS_POST        return retval;
  126. #endif /* AROS_SLOWSTACKMETHODS */
  127.  
  128. #ifdef AROS_SLOWSTACKTAGS
  129.     struct TagItem * GetTagsFromStack  (ULONG firstTag, va_list args);
  130.     void         FreeTagsFromStack (struct TagItem * tags);
  131. #endif /* AROS_SLOWSTACKTAGS */
  132.  
  133. #endif /* CLIB_ALIB_PROTOS_H */
  134.