2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 #include <utility/utility.h>
10 #include <proto/boopsi.h>
14 /**********************************************************************************************/
20 /* Customize libheader.c */
21 #define LC_SYSBASE_FIELD(lib) (((struct IntBOOPSIBase *)(lib))->bb_SysBase)
22 #define LC_SEGLIST_FIELD(lib) (((struct IntBOOPSIBase *)(lib))->bb_SegList)
23 #define LC_RESIDENTNAME BOOPSI_resident
24 #define LC_RESIDENTFLAGS RTF_AUTOINIT|RTF_COLDSTART
25 #define LC_RESIDENTPRI 95
26 #define LC_LIBBASESIZE sizeof(struct IntBOOPSIBase)
27 #define LC_LIBHEADERTYPEPTR LIBBASETYPEPTR
28 #define LC_LIB_FIELD(lib) (((struct IntBOOPSIBase *)(lib))->bb_LibNode)
30 #define LC_NO_CLOSELIB
31 #define LC_NO_EXPUNGELIB
32 #define LC_STATIC_INITLIB
34 #include <libcore/libheader.c>
36 /**********************************************************************************************/
38 #define SysBase (GetBBase(BOOPSIBase)->bb_SysBase)
40 /**********************************************************************************************/
42 static void FreeAllClasses(struct Library
*BOOPSIBase
)
46 while((cl
= (Class
*)RemHead((struct List
*)&GetBBase(BOOPSIBase
)->bb_ClassList
)))
48 /* We can't free this class, so lets not bother */
54 /**********************************************************************************************/
56 static ULONG SAVEDS STDARGS
LC_BUILDNAME(L_InitLib
) (LIBBASETYPEPTR LIBBASE
)
60 UtilityBase
= OpenLibrary (UTILITYNAME
, 0);
65 /* All we have to do is to set up the pre-existing classes. */
66 NEWLIST(&GetBBase(LIBBASE
)->bb_ClassList
);
67 InitSemaphore(&GetBBase(LIBBASE
)->bb_ClassListLock
);
69 rootclass
.cl_UserData
= (IPTR
)LIBBASE
;
72 if((cl
= InitICClass(LIBBASE
)) == 0)
74 CloseLibrary (UtilityBase
);
78 if((cl
= InitModelClass(LIBBASE
)) == 0)
80 FreeAllClasses(LIBBASE
);
81 CloseLibrary (UtilityBase
);
88 /**********************************************************************************************/