export cppflags from configure
[AROS.git] / rom / exec / openresource.c
blobfce52792c474065735485eb0755bb05027871075
1 /*
2 Copyright © 1995-2017, 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 #include "exec_intern.h"
15 #include "exec_debug.h"
16 #include "exec_locks.h"
18 /*****************************************************************************
20 NAME */
22 AROS_LH1(APTR, OpenResource,
24 /* SYNOPSIS */
25 AROS_LHA(CONST_STRPTR, resName, A1),
27 /* LOCATION */
28 struct ExecBase *, SysBase, 83, Exec)
30 /* FUNCTION
31 Return a pointer to a previously installed resource addressed by
32 name. If this name can't be found NULL is returned.
34 INPUTS
35 resName - Pointer to the resource's name.
37 RESULT
38 Pointer to resource or NULL.
40 NOTES
42 EXAMPLE
44 BUGS
46 SEE ALSO
47 AddResource(), RemResource()
49 INTERNALS
51 *****************************************************************************/
53 AROS_LIBFUNC_INIT
55 APTR resource;
57 /* Arbitrate for the resource list */
58 EXEC_LOCK_LIST_READ_AND_FORBID(&SysBase->ResourceList);
60 /* Look for the resource in our list */
61 resource = (APTR) FindName (&SysBase->ResourceList, resName);
63 /* All done. */
64 EXEC_UNLOCK_LIST_AND_PERMIT(&SysBase->ResourceList);
66 return resource;
67 AROS_LIBFUNC_EXIT
68 } /* OpenResource */