Metatarget for copying of testfile fixed.
[AROS.git] / workbench / libs / muimaster / muimaster_init.c
blob15ecb7479d50e1b394b1695f881865f58032a5b4
1 /*
2 Copyright © 2002, The AROS Development Team.
3 All rights reserved.
5 $Id$
6 */
8 #include <exec/types.h>
9 #include <exec/libraries.h>
11 #include <proto/exec.h>
12 #include <clib/alib_protos.h>
14 #include "muimaster_intern.h"
15 #include "mui.h"
17 /****************************************************************************************/
19 /* #define MYDEBUG 1 */
20 #include "debug.h"
22 /* Global libbase vars */
23 #undef IntuitionBase
25 /* Undef the following bases because the casts struct Libaray * -> struct <Lib>Base * casts
26 * would use them */
27 #undef UtilityBase
28 #undef DOSBase
29 #undef GfxBase
31 struct Library *MUIMasterBase;
32 struct IntuitionBase *IntuitionBase;
33 struct Library *DataTypesBase;
35 struct Library **MUIMasterBasePtr = &MUIMasterBase;
37 /****************************************************************************************/
39 ULONG SAVEDS STDARGS LC_BUILDNAME(L_InitLib) (LC_LIBHEADERTYPEPTR MUIMasterBase)
41 D(bug("Inside Init func of muimaster.library\n"));
43 *MUIMasterBasePtr = MUIMasterBase;
45 if (!MUIMB(MUIMasterBase)->dosbase)
47 if (!(MUIMB(MUIMasterBase)->dosbase = (struct DosLibrary*)OpenLibrary("dos.library", 37)))
48 return FALSE;
51 if (!MUIMB(MUIMasterBase)->utilitybase)
53 if (!(MUIMB(MUIMasterBase)->utilitybase = (struct UtilityBase*)OpenLibrary("utility.library", 37)))
54 return FALSE;
57 if (!MUIMB(MUIMasterBase)->gfxbase)
59 if (!(MUIMB(MUIMasterBase)->gfxbase = (struct GfxBase*)OpenLibrary("graphics.library", 39)))
60 return FALSE;
63 if (!AslBase)
64 AslBase = OpenLibrary("asl.library", 37);
65 if (!AslBase)
66 return FALSE;
68 if (!LayersBase)
69 LayersBase = OpenLibrary("layers.library", 37);
70 if (!LayersBase)
71 return FALSE;
73 if (!IntuitionBase)
74 IntuitionBase = (struct IntuitionBase*)OpenLibrary("intuition.library", 39);
75 if (!IntuitionBase)
76 return FALSE;
78 if (!CxBase)
79 CxBase = OpenLibrary("commodities.library", 37);
80 if (!CxBase)
81 return FALSE;
83 if (!RexxSysBase)
84 RexxSysBase = OpenLibrary("rexxsyslib.library", 37);
85 if (!RexxSysBase)
86 return FALSE;
88 if (!GadToolsBase)
89 GadToolsBase = OpenLibrary("gadtools.library", 37);
90 if (!GadToolsBase)
91 return FALSE;
93 if (!KeymapBase)
94 KeymapBase = OpenLibrary("keymap.library", 37);
95 if (!KeymapBase)
96 return FALSE;
98 if (!DataTypesBase)
99 DataTypesBase = OpenLibrary("datatypes.library", 37);
100 if (!DataTypesBase)
101 return FALSE;
103 if (!IFFParseBase)
104 IFFParseBase = OpenLibrary("iffparse.library", 37);
105 if (!IFFParseBase)
106 return FALSE;
108 if (!DiskfontBase)
109 DiskfontBase = OpenLibrary("diskfont.library", 37);
110 if (!DiskfontBase)
111 return FALSE;
113 if (!IconBase)
114 IconBase = OpenLibrary("icon.library", 37); /* V44 really */
115 if (!IconBase)
116 return FALSE;
118 if (!CyberGfxBase)
119 CyberGfxBase = OpenLibrary("cybergraphics.library", 0);
120 /* continue even if cybergraphics.library is not available */
122 if (!WorkbenchBase)
123 WorkbenchBase = OpenLibrary("workbench.library", 37);
124 if (!WorkbenchBase)
125 return FALSE;
127 #ifdef HAVE_COOLIMAGES
128 if (!CoolImagesBase)
129 CoolImagesBase = OpenLibrary("coolimages.library", 0);
130 #endif
132 MUIMB(MUIMasterBase)->intuibase = IntuitionBase;
134 InitSemaphore(&MUIMB(MUIMasterBase)->ZuneSemaphore);
136 NewList((struct List *)&MUIMB(MUIMasterBase)->BuiltinClasses);
137 NewList((struct List *)&MUIMB(MUIMasterBase)->Applications);
138 return TRUE;
141 /****************************************************************************************/
143 ULONG SAVEDS STDARGS LC_BUILDNAME(L_OpenLib) (LC_LIBHEADERTYPEPTR MUIMasterBase)
145 D(bug("Inside Open func of muimaster.library\n"));
147 return TRUE;
150 /****************************************************************************************/
152 void SAVEDS STDARGS LC_BUILDNAME(L_CloseLib) (LC_LIBHEADERTYPEPTR MUIMasterBase)
154 D(bug("Inside Close func of muimaster.library\n"));
157 /****************************************************************************************/
159 void SAVEDS STDARGS LC_BUILDNAME(L_ExpungeLib) (LC_LIBHEADERTYPEPTR MUIMasterBase)
161 D(bug("Inside Expunge func of muimaster.library\n"));
163 /* CloseLibrary() checks for NULL-pointers */
165 CloseLibrary((struct Library *)MUIMB(MUIMasterBase)->gfxbase);
166 MUIMB(MUIMasterBase)->gfxbase = NULL;
168 CloseLibrary((struct Library *)MUIMB(MUIMasterBase)->utilitybase);
169 MUIMB(MUIMasterBase)->utilitybase = NULL;
171 CloseLibrary(AslBase);
172 CloseLibrary((struct Library *)MUIMB(MUIMasterBase)->dosbase);
173 MUIMB(MUIMasterBase)->dosbase = NULL;
175 AslBase = NULL;
177 CloseLibrary(LayersBase);
178 LayersBase = NULL;
180 CloseLibrary((struct Library *)MUIMB(MUIMasterBase)->intuibase);
181 MUIMB(MUIMasterBase)->intuibase = IntuitionBase = NULL;
183 CloseLibrary(CxBase);
184 CxBase = NULL;
186 CloseLibrary(RexxSysBase);
187 RexxSysBase = NULL;
189 CloseLibrary(GadToolsBase);
190 GadToolsBase = NULL;
192 CloseLibrary(KeymapBase);
193 KeymapBase = NULL;
195 CloseLibrary(DataTypesBase);
196 DataTypesBase = NULL;
198 CloseLibrary(IFFParseBase);
199 IFFParseBase = NULL;
201 CloseLibrary(DiskfontBase);
202 DiskfontBase = NULL;
204 CloseLibrary(IconBase);
205 IconBase = NULL;
207 CloseLibrary(CyberGfxBase);
208 CyberGfxBase = NULL;
210 CloseLibrary(WorkbenchBase);
211 WorkbenchBase = NULL;
213 #ifdef HAVE_COOLIMAGES
214 CloseLibrary(CoolImagesBase);
215 CoolImagesBase = NULL;
216 #endif
219 /****************************************************************************************/