home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / rom / exec / openresource.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-09  |  1.8 KB  |  86 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: openresource.c,v 1.7 1997/01/01 03:46:13 ldp Exp $
  4.     $Log: openresource.c,v $
  5.     Revision 1.7  1997/01/01 03:46:13  ldp
  6.     Committed Amiga native (support) code
  7.  
  8.     Changed clib to proto
  9.  
  10.     Revision 1.6  1996/12/10 13:51:50  aros
  11.     Moved all #include's in the first column so makedepend can see it.
  12.  
  13.     Revision 1.5  1996/10/24 15:50:53  aros
  14.     Use the official AROS macros over the __AROS versions.
  15.  
  16.     Revision 1.4  1996/08/13 13:56:05  digulla
  17.     Replaced AROS_LA by AROS_LHA
  18.     Replaced some AROS_LH*I by AROS_LH*
  19.     Sorted and added includes
  20.  
  21.     Revision 1.3  1996/08/01 17:41:15  digulla
  22.     Added standard header for all files
  23.  
  24.     Desc:
  25.     Lang: english
  26. */
  27. #include <exec/execbase.h>
  28. #include <exec/lists.h>
  29. #include <aros/libcall.h>
  30. #include <exec/libraries.h>
  31. #include <proto/exec.h>
  32.  
  33. /*****************************************************************************
  34.  
  35.     NAME */
  36.  
  37.     AROS_LH1(APTR, OpenResource,
  38.  
  39. /*  SYNOPSIS */
  40.     AROS_LHA(STRPTR, resName, A1),
  41.  
  42. /*  LOCATION */
  43.     struct ExecBase *, SysBase, 83, Exec)
  44.  
  45. /*  FUNCTION
  46.     Return a pointer to a previously installed resource addressed by name.
  47.     It this name can't be found NULL is returned.
  48.  
  49.     INPUTS
  50.     libName - Pointer to the resource's name.
  51.  
  52.     RESULT
  53.     Pointer to resource or NULL.
  54.  
  55.     NOTES
  56.  
  57.     EXAMPLE
  58.  
  59.     BUGS
  60.  
  61.     SEE ALSO
  62.     AddResource(), RemResource()
  63.  
  64.     INTERNALS
  65.  
  66.     HISTORY
  67.  
  68. *****************************************************************************/
  69. {
  70.     AROS_LIBFUNC_INIT
  71.  
  72.     AROS_LIBBASE_EXT_DECL(struct ExecBase *,SysBase)
  73.     APTR resource;
  74.  
  75.     /* Arbitrate for the resource list */
  76.     Forbid();
  77.  
  78.     /* Look for the resource in our list */
  79.     resource = (APTR) FindName (&SysBase->ResourceList, resName);
  80.  
  81.     /* All done. */
  82.     Permit();
  83.     return resource;
  84.     AROS_LIBFUNC_EXIT
  85. } /* OpenResource */
  86.