added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / rom / exec / addlibrary.c
blob609ccd0d27c6761fce8ff62065aa83aa6c87fc78
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Add a library to the public list of libraries.
6 Lang: english
7 */
8 #include <aros/debug.h>
9 #include <exec/execbase.h>
10 #include <aros/libcall.h>
11 #include <proto/exec.h>
13 /*****************************************************************************
15 NAME */
17 AROS_LH1(void, AddLibrary,
19 /* SYNOPSIS */
20 AROS_LHA(struct Library *, library,A1),
22 /* LOCATION */
23 struct ExecBase *, SysBase, 66, Exec)
25 /* FUNCTION
26 Adds a given library to the system's library list after checksumming
27 the library vectors. This function is not for general use but
28 (of course) for building shared librarys that don't use exec's
29 MakeLibrary() mechanism.
31 INPUTS
32 library - Pointer to a ready for use library structure.
34 RESULT
36 NOTES
37 Some old Amiga software expects that AddLibrary returns the
38 library which was just added. When in binary compatibility mode
39 AROS does this too.
41 EXAMPLE
43 BUGS
45 SEE ALSO
46 RemLibrary(), MakeLibrary(), MakeFunctions(), InitStruct(), SumLibrary().
48 INTERNALS
50 ******************************************************************************/
52 AROS_LIBFUNC_INIT
54 ASSERT_VALID_PTR(library);
56 /* Just in case the user forgot them */
57 library->lib_Node.ln_Type=NT_LIBRARY;
58 library->lib_Flags|=LIBF_CHANGED;
60 /* Build checksum for library vectors */
61 SumLibrary(library);
63 /* Arbitrate for the library list */
64 Forbid();
66 /* And add the library */
67 Enqueue(&SysBase->LibList,&library->lib_Node);
69 /* All done. */
70 Permit();
72 AROS_COMPAT_SETD0(library);
73 AROS_LIBFUNC_EXIT
74 } /* AddLibrary */