autoinit: Provide version checked autoinit for SysBase
[AROS.git] / rom / hyperlayers / layers_init.c
blob2bb372b5c326a3b0f544cd379cc81c3e762e4757
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Layers Resident and initialization.
6 Lang: english
7 */
9 #include LC_LIBDEFS_FILE
10 #include <graphics/gfxbase.h>
11 #include <proto/exec.h>
12 #include <aros/symbolsets.h>
14 #include "layers_intern.h"
16 static int LayersInit(LIBBASETYPEPTR LIBBASE)
18 GfxBase = (APTR)OpenLibrary("graphics.library", 41);
19 if (GfxBase == NULL)
20 return FALSE;
22 UtilityBase = (APTR)OpenLibrary("utility.library", 0);
23 if (UtilityBase == NULL) {
24 CloseLibrary((APTR)GfxBase);
25 return FALSE;
28 LIBBASE->lb_ClipRectPool = CreatePool(MEMF_CLEAR|MEMF_PUBLIC|MEMF_SEM_PROTECTED, sizeof(struct ClipRect) * 50, sizeof(struct ClipRect) * 50);
29 if (!LIBBASE->lb_ClipRectPool)
30 return FALSE;
32 return TRUE;
35 ADD2INITLIB(LayersInit, 0);