Carbon


ReplaceGestalt

Header: Gestalt.h Carbon status: Supported

Replaces the selector function associated with an existing selector code.

OSErr ReplaceGestalt (
    OSType selector, 
    SelectorFunctionUPP gestaltFunction, 
    SelectorFunctionUPP *oldGestaltFunction
);
Parameter descriptions
selector

The selector code for the function being replaced.

gestaltFunction

A pointer to the new selector function.

oldGestaltFunction

On return, a pointer to the function previously associated with the specified selector, so that your function can call the previous function. If ReplaceGestalt returns an error of any type, then the value of oldGestaltFunction is undefined.

function result

A result code.

SPECIAL CONSIDERATIONS

ReplaceGestalt function may move memory and should not be called at interrupt time.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.

CARBON NOTES

You should avoid using the ReplaceGestalt function to replace an existing selector function, which also requires your replacement function to reside in the system heap. Applications do not have access to the system heap in Mac OS X.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)