Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / gallium / gallium_init.c
blobe0ed39a54560904eaba37bb930d6849f998b06d0
1 /*
2 Copyright 2010, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/symbolsets.h>
7 #include <proto/exec.h>
8 #include <proto/oop.h>
10 #include LC_LIBDEFS_FILE
11 #include "gallium_intern.h"
14 static int Init(LIBBASETYPEPTR LIBBASE)
16 InitSemaphore(&LIBBASE->driversemaphore);
17 LIBBASE->driver = NULL;
18 LIBBASE->drivermodule = NULL;
19 LIBBASE->galliumAttrBase = OOP_ObtainAttrBase((STRPTR)IID_Hidd_Gallium);
21 if (!LIBBASE->galliumAttrBase)
22 return FALSE;
24 return TRUE;
27 static int Expunge(LIBBASETYPEPTR LIBBASE)
29 if (LIBBASE->driver)
30 OOP_DisposeObject(LIBBASE->driver);
32 if (LIBBASE->galliumAttrBase)
33 OOP_ReleaseAttrBase((STRPTR)IID_Hidd_Gallium);
35 if (LIBBASE->drivermodule)
36 CloseLibrary(LIBBASE->drivermodule);
38 return TRUE;
41 ADD2INITLIB(Init, 0);
42 ADD2EXPUNGELIB(Expunge, 0);
44 ADD2LIBS((STRPTR)"gallium.hidd", 0, static struct Library *, GalliumHiddBase);