Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Previous Book Contents Book Index Next

Inside Macintosh: PowerPC System Software /
Chapter 3 - Code Fragment Manager / Code Fragment Manager Reference
Code Fragment Manager Routines / Loading Fragments


You can use the GetSharedLibrary function to locate and possibly also load an import library into your application's context.

OSErr GetSharedLibrary (Str63 libName, OSType archType, 
                           LoadFlags findFlags, 
                           ConnectionID *connID, Ptr *mainAddr, 
                           Str255 errName);
The name of an import library.
The instruction set architecture of the import library. For the PowerPC architecture, use the constant kPowerPCArch. For the 680x0 architecture, use the constant kMotorola68KArch.
A flag that specifies the operation to perform on the import library. See the description of the GetDiskFragment function on page 3-19 for the values you can pass in this parameter.
On exit, the connection ID that identifies the connection to the import library. You can pass this ID to other Code Fragment Manager routines.
On exit, the main address of the import library. The value returned is specific to the import library itself and is not used by the Code
Fragment Manager.
On exit, the name of the fragment that could not successfully be loaded. This parameter is meaningful only if the call to GetSharedLibrary fails.
The GetSharedLibrary function locates the import library named by the libName parameter and possibly also loads that import library into your application's context. The actions of GetSharedLibrary depend on the action flag you pass in the findFlags parameter; pass kFindLib to get the connection ID of an existing connection to the specified fragment, kLoadLib to load the specified fragment, or kLoadNewCopy to load the fragment with a new copy of the fragment's data section.

The GetSharedLibrary function does not resolve any unresolved imports in your application. In particular, you cannot use it to resolve any weak imports in your
code fragment.

fragNoErr0No error
paramErr-50Parameter error
fragLibNotFound-2804Specified fragment not found
fragHadUnresolveds-2807Loaded fragment has unacceptable unresolved symbols
fragNoMem-2809Not enough memory for internal bookkeeping
fragNoAddrSpace-2810Not enough memory in user's address space for section
fragObjectInitSeqErr-2812Order error during user initialization function
fragImportTooOld-2813Import library is too old
fragImportTooNew-2814Import library is too new
fragInitLoop-2815Circularity in required initialization order
fragLibConnErr-2817Error connecting to fragment
fragUserInitProcErr-2821Initialization procedure did not return noErr
See "Loading Code Fragments" on page 3-10 for more details on the fragment-
loading process.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996

Get information on Apple products.
Visit the Apple Store online or at retail locations.

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice