home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Apple Shared Library Manager / ASLM Examples / Example Tools / Sources / LibraryManagerExample.cp next >
Encoding:
Text File  |  1996-11-19  |  1.3 KB  |  49 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        LibraryManagerExample.cp
  3.  
  4.     Contains:    A trivial Shared Library Manager client.
  5.  
  6.     Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10. #include <LibraryManagerUtilities.h>
  11.  
  12. #include <ctype.h>
  13. #include <iostream.h>
  14. #include <stdio.h>
  15.  
  16. /*————————————————————————————————————————————————————————————————————————————————————
  17.     main 
  18.     
  19.     this simple tool shows the initialization process for a Shared Library Manager
  20.     client. It also gets the current Shared Library Manager's version and prints it. 
  21. ————————————————————————————————————————————————————————————————————————————————————*/
  22.  
  23. main() 
  24. {
  25.     TLibraryManager     *libmgr=nil;
  26.     
  27.     OSErr err = InitLibraryManager();            //  create a local instance of TLibraryManager
  28.     
  29.     // GetLocalLibraryManager returns the TLibraryManager object that was created
  30.     // by InitLibraryManager. If InitLibraryManager failed, it returns NULL.
  31.     
  32.     if( err == kNoError ) { 
  33.         libmgr = GetLocalLibraryManager();        // get the local instance of TLibraryManager
  34.         
  35.         long slmvers = GetSLMVersion();            // Get the version # of SLM installed
  36.     
  37.         cout << "SLM Version = " << (void*)slmvers << endl;
  38.         Trace ("SLM Version = 0x%X \n", slmvers );// output the message to TraceMonitor
  39.     
  40.     }
  41.     else
  42.         printf("Sorry InitLibraryManager Failed\n");
  43.     
  44.     CleanupLibraryManager();                    // cleanup the local instance of TLibraryManager
  45.     
  46.     return 0;
  47. }
  48.  
  49.