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 / Finding Symbols


FindSymbol

You can use the FindSymbol 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
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. 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 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).

RESULT CODES
fragNoErr0No error
fragConnectionIDNotFound-2801Connection ID is not valid
fragSymbolNotFound-2802Symbol was not found in connection

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.
1-800-MY-APPLE

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