graphics.hidd: add ARCHCONVERTFUNC[H/P] macros that will be used for arch overrides...
[AROS.git] / compiler / alib / hookentry.c
blob3cdf0b22745716f3c5816a890beaea5032d3c997
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: amiga.lib function HookEntry()
6 Lang: english
7 */
9 #include <aros/system.h>
10 #include <stdarg.h>
11 #include "alib_intern.h"
13 /******************************************************************************
15 NAME */
16 #include <aros/asmcall.h>
17 #include <proto/alib.h>
19 AROS_UFH3(IPTR, HookEntry,
21 /* SYNOPSIS */
22 AROS_UFHA(struct Hook *, hook, A0),
23 AROS_UFHA(APTR, object, A2),
24 AROS_UFHA(APTR, param, A1))
26 /* FUNCTION
27 Some high level languages (HLL) don't allow to pass arguments in
28 registers. For these HLLs, it's not possible to call a hook
29 directly. To use hooks with these HLLs, you must put HookEntry into
30 hook->h_Entry and the real callback function into hook->h_SubEntry.
31 HookEntry will push the registers on the stack and then call
32 hook->h_SubEntry.
34 INPUTS
35 hook - Call this hook.
36 object - This is the object which is passed to the hook. The valid
37 values for this parameter depends on the definition of the called
38 hook.
39 param - Pass these parameters to the specified object
41 RESULT
42 The return value depends on the definition of the hook.
44 NOTES
46 EXAMPLE
48 BUGS
50 SEE ALSO
51 CallHookA(), CallHook()
53 HISTORY
54 28.11.96 digulla created
56 ******************************************************************************/
58 AROS_USERFUNC_INIT
59 return ((IPTR (*)(struct Hook *, APTR, APTR))(hook->h_SubEntry))
60 (hook, object, param);
61 AROS_USERFUNC_EXIT
62 } /* HookEntry */