[Kerberos for Macintosh] [Applications] [Miscellaneous Documentation]
What is ShlibResourcesLib?Why do I need ShlibResourcesLib?
ShlibResourcesLib is a CFM shared library for use with Kerberos Support Library. It allows shared libraries to access their resources without corrupting the application's resource fork.How does ShlibResourcesLib work?
A shared library might need access to its resources. However, the resource fork of a shared library is not put in the resource chain when the library is loaded. To deal with this, the shared library must explicitly put its resource file into the resource chain. The only place where this can be done reliably is in the CFM or Mach-O initializer function. The resource file reference number needs to be saved into a global variable and later used to change current resource file appropriatelly in order to use the library's private resources.Where is the API specification?
ShlibResources library consists of two parts. On Mac OS 8 and 9 these are the ShlibResourcesLib shared library and the ShlibResources.lib static library. On Mac OS X, these are the ShlibResources framework and the
gShlibContextglobal variable of type
If a shared library FooLib is using its resource fork, then it needs to make calls into ShlibResourcesLib shared library to put the resource fork of FooLib into the resource chain. When the ShlibResourcesLib shared library opens the resource fork, it uses the ShlibResources.lib static library or
gShlibContextglobal variable to store a reference to the resource fork. It is necessary to use a static library or global variable for this because one copy of this data is needed for each library using ShlibResourcesLib, so the information cannot be held in the ShlibResourcesLib shared library.
ShlibResourcesLib shared library provides the following functions:
- initialization/termination functions; these functions are used to initialize ShlibResourcesLib library for use with a shared library.
- shared library resource interface; these functions provide a low-level access to the functionality of ShlibResourcesLib.
- resource file tracking interface; these functions allow you to keep track of a resource file while it's moved on disk, without holding it in the resource chain.
However, you should never make direct calls to these functions. Instead, you should use ShlibResourcesLib macros.Where do I get ShlibResourcesLib?
Please refer to the ShlibResourcesLib API for a list of the available functions and how to use them.
The ShlibResourcesLib SDK is part of Kerberos Support Library. You can get the latest release of the Kerberos Support Library here.
Please read the ShlibResourcesLib Bugs List and Version History for information on the latest release of ShlibResourcesLib.
Questions or comments? Send mail to email@example.com
Last updated on $Date: 2003/11/19 20:49:19 $
Last modified by $Author: smcguire $