home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / aros / source / exec / library / src / addlibrary.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  1.4 KB  |  70 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 <aros/libcall.h>
  10.  
  11. /*****************************************************************************
  12.  
  13.     NAME */
  14.     #include <clib/exec_protos.h>
  15.  
  16.     __AROS_LH1(void, AddLibrary,
  17.  
  18. /*  SYNOPSIS */
  19.     __AROS_LA(struct Library *, library,A1),
  20.  
  21. /*  LOCATION */
  22.     struct ExecBase *, SysBase, 66, Exec)
  23.  
  24. /*  FUNCTION
  25.     Adds a given library to the system's library list after checksumming
  26.     the library vectors. This function is not for general use but
  27.     (of course) for building shared librarys that don't use exec's
  28.     MakeLibrary() mechanism.
  29.  
  30.     INPUTS
  31.     library - Pointer to a ready for use library structure.
  32.  
  33.     RESULT
  34.  
  35.     NOTES
  36.  
  37.     EXAMPLE
  38.  
  39.     BUGS
  40.  
  41.     SEE ALSO
  42.     RemLibrary(), MakeLibrary(), MakeFunctions(), InitStruct(), SumLibrary().
  43.  
  44.     INTERNALS
  45.  
  46.     HISTORY
  47.  
  48. ******************************************************************************/
  49. {
  50.     __AROS_FUNC_INIT
  51.  
  52.     /* Just in case the user forgot them */
  53.     library->lib_Node.ln_Type=NT_LIBRARY;
  54.     library->lib_Flags|=LIBF_CHANGED;
  55.  
  56.     /* Build checksum for library vectors */
  57.     SumLibrary(library);
  58.  
  59.     /* Arbitrate for the library list */
  60.     Forbid();
  61.  
  62.     /* And add the library */
  63.     Enqueue(&SysBase->LibList,&library->lib_Node);
  64.  
  65.     /* All done. */
  66.     Permit();
  67.     __AROS_FUNC_EXIT
  68. } /* AddLibrary */
  69.  
  70.