< Previous PageNext Page > Hide TOC

Deprecated Gestalt Manager Functions

A function identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in Mac OS X v10.3

NewGestalt

Adds a selector code to those already recognized by Gestalt. (Deprecated in Mac OS X v10.3. Use NewGestaltValue instead.)

OSErr NewGestalt (
   OSType selector,
   SelectorFunctionUPP gestaltFunction
);

Parameters
selector

The selector code you want to add. This should be a four-character sequence similar to those defined in “Gestalt Manager Constants.”

gestaltFunction

A universal procedure pointer (UPP) to the selector callback function that Gestalt executes when it receives the new selector code. See SelectorFunctionProcPtr for more information on the callback you need to provide.

Return Value

A result code. See “Gestalt Manager Result Codes.”

Discussion

The NewGestalt function registers a specified selector code with the Gestalt Manager so that when the Gestalt function is called with that selector code, the specified selector function is executed. Before calling NewGestalt, you must define a selector function callback. See SelectorFunctionProcPtr for a description of how to define your selector function.

Registering with the Gestalt Manager is a way for software such as system extensions to make their presence known to potential users of their services.

Special Considerations

You should avoid using the NewGestalt function to add a selector code, which requires moving your selector function into the system heap. Applications do not have access to the system heap in Mac OS X.

Availability
Declared In
Gestalt.h

ReplaceGestalt

Replaces the selector function associated with an existing selector code. (Deprecated in Mac OS X v10.3. Use NewGestaltValue instead.)

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

Parameters
selector

The selector code for the function you want to replace. You must provide the four-character sequence you provided previously for the function you are replacing.

gestaltFunction

A universal procedure pointer to the replacement selector function. You must obtain the value for this argument by calling the NewGestaltSelectorFunctionUPP function.

oldGestaltFunction

On output, a universal procedure pointer to the callback function previously associated with the specified selector. If the function ReplaceGestalt returns an error of any type, then the value of oldGestaltFunction is undefined.

Return Value

A result code. See “Gestalt Manager Result Codes.”

Special Considerations

You should avoid using the ReplaceGestalt function to replace an existing selector callback 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.

Availability
Declared In
Gestalt.h

< Previous PageNext Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-10-31)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.