Important: The information in this document is obsolete and should not be used for new development.
NewGestalt
You can use theNewGestalt
function to add a selector code to those already recognized byGestalt
.
FUNCTION NewGestalt (selector: OSType; gestaltFunction: SelectorFunctionUUP) : OSErr;
selector
- The selector code you're adding, which is a four-character sequence of type
OSType
.gestaltFunction
- A pointer to the selector function that
Gestalt
executes when it receives the new selector code.DESCRIPTION
TheNewGestalt
function registers a specified selector code with the Gestalt Manager so that whenGestalt
is called with that selector code, the specified selector function is executed. The function result ofNewGestalt
is a result code.Before calling
NewGestalt
, you must define a selector function and install it in the system heap. The selector function must conform to the interface defined in "Adding a New Selector Code" beginning on page 1-10.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
TheNewGestalt
function might move memory and should not be called at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for theNewGestalt
function are
Registers on entry A0 Address of new selector function D0 Selector code
Registers on exit D0 Result code RESULT CODES
noErr 0 No error memFullErr -108 Ran out of memory gestaltDupSelectorErr -5552 Selector already exists gestaltLocationErr -5553 Function not in system heap SEE ALSO
See "Adding a New Selector Code" beginning on page 1-10 for a sample selector function and a sample procedure that installs it. For information about theGestalt
function, see page 1-31.