r4493@vps: verhaegs | 2007-04-19 14:44:00 -0400
[AROS.git] / rom / exec / addresource.c
blob7de5384ecd0fad412324c2d5c26a56d705acc19e
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Add a resource to the public list of resources.
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, AddResource,
19 /* SYNOPSIS */
20 AROS_LHA(APTR, resource, A1),
22 /* LOCATION */
23 struct ExecBase *, SysBase, 81, Exec)
25 /* FUNCTION
26 Adds a given resource to the system's resource list.
28 INPUTS
29 resource - Pointer to a ready for use resource.
31 RESULT
33 NOTES
35 EXAMPLE
37 BUGS
39 SEE ALSO
40 RemResource(), OpenResource()
42 INTERNALS
44 ******************************************************************************/
46 AROS_LIBFUNC_INIT
47 ASSERT_VALID_PTR(resource);
49 /* Just in case the user forgot them */
50 ((struct Node *)resource)->ln_Type=NT_RESOURCE;
52 /* Arbitrate for the resource list */
53 Forbid();
55 /* And add the resource */
56 Enqueue(&SysBase->ResourceList,(struct Node *)resource);
58 /* All done. */
59 Permit();
60 AROS_LIBFUNC_EXIT
61 } /* AddResource */