Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 1 - Gestalt Manager / Gestalt Manager Reference
Gestalt Manager Routines / Modifying a Selector Function


ReplaceGestalt

You can use the ReplaceGestalt function to replace the function that is currently associated with a selector.

FUNCTION ReplaceGestalt (selector: OSType; 
                         gestaltFunction: SelectorFunctionUUP;
                         VAR oldGestaltFunction:
                         SelectorFunctionUUP): OSErr;
selector
The selector code for the function being replaced.
gestaltFunction
A pointer to the new selector function.
oldGestaltFunction
On exit, a pointer to the function previously associated with the specified selector.
DESCRIPTION
The ReplaceGestalt function replaces the selector function associated with an existing selector code.

So that your function can call the function previously associated with the selector, ReplaceGestalt places the address of the old selector function in the oldGestaltFunction parameter. If ReplaceGestalt returns an error of any type, then the value of oldGestaltFunction is undefined.

SPECIAL CONSIDERATIONS
The ReplaceGestalt function might move memory and should not be called at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for the ReplaceGestalt function are
Registers on entry
A0Address of new selector function
D0Selector code
Registers on exit
A0Address of old selector function
D0Result code

RESULT CODES
noErr0No error
gestaltUndefSelectorErr-5551Undefined selector
gestaltLocationErr-5553Function not in system heap
SEE ALSO
See "Modifying a Selector Function" on page 1-13 for a discussion of replacing selector functions. See "Adding a New Selector Code" beginning on page 1-10 for a sample selector function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996