bringing SDL 1.2.14 from vendor into the main branch
[AROS-Contrib.git] / regina / regina_init.c
blob21fbe3c427423508d095bb8eacd7d7ee7e9f3f9e
1 /*
2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Regina code for initialization during opening and closing of the library
6 */
8 #include <exec/types.h>
9 #include <exec/memory.h>
10 #include <aros/libcall.h>
11 #include <aros/debug.h>
12 #include <proto/exec.h>
13 #include <proto/alib.h>
15 #include <stddef.h>
16 #include "rexx.h"
18 #include <aros/symbolsets.h>
19 #include LC_LIBDEFS_FILE
21 struct DosLibrary* DOSBase;
22 struct Library* aroscbase;
23 struct MinList *__regina_tsdlist = NULL;
26 static int InitLib(LIBBASETYPEPTR LIBBASE)
28 D(bug("Inside Init func of regina.library\n"));
30 if (!(DOSBase = (struct DosLibrary *)OpenLibrary("dos.library",0))) return FALSE;
32 if (!(aroscbase = OpenLibrary("arosc.library",41)))
34 CloseLibrary((struct Library *)DOSBase);
35 return FALSE;
38 __regina_semaphorepool = CreatePool(MEMF_PUBLIC, 1024, 256);
40 __regina_tsdlist = (struct MinList *)AllocPooled (__regina_semaphorepool, sizeof(struct MinList));
41 NewList((struct List *)__regina_tsdlist);
43 return TRUE;
46 static int ExpungeLib(LIBBASETYPEPTR LIBBASE)
48 D(bug("Inside Expunge func of regina.library\n"));
50 DeletePool(__regina_semaphorepool);
51 CloseLibrary(aroscbase);
52 CloseLibrary((struct Library *)DOSBase);
54 return TRUE;
57 ADD2INITLIB(InitLib, 0);
58 ADD2EXPUNGELIB(ExpungeLib, 0);