Don't call ReadArgs() if started from WB.
[tangerine.git] / compiler / include / clib / alib_protos.h
blob20a527c8c7c53e6692953c766b8e37b1268772bc
1 #ifndef CLIB_ALIB_PROTOS_H
2 #define CLIB_ALIB_PROTOS_H
4 /*
5 Copyright © 1995-2001, 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, ...) __stackparm;
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( struct Locale * locale,
113 STRPTR name,
114 ULONG 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
134 #ifdef AROS_SLOWSTACKMETHODS
135 Msg GetMsgFromStack (ULONG MethodID, va_list args);
136 void FreeMsgFromStack (Msg msg);
138 # define AROS_SLOWSTACKMETHODS_PRE(arg) \
139 AROS_METHODRETURNTYPE retval; \
141 va_list args; \
142 Msg msg; \
144 va_start (args, arg); \
146 if ((msg = GetMsgFromStack (arg, args))) \
148 # define AROS_SLOWSTACKMETHODS_ARG(arg) msg
149 # define AROS_SLOWSTACKMETHODS_POST \
150 FreeMsgFromStack (msg); \
152 else \
153 retval = (AROS_METHODRETURNTYPE)0L; \
155 va_end (args); \
157 return retval;
158 #else
159 # define AROS_SLOWSTACKMETHODS_PRE(arg) AROS_METHODRETURNTYPE retval;
160 # define AROS_SLOWSTACKMETHODS_ARG(arg) ((Msg)&(arg))
161 # define AROS_SLOWSTACKMETHODS_POST return retval;
162 #endif /* AROS_SLOWSTACKMETHODS */
164 #ifdef AROS_SLOWSTACKTAGS
165 struct TagItem * GetTagsFromStack (ULONG firstTag, va_list args);
166 void FreeTagsFromStack (struct TagItem * tags);
167 #endif /* AROS_SLOWSTACKTAGS */
169 /* Rexx support */
170 BOOL CheckRexxMsg(struct RexxMsg *);
171 LONG SetRexxVar(struct RexxMsg *, char *, char *, ULONG length);
172 LONG GetRexxVar(struct RexxMsg *, char *, char **value);
174 __END_DECLS
176 #endif /* CLIB_ALIB_PROTOS_H */