Use more appropriate types for pt_regs struct, e.g. 16-bit types for 16-bit
[cake.git] / rom / oop / oop_init.c
blobadf64064c0b6998f2fb7066b6f588584c5bb9f6b
1 /*
2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: OOP Library
6 Lang: english
7 */
9 #define NUM_IDS 31
11 #include <utility/utility.h>
12 #include <proto/oop.h>
13 #include <oop/oop.h>
14 #include <aros/symbolsets.h>
16 #include "intern.h"
17 #include LC_LIBDEFS_FILE
19 #include "hash.h"
20 //#undef SDEBUG
21 #undef DEBUG
22 //#define SDEBUG 0
23 #define DEBUG 0
24 #include <aros/debug.h>
27 BOOL InitUtilityClasses(struct IntOOPBase *OOPBase);
30 #if 0
31 static void FreeAllClasses(struct Library *BOOPIBase)
33 OOP_Class *cl;
35 while((cl = (OOP_Class *)RemHead((struct List *)&GetOBase(OOPBase)->bb_ClassList)))
37 if(cl != &rootclass)
38 OOP_FreeClass(cl);
41 #endif
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);
56 SDInit();
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 },
67 #if 0
68 { IID_Method, &__IMethod },
69 { IID_Server, &__IServer },
70 { IID_Proxy, &__IProxy },
71 { IID_Interface, &__IInterface },
72 #endif
73 { NULL, NULL }
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"));
92 return (TRUE);
101 D(bug("OOPInit failed\n"));
103 return (FALSE);
106 ADD2INITLIB(OOPInit, 0);
108 /**************************
109 ** InitUtilityClasses() **
110 **************************/
111 BOOL InitUtilityClasses(struct IntOOPBase *OOPBase)
113 #if 0
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)
129 #endif
130 D(bug("Everything initialized\n"));
131 return TRUE;
132 #if 0
137 #endif
139 return FALSE;