Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 1 - Gestalt Manager / Gestalt Manager Reference
Gestalt Manager Routines / Adding a Selector Code


NewGestalt

You can use the NewGestalt function to add a selector code to those already recognized by Gestalt.

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
The NewGestalt function registers a specified selector code with the Gestalt Manager so that when Gestalt is called with that selector code, the specified selector function is executed. The function result of NewGestalt 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
The NewGestalt function might move memory and should not be called at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for the NewGestalt function are
Registers on entry
A0Address of new selector function
D0Selector code
Registers on exit
D0Result code

RESULT CODES
noErr0No error
memFullErr-108Ran out of memory
gestaltDupSelectorErr-5552Selector already exists
gestaltLocationErr-5553Function 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 the Gestalt function, see page 1-31.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996

Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice