1 /**********************************************************************
2 text.datatype - (c) 2000 by Sebastian Bauer
4 This module is the library initializion module for the
6 It must be compiled with sc's libcode option
7 ***********************************************************************/
10 * picture.datatype - a rippoff
13 #include <proto/exec.h>
14 #include <proto/intuition.h>
16 #include "compilerspecific.h"
20 struct IClass
*dt_class
;
22 struct ExecBase
*SysBase
;
23 struct IntuitionBase
*IntuitionBase
;
24 struct GfxBase
*GfxBase
;
26 struct UtilityBase
*UtilityBase
;
28 struct Library
*UtilityBase
;
30 struct DosLibrary
*DOSBase
;
31 struct Library
*LayersBase
;
32 struct Library
*DiskfontBase
;
33 struct Library
*DataTypesBase
;
34 struct Library
*IFFParseBase
;
35 struct Library
*CyberGfxBase
;
37 /* inside pictureclass.c */
38 struct IClass
*DT_MakeClass(struct Library
*picturebase
);
48 /**************************************************************************************************/
50 ASM SAVEDS
int __UserLibInit( register __a6
struct Library
*libbase
)
53 SysBase
= *(struct ExecBase
**)4;
56 D(bug("picture.datatype/__UserLibInit\n"));
58 if((LayersBase
= OpenLibrary("layers.library", 39)))
60 if((GfxBase
= (struct GfxBase
*)OpenLibrary("graphics.library", 39)))
62 if((IntuitionBase
= (struct IntuitionBase
*)OpenLibrary("intuition.library", 39)))
64 if((DOSBase
= (struct DosLibrary
*)OpenLibrary("dos.library", 39)))
66 if((DiskfontBase
= OpenLibrary("diskfont.library", 37)))
69 if((UtilityBase
= (struct UtilityBase
*)OpenLibrary("utility.library", 37)))
71 if((UtilityBase
= (struct Library
*)OpenLibrary("utility.library", 37)))
74 if((DataTypesBase
= OpenLibrary("datatypes.library", 37)))
76 if((IFFParseBase
= OpenLibrary("iffparse.library", 37)))
78 if((CyberGfxBase
= OpenLibrary("cybergraphics.library", 37)))
80 if((dt_class
= DT_MakeClass(libbase
)))
84 D(bug("picture.datatype/__UserLibInit: Returning success\n"));
98 D(bug("picture.datatype/__UserLibInit: Returning failure\n"));
103 /**************************************************************************************************/
105 ASM SAVEDS
void __UserLibCleanup( register __a6
struct Library
*libbase
)
107 D(bug("picture.datatype/__UserLibCleanup\n"));
109 D(bug("picture.datatype/__UserLibCleanup: Freeing class\n"));
113 RemoveClass(dt_class
);
118 D(bug("picture.datatype/__UserLibCleanup: Closing Libraries\n"));
120 if(CyberGfxBase
) CloseLibrary(CyberGfxBase
);
121 if(IFFParseBase
) CloseLibrary(IFFParseBase
);
122 if(DataTypesBase
) CloseLibrary(DataTypesBase
);
123 if(UtilityBase
) CloseLibrary((struct Library
*)UtilityBase
);
124 if(DiskfontBase
) CloseLibrary(DiskfontBase
);
125 if(DOSBase
) CloseLibrary((struct Library
*)DOSBase
);
126 if(IntuitionBase
) CloseLibrary((struct Library
*)IntuitionBase
);
127 if(GfxBase
) CloseLibrary((struct Library
*)GfxBase
);
128 if(LayersBase
) CloseLibrary(LayersBase
);
130 D(bug("picture.datatype/__UserLibCleanup: Done\n"));
133 /**************************************************************************************************/
135 SAVEDS STDARGS
struct IClass
*ObtainEngine(void)
137 D(bug("picture.datatype/ObtainEngine: returning %x\n", dt_class
));
142 /**************************************************************************************************/