A function identified as deprecated has been superseded and may become unsupported in the future.
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 );
The selector code you want to add. This should be a four-character sequence similar to those defined in “Gestalt Manager Constants.”
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.
A result code. See “Gestalt Manager Result Codes.”
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.
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.
Gestalt.h
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 );
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.
A universal procedure pointer to the replacement selector function. You must obtain the value for this argument by calling the NewGestaltSelectorFunctionUPP
function.
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.
A result code. See “Gestalt Manager Result Codes.”
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.
Gestalt.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-10-31)