2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
8 #include <exec/execbase.h>
9 #include <exec/lists.h>
10 #include <exec/libraries.h>
11 #include <aros/libcall.h>
12 #include <proto/exec.h>
14 /*****************************************************************************
18 AROS_LH2(struct Library
*, OpenLibrary
,
21 AROS_LHA(CONST_STRPTR
, libName
, A1
),
22 AROS_LHA(ULONG
, version
, D0
),
25 struct ExecBase
*, SysBase
, 92, Exec
)
28 Opens a library given by name and revision. If the library does not
29 exist in the current system shared library list, the first the
30 system ROMTag module list is tried. If this fails, and the DOS is
31 running, then the library will be loaded from disk.
34 libName - Pointer to the library's name.
35 version - the library's version number.
38 Pointer to library structure or NULL.
51 *****************************************************************************/
55 struct Library
* library
;
57 /* Arbitrate for the library list */
60 /* Look for the library in our list */
61 library
= (struct Library
*) FindName (&SysBase
->LibList
, libName
);
63 /* Something found ? */
67 if(library
->lib_Version
>=version
)
69 /* Call Open vector */
70 library
=AROS_LVO_CALL1(struct Library
*,
71 AROS_LCA(ULONG
,version
,D0
),
72 struct Library
*,library
,1,lib
79 * We cannot handle loading libraries from disk. But this is taken
80 * care of by dos.library (well lddemon really) replacing this
81 * function with a SetFunction() call.