2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <aros/debug.h>
7 #include <aros/symbolsets.h>
8 #include <proto/exec.h>
11 #include "hiddclass_intern.h"
13 #include LC_LIBDEFS_FILE
15 static int init_hiddclass(LIBBASETYPEPTR lh
)
17 struct Library
*OOPBase
= GM_OOPBASE_FIELD(lh
);
18 struct class_static_data
*csd
;
20 EnterFunc(bug("HIDD::Init()\n"));
23 csd
->cs_UtilityBase
= OpenLibrary("utility.library", 36);
24 if (!csd
->cs_UtilityBase
)
27 csd
->MemPool
= CreatePool(MEMF_CLEAR
| MEMF_PUBLIC
, 8192, 4096);
31 csd
->hiddAttrBase
= OOP_ObtainAttrBase(IID_Hidd
);
32 if (!csd
->hiddAttrBase
)
34 csd
->hwAttrBase
= OOP_ObtainAttrBase(IID_HW
);
38 csd
->hwMethodBase
= OOP_GetMethodID(IID_HW
, 0);
40 if (!OOP_NewObject(csd
->rootclass
, NULL
, NULL
))
43 ReturnInt("HIDD::Init", ULONG
, TRUE
);
46 static int free_hiddclass(LIBBASETYPEPTR lh
)
48 struct Library
*OOPBase
= GM_OOPBASE_FIELD(lh
);
49 struct class_static_data
*csd
= &lh
->hd_csd
;
51 EnterFunc(bug("HIDD::Free()\n"));
53 /* We do not dispose csd->hwroot because we will never be expunged */
56 OOP_ReleaseAttrBase(IID_HW
);
57 if (csd
->hiddAttrBase
)
58 OOP_ReleaseAttrBase(IID_Hidd
);
60 DeletePool(csd
->MemPool
);
61 CloseLibrary(csd
->cs_UtilityBase
);
63 ReturnInt("HIDD::Free", ULONG
, TRUE
);
66 ADD2INITLIB(init_hiddclass
, 0)
67 ADD2EXPUNGELIB(free_hiddclass
, 0)