2019-06-29 22:17:03 +08:00

53 lines
1.5 KiB
Plaintext

; File Signal.a
;
; Copyright Apple Computer, Inc. 1986, 1990
; All rights reserved.
;
; Include File for Signal processing in the MPW Environment
; Set CASE OBJECT to assure references to the names IMPORTed here link
; properly. The following statements restore the CASE setting to its
; previous value.
IF &TYPE('__IncludingSignal__') = 'UNDEFINED' THEN
__IncludingSignal__ SET 1
PRINT Push,Off ; save the current print settings and turn it off
GBLC &S%%%%,&P%%%%
&S%%%% SETC &Setting('CASE') ; save the current CASE setting
&P%%%% SETC &Setting('PRINT',1) ; and the PRINT settings before we changed them
MACRO
X%%%%
GBLC &S%%%%,&P%%%% ; link references with previously defined variables
PRINT Push,&P%%%% ; restore the previous PRINT settings
CASE &S%%%% ; and restore the CASE setting
PRINT POP ; restore the PRINT settings
ENDM
PRINT Pop ; restore the PRINT settings
CASE OBJECT ; all imported/exported names case significant
SIG_DFL EQU 1
SIG_ERR EQU -1
SIG_IGN EQU 0
SIG_HOLD EQU 3
SIG_RELEASE EQU 5
SIGABRT EQU $0001
SIGINT EQU $0002
SIGFPE EQU $0004
SIGILL EQU $0008
SIGSEGV EQU $0010
SIGTERM EQU $0020
IMPORT signal
IMPORT raise
PRINT Push,Off ; save and turn off PRINT when macro is invoked
X%%%% ; invoke the macro to restore CASE setting
PRINT POP ; restore the PRINT settings
ENDIF ; ...already included