tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / rom / exec / remlibrary.c
blobd45e252330e1f03037894ab7f443dcaf209652c6
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Remove a library from the list of public libraries.
6 Lang: english
7 */
8 #include <aros/config.h>
9 #include <exec/execbase.h>
10 #include <aros/libcall.h>
11 #include <dos/dos.h>
12 #include <proto/exec.h>
14 #include "exec_debug.h"
15 #ifndef DEBUG_RemLibrary
16 # define DEBUG_RemLibrary 0
17 #endif
18 #undef DEBUG
19 #if DEBUG_RemLibrary
20 # define DEBUG 1
21 #endif
22 #include <aros/debug.h>
23 #undef kprintf
25 /*****************************************************************************
27 NAME */
29 AROS_LH1(void, RemLibrary,
31 /* SYNOPSIS */
32 AROS_LHA(struct Library *, library,A1),
34 /* LOCATION */
35 struct ExecBase *, SysBase, 67, Exec)
37 /* FUNCTION
38 Calls the given library's expunge vector, thus trying to delete it.
39 The library may refuse to do so and still be open after this call.
41 INPUTS
42 library - Pointer to the library structure.
44 RESULT
46 NOTES
48 EXAMPLE
50 BUGS
52 SEE ALSO
53 AddLibrary(), MakeLibrary(), MakeFunctions(), InitStruct(), SumLibrary()
55 INTERNALS
57 ******************************************************************************/
59 AROS_LIBFUNC_INIT
60 BPTR seglist;
62 D(bug("RemLibrary $%lx (\"%s\") by \"%s\"\n", library,
63 library ? library->lib_Node.ln_Name : "(null)",
64 GET_THIS_TASK->tc_Node.ln_Name));
66 /* Arbitrate for the library list */
67 Forbid();
69 /* Call expunge vector */
70 seglist = AROS_LVO_CALL1(BPTR,
71 AROS_LCA(struct Library *, library, D0),
72 struct Library *,library,3,);
74 Normally you'd expect the library to be expunged if this returns
75 non-zero, but this is only exec which doesn't know anything about
76 seglists - therefore dos.library has to SetFunction() into this
77 vector for the additional functionality.
80 /* All done. */
81 Permit();
83 AROS_COMPAT_SETD0(seglist);
84 AROS_LIBFUNC_EXIT
85 } /* RemLibrary */