home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-11-19 | 1.3 KB | 49 lines | [TEXT/MPS ] |
- /*
- File: LibraryManagerExample.cp
-
- Contains: A trivial Shared Library Manager client.
-
- Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #include <LibraryManagerUtilities.h>
-
- #include <ctype.h>
- #include <iostream.h>
- #include <stdio.h>
-
- /*————————————————————————————————————————————————————————————————————————————————————
- main
-
- this simple tool shows the initialization process for a Shared Library Manager
- client. It also gets the current Shared Library Manager's version and prints it.
- ————————————————————————————————————————————————————————————————————————————————————*/
-
- main()
- {
- TLibraryManager *libmgr=nil;
-
- OSErr err = InitLibraryManager(); // create a local instance of TLibraryManager
-
- // GetLocalLibraryManager returns the TLibraryManager object that was created
- // by InitLibraryManager. If InitLibraryManager failed, it returns NULL.
-
- if( err == kNoError ) {
- libmgr = GetLocalLibraryManager(); // get the local instance of TLibraryManager
-
- long slmvers = GetSLMVersion(); // Get the version # of SLM installed
-
- cout << "SLM Version = " << (void*)slmvers << endl;
- Trace ("SLM Version = 0x%X \n", slmvers );// output the message to TraceMonitor
-
- }
- else
- printf("Sorry InitLibraryManager Failed\n");
-
- CleanupLibraryManager(); // cleanup the local instance of TLibraryManager
-
- return 0;
- }
-
-