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


You can use the FindSymbol function to search for a specific exported symbol.

OSErr FindSymbol (ConnectionID connID, Str255 symName, 
                     Ptr *symAddr, SymClass *symClass);
A connection ID.
A symbol name.
On exit, the address of the symbol whose name is symName.
On exit, the class of the symbol whose name is symName. See the description below for a list of the recognized symbol classes.
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).

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.

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