{============================================================================} {= =} {= 'MacDefs.Pas' =} {= =} {= Macintosh interface definitions used by the compiler. =} {= These are adapted from the standard interface files. =} {= =} {= 11/9/86 - Bruce Tomlin =} {= =} {============================================================================} UNIT MacDefs; INTERFACE {$U MacIntfGlue } { Glue code for system interfaces } { From 'MemTypes' } TYPE SignedByte = -128..127; { any byte in memory } Ptr = ^SignedByte; { blind pointer } ProcPtr = Ptr; { pointer to a procedure } Str255 = String[255]; { maximum string size } StringPtr = ^Str255; { pointer to maximum string } { From 'QuickDraw' } Point = RECORD v: INTEGER; h: INTEGER; END; PROCEDURE SetPt(VAR pt: Point; h,v: INTEGER); INLINE $A880; { From 'OSIntf' } CONST everyEvent = -1; { Event Manager event mask constants } mDownMask = 2; keyDownMask = 8; diskMask = 128; noErr = 0; { Operating system constant for 'no error occurred' } TYPE OSErr = INTEGER; EventRecord = RECORD what: INTEGER; message: LONGINT; when: LONGINT; where: Point; modifiers: INTEGER; END; ParamBlkType = (IOParam,FileParam,VolumeParam,CntrlParam); OsType = PACKED ARRAY[1..4] OF CHAR; ParamBlockRec = RECORD {12 byte header used by the file and IO system} qLink: Ptr; {queue link in header} qType: INTEGER; {type byte for safety check} ioTrap: INTEGER; {FS: the Trap} ioCmdAddr: Ptr; {FS: address to dispatch to} {common header to all variants} ioCompletion: ProcPtr; {completion routine addr (0 for sync calls)} ioResult: OsErr; {result code} ioNamePtr: StringPtr; {ptr to volume or file name string} ioVRefNum: INTEGER; {volume refnum} CASE ParamBlkType OF ioParam: ({deleted}); FileParam: ({deleted}); VolumeParam: ({deleted}); CntrlParam: ({deleted}); END; ParmBlkPtr = ^ParamBlockRec; PROCEDURE FlushEvents(whichMask,stopMask: Integer); INLINE $201F, $A032; PROCEDURE ExitToShell; INLINE $A9F4; PROCEDURE SysBeep(duration: INTEGER); INLINE $A9C8; FUNCTION GetVol(volName: StringPtr; VAR vRefNum: INTEGER): OsErr; EXTERNAL; FUNCTION SetVol(volName: StringPtr; vRefNum: INTEGER): OsErr; EXTERNAL; PROCEDURE UprString(VAR theString: Str255; diacSens: BOOLEAN); EXTERNAL; FUNCTION NewPtr(byteCount: LONGINT): Ptr; EXTERNAL; PROCEDURE DisposPtr(p: Ptr); EXTERNAL; FUNCTION MemError: OsErr; INLINE $3EB8, $0220; PROCEDURE BlockMove(srcPtr, destPtr: Ptr; byteCount: LONGINT); EXTERNAL; { From 'ToolIntf' } FUNCTION GetNextEvent(mask: INTEGER; VAR theEvent: EventRecord): BOOLEAN; INLINE $A970; FUNCTION Button: BOOLEAN; INLINE $A974; { From 'PackIntf.iPas' } { Standard File package interface } TYPE SFReply = RECORD good: BOOLEAN; { ignore command if FALSE } copy_: BOOLEAN; { not used } fType: OsType; { file type or not used } vRefNum: INTEGER; { volume reference number } version: INTEGER; { file's version number } fName: STRING[63]; { file name } END; SFTypeList = ARRAY[0..3] OF OSType; PROCEDURE SFPutFile(where: Point; prompt: Str255; origName: Str255; dlgHook: ProcPtr; VAR reply: SFReply); INLINE $3F3C, $0001, $A9EA; PROCEDURE SFGetFile(where: Point; prompt: Str255; fileFilter: ProcPtr; numTypes: INTEGER; typeList: SFTypeList; dlgHook: ProcPtr; VAR reply: SFReply); INLINE $3F3C, $0002, $A9EA; { From 'SANEIntf' } { Numerics package } { XPwrI returns 'x' raised to the power of 'i' } FUNCTION XPwrI(x: REAL; i: INTEGER): REAL; INLINE $3F3C, $8010, $A9EC; { Not from any interface file... } { Interfaces for the debugger } PROCEDURE Debug; INLINE $A9FF; PROCEDURE DebugStr(str: Str255); INLINE $ABFF; IMPLEMENTATION END.