Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 8 - Trap Manager


Summary of the Trap Manager

Pascal Summary

Constants

CONST
   {Gestalt selectors}
   gestaltOSTable          = 'ostt';   {base of Operating System dispatch }
                                       { table}
   gestaltToolboxTable     = 'tbtt';   {base of Toolbox dispatch table}
   gestaltExtToolboxTable  = 'xttt';   {0, unless Toolbox dispatch table }
                                       { is disjoint, in which case base }
                                       { of upper half}
   {system errors triggered by the Trap Manager}
   dsCoreErr               = 12;       {unimplemented trap error}
   dsBadPatchHeader        = 83;       {attempt to install a come-from patch}

Data Types

TYPE TrapType     = (OSTrap, ToolTrap);

Routines

Accessing Addresses From the Trap Dispatch Tables

FUNCTION GetOSTrapAddress		(trapNum: Integer): LongInt;
{GetToolboxTrapAddress is also spelled as GetToolTrapAddress}
FUNCTION GetToolboxTrapAddress
					(trapNum: Integer): LongInt;
FUNCTION NGetTrapAddress		(trapNum: Integer; tTyp: TrapType): LongInt;

Installing Patch Addresses Into the Trap Dispatch Tables

PROCEDURE SetOSTrapAddress		(trapAddr: LongInt; trapNum: Integer);
{SetToolboxTrapAddress is also spelled as SetToolTrapAddress}
PROCEDURE SetToolboxTrapAddress
					(trapAddr: LongInt; trapNum: Integer);
PROCEDURE NSetTrapAddress		(trapAddr: LongInt; trapNum: Integer;
					tTyp: TrapType);

Detecting Unimplemented System Software Routines

PROCEDURE Unimplemented;

Manipulating One Trap Dispatch Table (Obsolete Routines)

FUNCTION GetTrapAddress			(trapNum: Integer): LongInt;
PROCEDURE SetTrapAddress		(trapAddr: LongInt; trapNum: Integer);

C Summary

Constants

/*Gestalt selectors*/
#define gestaltOSTable        'ostt'   /*base of Operating System dispatch */
                                       /* table*/
#define gestaltToolboxTable   'tbtt'   /*base of Toolbox dispatch table*/
#define gestaltExtToolboxTable'xttt'   /*0, unless Toolbox dispatch table */
                                       /* is disjoint, in which case base */
                                       /* of upper half*/
/*values of TrapType*/
enum {OSTrap, ToolTrap};
/*system errors triggered by Trap Manager*/
enum {
   dsCoreErr         = 12,             /*unimplemented trap error*/
   dsBadPatchHeader  = 83              /*attempt to install come-from patch*/
};

Data Types

typedef unsigned char TrapType;

Routines

Accessing Addresses From the Trap Dispatch Tables

pascal long NGetTrapAddress
				(short trapNum, TrapType tTyp);
pascal long GetOSTrapAddress
				(short trapNum);
/*GetToolboxTrapAddress is also spelled as GetToolTrapAddress*/
pascal long GetToolboxTrapAddress
				(short trapNum);

Installing Patch Addresses Into the Trap Dispatch Tables

pascal void NSetTrapAddress
			(long trapAddr, short trapNum,
			 TrapType tTyp);
pascal void SetOSTrapAddress
			(long trapAddr, short trapNum);
/*SetToolboxTrapAddress is also spelled as SetToolTrapAddress*/
pascal void SetToolboxTrapAddress
			(long trapAddr, short trapNum);
pascal void SetToolTrapAddress
			(long trapAddr, short trapNum);

Detecting Unimplemented System Software Routines

pascal void Unimplemented(void);

Manipulating One Trap Dispatch Table (Obsolete Routines)

pascal long GetTrapAddress	(short trapNum);
pascal void SetTrapAddress	(long trapAddr, short trapNum);

Assembly-Language Summary

Constants

newOS          EQU   $200     ;access Operating System trap dispatch table;
newTool        EQU   $600     ;access Toolbox trap dispatch table

Trap Macros

Trap Macros Requiring Register Setup
Trap macro nameRegisters on entryRegisters on exit
_GetTrapAddressD0: trap numberA0: address of patch
_SetTrapAddressD0: trap number
A0: address of patch
 
_Unimplemented  


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996