mirror of
https://github.com/elliotnunn/mac-rom.git
synced 2025-01-07 20:29:52 +00:00
137 lines
4.8 KiB
Plaintext
137 lines
4.8 KiB
Plaintext
|
;
|
|||
|
; File: IntEnv.a
|
|||
|
;
|
|||
|
; Contains: xxx put contents here xxx
|
|||
|
;
|
|||
|
; Written by: xxx put writers here xxx
|
|||
|
;
|
|||
|
; Copyright: <09> 1991 by Apple Computer, Inc., all rights reserved.
|
|||
|
;
|
|||
|
; Change History (most recent first):
|
|||
|
;
|
|||
|
; <5> 3/13/91 JL Checked in MPW version. Restored TIOFlush.
|
|||
|
; <4> 1/30/91 gbm sab, #38: Change the <20>already including this file<6C> variable to
|
|||
|
; all uppercase (for security reasons)
|
|||
|
;
|
|||
|
; To Do:
|
|||
|
;
|
|||
|
|
|||
|
; File IntEnv.a
|
|||
|
;
|
|||
|
; Copyright Apple Computer, Inc. 1986 - 1990
|
|||
|
; All rights reserved.
|
|||
|
;
|
|||
|
; Include File for Accessing the Integrated Environment Libraries
|
|||
|
|
|||
|
; 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('__INCLUDINGINTENV__') = 'UNDEFINED' THEN
|
|||
|
__INCLUDINGINTENV__ SET 1
|
|||
|
|
|||
|
PRINT Push,Off ; save current print settings and turn it off
|
|||
|
GBLC &S%%%,&P%%%
|
|||
|
&S%%% SETC &Setting('CASE') ; save current CASE setting
|
|||
|
&P%%% SETC &Setting('PRINT',1) ; and 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
|
|||
|
|
|||
|
; Integrated Environment Globals
|
|||
|
|
|||
|
IMPORT StandAlone ; a long, 0 if in shell, 1 if standalone
|
|||
|
IMPORT errno ; a long, error number; set on unsuccessful I/O calls
|
|||
|
IMPORT MacOSErr ; a word; set along with errno if appropriate
|
|||
|
|
|||
|
; Integrated Environment Routines
|
|||
|
|
|||
|
IMPORT _DataInit ; called for you by _RTInit
|
|||
|
IMPORT _RTInit ; your tool MUST call this routine on startup
|
|||
|
IMPORT _RTExit ; Does NOT return
|
|||
|
IMPORT getenv
|
|||
|
IMPORT IEGETENV
|
|||
|
IMPORT atexit
|
|||
|
IMPORT exit
|
|||
|
IMPORT _exit
|
|||
|
IMPORT faccess
|
|||
|
; cmd values for faccess
|
|||
|
; F_OPEN EQU (('d'<<8)|$0) ; for internal use only
|
|||
|
; 'd' => "directory" ops; available for any program
|
|||
|
F_DELETE EQU (('d'<<8)|$1) ; deletes filename
|
|||
|
F_RENAME EQU (('d'<<8)|$2) ; renames file to string pointed to by arg
|
|||
|
; 'e' => "editor" ops; available to programs running under MPW
|
|||
|
F_GTABINFO EQU (('e'<<8)|$0) ; arg is address of long, has tab offset
|
|||
|
F_STABINFO EQU (('e'<<8)|$1) ; arg is address of long, new tab offset
|
|||
|
F_GFONTINFO EQU (('e'<<8)|$2) ; arg is address of long, has font info
|
|||
|
F_SFONTINFO EQU (('e'<<8)|$3) ; arg is address of long, new font info
|
|||
|
; high order-font number; low-font size
|
|||
|
F_GPRINTREC EQU (('e'<<8)|$4) ; arg is handle to print record TPrint
|
|||
|
F_SPRINTREC EQU (('e'<<8)|$5) ; arg sets handle to print record TPrint
|
|||
|
F_GSELINFO EQU (('e'<<8)|$6) ; arg is address of selection record
|
|||
|
F_SSELINFO EQU (('e'<<8)|$7) ; arg is address of selection record
|
|||
|
F_GWININFO EQU (('e'<<8)|$8) ; arg is address of a rect
|
|||
|
F_SWININFO EQU (('e'<<8)|$9) ; arg is address of a rect
|
|||
|
F_GSCROLLINFO EQU (('e'<<8)|$A) ; get scroll information
|
|||
|
F_SSCROLLINFO EQU (('e'<<8)|$B) ; set scroll information
|
|||
|
|
|||
|
IMPORT open
|
|||
|
; mode values for open call
|
|||
|
O_RDONLY EQU 0
|
|||
|
O_WRONLY EQU 1
|
|||
|
O_RDWR EQU 2
|
|||
|
|
|||
|
; auxiliary mode flags for open call (one of above plus zero or more from this list)
|
|||
|
O_APPEND EQU (1<<3) ; when writing, seek to EOF before each write
|
|||
|
O_RSRC EQU (1<<4) ; open the resource fork
|
|||
|
O_CREAT EQU (1<<8) ; create file if it doesn't exist
|
|||
|
O_TRUNC EQU (1<<9) ; truncate file to zero size
|
|||
|
|
|||
|
; only valid with O_CREAT specified
|
|||
|
O_EXCL EQU (1<<10) ; if O_CREAT is set, open will fail if file exists
|
|||
|
|
|||
|
; predefined file descriptors for standard input, standard output, and diagnostic output
|
|||
|
InputFD EQU 0
|
|||
|
OutputFD EQU 1
|
|||
|
DiagnosticFD EQU 2
|
|||
|
|
|||
|
IMPORT close
|
|||
|
IMPORT read
|
|||
|
IMPORT write
|
|||
|
IMPORT ioctl
|
|||
|
|
|||
|
; selector values for ioctl calls
|
|||
|
; FIOLSEEK EQU (('f'<<8)|00) ; internal use only
|
|||
|
; FIODUPFD EQU (('f'<<8)|01) ; internal use only
|
|||
|
FIOINTERACTIVE EQU (('f'<<8)|02) ; returns 0 if interactive, -1 if not
|
|||
|
FIOBUFSIZE EQU (('f'<<8)|03) ; Arg is address of long, returns the optimal
|
|||
|
; buffer size for this device
|
|||
|
FIOFNAME EQU (('f'<<8)|04) ; Arg is address of filename associated with fd
|
|||
|
FIOREFNUM EQU (('f'<<8)|05) ; Arg is address of short, returns fd's refnum
|
|||
|
FIOSETEOF EQU (('f'<<8)|06) ; Set file length to long in arg
|
|||
|
TIOFLUSH EQU (('t'<<8)|00) ; throw away terminal input
|
|||
|
|
|||
|
IMPORT lseek
|
|||
|
; mode values for lseek
|
|||
|
fromStart EQU 0
|
|||
|
fromCurPos EQU 1
|
|||
|
fromEnd EQU 2
|
|||
|
|
|||
|
IMPORT fcntl
|
|||
|
; argument to fcntl
|
|||
|
F_DUPFD EQU 0
|
|||
|
|
|||
|
|
|||
|
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
|