Important: The information in this document is obsolete and should not be used for new development.
FindSymbol
You can use theFindSymbol
function to search for a specific exported symbol.
OSErr FindSymbol (ConnectionID connID, Str255 symName, Ptr *symAddr, SymClass *symClass);
connID
- A connection ID.
symName
- A symbol name.
symAddr
- On exit, the address of the symbol whose name is
symName
.symClass
- On exit, the class of the symbol whose name is
symName
. See the description below for a list of the recognized symbol classes.DESCRIPTION
TheFindSymbol
function searches the code fragment identified by theconnID
parameter for the symbol whose name is specified by thesymName
parameter. If that symbol is found,FindSymbol
returns the address of the symbol in thesymAddr
parameter and the class of the symbol in thesymClass
parameter. The currently recognized symbol classes are defined by constants.
enum { kCodeSymbol = 0, /*a code symbol*/ kDataSymbol = 1, /*a data symbol*/ kTVectSymbol = 2 /*a transition vector symbol*/ };Because a fragment's code is normally exported through transition vectors to that code, the valuekCodeSymbol
is not returned in the PowerPC environment. You can use the other two constants to distinguish exports that represent code (of classkTVectSymbol
) from those that represent general data (of classkDataSymbol
).RESULT CODES
fragNoErr 0 No error fragConnectionIDNotFound -2801 Connection ID is not valid fragSymbolNotFound -2802 Symbol was not found in connection