Replaced Popscren with a custom pop-up list for selecting public screen. Now it conta...
[tangerine.git] / compiler / include / clib / alib_protos.h
blob1990e28f656bd9b67c2b1de0eda79696d69a1e80
1 #ifndef CLIB_ALIB_PROTOS_H
2 #define CLIB_ALIB_PROTOS_H
4 /*
5 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: Prototypes for amiga.lib
9 Lang: english
12 #if defined(RT_ENABLE) && RT_ENABLE
13 # include <aros/rt.h>
14 #endif
15 #ifndef EXEC_TYPES_H
16 # include <exec/types.h>
17 #endif
18 #ifndef INTUITION_INTUITION_H
19 # include <intuition/intuition.h>
20 #endif
21 #ifndef INTUITION_SCREENS_H
22 # include <intuition/screens.h>
23 #endif
25 /* #ifndef INTUITION_CLASSUSR_H
26 # include <intuition/classusr.h>
27 #endif
28 #ifndef INTUITION_CLASSES_H
29 # include <intuition/classes.h>
30 #endif */
31 #ifndef LIBRARIES_COMMODITIES_H
32 # include <libraries/commodities.h>
33 #endif
34 #ifndef AROS_ASMCALL_H
35 # include <aros/asmcall.h>
36 #endif
37 #ifndef LIBRARIES_GADTOOLS_H
38 # include <libraries/gadtools.h>
39 #endif
40 #ifndef DEVICES_KEYMAP_H
41 # include <devices/keymap.h>
42 #endif
43 #ifndef DEVICES_INPUTEVENT_H
44 # include <devices/inputevent.h>
45 #endif
46 #include <rexx/storage.h>
48 __BEGIN_DECLS
50 struct MsgPort;
51 struct IORequest;
52 struct Task;
53 struct InputEvent;
54 struct Hook;
55 struct Locale;
57 Prototypes
59 IPTR CallHookA (struct Hook * hook, APTR obj, APTR param);
60 IPTR CallHook (struct Hook * hook, APTR obj, ...) __stackparm;
62 /* Exec support */
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);
74 #endif
76 /* Extra */
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);
87 /* Commodities */
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);
96 /* Graphics */
97 #ifndef ObtainBestPen
98 LONG ObtainBestPen( struct ColorMap * cm, LONG R, LONG G, LONG B, ULONG tag1, ...) __stackparm;
99 #endif
101 #ifndef GetRPAttrs
102 void GetRPAttrs( struct RastPort * rp, Tag tag1, ...) __stackparm;
103 #endif
105 /* Intuition */
106 #ifndef SetWindowPointer
107 void SetWindowPointer( struct Window * window, ULONG tag1, ...) __stackparm;
108 #endif
110 /* Locale */
111 #ifndef OpenCatalog
112 struct Catalog *OpenCatalog(const struct Locale * locale,
113 CONST_STRPTR name,
114 Tag tag1,
115 ...) __stackparm;
116 #endif
118 /* Pools */
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);
124 /* Hook Support */
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
133 #endif
135 #ifdef AROS_SLOWSTACKMETHODS
136 Msg GetMsgFromStack (IPTR MethodID, va_list args);
137 void FreeMsgFromStack (Msg msg);
139 # define AROS_NR_SLOWSTACKMETHODS_PRE(arg) \
140 va_list args; \
141 Msg msg; \
143 va_start (args, arg); \
145 if ((msg = GetMsgFromStack (arg, args))) \
148 # define AROS_SLOWSTACKMETHODS_PRE(arg) \
149 AROS_METHODRETURNTYPE retval; \
151 va_list args; \
152 Msg msg; \
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); \
164 else \
165 retval = (AROS_METHODRETURNTYPE)0L; \
167 va_end (args); \
169 return retval;
171 # define AROS_NR_SLOWSTACKMETHODS_POST \
172 FreeMsgFromStack (msg); \
175 va_end (args);
176 #else
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
191 #endif
193 #ifdef AROS_SLOWSTACKHOOKS
194 APTR GetParamsFromStack (va_list args);
195 void FreeParamsFromStack (APTR params);
197 # define AROS_NR_SLOWSTACKHOOKS_PRE(arg) \
198 va_list args; \
199 APTR params; \
201 va_start (args, arg); \
203 if ((params = GetParamsFromStack (args))) \
206 # define AROS_SLOWSTACKHOOKS_PRE(arg) \
207 AROS_HOOKRETURNTYPE retval; \
209 va_list args; \
210 APTR params; \
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); \
222 else \
223 retval = (AROS_HOOKRETURNTYPE)0L; \
225 va_end (args); \
227 return retval;
229 # define AROS_NR_SLOWSTACKHOOKS_POST \
230 FreeParamsFromStack (params); \
233 va_end (args);
234 #else
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 */
242 /* Rexx support */
243 BOOL CheckRexxMsg(struct RexxMsg *);
244 LONG SetRexxVar(struct RexxMsg *, char *, char *, ULONG length);
245 LONG GetRexxVar(struct RexxMsg *, char *, char **value);
247 __END_DECLS
249 #endif /* CLIB_ALIB_PROTOS_H */