A library consists of a group of functions somewhere in memory (ROM or RAM), a vector table, and a library structure which can be followed by an optional private data area for the library. The library's base pointer (as returned by openlibrary()) points to the library's library data structure: struct Library { struct Node lib_Node; UBYTE lib_Flags; UBYTE lib_pad; UWORD lib_NegSize; /* number of bytes before library */ UWORD lib_PosSize; /* number of bytes after library */ UWORD lib_Version; UWORD lib_Revision; APTR lib_IdString; ULONG lib_Sum; /* the checksum itself */ UWORD lib_OpenCnt; /* number of current opens */ }; /* Meaning of the flag bits: */ /* A task is currently running a checksum */ #define LIBF_SUMMING (1 << 0) /* on this library (system maintains this */ /* flag) */ #define LIBF_CHANGED (1 << 1) /* One or more entries have been changed */ /* in the library code vectors used by */ /* SumLibrary (system maintains this flag)*/ #define LIBF_SUMUSED (1 << 2) /* A checksum fault should cause a system */ /* panic (library flag) */ #define LIBF_DELEXP (1 << 3) /* A user has requested expunge but */ /* another user still has the library */ /* open (this is maintained by library) */ using a library to reference data relationship of libraries to devices minimum subset of library vectors changing the contents of a library