Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / libs / openurl / library / libinit-aros.c
bloba71e7b9c6cea9acd159894fd1f975dfc9d66c27f
1 #include "lib.h"
2 #include <aros/symbolsets.h>
4 struct Library * OpenURLBase;
6 struct RxsLib *RexxSysBase = NULL;
7 struct SignalSemaphore lib_sem;
8 struct SignalSemaphore lib_prefsSem;
9 struct SignalSemaphore lib_memSem;
11 APTR lib_pool = NULL;
12 ULONG lib_use = 0;
13 ULONG lib_flags = 0;
14 struct URL_Prefs *lib_prefs = NULL;
16 /****************************************************************************/
18 int LibInit(struct Library *base)
20 BOOL success = FALSE;
22 // Init global library base
23 OpenURLBase = base;
25 InitSemaphore(&lib_sem);
26 InitSemaphore(&lib_prefsSem);
27 InitSemaphore(&lib_memSem);
29 // protect access to initBase()
30 ObtainSemaphore(&lib_sem);
32 success = initBase();
34 // unprotect initBase()
35 ReleaseSemaphore(&lib_sem);
37 return success;
40 /****************************************************************************/
42 int LibExpunge(struct Library *base)
44 // free all our private data and stuff.
45 ObtainSemaphore(&lib_sem);
47 freeBase();
49 // unprotect
50 ReleaseSemaphore(&lib_sem);
52 OpenURLBase = NULL;
54 return TRUE;
57 /****************************************************************************/
59 ADD2INITLIB(LibInit, 0);
60 ADD2EXPUNGELIB(LibExpunge, 0);
62 /***********************************************************************/