MIT Information Systems

Macintosh Development

[Home] [About Us] [People] [Information Systems]
[Kerberos for Macintosh] [Applications] [Miscellaneous Documentation]


ShlibResourcesLib
What is 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.

Why do I need ShlibResourcesLib?

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.

How does ShlibResourcesLib work?

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 gShlibContext global variable of type ShlibContext.

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 gShlibContext global 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:

However, you should never make direct calls to these functions. Instead, you should use ShlibResourcesLib macros.

Where is the API specification?

Please refer to the ShlibResourcesLib API for a list of the available functions and how to use them.

Where do I get ShlibResourcesLib?

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 macdev@mit.edu
Last updated on $Date: 2003/11/19 20:49:19 $
Last modified by $Author: smcguire $