2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
5 IFFParse initialization code.
8 #include <exec/types.h>
9 #include <proto/exec.h>
10 #include <aros/symbolsets.h>
11 #include <utility/utility.h>
15 #include <intuition/classusr.h>
16 #define CLIB_ALIB_PROTOS_H
19 #include "iffparse_intern.h"
20 #include <aros/debug.h>
21 #include LC_LIBDEFS_FILE
23 #include <proto/alib.h>
28 struct Hook
*h
=(struct Hook
*)REG_A0
;
30 Object
*obj
=(Object
*) REG_A2
;
32 return ((ULONG(*)(APTR
,APTR
,APTR
))h
->h_SubEntry
)(h
,obj
,msg
);
35 static struct EmulLibEntry HookEntry_Gate
=
37 TRAP_LIB
, 0, (void (*)(void))HookEntry
40 #define EasyHook(hook, func) \
41 IFFParseBase->hook.h_Entry = (IPTR (*)())&HookEntry_Gate;\
42 IFFParseBase->hook.h_SubEntry = (IPTR(*)())func;\
43 IFFParseBase->hook.h_Data = IFFParseBase
45 #define EasyHook(hook, func) \
46 IFFParseBase->hook.h_Entry = HookEntry; \
47 IFFParseBase->hook.h_SubEntry = (IPTR(*)())func; \
48 IFFParseBase->hook.h_Data = IFFParseBase
51 static int Init(LIBBASETYPEPTR LIBBASE
)
53 /* This function is single-threaded by exec by calling Forbid. */
55 EasyHook(stophook
, StopFunc
);
56 EasyHook(prophook
, PropFunc
);
57 EasyHook(collectionhook
, CollectionFunc
);
58 EasyHook(doshook
, DOSStreamHandler
);
59 EasyHook(cliphook
, ClipStreamHandler
);
60 EasyHook(bufhook
, BufStreamHandler
);
61 EasyHook(collectionpurgehook
, CollectionPurgeFunc
);
62 EasyHook(proppurgehook
, PropPurgeFunc
);
63 EasyHook(exitcontexthook
, ExitContextFunc
);