1 #ifndef CLIB_ALIB_PROTOS_H
2 #define CLIB_ALIB_PROTOS_H
5 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
8 Desc: Prototypes for amiga.lib
12 #if defined(RT_ENABLE) && RT_ENABLE
16 # include <exec/types.h>
18 #ifndef INTUITION_INTUITION_H
19 # include <intuition/intuition.h>
21 #ifndef INTUITION_SCREENS_H
22 # include <intuition/screens.h>
25 /* #ifndef INTUITION_CLASSUSR_H
26 # include <intuition/classusr.h>
28 #ifndef INTUITION_CLASSES_H
29 # include <intuition/classes.h>
31 #ifndef LIBRARIES_COMMODITIES_H
32 # include <libraries/commodities.h>
34 #ifndef AROS_ASMCALL_H
35 # include <aros/asmcall.h>
37 #ifndef LIBRARIES_GADTOOLS_H
38 # include <libraries/gadtools.h>
40 #ifndef DEVICES_KEYMAP_H
41 # include <devices/keymap.h>
43 #ifndef DEVICES_INPUTEVENT_H
44 # include <devices/inputevent.h>
46 #include <rexx/storage.h>
59 IPTR
CallHookA (struct Hook
* hook
, APTR obj
, APTR param
);
60 IPTR
CallHook (struct Hook
* hook
, APTR obj
, ...) __stackparm
;
63 VOID
BeginIO (struct IORequest
*ioReq
);
64 struct IORequest
* CreateExtIO (struct MsgPort
* port
, ULONG iosize
);
65 struct IOStdReq
* CreateStdIO (struct MsgPort
* port
);
66 void DeleteExtIO (struct IORequest
* ioreq
);
67 void DeleteStdIO (struct IOStdReq
* ioreq
);
68 struct Task
* CreateTask (STRPTR name
, LONG pri
, APTR initpc
, ULONG stacksize
);
69 void DeleteTask (struct Task
* task
);
70 void NewList (struct List
*);
71 #if !defined(ENABLE_RT) || !ENABLE_RT
72 struct MsgPort
* CreatePort (STRPTR name
, LONG pri
);
73 void DeletePort (struct MsgPort
* mp
);
77 ULONG
RangeRand (ULONG maxValue
);
78 ULONG
FastRand (ULONG seed
);
79 LONG
TimeDelay (LONG unit
, ULONG secs
, ULONG microsecs
);
80 void waitbeam (LONG pos
);
81 void __sprintf(UBYTE
*buffer
, UBYTE
*format
, ...);
82 STRPTR
StrDup(CONST_STRPTR str
);
83 APTR
ReAllocVec(APTR oldmem
, ULONG size
, ULONG requirements
);
85 void MergeSortList(struct MinList
*l
, int (*compare
)(struct MinNode
*n1
, struct MinNode
*n2
, void *data
), void *data
);
88 CxObj
*HotKey (STRPTR description
, struct MsgPort
*port
, LONG id
);
89 VOID
FreeIEvents (volatile struct InputEvent
*events
);
90 UBYTE
**ArgArrayInit(ULONG argc
, UBYTE
**argv
);
91 VOID
ArgArrayDone(VOID
);
92 LONG
ArgInt(UBYTE
**tt
, STRPTR entry
, LONG defaultVal
);
93 STRPTR
ArgString(UBYTE
**tt
, STRPTR entry
, STRPTR defaultstring
);
94 struct InputEvent
*InvertString(STRPTR str
, struct KeyMap
*km
);
98 LONG
ObtainBestPen( struct ColorMap
* cm
, LONG R
, LONG G
, LONG B
, ULONG tag1
, ...) __stackparm
;
102 void GetRPAttrs( struct RastPort
* rp
, Tag tag1
, ...) __stackparm
;
106 #ifndef SetWindowPointer
107 void SetWindowPointer( struct Window
* window
, ULONG tag1
, ...) __stackparm
;
112 struct Catalog
*OpenCatalog(const struct Locale
* locale
,
119 APTR
LibCreatePool (ULONG requirements
, ULONG puddleSize
, ULONG threshSize
);
120 void LibDeletePool (APTR poolHeader
);
121 APTR
LibAllocPooled (APTR poolHeader
, ULONG memSize
);
122 void LibFreePooled (APTR poolHeader
, APTR memory
, ULONG memSize
);
125 AROS_UFP3(IPTR
, HookEntry
,
126 AROS_UFPA(struct Hook
*, hook
, A0
),
127 AROS_UFPA(APTR
, obj
, A2
),
128 AROS_UFPA(APTR
, param
, A1
)
131 #ifndef AROS_METHODRETURNTYPE
132 # define AROS_METHODRETURNTYPE IPTR
135 #ifdef AROS_SLOWSTACKMETHODS
136 Msg
GetMsgFromStack (IPTR MethodID
, va_list args
);
137 void FreeMsgFromStack (Msg msg
);
139 # define AROS_NR_SLOWSTACKMETHODS_PRE(arg) \
143 va_start (args, arg); \
145 if ((msg = GetMsgFromStack (arg, args))) \
148 # define AROS_SLOWSTACKMETHODS_PRE(arg) \
149 AROS_METHODRETURNTYPE retval; \
154 va_start (args, arg); \
156 if ((msg = GetMsgFromStack (arg, args))) \
159 # define AROS_SLOWSTACKMETHODS_ARG(arg) msg
161 # define AROS_SLOWSTACKMETHODS_POST \
162 FreeMsgFromStack (msg); \
165 retval = (AROS_METHODRETURNTYPE)0L; \
171 # define AROS_NR_SLOWSTACKMETHODS_POST \
172 FreeMsgFromStack (msg); \
177 # define AROS_NR_SLOWSTACKMETHODS_PRE(arg)
178 # define AROS_SLOWSTACKMETHODS_PRE(arg) AROS_METHODRETURNTYPE retval;
179 # define AROS_SLOWSTACKMETHODS_ARG(arg) ((Msg)&(arg))
180 # define AROS_SLOWSTACKMETHODS_POST return retval;
181 # define AROS_NR_SLOWSTACKMETHODS_POST
182 #endif /* AROS_SLOWSTACKMETHODS */
184 #ifdef AROS_SLOWSTACKTAGS
185 struct TagItem
* GetTagsFromStack (IPTR firstTag
, va_list args
);
186 void FreeTagsFromStack (struct TagItem
* tags
);
187 #endif /* AROS_SLOWSTACKTAGS */
189 #ifndef AROS_HOOKRETURNTYPE
190 # define AROS_HOOKRETURNTYPE IPTR
193 #ifdef AROS_SLOWSTACKHOOKS
194 APTR
GetParamsFromStack (va_list args
);
195 void FreeParamsFromStack (APTR params
);
197 # define AROS_NR_SLOWSTACKHOOKS_PRE(arg) \
201 va_start (args, arg); \
203 if ((params = GetParamsFromStack (args))) \
206 # define AROS_SLOWSTACKHOOKS_PRE(arg) \
207 AROS_HOOKRETURNTYPE retval; \
212 va_start (args, arg); \
214 if ((params = GetParamsFromStack (args))) \
217 # define AROS_SLOWSTACKHOOKS_ARG(arg) params
219 # define AROS_SLOWSTACKHOOKS_POST \
220 FreeParamsFromStack (params); \
223 retval = (AROS_HOOKRETURNTYPE)0L; \
229 # define AROS_NR_SLOWSTACKHOOKS_POST \
230 FreeParamsFromStack (params); \
235 # define AROS_NR_SLOWSTACKHOOKS_PRE(arg)
236 # define AROS_SLOWSTACKHOOKS_PRE(arg) AROS_HOOKRETURNTYPE retval;
237 # define AROS_SLOWSTACKHOOKS_ARG(arg) ((IPTR*)&(arg)+1)
238 # define AROS_SLOWSTACKHOOKS_POST return retval;
239 # define AROS_NR_SLOWSTACKHOOKS_POST
240 #endif /* AROS_SLOWSTACKHOOKS */
243 BOOL
CheckRexxMsg(struct RexxMsg
*);
244 LONG
SetRexxVar(struct RexxMsg
*, char *, char *, ULONG length
);
245 LONG
GetRexxVar(struct RexxMsg
*, char *, char **value
);
249 #endif /* CLIB_ALIB_PROTOS_H */