2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
11 #include <utility/utility.h>
12 #include <proto/oop.h>
14 #include <aros/symbolsets.h>
17 #include LC_LIBDEFS_FILE
24 #include <aros/debug.h>
27 BOOL
InitUtilityClasses(struct IntOOPBase
*OOPBase
);
31 static void FreeAllClasses(struct Library *BOOPIBase)
35 while((cl = (OOP_Class *)RemHead((struct List *)&GetOBase(OOPBase)->bb_ClassList)))
44 static int OOPInit(LIBBASETYPEPTR LIBBASE
)
46 D(bug("Enter OOPInit\n"));
48 NEWLIST(&LIBBASE
->ob_ClassList
);
49 InitSemaphore(&LIBBASE
->ob_ClassListLock
);
51 NEWLIST(&LIBBASE
->ob_ServerList
);
52 InitSemaphore(&LIBBASE
->ob_ServerListLock
);
54 InitSemaphore(&LIBBASE
->ob_IIDTableLock
);
58 LIBBASE
->ob_IIDTable
= NewHash(NUM_IDS
, HT_STRING
, LIBBASE
);
59 if (LIBBASE
->ob_IIDTable
)
61 struct IDDescr intern_ids
[] =
63 /* We must make sure that Root gets ID 0 and Meta gets ID 1 */
64 { IID_Root
, &__IRoot
},
65 { IID_Meta
, &__IMeta
},
68 { IID_Method
, &__IMethod
},
69 { IID_Server
, &__IServer
},
70 { IID_Proxy
, &__IProxy
},
71 { IID_Interface
, &__IInterface
},
76 /* Get some IDs that are used internally */
77 if (GetIDs(intern_ids
, LIBBASE
))
79 if (init_rootclass(LIBBASE
))
81 if (init_basemeta(LIBBASE
))
83 if (init_ifmetaclass(LIBBASE
))
85 LIBBASE
->ob_HIDDMetaClass
86 = init_hiddmetaclass(LIBBASE
);
87 if (LIBBASE
->ob_HIDDMetaClass
)
89 if (InitUtilityClasses(LIBBASE
))
91 D(bug("OOPInit all OK\n"));
101 D(bug("OOPInit failed\n"));
106 ADD2INITLIB(OOPInit
, 0);
108 /**************************
109 ** InitUtilityClasses() **
110 **************************/
111 BOOL
InitUtilityClasses(struct IntOOPBase
*OOPBase
)
114 D(bug("Initializing methodclass\n"));
115 if ((GetOBase(OOPBase
)->ob_MethodClass
= init_methodclass(GetOBase(OOPBase
) )))
117 D(bug("Initializing serverclass\n"));
118 OOPBase
->ob_ServerClass
= init_serverclass((struct Library
*)OOPBase
);
119 if (OOPBase
->ob_ServerClass
)
121 D(bug("Initializing proxyclass\n"));
122 OOPBase
->ob_ProxyClass
= init_proxyclass((struct Library
*)OOPBase
);
123 if (OOPBase
->ob_ProxyClass
)
125 D(bug("Initializing interfaceclass\n"));
126 OOPBase
->ob_InterfaceClass
= init_interfaceclass((struct Library
*)OOPBase
);
127 if (OOPBase
->ob_InterfaceClass
)
130 D(bug("Everything initialized\n"));