; ; File: PPCToolbox.a ; ; Contains: Interface to the PPCToolbox from Assembly language. ; ; Written by: Eric M. Trehus ; ; Copyright: © 1990-1992 by Apple Computer, Inc., all rights reserved. ; ; Change History (most recent first): ; ; <14> 4/17/92 JSM Undo last revision, those changes are not supported by PPC for ; CubeE. ; <13> 9/6/91 MH add: ppcServiceStoreAndForward EQU 2, and PPCKill trap macro and ; selector. ; <12> 8/15/91 MH change formatting of comments, move conditional assembly ; declaration immediately after copyright notice ; <11> 1/30/91 gbm sab, #38: Change the Ôalready including this fileÕ variable to ; all uppercase (for security reasons) ; <10> 12/13/90 EMT Change interface to support new calling conventions, ; basically rewrote interface. ; ; Version: 1.00 ; Created: Friday, October 20, 1989 at 9:35:53 PM ; ; PPCToolbox.a ; Assembler Interface to the Macintosh Libraries ; ; Copyright Apple Computer, Inc. 1989-90 ; All rights reserved ; ; 1.3 JAL 10/10/1990 Changed cmdCode to ppcCmdCode because of duplicate definitions. ; 1.2 CVC 11/28/1989 Added the StartSecureSession call. ; 1.1 CVC 11/08/1989 Put the offset to PB here. ; 1.0 CVC 11/02/1989 First time add the file to the AIncludes folder ; END EASE MODIFICATION HISTORY ; 1.1 CVC 11/02/1989 Added PPC command codes (moved from PPCEqu.a) ; 1.0 CVC 09/18/1989 Adding PPC toolbox for the first time. IF &TYPE('__INCLUDINGPPCTOOLBOX__') = 'UNDEFINED' THEN __INCLUDINGPPCTOOLBOX__ SET 1 ; PPCCommand Values ; Trap Selector D0 Must be set to one of the following, csCode will contain this value ; when the call completes. ppcInitCmd EQU 0 ppcOpenCmd EQU 1 ppcStartCmd EQU 2 ppcInformCmd EQU 3 ppcAcceptCmd EQU 4 ppcRejectCmd EQU 5 ppcWriteCmd EQU 6 ppcReadCmd EQU 7 ppcEndCmd EQU 8 ppcCloseCmd EQU 9 IPCListPortsCmd EQU 10 DeleteUserCmd EQU 12 GetDefaultUserCmd EQU 13 StartSecureCmd EQU 14 ; Valid PPCServiceTypes ppcServiceRealTime EQU 1 ; Valid PPCLocationKinds = Integer; ppcNoLocation EQU 0 ; There is no PPCLocName ppcNBPLocation EQU 1 ; Use AppleTalk NBP ppcNBPTypeLocation EQU 2 ; Use just the NBP type, fill in rest with default ; Valid PPCPortKinds = Integer; ppcByCreatorAndType EQU 1 ; Port type is specified as colloquial Mac creator and type ppcByString EQU 2 ; Port type is in pascal string format ; Valid PPCSessionOrigins = SignedByte; { requestType returned in PPCInform } ppcLocalOrigin EQU 1 ; session originated from this machine ppcRemoteOrigin EQU 2 ; session originated from remote machine PPCPortRec RECORD 0 ; TYPE Comment nameScript DS.W 1 ; ScriptCode; script of name name DS.B 34 ; Str32; name of port as seen in browser portKindSelector DS.W 1 ; PPCPortKinds; which variant portTypeStr DS.B 34 ; Str32; ORG portTypeStr portCreator DS.L 1 ; OSType; portType DS.L 1 ; OSType; ENDR LocationNameRec RECORD 0 ; locationKindSelector DS.W 1 ; PPCLocationKind; which variant nbpEntity DS.B 100 ; NBP name entity ORG nbpEntity ; nbpType DS.B 34 ; Str32; just the NBP type string, for PPCOpen ENDR PortInfoRec RECORD 0 ; filler1 DS.B 1 ; SignedByte; authRequired DS.B 1 ; Boolean; name DS PPCPortRec ; ENDR PPCOpenPBRec RECORD 0 ; TYPE Comment qLink DS.L 1 ; Ptr reserved csCode DS.W 1 ; INTEGER reserved intUse DS.W 1 ; INTEGER reserved intUsePtr DS.L 1 ; Ptr reserved ioCompletion DS.L 1 ; PPCComProcPtr Completion routine. ioResult DS.W 1 ; OSErr Result of operation. reserved DS.L 5 ; LONGINT reserved portRefNum DS.W 1 ; PPCPortRefNum Port Reference filler1 DS.L 1 ; LONGINT ignored serviceType DS.B 1 ; PPCServiceType Bit field describing the requested port service resFlag DS.B 1 ; BYTE Must be set to 0 portName DS.L 1 ; PPCPortPtr PortName for PPC locationName DS.L 1 ; LocationNamePtr If NBP Registration is required networkVisible DS.B 1 ; BOOLEAN make this network visible on network nbpRegistered DS.B 1 ; BOOLEAN The given location name was registered on the network ENDR PPCInformPBRec RECORD 0 ; TYPE Comment qLink DS.L 1 ; Ptr reserved csCode DS.W 1 ; INTEGER reserved intUse DS.W 1 ; INTEGER reserved intUsePtr DS.L 1 ; Ptr reserved ioCompletion DS.L 1 ; PPCComProcPtr Completion routine. ioResult DS.W 1 ; OSErr Result of operation. reserved DS.L 5 ; LONGINT reserved portRefNum DS.W 1 ; PPCPortRefNum Port Identifier sessRefNum DS.L 1 ; PPCSessRefNum Session Reference serviceType DS.B 1 ; PPCServiceType Status Flags for type of session, local, remote autoAccept DS.B 1 ; Boolean if true session will be accepted automatically portName DS.L 1 ; PPCPortPtr Buffer for Source PPCPortRec locationName DS.L 1 ; LocationNamePtr Buffer for Source LocationNameRec userName DS.L 1 ; StringPtr Buffer for Soure user's name trying to link. userData DS.L 1 ; LongInt value included in PPCStart's userData requestType DS.B 1 ; PPCSessionOrigin Local or Network ENDR PPCStartPBRec RECORD 0 ; TYPE Comment qLink DS.L 1 ; Ptr reserved csCode DS.W 1 ; INTEGER reserved intUse DS.W 1 ; INTEGER reserved intUsePtr DS.L 1 ; Ptr reserved ioCompletion DS.L 1 ; PPCComProcPtr Completion routine. ioResult DS.W 1 ; OSErr Result of operation. reserved DS.L 5 ; LONGINT reserved portRefNum: DS.W 1 ; PPCPortRefNum; Port Identifier sessRefNum: DS.L 1 ; PPCSessRefNum; Session Reference serviceType: DS.B 1 ; PPCServiceType Actual service method (realTime) resFlag: DS.B 1 ; SignedByte Must be set to 0 portName: DS.L 1 ; PPCPortPtr Destination portName locationName: DS.L 1 ; LocationNamePtr NBP or NAS style service location name rejectInfo: DS.L 1 ; LongInt reason for rejecting the session request userData: DS.L 1 ; LongInt Copied to destination PPCInform parameter block userRefNum: DS.L 1 ; LongInt userRefNum (obtained during login process) ENDR PPCAcceptPBRec RECORD 0 ; TYPE Comment qLink DS.L 1 ; Ptr reserved csCode DS.W 1 ; INTEGER reserved intUse DS.W 1 ; INTEGER reserved intUsePtr DS.L 1 ; Ptr reserved ioCompletion DS.L 1 ; PPCComProcPtr Completion routine. ioResult DS.W 1 ; OSErr Result of operation. reserved DS.L 5 ; LONGINT reserved filler1 DS.W 1 ; Integer sessRefNum DS.L 1 ; PPCSessRefNum Session Reference ENDR PPCRejectPBRec RECORD 0 ; TYPE Comment qLink DS.L 1 ; Ptr reserved csCode DS.W 1 ; INTEGER reserved intUse DS.W 1 ; INTEGER reserved intUsePtr DS.L 1 ; Ptr reserved ioCompletion DS.L 1 ; PPCComProcPtr Completion routine. ioResult DS.W 1 ; OSErr Result of operation. reserved DS.L 5 ; LONGINT reserved filler1 DS.W 1 ; Integer sessRefNum DS.L 1 ; PPCSessRefNum Session Reference filler2 DS.W 1 ; Integer filler3 DS.L 1 ; LongInt filler4 DS.L 1 ; LongInt rejectInfo DS.L 1 ; LongInt reason for rejecting the session request ENDR PPCWritePBRec RECORD 0 ; TYPE Comment qLink DS.L 1 ; Ptr reserved csCode DS.W 1 ; INTEGER reserved intUse DS.W 1 ; INTEGER reserved intUsePtr DS.L 1 ; Ptr reserved ioCompletion DS.L 1 ; PPCComProcPtr Completion routine. ioResult DS.W 1 ; OSErr Result of operation. reserved DS.L 5 ; LONGINT reserved filler1 DS.W 1 ; Integer sessRefNum DS.L 1 ; PPCSessRefNum Session Reference bufferLength DS.L 1 ; Size Length of the message buffer actualLength DS.L 1 ; Size Actual Length Written bufferPtr DS.L 1 ; Ptr Pointer to message buffer more DS.B 1 ; Boolean if more data in this block will be written filler2 DS.B 1 ; SignedByte; userData DS.L 1 ; LongInt Message block userData Uninterpreted by PPC blockCreator DS.L 1 ; OSType Message block creator Uninterpreted by PPC blockType DS.L 1 ; OSType Message block type Uninterpreted by PPC ENDR PPCReadPBRec RECORD 0 ; TYPE Comment qLink DS.L 1 ; Ptr reserved csCode DS.W 1 ; INTEGER reserved intUse DS.W 1 ; INTEGER reserved intUsePtr DS.L 1 ; Ptr reserved ioCompletion DS.L 1 ; PPCComProcPtr Completion routine. ioResult DS.W 1 ; OSErr Result of operation. reserved DS.L 5 ; LONGINT reserved filler1 DS.W 1 ; Integer sessRefNum DS.L 1 ; PPCSessRefNum Session Reference bufferLength DS.L 1 ; Size Length of the message buffer actualLength DS.L 1 ; Size Actual length read bufferPtr DS.L 1 ; Ptr Pointer to message buffer more DS.B 1 ; Boolean if true more data in this block to be read filler2 DS.B 1 ; SignedByte userData DS.L 1 ; LongInt Message block userData Uninterpreted by PPC blockCreator DS.L 1 ; OSType Message block creator Uninterpreted by PPC blockType DS.L 1 ; OSType Message block type Uninterpreted by PPC ENDR PPCEndPBRec RECORD 0 ; TYPE Comment qLink DS.L 1 ; Ptr reserved csCode DS.W 1 ; INTEGER reserved intUse DS.W 1 ; INTEGER reserved intUsePtr DS.L 1 ; Ptr reserved ioCompletion DS.L 1 ; PPCComProcPtr Completion routine. ioResult DS.W 1 ; OSErr Result of operation. reserved DS.L 5 ; LONGINT reserved filler1 DS.W 1 ; Integer sessRefNum DS.L 1 ; PPCSessRefNum Session Reference ENDR PPCClosePBRec RECORD 0 ; TYPE Comment qLink DS.L 1 ; Ptr reserved csCode DS.W 1 ; INTEGER reserved intUse DS.W 1 ; INTEGER reserved intUsePtr DS.L 1 ; Ptr reserved ioCompletion DS.L 1 ; PPCComProcPtr Completion routine. ioResult DS.W 1 ; OSErr Result of operation. reserved DS.L 5 ; LONGINT reserved portRefNum DS.W 1 ; PPCPortRefNum Port Identifier ENDR IPCListPortsPBRec RECORD 0 ; TYPE Comment qLink DS.L 1 ; Ptr reserved csCode DS.W 1 ; INTEGER reserved intUse DS.W 1 ; INTEGER reserved intUsePtr DS.L 1 ; Ptr reserved ioCompletion DS.L 1 ; PPCComProcPtr Completion routine. ioResult DS.W 1 ; OSErr Result of operation. reserved DS.L 5 ; LONGINT reserved filler1 DS.W 1 ; Integer startIndex DS.W 1 ; Integer Start Index requestCount DS.W 1 ; Integer Number of entries to be returned actualCount DS.W 1 ; Integer Actual Number of entries to be returned portName DS.L 1 ; PPCPortPtr PortName Match locationName DS.L 1 ; LocationNamePtr NBP or NAS type name to locate the Port Location bufferPtr DS.L 1 ; PortInfoArrayPtr Pointer to a buffer requestCount*sizeof(PortInfo) bytes big ENDR DeleteUserParams RECORD 0 ; userRefNum DS.L 1 ; LONGINT ENDR StartSecureParams RECORD 0 ; TYPE prompt DS.L 1 ; StringPtr guestSelected DS.L 1 ; pointer to a Boolean allowGuest DS.B 1 ; Boolean reserved1 DS.B 1 ; Byte useDefault DS.B 1 ; Boolean reserved2 DS.B 1 ; Byte userName DS.L 1 ; StringPtr startPb DS.L 1 ; PPCStartPBPtr ENDR GetDefaultUserParams RECORD 0 ; userName DS.L 1 ; Pointer to Str32. userRef DS.L 1 ; Pointer to LONGINT. ENDR PPCParamBlockRec RECORD 0 ; openParam DS PPCOpenPBRec ORG 0 informParam DS PPCInformPBRec ORG 0 startParam DS PPCStartPBRec ORG 0 acceptParam DS PPCAcceptPBRec ORG 0 rejectParam DS PPCRejectPBRec ORG 0 writeParam DS PPCWritePBRec ORG 0 readParam DS PPCReadPBRec ORG 0 endParam DS PPCEndPBRec ORG 0 closeParam DS PPCClosePBRec ORG 0 listPortsParam DS IPCListPortsPBRec ENDR Macro _PPCInit MOVEQ #ppcInitCmd,D0 DC.W $A0DD Endm Macro _DoPPCTrap IF &SYSLIST[1] = 'SYNC' THEN DC.W $A0DD ELSE DC.W $A4DD ENDIF Endm Macro _PPCMacro MOVEQ &SYSLIST[1],D0 _DoPPCTrap &SYSLIST[2] Endm Macro _PPCOpen _PPCMacro #ppcOpenCmd,&SYSLIST[2] Endm Macro _PPCInform _PPCMacro #ppcInformCmd,&SYSLIST[2] Endm Macro _PPCStart _PPCMacro #ppcStartCmd,&SYSLIST[2] Endm Macro _PPCAccept _PPCMacro #ppcAcceptCmd,&SYSLIST[2] Endm Macro _PPCReject _PPCMacro #ppcRejectCmd,&SYSLIST[2] Endm Macro _PPCWrite _PPCMacro #ppcWriteCmd,&SYSLIST[2] Endm Macro _PPCRead _PPCMacro #ppcReadCmd,&SYSLIST[2] Endm Macro _PPCClose _PPCMacro #ppcCloseCmd,&SYSLIST[2] Endm Macro _PPCEnd _PPCMacro #ppcEndCmd,&SYSLIST[2] Endm Macro _IPCListPorts _PPCMacro #IPCListPortsCmd,&SYSLIST[2] Endm Macro _DeleteUserIdentity Moveq #DeleteUserCmd,D0 DC.W $A0DD Endm Macro _GetDefaultUser Moveq #GetDefaultUserCmd,D0 DC.W $A0DD Endm Macro _StartSecureSession Moveq #StartSecureCmd,D0 DC.W $A0DD Endm Macro _PPCBrowser MOVE.W #$0D00,D0 _Pack9 Endm ENDIF ;...already included