2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
5 Desc: CallHook arguments passing test.
9 #include <proto/alib.h>
10 #include <proto/aros.h>
11 #include <utility/hooks.h>
15 STACKED
char p1
; STACKED
short p2
; STACKED
int p3
; STACKED
long p4
;
16 STACKED
char p5
; STACKED
short p6
; STACKED
int p7
; STACKED
long p8
;
17 STACKED
char p9
; STACKED
short p10
; STACKED
int p11
; STACKED
long p12
;
18 STACKED
char p13
; STACKED
short p14
; STACKED
int p15
; STACKED
long p16
;
21 AROS_UFH3(long, TestHook
,
22 AROS_UFHA(struct Hook
*, hook
, A0
),
23 AROS_UFHA(APTR
, object
, A2
),
24 AROS_UFHA(struct Params
*, params
, A1
))
27 printf("TestHook(%p, %p, %d, %d, %d, %ld, %d, %d, %d, %ld, %d, %d, %d, %ld, %d, %d, %d, %ld)\n", hook
, object
,
28 params
->p1
, params
->p2
, params
->p3
, params
->p4
, params
->p5
, params
->p6
, params
->p7
, params
->p8
,
29 params
->p9
, params
->p10
, params
->p11
, params
->p12
, params
->p13
, params
->p14
, params
->p15
, params
->p16
);
34 int main (int argc
, char ** argv
)
37 hook
.h_Entry
= (HOOKFUNC
)TestHook
;
38 long res
= CallHook(&hook
, 0x0,
39 (char) 0x1, (short) -0x1, (int) 0x2, (long) -0x2,
40 (char) 0x3, (short) -0x3, (int) 0x4, (long) -0x4,
41 (char) 0x5, (short) -0x5, (int) 0x6, (long) -0x6,
42 (char) 0x7, (short) -0x7, (int) 0x8, (long) -0x8
44 printf("CallHook result: %lx\n", res
);
46 return (res
== 0xbabadada) ? 0 : 1;