Important: The information in this document is obsolete and should not be used for new development.
NewGestalt
You can use theNewGestaltfunction 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
Gestaltexecutes when it receives the new selector code.DESCRIPTION
TheNewGestaltfunction registers a specified selector code with the Gestalt Manager so that whenGestaltis called with that selector code, the specified selector function is executed. The function result ofNewGestaltis 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
TheNewGestaltfunction might move memory and should not be called at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for theNewGestaltfunction 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 theGestaltfunction, see page 1-31.