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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: closelibrary.c,v 1.7 1997/01/01 03:46:07 ldp Exp $
  4.  
  5.     Desc:
  6.     Lang: english
  7. */
  8. #include <exec/execbase.h>
  9. #include <dos/dos.h>
  10. #include <aros/libcall.h>
  11. #include <proto/exec.h>
  12.  
  13. /*****************************************************************************
  14.  
  15.     NAME */
  16.  
  17.     AROS_LH1(void, CloseLibrary,
  18.  
  19. /*  SYNOPSIS */
  20.     AROS_LHA(struct Library *, library, A1),
  21.  
  22. /*  LOCATION */
  23.     struct ExecBase *, SysBase, 69, Exec)
  24.  
  25. /*  FUNCTION
  26.     Closes a previously opened library. It is legal to call this function
  27.     with a NULL pointer.
  28.  
  29.     INPUTS
  30.     library - Pointer to library structure or NULL.
  31.  
  32.     RESULT
  33.  
  34.     NOTES
  35.  
  36.     EXAMPLE
  37.  
  38.     BUGS
  39.  
  40.     SEE ALSO
  41.     OpenLibrary().
  42.  
  43.     INTERNALS
  44.  
  45.     HISTORY
  46.  
  47. ******************************************************************************/
  48. {
  49.     AROS_LIBFUNC_INIT
  50.  
  51.     /* Something to do? */
  52.     if(library!=NULL)
  53.     {
  54.     /* Single-thread the close routine. */
  55.     Forbid();
  56.  
  57.     /* Do the close */
  58.     (void)AROS_LVO_CALL0(BPTR,struct Library,library,2,);
  59.     /*
  60.         Normally you'd expect the library to be expunged if this returns
  61.         non-zero, but this is only exec which doesn't know anything about
  62.         seglists - therefore dos.library has to SetFunction() into this
  63.         vector for the additional functionality.
  64.     */
  65.  
  66.     /* All done. */
  67.     Permit();
  68.     }
  69.  
  70.     AROS_LIBFUNC_EXIT
  71. } /* CloseLibrary */
  72.  
  73.