r4684@vps: verhaegs | 2007-05-04 21:04:10 -0400
[AROS.git] / rom / exec / openresource.c
blob4ad59cebe797321de233318ddacdd46d6cabd968
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Open a resource.
6 Lang: english
7 */
8 #include <exec/execbase.h>
9 #include <exec/lists.h>
10 #include <aros/libcall.h>
11 #include <exec/libraries.h>
12 #include <proto/exec.h>
14 /*****************************************************************************
16 NAME */
18 AROS_LH1(APTR, OpenResource,
20 /* SYNOPSIS */
21 AROS_LHA(CONST_STRPTR, resName, A1),
23 /* LOCATION */
24 struct ExecBase *, SysBase, 83, Exec)
26 /* FUNCTION
27 Return a pointer to a previously installed resource addressed by
28 name. If this name can't be found NULL is returned.
30 INPUTS
31 libName - Pointer to the resource's name.
33 RESULT
34 Pointer to resource or NULL.
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 AddResource(), RemResource()
45 INTERNALS
47 *****************************************************************************/
49 AROS_LIBFUNC_INIT
51 AROS_LIBBASE_EXT_DECL(struct ExecBase *,SysBase)
52 APTR resource;
54 /* Arbitrate for the resource list */
55 Forbid();
57 /* Look for the resource in our list */
58 resource = (APTR) FindName (&SysBase->ResourceList, resName);
60 /* All done. */
61 Permit();
62 return resource;
63 AROS_LIBFUNC_EXIT
64 } /* OpenResource */