Important: The information in this document is obsolete and should not be used for new development.
Using the Main Symbol as a Data Structure
As mentioned before, the main symbol does not have to point to a routine, but can point to a block of data instead. You can use this fact to good effect with plug-ins, where the block of data referenced by the main symbol can contain essential information about the plug-in. Using the main symbol in this fashion has several advantages:
However, not having a specific symbol name means that the plug-in's purpose is not quite as obvious.
- The Code Fragment Manager returns the address of the main symbol when you programmatically prepare a fragment, so you do not need to call
FindSymbol
.- You do not have to reserve and document the specific name of an export for your plug-in.
A plug-in can store its name, icon, or information about its symbols in the main symbol data structure. Storing symbolic information in this fashion eliminates the need for multiple
FindSymbol
calls.
© Apple Computer, Inc.
11 MARCH 1997