home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / aros / source / exec / library / src / closelibrary.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  1.4 KB  |  76 lines

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