fix function to take the hook param
[AROS.git] / workbench / libs / datatypes / classfuncs.c
blob4948610d23d2e3c5adf40982c0922a0cf2f2df90
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/intuition.h>
7 #include <intuition/classusr.h>
8 #include "datatypes_intern.h"
10 AROS_UFP3(IPTR, Dispatcher,
11 AROS_UFHA(Class *, class, A0),
12 AROS_UFHA(Object *, object, A2),
13 AROS_UFHA(Msg, msg, A1));
15 BOOL InstallClass(struct Library *DataTypesBase)
17 BOOL Success = FALSE;
19 if((GPB(DataTypesBase)->dtb_DataTypesClass = MakeClass(DATATYPESCLASS,
20 GADGETCLASS, NULL,
21 sizeof(struct DTObject),
22 0)))
24 GPB(DataTypesBase)->dtb_DataTypesClass->cl_Dispatcher.h_Entry = (HOOKFUNC)AROS_ASMSYMNAME(Dispatcher);
25 GPB(DataTypesBase)->dtb_DataTypesClass->cl_UserData = (IPTR)DataTypesBase;
27 AddClass(GPB(DataTypesBase)->dtb_DataTypesClass);
29 Success = TRUE;
32 if(!Success)
33 TryRemoveClass(DataTypesBase);
35 return Success;
39 BOOL TryRemoveClass(struct Library *DataTypesBase)
41 if(GPB(DataTypesBase)->dtb_DataTypesClass != NULL)
43 if(FreeClass(GPB(DataTypesBase)->dtb_DataTypesClass))
44 GPB(DataTypesBase)->dtb_DataTypesClass = NULL;
47 return GPB(DataTypesBase)->dtb_DataTypesClass == NULL;