Carbon


FindSymbol

Header: CodeFragments.h Carbon status: Supported

Searches for a specific exported symbol.

OSErr FindSymbol (
    CFragConnectionID connID, 
    ConstStr255Param symName, 
    Ptr *symAddr, 
    CFragSymbolClass *symClass
);
Parameter descriptions
connID

A connection ID.

symName

A symbol name.

symAddr

On return, a pointer to the address of the symbol whose name is symName.

symClass

On return, a pointer to the class of the symbol whose name is symName. The currently recognized symbol classes are defined by the “Load Flag, Symbol Class, and Fragment Locator Constants”.

function result

A result code.

DISCUSSION

The FindSymbol function searches the code fragment identified by the connID parameter for the symbol whose name is specified by the symName parameter. If that symbol is found, FindSymbol returns the address of the symbol in the symAddr parameter and the class of the symbol in the symClass parameter.

Because a fragment’s code is normally exported through transition vectors to that code, the value kCodeSymbol is not returned in the PowerPC environment. You can use the other two constants to distinguish exports that represent code (of class kTVectSymbol) from those that represent general data (of class kDataSymbol).

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)