home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1991-04-08 | 2.7 MB | 96,775 lines | [ TEXT/MPS ]
Text Truncated. Only the first 1MB is shown below. Download the file for the complete contents.
æKY CopyrightNotice æC Copyright Apple Computer, Inc. 1985-1991, All rights reserved. 411 - PInterfaces Help - MPW 3.2 Final Release Friday, April 5, 1991 3:27:56 PM æKY Help PInterfacesHelp æKL AboutPInterfacesHelp ADSP.p AIFF.p Aliases.p AppleEvents.p AppleTalk.p Balloons.p CommResources.p Connections.p ConnectionTools.p Controls.p CRMSerialDevices.p CTBUtilities.p CursorCtl.p DatabaseAccess.p Desk.p DeskBus.p Devices.p Dialogs.p DisAsmLookup.p DiskInit.p Disks.p Editions.p ENET.p EPPC.p ErrMgr.p Errors.p Events.p Files.p FileTransfers.p FileTransferTools.p Finder.p FixMath.p Folders.p Fonts.p GestaltEqu.p Globals.p Graf3D.p HyperXCmd.p Icons.p Language.p Lists.p Memory.p Menus.p MIDI.p Notification.p OSEvents.p OSUtils.p Packages.p Palettes.p Perf.p Picker.p PictUtil.p Power.p PPCToolBox.p Printing.p Processes.p QDOffscreen.p Quickdraw.p Resources.p Retrace.p ROMDefs.p SANE.p Scrap.p Script.p SCSI.p SegLoad.p Serial.p ShutDown.p Signal.p Slots.p Sound.p SoundInput.p StandardFile.p Start.p Strings.p SysEqu.p TextEdit.p Timer.p ToolUtils.p Traps.p Types.p Video.p Windows.p æKY AboutPInterfacesHelp æC __________________________________________________________________ Version 1.0 Final -- MPW 3.2 Final Contains Nets & Comm Interfaces and bug fixes. __________________________________________________________________ Version 1.0 Beta 6 -- ETO# 3 Contains updated InsideMacintosh Volume VI information. __________________________________________________________________ Version 1.0 Beta -- ETO# 2 This version contains the InsideMacintosh Volume VI information. æKY ADSP.p æKL attnBufSize dspAttention dspCLDeny dspCLInit dspCLListen dspClose dspCLRemove dspInit dspNewCID dspOpen dspOptions DSPParamBlock DSPPBPtr dspRead dspRemove dspReset dspStatus dspWrite eAttention eClosed eFwdReset errAborted errAttention errDSPQueueSize errFwdReset errOpenDenied errOpening errRefNum errState eTearDown minDSPQueueSize ocAccept ocEstablish ocPassive ocRequest sClosed sClosing sListening sOpen sOpening sPassive TPCCB TRCCB æKY errRefNum æFp ADSP.p æT CONST æD errRefNum = -1280; { bad connection refNum } æC æKY errAborted æFp ADSP.p æT CONST æD errAborted = -1279; { control call was aborted } æC æKY errState æFp ADSP.p æT CONST æD errState = -1278; { bad connection state for this operation } æC æKY errOpening æFp ADSP.p æT CONST æD errOpening = -1277; { open connection request failed } æC æKY errAttention æFp ADSP.p æT CONST æD errAttention = -1276; { attention message too long } æC æKY errFwdReset æFp ADSP.p æT CONST æD errFwdReset = -1275; { read terminated by forward reset } æC æKY errDSPQueueSize æFp ADSP.p æT CONST æD errDSPQueueSize = -1274; { DSP Read/Write Queue Too small } æC æKY errOpenDenied æFp ADSP.p æT CONST æD errOpenDenied = -1273; { open connection request was denied } æC æKY dspInit æFp ADSP.p æT CONST æD dspInit = 255; { create a new connection end } æC æKY dspRemove æFp ADSP.p æT CONST æD dspRemove = 254; { remove a connection end } æC æKY dspOpen æFp ADSP.p æT CONST æD dspOpen = 253; { open a connection } æC æKY dspClose æFp ADSP.p æT CONST æD dspClose = 252; { close a connection } æC æKY dspCLInit æFp ADSP.p æT CONST æD dspCLInit = 251; { create a connection listener } æC æKY dspCLRemove æFp ADSP.p æT CONST æD dspCLRemove = 250; { remove a connection listener } æC æKY dspCLListen æFp ADSP.p æT CONST æD dspCLListen = 249; { post a listener request } æC æKY dspCLDeny æFp ADSP.p æT CONST æD dspCLDeny = 248; { deny an open connection request } æC æKY dspStatus æFp ADSP.p æT CONST æD dspStatus = 247; { get status of connection end } æC æKY dspRead æFp ADSP.p æT CONST æD dspRead = 246; { read data from the connection } æC æKY dspWrite æFp ADSP.p æT CONST æD dspWrite = 245; { write data on the connection } æC æKY dspAttention æFp ADSP.p æT CONST æD dspAttention = 244; { send an attention message } æC æKY dspOptions æFp ADSP.p æT CONST æD dspOptions = 243; { set connection end options } æC æKY dspReset æFp ADSP.p æT CONST æD dspReset = 242; { forward reset the connection } æC æKY dspNewCID æFp ADSP.p æT CONST æD dspNewCID = 241; { generate a cid for a connection end } æC æKY ocRequest æFp ADSP.p æT CONST æD ocRequest = 1; { request a connection with remote } æC æKY ocPassive æFp ADSP.p æT CONST æD ocPassive = 2; { wait for a connection request from remote } æC æKY ocAccept æFp ADSP.p æT CONST æD ocAccept = 3; { accept request as delivered by listener } æC æKY ocEstablish æFp ADSP.p æT CONST æD ocEstablish = 4; { consider connection to be open } æC æKY sListening æFp ADSP.p æT CONST æD sListening = 1; { for connection listeners } æC æKY sPassive æFp ADSP.p æT CONST æD sPassive = 2; { waiting for a connection request from remote } æC æKY sOpening æFp ADSP.p æT CONST æD sOpening = 3; { requesting a connection with remote } æC æKY sOpen æFp ADSP.p æT CONST æD sOpen = 4; { connection is open } æC æKY sClosing æFp ADSP.p æT CONST æD sClosing = 5; { connection is being torn down } æC æKY sClosed æFp ADSP.p æT CONST æD sClosed = 6; { connection end state is closed } æC æKY eClosed æFp ADSP.p æT CONST æD eClosed = $80; { received connection closed advice } æC æKY eTearDown æFp ADSP.p æT CONST æD eTearDown = $40; { connection closed due to broken connection } æC æKY eAttention æFp ADSP.p æT CONST æD eAttention = $20; { received attention message } æC æKY eFwdReset æFp ADSP.p æT CONST æD eFwdReset = $10; { received forward reset advice } æC æKY attnBufSize æFp ADSP.p æT CONST æD attnBufSize = 570; { size of client attention buffer } æC æKY minDSPQueueSize æFp ADSP.p æT CONST æD minDSPQueueSize = 100; { Minimum size of receive or send Queue } æC æKY TRCCB TPCCB æFp ADSP.p æT RECORD æD TPCCB = ^TRCCB; TRCCB = PACKED RECORD ccbLink: TPCCB; { link to next ccb } refNum: INTEGER; { user reference number } state: INTEGER; { state of the connection end } userFlags: Byte; { flags for unsolicited connection events } localSocket: Byte; { socket number of this connection end } remoteAddress: AddrBlock; { internet address of remote end } attnCode: INTEGER; { attention code received } attnSize: INTEGER; { size of received attention data } attnPtr: Ptr; { ptr to received attention data } reserved: PACKED ARRAY [1..220] OF Byte; { adsp internal use } END; æC æKY DSPParamBlock DSPPBPtr æFp ADSP.p æT RECORD æD DSPPBPtr = ^DSPParamBlock; DSPParamBlock = PACKED RECORD qLink: QElemPtr; qType: INTEGER; ioTrap: INTEGER; ioCmdAddr: Ptr; ioCompletion: ProcPtr; ioResult: OSErr; ioNamePtr: StringPtr; ioVRefNum: INTEGER; ioCRefNum: INTEGER; { adsp driver refNum } csCode: INTEGER; { adsp driver control code } qStatus: LONGINT; { adsp internal use } ccbRefNum: INTEGER; { refnum of ccb } CASE INTEGER OF dspInit,dspCLInit: (ccbPtr: TPCCB; {pointer to connection control block} userRoutine: ProcPtr; {client routine to call on event} sendQSize: INTEGER; {size of send queue (0..64K bytes)} sendQueue: Ptr; {client passed send queue buffer} recvQSize: INTEGER; {size of receive queue (0..64K bytes)} recvQueue: Ptr; {client passed receive queue buffer} attnPtr: Ptr; {client passed receive attention buffer} localSocket: Byte; {local socket number} filler1: Byte; {filler for proper byte alignment} ); dspOpen,dspCLListen,dspCLDeny: (localCID: INTEGER; {local connection id} remoteCID: INTEGER; {remote connection id} remoteAddress: AddrBlock; {address of remote end} filterAddress: AddrBlock; {address filter} sendSeq: LONGINT; {local send sequence number} sendWindow: INTEGER; {send window size} recvSeq: LONGINT; {receive sequence number} attnSendSeq: LONGINT; {attention send sequence number} attnRecvSeq: LONGINT; {attention receive sequence number} ocMode: Byte; {open connection mode} ocInterval: Byte; {open connection request retry interval} ocMaximum: Byte; {open connection request retry maximum} filler2: Byte; {filler for proper byte alignment} ); dspClose,dspRemove: (abort: Byte; {abort connection immediately if non-zero} filler3: Byte; {filler for proper byte alignment} ); dspStatus: (statusCCB: TPCCB; {pointer to ccb} sendQPending: INTEGER; {pending bytes in send queue} sendQFree: INTEGER; {available buffer space in send queue} recvQPending: INTEGER; {pending bytes in receive queue} recvQFree: INTEGER; {available buffer space in receive queue} ); dspRead,dspWrite: (reqCount: INTEGER; {requested number of bytes} actCount: INTEGER; {actual number of bytes} dataPtr: Ptr; {pointer to data buffer} eom: Byte; {indicates logical end of message} flush: Byte; {send data now} ); dspAttention: (attnCode: INTEGER; {client attention code} attnSize: INTEGER; {size of attention data} attnData: Ptr; {pointer to attention data} attnInterval: Byte; {retransmit timer in 10-tick intervals} filler4: Byte; {filler for proper byte alignment} ); dspOptions: (sendBlocking: INTEGER; {quantum for data packets} sendTimer: Byte; {send timer in 10-tick intervals} rtmtTimer: Byte; {retransmit timer in 10-tick intervals} badSeqMax: Byte; {threshold for sending retransmit advice} useCheckSum: Byte; {use ddp packet checksum} ); dspNewCID: (newCID: INTEGER; {new connection id returned} ); END; æC æKY AIFF.p æKL ACE2to1Name ACE2Type ACE8to3Name ACE8Type AIFCID AIFCVersion1 AIFFID AIFFLoop AnnotationID ApplicationSpecificChunk ApplicationSpecificChunkPtr ApplicationSpecificID AudioRecordingChunk AudioRecordingChunkPtr AudioRecordingID AuthorID ChunkHeader Comment CommentID CommentsChunk CommentsChunkPtr CommonChunk CommonChunkPtr CommonID ContainerChunk CopyrightID ExtCommonChunk ExtCommonChunkPtr FormatVersionChunk FormatVersionChunkPtr FormatVersionID FORMID ForwardBackwardLooping ForwardLooping ID InstrumentChunk InstrumentChunkPtr InstrumentID MACE3to1Name MACE3Type MACE6to1Name MACE6Type Marker MarkerChunk MarkerChunkPtr MarkerID MarkerIdType MIDIDataChunk MIDIDataChunkPtr MIDIDataID NameID NoLooping NoneName NoneType SoundDataChunk SoundDataChunkPtr SoundDataID TextChunk TextChunkPtr æKY AIFFID æFp AIFF.p æT CONST æD AIFFID = 'AIFF'; æC æKY AIFCID æFp AIFF.p æT CONST æD AIFCID = 'AIFC'; æC æKY FormatVersionID æFp AIFF.p æT CONST æD FormatVersionID = 'FVER'; æC æKY CommonID æFp AIFF.p æT CONST æD CommonID = 'COMM'; æC æKY FORMID æFp AIFF.p æT CONST æD FORMID = 'FORM'; æC æKY SoundDataID æFp AIFF.p æT CONST æD SoundDataID = 'SSND'; æC æKY MarkerID æFp AIFF.p æT CONST æD MarkerID = 'MARK'; æC æKY InstrumentID æFp AIFF.p æT CONST æD InstrumentID = 'INST'; æC æKY MIDIDataID æFp AIFF.p æT CONST æD MIDIDataID = 'MIDI'; æC æKY AudioRecordingID æFp AIFF.p æT CONST æD AudioRecordingID = 'AESD'; æC æKY ApplicationSpecificID æFp AIFF.p æT CONST æD ApplicationSpecificID = 'APPL'; æC æKY CommentID æFp AIFF.p æT CONST æD CommentID = 'COMT'; æC æKY NameID æFp AIFF.p æT CONST æD NameID = 'NAME'; æC æKY AuthorID æFp AIFF.p æT CONST æD AuthorID = 'AUTH'; æC æKY CopyrightID æFp AIFF.p æT CONST æD CopyrightID = '(c) '; æC æKY AnnotationID æFp AIFF.p æT CONST æD AnnotationID = 'ANNO'; æC æKY NoLooping æFp AIFF.p æT CONST æD NoLooping = 0; æC æKY ForwardLooping æFp AIFF.p æT CONST æD ForwardLooping = 1; æC æKY ForwardBackwardLooping æFp AIFF.p æT CONST æD ForwardBackwardLooping = 2; æC æKY AIFCVersion1 æFp AIFF.p æT CONST æD AIFCVersion1 = $A2805140; æC æKY NoneName æFp AIFF.p æT CONST æD NoneName = 'pnot compressed'; æC æKY ACE2to1Name æFp AIFF.p æT CONST æD ACE2to1Name = 'ACE 2-to-1'; æC æKY ACE8to3Name æFp AIFF.p æT CONST æD ACE8to3Name = 'ACE 8-to-3'; æC æKY MACE3to1Name æFp AIFF.p æT CONST æD MACE3to1Name = 'MACE 3-to-1'; æC æKY MACE6to1Name æFp AIFF.p æT CONST æD MACE6to1Name ='MACE 6-to-1'; æC æKY NoneType æFp AIFF.p æT CONST æD NoneType = 'NONE'; æC æKY ACE2Type æFp AIFF.p æT CONST æD ACE2Type = 'ACE2'; æC æKY ACE8Type æFp AIFF.p æT CONST æD ACE8Type = 'ACE8'; æC æKY MACE3Type æFp AIFF.p æT CONST æD MACE3Type = 'MAC3'; æC æKY MACE6Type æFp AIFF.p æT CONST æD MACE6Type = 'MAC6'; æC æKY ID æFp AIFF.p æT TYPE æD ID = LONGINT; æC æKY MarkerIdType æFp AIFF.p æT TYPE æD MarkerIdType = INTEGER; æC æKY ChunkHeader æFp AIFF.p æT RECORD æD ChunkHeader = RECORD ckID: ID; ckSize: LONGINT; END; æC æKY ContainerChunk æFp AIFF.p æT RECORD æD ContainerChunk = RECORD ckID: ID; ckSize: LONGINT; formType: ID; END; æC æKY FormatVersionChunk FormatVersionChunkPtr æFp AIFF.p æT RECORD æD FormatVersionChunkPtr = ^FormatVersionChunk; FormatVersionChunk = RECORD ckID: ID; ckSize: LONGINT; timestamp: LONGINT; END; æC æKY CommonChunk CommonChunkPtr æFp AIFF.p æT RECORD æD CommonChunkPtr = ^CommonChunk; CommonChunk = RECORD ckID: ID; ckSize: LONGINT; numChannels: INTEGER; numSampleFrames: LONGINT; sampleSize: INTEGER; sampleRate: extended; END; æC æKY ExtCommonChunk ExtCommonChunkPtr æFp AIFF.p æT RECORD æD ExtCommonChunkPtr = ^ExtCommonChunk; ExtCommonChunk = RECORD ckID: ID; ckSize: LONGINT; numChannels: INTEGER; numSampleFrames: LONGINT; sampleSize: INTEGER; sampleRate: extended; compressionType: ID; compressionName: PACKED ARRAY [0..0] OF Byte; END; æC æKY SoundDataChunk SoundDataChunkPtr æFp AIFF.p æT RECORD æD SoundDataChunkPtr = ^SoundDataChunk; SoundDataChunk = RECORD ckID: ID; ckSize: LONGINT; offset: LONGINT; blockSize: LONGINT; END; æC æKY Marker æFp AIFF.p æT RECORD æD Marker = RECORD id: MarkerIdType; position: LONGINT; markerName: Str255; END; æC æKY MarkerChunk MarkerChunkPtr æFp AIFF.p æT RECORD æD MarkerChunkPtr = ^MarkerChunk; MarkerChunk = RECORD ckID: ID; ckSize: LONGINT; numMarkers: INTEGER; Markers: ARRAY [0..0] OF Marker; END; æC æKY AIFFLoop æFp AIFF.p æT RECORD æD AIFFLoop = RECORD playMode: INTEGER; beginLoop: MarkerIdType; endLoop: MarkerIdType; END; æC æKY InstrumentChunk InstrumentChunkPtr æFp AIFF.p æT RECORD æD InstrumentChunkPtr = ^InstrumentChunk; InstrumentChunk = RECORD ckID: ID; ckSize: LONGINT; baseFrequency: Byte; detune: Byte; lowFrequency: Byte; highFrequency: Byte; lowVelocity: Byte; highVelocity: Byte; gain: INTEGER; sustainLoop: AIFFLoop; releaseLoop: AIFFLoop; END; æC æKY MIDIDataChunk MIDIDataChunkPtr æFp AIFF.p æT RECORD æD MIDIDataChunkPtr = ^MIDIDataChunk; MIDIDataChunk = RECORD ckID: ID; ckSize: LONGINT; MIDIdata: ARRAY [0..0] OF SignedByte; END; æC æKY AudioRecordingChunk AudioRecordingChunkPtr æFp AIFF.p æT RECORD æD AudioRecordingChunkPtr = ^AudioRecordingChunk; AudioRecordingChunk = RECORD ckID: ID; ckSize: LONGINT; AESChannelStatus: ARRAY [0..23] OF SignedByte; END; æC æKY ApplicationSpecificChunk ApplicationSpecificChunkPtr æFp AIFF.p æT RECORD æD ApplicationSpecificChunkPtr = ^ApplicationSpecificChunk; ApplicationSpecificChunk = RECORD ckID: ID; ckSize: LONGINT; applicationSignature: OSType; data: ARRAY [0..0] OF Byte; END; æC æKY Comment æFp AIFF.p æT RECORD æD Comment = RECORD timeStamp: LONGINT; marker: MarkerIdType; count: INTEGER; text: ARRAY [0..0] OF Byte; END; æC æKY CommentsChunk CommentsChunkPtr æFp AIFF.p æT RECORD æD CommentsChunkPtr = ^CommentsChunk; CommentsChunk = RECORD ckID: ID; ckSize: LONGINT; numComments: INTEGER; comments: ARRAY [0..0] OF Comment; END; æC æKY TextChunk TextChunkPtr æFp AIFF.p æT RECORD æD TextChunkPtr = ^TextChunk; TextChunk = RECORD ckID: ID; ckSize: LONGINT; text: ARRAY [0..0] OF Byte; END; æC æKY Aliases.p æKL GetAliasInfo MatchAlias NewAlias NewAliasMinimal NewAliasMinimalFromFullPath ResolveAlias ResolveAliasFile UpdateAlias AliasFilterProcPtr AliasHandle AliasInfoType AliasPtr AliasRecord asiAliasName asiParentName asiServerName asiVolumeName asiZoneName kARMMountVol kARMMultVols kARMNoUI kARMSearch kARMSearchMore kARMSearchRelFirst rAliasType æKY rAliasType æFp Aliases.p æT CONST æD rAliasType = 'alis'; { Aliases are stored as resources of this type } æC æKY kARMMountVol æFp Aliases.p æT CONST æD kARMMountVol = $00000001; { mount the volume automatically } æC æKY kARMNoUI æFp Aliases.p æT CONST æD kARMNoUI = $00000002; { no user interface allowed during resolution } æC æKY kARMMultVols æFp Aliases.p æT CONST æD kARMMultVols = $00000008; { search on multiple volumes } æC æKY kARMSearch æFp Aliases.p æT CONST æD kARMSearch = $00000100; { search quickly } æC æKY kARMSearchMore æFp Aliases.p æT CONST æD kARMSearchMore = $00000200; { search further } æC æKY kARMSearchRelFirst æFp Aliases.p æT CONST æD kARMSearchRelFirst = $00000400; { search target on a relative path first } æC æKY asiZoneName æFp Aliases.p æT CONST æD asiZoneName = -3; { get zone name } æC æKY asiServerName æFp Aliases.p æT CONST æD asiServerName = -2; { get server name } æC æKY asiVolumeName æFp Aliases.p æT CONST æD asiVolumeName = -1; { get volume name } æC æKY asiAliasName æFp Aliases.p æT CONST æD asiAliasName = 0; { get aliased file/folder/volume name } æC æKY asiParentName æFp Aliases.p æT CONST æD asiParentName = 1; { get parent folder name } æC æKY AliasRecord AliasPtr AliasHandle æFp Aliases.p æT RECORD æD AliasPtr = ^AliasRecord; AliasHandle = ^AliasPtr; AliasRecord = RECORD userType: OSType; { appl stored type like creator type } aliasSize: INTEGER; { alias record size in bytes, for appl usage } END; æC æKY AliasInfoType æFp Aliases.p æT TYPE æD AliasInfoType = INTEGER; { alias record information type } æC æKY AliasFilterProcPtr æFp Aliases.p æT TYPE æD AliasFilterProcPtr = ProcPtr; æC æKY NewAlias æFp Aliases.p æT FUNCTION æTN A823 æD FUNCTION NewAlias(fromFile: FSSpecPtr; target: FSSpec; VAR alias: AliasHandle): OSErr; INLINE $7002,$A823; æDT myVariable := NewAlias(fromFile,target,alias); æC æKY NewAliasMinimal æFp Aliases.p æT FUNCTION æTN A823 æD FUNCTION NewAliasMinimal(target: FSSpec; VAR alias: AliasHandle): OSErr; INLINE $7008,$A823; æDT myVariable := NewAliasMinimal(target,alias); æC æKY NewAliasMinimalFromFullPath æFp Aliases.p æT FUNCTION æTN A823 æD FUNCTION NewAliasMinimalFromFullPath(fullPathLength: INTEGER; fullPath: Ptr; zoneName: Str32; serverName: Str31; VAR alias: AliasHandle): OSErr; INLINE $7009,$A823; æDT myVariable := NewAliasMinimalFromFullPath(fullPathLength,fullPath,zoneName,serverName,alias); æC æKY ResolveAlias æFp Aliases.p æT FUNCTION æTN A823 æD FUNCTION ResolveAlias(fromFile: FSSpecPtr; alias: AliasHandle; VAR target: FSSpec; VAR wasChanged: BOOLEAN): OSErr; INLINE $7003,$A823; æDT myVariable := ResolveAlias(fromFile,alias,target,wasChanged); æC æKY GetAliasInfo æFp Aliases.p æT FUNCTION æTN A823 æD FUNCTION GetAliasInfo(alias: AliasHandle; index: AliasInfoType; VAR theString: Str63): OSErr; INLINE $7007,$A823; æDT myVariable := GetAliasInfo(alias,index,theString); æC æKY ResolveAliasFile æFp Aliases.p æT FUNCTION æTN A823 æD FUNCTION ResolveAliasFile(VAR theSpec: FSSpec; resolveAliasChains: BOOLEAN; VAR targetIsFolder: BOOLEAN; VAR wasAliased: BOOLEAN): OSErr; INLINE $700C,$A823; æDT myVariable := ResolveAliasFile(theSpec,resolveAliasChains,targetIsFolder,wasAliased); æC æKY MatchAlias æFp Aliases.p æT FUNCTION æTN A823 æD FUNCTION MatchAlias(fromFile: FSSpecPtr; rulesMask: LONGINT; alias: AliasHandle; VAR aliasCount: INTEGER; aliasList: FSSpecArrayPtr; VAR needsUpdate: BOOLEAN; aliasFilter: AliasFilterProcPtr; yourDataPtr: UNIV Ptr): OSErr; INLINE $7005,$A823; æDT myVariable := MatchAlias(fromFile,rulesMask,alias,aliasCount,aliasList,needsUpdate,aliasFilter,yourDataPtr); æC æKY UpdateAlias æFp Aliases.p æT FUNCTION æTN A823 æD FUNCTION UpdateAlias(fromFile: FSSpecPtr; target: FSSpec; alias: AliasHandle; VAR wasChanged: BOOLEAN): OSErr; INLINE $7006,$A823; æDT myVariable := UpdateAlias(fromFile,target,alias,wasChanged); æC æKY AppleEvents.p æKL AECoerceDesc AECoercePtr AECountItems AECreateAppleEvent AECreateDesc AECreateList AEDeleteItem AEDeleteKeyDesc AEDeleteParam AEDisposeDesc AEDuplicateDesc AEGetArray AEGetAttributeDesc AEGetAttributePtr AEGetCoercionHandler AEGetEventHandler AEGetInteractionAllowed AEGetKeyDesc AEGetKeyPtr AEGetNthDesc AEGetNthPtr AEGetParamDesc AEGetParamPtr AEGetSpecialHandler AEGetTheCurrentEvent AEInstallCoercionHandler AEInstallEventHandler AEInstallSpecialHandler AEInteractWithUser AEProcessAppleEvent AEPutArray AEPutAttributeDesc AEPutAttributePtr AEPutDesc AEPutKeyDesc AEPutKeyPtr AEPutParamDesc AEPutParamPtr AEPutPtr AERemoveCoercionHandler AERemoveEventHandler AERemoveSpecialHandler AEResetTimer AEResumeTheCurrentEvent AESend AESetInteractionAllowed AESetTheCurrentEvent AESizeOfAttribute AESizeOfKeyDesc AESizeOfNthItem AESizeOfParam AESuspendTheCurrentEvent AEAddressDesc AEArrayData AEArrayDataPointer AEArrayType AEDesc AEDescList AEEventClass AEEventID AEEventSource AEInteractAllowed AEKeyDesc AEKeyword AERecord AESendMode AESendPriority AppleEvent DescType errAEBadListItem errAECoercionFail errAECorruptData errAEDescNotFound errAEEventNotHandled errAEHandlerNotFound errAEIllegalIndex errAENewerVersion errAENotAEDesc errAENotAppleEvent errAENotASpecialFunction errAENoUserInteraction errAEParamMissed errAEReplyNotArrived errAEReplyNotValid errAETimeout errAEUnknownAddressType errAEUnknownSendMode errAEWaitCanceled errAEWrongDataType EventFilterProcPtr EventHandlerProcPtr IdleProcPtr kAEAlwaysInteract kAEAnswer kAEApplicationDied kAECanInteract kAECanSwitchLayer kAECreatorType kAEDataArray kAEDefaultTimeout kAEDescArray kAEDirectCall kAEDontReconnect kAEHandleArray kAEHighPriority kAEInteractWithAll kAEInteractWithLocal kAEInteractWithSelf kAEKeyDescArray kAELocalProcess kAENeverInteract kAENoDispatch kAENoReply kAENormalPriority kAEOpenApplication kAEOpenDocuments kAEPackedArray kAEPrintDocuments kAEQueueReply kAEQuitAll kAEQuitApplication kAERemoteProcess kAERestart kAESameProcess kAEShutDown kAEUnknownSource kAEUseStandardDispatch kAEWaitReply kAEWantReceipt kAnyTransactionID kAutoGenerateReturnID kCoreEventClass keyAddressAttr keyDirectObject keyErrorNumber keyErrorString keyEventClassAttr keyEventIDAttr keyEventSourceAttr keyInteractLevelAttr keyMissedKeywordAttr keyOptionalKeywordAttr keyPreDispatch keyProcessSerialNumber keyReturnIDAttr keySelectProc keyTimeoutAttr keyTransactionIDAttr kNoTimeOut typeAEList typeAERecord typeAlias typeApplSignature typeAppParameters typeBoolean typeChar typeComp typeEnumerated typeExtended typeFalse typeFloat typeFSS typeInteger typeKeyword typeLongFloat typeLongInteger typeMagnitude typeNull typeProcessSerialNumber typeProperty typeSectionH typeSessionID typeShortFloat typeShortInteger typeSMFloat typeSMInt typeTargetID typeTrue typeType typeWildCard æKY typeBoolean æFp AppleEvents.p æT CONST æD typeBoolean = 'bool'; æC æKY typeChar æFp AppleEvents.p æT CONST æD typeChar = 'TEXT'; æC æKY typeSMInt æFp AppleEvents.p æT CONST æD typeSMInt = 'shor'; æC æKY typeInteger æFp AppleEvents.p æT CONST æD typeInteger = 'long'; æC æKY typeSMFloat æFp AppleEvents.p æT CONST æD typeSMFloat = 'sing'; æC æKY typeFloat æFp AppleEvents.p æT CONST æD typeFloat = 'doub'; æC æKY typeLongInteger æFp AppleEvents.p æT CONST æD typeLongInteger = 'long'; æC æKY typeShortInteger æFp AppleEvents.p æT CONST æD typeShortInteger = 'shor'; æC æKY typeLongFloat æFp AppleEvents.p æT CONST æD typeLongFloat = 'doub'; æC æKY typeShortFloat æFp AppleEvents.p æT CONST æD typeShortFloat = 'sing'; æC æKY typeExtended æFp AppleEvents.p æT CONST æD typeExtended = 'exte'; æC æKY typeComp æFp AppleEvents.p æT CONST æD typeComp = 'comp'; æC æKY typeMagnitude æFp AppleEvents.p æT CONST æD typeMagnitude = 'magn'; æC æKY typeAEList æFp AppleEvents.p æT CONST æD typeAEList = 'list'; æC æKY typeAERecord æFp AppleEvents.p æT CONST æD typeAERecord = 'reco'; æC æKY typeTrue æFp AppleEvents.p æT CONST æD typeTrue = 'true'; æC æKY typeFalse æFp AppleEvents.p æT CONST æD typeFalse = 'fals'; æC æKY typeAlias æFp AppleEvents.p æT CONST æD typeAlias = 'alis'; æC æKY typeEnumerated æFp AppleEvents.p æT CONST æD typeEnumerated = 'enum'; æC æKY typeType æFp AppleEvents.p æT CONST æD typeType = 'type'; æC æKY typeAppParameters æFp AppleEvents.p æT CONST æD typeAppParameters = 'appa'; æC æKY typeProperty æFp AppleEvents.p æT CONST æD typeProperty = 'prop'; æC æKY typeFSS æFp AppleEvents.p æT CONST æD typeFSS = 'fss '; æC æKY typeKeyword æFp AppleEvents.p æT CONST æD typeKeyword = 'keyw'; æC æKY typeSectionH æFp AppleEvents.p æT CONST æD typeSectionH = 'sect'; æC æKY typeWildCard æFp AppleEvents.p æT CONST æD typeWildCard = '****'; æC æKY typeApplSignature æFp AppleEvents.p æT CONST æD typeApplSignature = 'sign'; æC æKY typeSessionID æFp AppleEvents.p æT CONST æD typeSessionID = 'ssid'; æC æKY typeTargetID æFp AppleEvents.p æT CONST æD typeTargetID = 'targ'; æC æKY typeProcessSerialNumber æFp AppleEvents.p æT CONST æD typeProcessSerialNumber = 'psn '; æC æKY typeNull æFp AppleEvents.p æT CONST æD typeNull = 'null'; {the type of null/nonexistent data} æC æKY kCoreEventClass æFp AppleEvents.p æT CONST æD kCoreEventClass = 'aevt'; æC æKY kAEOpenApplication æFp AppleEvents.p æT CONST æD kAEOpenApplication = 'oapp'; æC æKY kAEOpenDocuments æFp AppleEvents.p æT CONST æD kAEOpenDocuments = 'odoc'; æC æKY kAEPrintDocuments æFp AppleEvents.p æT CONST æD kAEPrintDocuments = 'pdoc'; æC æKY kAEQuitApplication æFp AppleEvents.p æT CONST æD kAEQuitApplication = 'quit'; æC æKY kAECreatorType æFp AppleEvents.p æT CONST æD kAECreatorType = 'crea'; æC æKY kAEQuitAll æFp AppleEvents.p æT CONST æD kAEQuitAll = 'quia'; æC æKY kAEShutDown æFp AppleEvents.p æT CONST æD kAEShutDown = 'shut'; æC æKY kAERestart æFp AppleEvents.p æT CONST æD kAERestart = 'rest'; æC æKY kAEApplicationDied æFp AppleEvents.p æT CONST æD kAEApplicationDied = 'obit'; æC æKY keyProcessSerialNumber æFp AppleEvents.p æT CONST æD keyProcessSerialNumber = 'psn '; æC æKY keyErrorNumber æFp AppleEvents.p æT CONST æD keyErrorNumber = 'errn'; æC æKY keyErrorString æFp AppleEvents.p æT CONST æD keyErrorString = 'errs'; æC æKY kAEAnswer æFp AppleEvents.p æT CONST æD kAEAnswer = 'ansr'; æC æKY keyDirectObject æFp AppleEvents.p æT CONST æD keyDirectObject = '----'; æC æKY keyPreDispatch æFp AppleEvents.p æT CONST æD keyPreDispatch = 'phac'; { PreHandler Accessor Call } æC æKY keySelectProc æFp AppleEvents.p æT CONST æD keySelectProc = 'selh'; { More selector Call } æC æKY keyTransactionIDAttr æFp AppleEvents.p æT CONST æD keyTransactionIDAttr = 'tran'; æC æKY keyReturnIDAttr æFp AppleEvents.p æT CONST æD keyReturnIDAttr = 'rtid'; æC æKY keyEventClassAttr æFp AppleEvents.p æT CONST æD keyEventClassAttr = 'evcl'; æC æKY keyEventIDAttr æFp AppleEvents.p æT CONST æD keyEventIDAttr = 'evid'; æC æKY keyAddressAttr æFp AppleEvents.p æT CONST æD keyAddressAttr = 'addr'; æC æKY keyOptionalKeywordAttr æFp AppleEvents.p æT CONST æD keyOptionalKeywordAttr = 'optk'; æC æKY keyTimeoutAttr æFp AppleEvents.p æT CONST æD keyTimeoutAttr = 'timo'; æC æKY keyInteractLevelAttr æFp AppleEvents.p æT CONST æD keyInteractLevelAttr = 'inte'; {this attribute is read only will be set in AESend} æC æKY keyEventSourceAttr æFp AppleEvents.p æT CONST æD keyEventSourceAttr = 'esrc'; { this attribute is read only } æC æKY keyMissedKeywordAttr æFp AppleEvents.p æT CONST æD keyMissedKeywordAttr = 'miss'; { this attribute is read only } æC æKY kAENoReply æFp AppleEvents.p æT CONST æD kAENoReply = $00000001; { Sender doesn't want a reply to event } æC æKY kAEQueueReply æFp AppleEvents.p æT CONST æD kAEQueueReply = $00000002; { Sender wants a reply but won't wait } æC æKY kAEWaitReply æFp AppleEvents.p æT CONST æD kAEWaitReply = $00000003; { Sender wants a reply and will be waiting } æC æKY kAENeverInteract æFp AppleEvents.p æT CONST æD kAENeverInteract = $00000010; { Server should not interact with user } æC æKY kAECanInteract æFp AppleEvents.p æT CONST æD kAECanInteract = $00000020; { Server may try to interact with user } æC æKY kAEAlwaysInteract æFp AppleEvents.p æT CONST æD kAEAlwaysInteract = $00000030; { Server should always interact with user where appropriate } æC æKY kAECanSwitchLayer æFp AppleEvents.p æT CONST æD kAECanSwitchLayer = $00000040; { Interaction may switch layer } æC æKY kAEDontReconnect æFp AppleEvents.p æT CONST æD kAEDontReconnect = $00000080; { don't reconnect if there is a sessClosedErr from PPCToolbox } æC æKY kAEWantReceipt æFp AppleEvents.p æT CONST æD kAEWantReceipt = nReturnReceipt; { Send wants a receipt of message } æC æKY kAENormalPriority æFp AppleEvents.p æT CONST æD kAENormalPriority = $00000000; { Post message at the end of event queue } æC æKY kAEHighPriority æFp AppleEvents.p æT CONST æD kAEHighPriority = nAttnMsg; { Post message at the front of the event queue } æC æKY kAnyTransactionID æFp AppleEvents.p æT CONST æD kAnyTransactionID = 0; { no transaction is in use } æC æKY kAutoGenerateReturnID æFp AppleEvents.p æT CONST æD kAutoGenerateReturnID = -1; { AECreateAppleEvent will generate a session-unique ID } æC æKY kAEDefaultTimeout æFp AppleEvents.p æT CONST æD kAEDefaultTimeout = -1; { timeout value determined by AEM } æC æKY kNoTimeOut æFp AppleEvents.p æT CONST æD kNoTimeOut = -2; { wait until reply comes back, however long it takes } æC æKY kAENoDispatch æFp AppleEvents.p æT CONST æD kAENoDispatch = 0; æC æKY kAEUseStandardDispatch æFp AppleEvents.p æT CONST æD kAEUseStandardDispatch = -1; æC æKY errAECoercionFail æFp AppleEvents.p æT CONST æD errAECoercionFail = -1700; æC æKY errAEDescNotFound æFp AppleEvents.p æT CONST æD errAEDescNotFound = -1701; æC æKY errAECorruptData æFp AppleEvents.p æT CONST æD errAECorruptData = -1702; æC æKY errAEWrongDataType æFp AppleEvents.p æT CONST æD errAEWrongDataType = -1703; æC æKY errAENotAEDesc æFp AppleEvents.p æT CONST æD errAENotAEDesc = -1704; æC æKY errAEBadListItem æFp AppleEvents.p æT CONST æD errAEBadListItem = -1705; { Specified list item does not exist } æC æKY errAENewerVersion æFp AppleEvents.p æT CONST æD errAENewerVersion = -1706; { Need newer version of AppleEvent Manager } æC æKY errAENotAppleEvent æFp AppleEvents.p æT CONST æD errAENotAppleEvent = -1707; { The event is not in AppleEvent format } æC æKY errAEEventNotHandled æFp AppleEvents.p æT CONST æD errAEEventNotHandled = -1708; { The AppleEvent was not handled by any handler } æC æKY errAEReplyNotValid æFp AppleEvents.p æT CONST æD errAEReplyNotValid = -1709; { AEResetTimer was passed an invalid reply parameter } æC æKY errAEUnknownSendMode æFp AppleEvents.p æT CONST æD errAEUnknownSendMode = -1710; { Mode wasn't NoReply, WaitReply, or QueueReply; or Interaction level is unknown } æC æKY errAEWaitCanceled æFp AppleEvents.p æT CONST æD errAEWaitCanceled = -1711; { In AESend, User cancelled out of wait loop for reply or receipt } æC æKY errAETimeout æFp AppleEvents.p æT CONST æD errAETimeout = -1712; { AppleEvent timed out } æC æKY errAENoUserInteraction æFp AppleEvents.p æT CONST æD errAENoUserInteraction = -1713; { no user interaction allowed } æC æKY errAENotASpecialFunction æFp AppleEvents.p æT CONST æD errAENotASpecialFunction = -1714; { there is no special function with this keyword } æC æKY errAEParamMissed æFp AppleEvents.p æT CONST æD errAEParamMissed = -1715; { a required parameter was not accessed } æC æKY errAEUnknownAddressType æFp AppleEvents.p æT CONST æD errAEUnknownAddressType = -1716; { The target address type is not known } æC æKY errAEHandlerNotFound æFp AppleEvents.p æT CONST æD errAEHandlerNotFound = -1717; { No handler in the dispatch tables fits the parameters to AEGetEventHandler or AEGetCoercionHandler } æC æKY errAEReplyNotArrived æFp AppleEvents.p æT CONST æD errAEReplyNotArrived = -1718; { the contents of the reply you are accessing have not arrived yet } æC æKY errAEIllegalIndex æFp AppleEvents.p æT CONST æD errAEIllegalIndex = -1719; { Index is out of range in a put operation } æC æKY AEKeyword æFp AppleEvents.p æT TYPE æD AEKeyword = PACKED ARRAY [1..4] OF CHAR; æC æKY AEEventClass æFp AppleEvents.p æT TYPE æD AEEventClass = PACKED ARRAY [1..4] OF CHAR; æC æKY AEEventID æFp AppleEvents.p æT TYPE æD AEEventID = PACKED ARRAY [1..4] OF CHAR; æC æKY DescType æFp AppleEvents.p æT TYPE æD DescType = ResType; æC æKY AEDesc æFp AppleEvents.p æT RECORD æD AEDesc = RECORD descriptorType: DescType; dataHandle: Handle; END; æC æKY AEAddressDesc æFp AppleEvents.p æT TYPE æD AEAddressDesc = AEDesc; { an AEDesc which contains addressing data } æC æKY AEDescList æFp AppleEvents.p æT TYPE æD AEDescList = AEDesc; { a list of AEDesc is a special kind of AEDesc } æC æKY AERecord æFp AppleEvents.p æT TYPE æD AERecord = AEDescList; { AERecord is a list of keyworded AEDesc } æC æKY AppleEvent æFp AppleEvents.p æT TYPE æD AppleEvent = AERecord; { an AERecord that contains an AppleEvent } æC æKY AESendMode æFp AppleEvents.p æT TYPE æD AESendMode = LONGINT; { Type of parameter to AESend } æC æKY AESendPriority æFp AppleEvents.p æT TYPE æD AESendPriority = INTEGER; { Type of priority param of AESend } æC æKY AEInteractAllowed kAEInteractWithSelf kAEInteractWithLocal kAEInteractWithAll æFp AppleEvents.p æT TYPE æD AEInteractAllowed = (kAEInteractWithSelf,kAEInteractWithLocal,kAEInteractWithAll); æC æKY AEEventSource kAEUnknownSource kAEDirectCall kAESameProcess kAELocalProcess kAERemoteProcess æFp AppleEvents.p æT TYPE æD AEEventSource = (kAEUnknownSource,kAEDirectCall,kAESameProcess,kAELocalProcess, kAERemoteProcess); æC æKY AEKeyDesc æFp AppleEvents.p æT RECORD æD AEKeyDesc = RECORD descKey: AEKeyword; descContent: AEDesc; END; æC æKY AEArrayType kAEDataArray kAEPackedArray kAEHandleArray kAEDescArray kAEKeyDescArray æFp AppleEvents.p æT TYPE æD AEArrayType = (kAEDataArray,kAEPackedArray,kAEHandleArray,kAEDescArray, kAEKeyDescArray); æC æKY AEArrayData AEArrayDataPointer æFp AppleEvents.p æT RECORD æD AEArrayData = RECORD case AEArrayType OF kAEDataArray: (AEDataArray: Array[0..0] OF Integer); kAEPackedArray: (AEPackedArray: Packed Array[0..0] OF Char); kAEHandleArray: (AEHandleArray: Array[0..0] OF Handle); kAEDescArray: (AEDescArray: Array[0..0] OF AEDesc); kAEKeyDescArray: (AEKeyDescArray: Array[0..0] OF AEKeyDesc); END; AEArrayDataPointer = ^AEArrayData; æC æKY EventHandlerProcPtr æFp AppleEvents.p æT TYPE æD EventHandlerProcPtr = ProcPtr; æC æKY IdleProcPtr æFp AppleEvents.p æT TYPE æD IdleProcPtr = ProcPtr; æC æKY EventFilterProcPtr æFp AppleEvents.p æT TYPE æD EventFilterProcPtr = ProcPtr; æC æKY AECreateDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AECreateDesc(typeCode: DescType; dataPtr: Ptr; dataSize: Size; VAR result: AEDesc): OSErr; INLINE $303C, $0825, $A816; æDT myVariable := AECreateDesc(typeCode,dataPtr,dataSize,result); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AECoercePtr æFp AppleEvents.p æT FUNCTION æD FUNCTION AECoercePtr(typeCode: DescType; dataPtr: Ptr; dataSize: Size; toType: DescType; VAR result: AEDesc): OSErr; INLINE $303C, $0A02, $A816; æDT myVariable := AECoercePtr(typeCode,dataPtr,dataSize,toType,result); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AECoerceDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AECoerceDesc(theAEDesc: AEDesc; toType: DescType; VAR result: AEDesc): OSErr; INLINE $303C, $0603, $A816; æDT myVariable := AECoerceDesc(theAEDesc,toType,result); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEDisposeDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AEDisposeDesc(VAR theAEDesc: AEDesc): OSErr; INLINE $303C, $0204, $A816; æDT myVariable := AEDisposeDesc(theAEDesc); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEDuplicateDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AEDuplicateDesc(theAEDesc: AEDesc;VAR result: AEDesc): OSErr; INLINE $303C, $0405, $A816; æDT myVariable := AEDuplicateDesc(theAEDesc,result); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AECreateList æFp AppleEvents.p æT FUNCTION æD FUNCTION AECreateList(factoringPtr: Ptr; factoredSize: Size; isRecord: BOOLEAN; VAR resultList: AEDescList): OSErr; INLINE $303C, $0706, $A816; æDT myVariable := AECreateList(factoringPtr,factoredSize,isRecord,resultList); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AECountItems æFp AppleEvents.p æT FUNCTION æD FUNCTION AECountItems(theAEDescList: AEDescList; VAR theCount: LONGINT): OSErr; INLINE $303C, $0407, $A816; æDT myVariable := AECountItems(theAEDescList,theCount); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEPutPtr æFp AppleEvents.p æT FUNCTION æD FUNCTION AEPutPtr(theAEDescList: AEDescList; index: LONGINT; typeCode: DescType; dataPtr: Ptr; dataSize: Size): OSErr; INLINE $303C, $0A08, $A816; æDT myVariable := AEPutPtr(theAEDescList,index,typeCode,dataPtr,dataSize); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEPutDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AEPutDesc(theAEDescList: AEDescList; index: LONGINT; theAEDesc: AEDesc): OSErr; INLINE $303C, $0609, $A816; æDT myVariable := AEPutDesc(theAEDescList,index,theAEDesc); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetNthPtr æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetNthPtr(theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; VAR theAEKeyword: AEKeyword; VAR typeCode: DescType; dataPtr: Ptr; maximumSize: Size; VAR actualSize: Size): OSErr; INLINE $303C, $100A, $A816; æDT myVariable := AEGetNthPtr(theAEDescList,index,desiredType,theAEKeyword,typeCode,dataPtr,maximumSize,actualSize); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetNthDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetNthDesc(theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; VAR theAEKeyword: AEKeyword; VAR result: AEDesc): OSErr; INLINE $303C, $0A0B, $A816; æDT myVariable := AEGetNthDesc(theAEDescList,index,desiredType,theAEKeyword,result); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AESizeOfNthItem æFp AppleEvents.p æT FUNCTION æD FUNCTION AESizeOfNthItem(theAEDescList: AEDescList; index: LONGINT; VAR typeCode: DescType; VAR dataSize: Size): OSErr; INLINE $303C, $082A, $A816; æDT myVariable := AESizeOfNthItem(theAEDescList,index,typeCode,dataSize); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetArray æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetArray(theAEDescList: AEDescList; arrayType: AEArrayType; arrayPtr: AEArrayDataPointer; maximumSize: Size; VAR itemType: DescType; VAR itemSize: Size; VAR itemCount: LONGINT): OSErr; INLINE $303C, $0D0C, $A816; æDT myVariable := AEGetArray(theAEDescList,arrayType,arrayPtr,maximumSize,itemType,itemSize,itemCount); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEPutArray æFp AppleEvents.p æT FUNCTION æD FUNCTION AEPutArray(theAEDescList: AEDescList; arrayType: AEArrayType; arrayPtr: AEArrayDataPointer; itemType: DescType; itemSize: Size; itemCount: LONGINT): OSErr; INLINE $303C, $0B0D, $A816; æDT myVariable := AEPutArray(theAEDescList,arrayType,arrayPtr,itemType,itemSize,itemCount); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEDeleteItem æFp AppleEvents.p æT FUNCTION æD FUNCTION AEDeleteItem(theAEDescList: AEDescList; index: LONGINT): OSErr; INLINE $303C, $040E, $A816; æDT myVariable := AEDeleteItem(theAEDescList,index); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEPutKeyPtr æFp AppleEvents.p æT FUNCTION æD FUNCTION AEPutKeyPtr(theAERecord: AERecord; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: Ptr; dataSize: Size): OSErr; INLINE $303C, $0A0F, $A816; æDT myVariable := AEPutKeyPtr(theAERecord,theAEKeyword,typeCode,dataPtr,dataSize); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEPutKeyDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AEPutKeyDesc(theAERecord: AERecord; theAEKeyword: AEKeyword; theAEDesc: AEDesc): OSErr; INLINE $303C, $0610, $A816; æDT myVariable := AEPutKeyDesc(theAERecord,theAEKeyword,theAEDesc); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetKeyPtr æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetKeyPtr(theAERecord: AERecord; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: Ptr; maximumSize: Size; VAR actualSize: Size): OSErr; INLINE $303C, $0E11, $A816; æDT myVariable := AEGetKeyPtr(theAERecord,theAEKeyword,desiredType,typeCode,dataPtr,maximumSize,actualSize); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetKeyDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetKeyDesc(theAERecord: AERecord; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr; INLINE $303C, $0812, $A816; æDT myVariable := AEGetKeyDesc(theAERecord,theAEKeyword,desiredType,result); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AESizeOfKeyDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AESizeOfKeyDesc(theAERecord: AERecord; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr; INLINE $303C, $0829, $A816; æDT myVariable := AESizeOfKeyDesc(theAERecord,theAEKeyword,typeCode,dataSize); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEDeleteKeyDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AEDeleteKeyDesc(theAERecord: AERecord; theAEKeyword: AEKeyword): OSErr; INLINE $303C, $0413, $A816; æDT myVariable := AEDeleteKeyDesc(theAERecord,theAEKeyword); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEPutParamPtr æFp AppleEvents.p æT FUNCTION æD FUNCTION AEPutParamPtr(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: Ptr; dataSize: Size): OSErr; INLINE $303C,$0A0F,$A816; æDT myVariable := AEPutParamPtr(theAppleEvent,theAEKeyword,typeCode,dataPtr,dataSize); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEPutParamDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AEPutParamDesc(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; theAEDesc: AEDesc): OSErr; INLINE $303C,$0610,$A816; æDT myVariable := AEPutParamDesc(theAppleEvent,theAEKeyword,theAEDesc); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetParamPtr æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetParamPtr(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: Ptr; maximumSize: Size; VAR actualSize: Size): OSErr; INLINE $303C,$0E11,$A816; æDT myVariable := AEGetParamPtr(theAppleEvent,theAEKeyword,desiredType,typeCode,dataPtr,maximumSize,actualSize); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetParamDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetParamDesc(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr; INLINE $303C,$0812,$A816; æDT myVariable := AEGetParamDesc(theAppleEvent,theAEKeyword,desiredType,result); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AESizeOfParam æFp AppleEvents.p æT FUNCTION æD FUNCTION AESizeOfParam(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr; INLINE $303C,$0829,$A816; æDT myVariable := AESizeOfParam(theAppleEvent,theAEKeyword,typeCode,dataSize); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEDeleteParam æFp AppleEvents.p æT FUNCTION æD FUNCTION AEDeleteParam(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword): OSErr; INLINE $303C,$0413,$A816; æDT myVariable := AEDeleteParam(theAppleEvent,theAEKeyword); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetAttributePtr æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetAttributePtr(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: Ptr; maximumSize: Size; VAR actualSize: Size): OSErr; INLINE $303C,$0E15,$A816; æDT myVariable := AEGetAttributePtr(theAppleEvent,theAEKeyword,desiredType,typeCode,dataPtr,maximumSize,actualSize); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetAttributeDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetAttributeDesc(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr; INLINE $303C,$0826,$A816; æDT myVariable := AEGetAttributeDesc(theAppleEvent,theAEKeyword,desiredType,result); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AESizeOfAttribute æFp AppleEvents.p æT FUNCTION æD FUNCTION AESizeOfAttribute(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr; INLINE $303C,$0828,$A816; æDT myVariable := AESizeOfAttribute(theAppleEvent,theAEKeyword,typeCode,dataSize); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEPutAttributePtr æFp AppleEvents.p æT FUNCTION æD FUNCTION AEPutAttributePtr(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: Ptr; dataSize: Size): OSErr; INLINE $303C,$0A16,$A816; æDT myVariable := AEPutAttributePtr(theAppleEvent,theAEKeyword,typeCode,dataPtr,dataSize); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEPutAttributeDesc æFp AppleEvents.p æT FUNCTION æD FUNCTION AEPutAttributeDesc(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; theAEDesc: AEDesc): OSErr; INLINE $303C,$0627,$A816; æDT myVariable := AEPutAttributeDesc(theAppleEvent,theAEKeyword,theAEDesc); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AECreateAppleEvent æFp AppleEvents.p æT FUNCTION æD FUNCTION AECreateAppleEvent(theAEEventClass: AEEventClass; theAEEventID: AEEventID; target: AEAddressDesc; returnID: INTEGER; transactionID: LONGINT; VAR result: AppleEvent): OSErr; INLINE $303C,$0B14,$A816; æDT myVariable := AECreateAppleEvent(theAEEventClass,theAEEventID,target,returnID,transactionID,result); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AESend æFp AppleEvents.p æT FUNCTION æD FUNCTION AESend(theAppleEvent: AppleEvent; VAR reply: AppleEvent; sendMode: AESendMode; sendPriority: AESendPriority; timeOutInTicks: LONGINT; idleProc: IdleProcPtr; filterProc: EventFilterProcPtr): OSErr; INLINE $303C,$0D17,$A816; æDT myVariable := AESend(theAppleEvent,reply,sendMode,sendPriority,timeOutInTicks,idleProc,filterProc); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEProcessAppleEvent æFp AppleEvents.p æT FUNCTION æD FUNCTION AEProcessAppleEvent(theEventRecord: EventRecord): OSErr; INLINE $303C,$021B,$A816; æDT myVariable := AEProcessAppleEvent(theEventRecord); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEResetTimer æFp AppleEvents.p æT FUNCTION æD FUNCTION AEResetTimer(reply: AppleEvent): OSErr; INLINE $303C,$0219,$A816; æDT myVariable := AEResetTimer(reply); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AESuspendTheCurrentEvent æFp AppleEvents.p æT FUNCTION æD FUNCTION AESuspendTheCurrentEvent(theAppleEvent: AppleEvent): OSErr; INLINE $303C,$022B,$A816; æDT myVariable := AESuspendTheCurrentEvent(theAppleEvent); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEResumeTheCurrentEvent æFp AppleEvents.p æT FUNCTION æD FUNCTION AEResumeTheCurrentEvent(theAppleEvent: AppleEvent; reply: AppleEvent; dispatcher: EventHandlerProcPtr; handlerRefcon: LONGINT): OSErr; INLINE $303C,$0818,$A816; æDT myVariable := AEResumeTheCurrentEvent(theAppleEvent,reply,dispatcher,handlerRefcon); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetTheCurrentEvent æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetTheCurrentEvent(VAR theAppleEvent: AppleEvent): OSErr; INLINE $303C,$021A,$A816; æDT myVariable := AEGetTheCurrentEvent(theAppleEvent); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AESetTheCurrentEvent æFp AppleEvents.p æT FUNCTION æD FUNCTION AESetTheCurrentEvent(theAppleEvent: AppleEvent): OSErr; INLINE $303C,$022C,$A816; æDT myVariable := AESetTheCurrentEvent(theAppleEvent); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetInteractionAllowed æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetInteractionAllowed(VAR level: AEInteractAllowed): OSErr; INLINE $303C,$021D,$A816; æDT myVariable := AEGetInteractionAllowed(level); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AESetInteractionAllowed æFp AppleEvents.p æT FUNCTION æD FUNCTION AESetInteractionAllowed(level: AEInteractAllowed): OSErr; INLINE $303C,$011E,$A816; æDT myVariable := AESetInteractionAllowed(level); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEInteractWithUser æFp AppleEvents.p æT FUNCTION æD FUNCTION AEInteractWithUser(timeOutInTicks: LONGINT; nmReqPtr: NMRecPtr; idleProc: IdleProcPtr): OSErr; INLINE $303C,$061C,$A816; æDT myVariable := AEInteractWithUser(timeOutInTicks,nmReqPtr,idleProc); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEInstallEventHandler æFp AppleEvents.p æT FUNCTION æD FUNCTION AEInstallEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: EventHandlerProcPtr; handlerRefcon: LONGINT; isSysHandler: BOOLEAN): OSErr; INLINE $303C,$091F,$A816; æDT myVariable := AEInstallEventHandler(theAEEventClass,theAEEventID,handler,handlerRefcon,isSysHandler); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AERemoveEventHandler æFp AppleEvents.p æT FUNCTION æD FUNCTION AERemoveEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: EventHandlerProcPtr; isSysHandler: BOOLEAN): OSErr; INLINE $303C,$0720,$A816; æDT myVariable := AERemoveEventHandler(theAEEventClass,theAEEventID,handler,isSysHandler); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetEventHandler æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; VAR handler: EventHandlerProcPtr; VAR handlerRefcon: LONGINT; isSysHandler: BOOLEAN): OSErr; INLINE $303C,$0921,$A816; æDT myVariable := AEGetEventHandler(theAEEventClass,theAEEventID,handler,handlerRefcon,isSysHandler); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEInstallCoercionHandler æFp AppleEvents.p æT FUNCTION æD FUNCTION AEInstallCoercionHandler(fromType: DescType; toType: DescType; handler: ProcPtr; handlerRefcon: LONGINT; fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): OSErr; INLINE $303C, $0A22, $A816; æDT myVariable := AEInstallCoercionHandler(fromType,toType,handler,handlerRefcon,fromTypeIsDesc,isSysHandler); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AERemoveCoercionHandler æFp AppleEvents.p æT FUNCTION æD FUNCTION AERemoveCoercionHandler(fromType: DescType; toType: DescType; handler: ProcPtr; isSysHandler: BOOLEAN): OSErr; INLINE $303C, $0723, $A816; æDT myVariable := AERemoveCoercionHandler(fromType,toType,handler,isSysHandler); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetCoercionHandler æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetCoercionHandler(fromType: DescType; toType: DescType; VAR handler: ProcPtr; VAR handlerRefcon: LONGINT; VAR fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): OSErr; INLINE $303C, $0B24, $A816; æDT myVariable := AEGetCoercionHandler(fromType,toType,handler,handlerRefcon,fromTypeIsDesc,isSysHandler); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEInstallSpecialHandler æFp AppleEvents.p æT FUNCTION æD FUNCTION AEInstallSpecialHandler(functionClass: AEKeyword; handler: ProcPtr; isSysHandler: BOOLEAN): OSErr; INLINE $303C, $0500, $A816; æDT myVariable := AEInstallSpecialHandler(functionClass,handler,isSysHandler); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AERemoveSpecialHandler æFp AppleEvents.p æT FUNCTION æD FUNCTION AERemoveSpecialHandler(functionClass: AEKeyword; handler: ProcPtr; isSysHandler: BOOLEAN): OSErr; INLINE $303C, $0501, $A816; æDT myVariable := AERemoveSpecialHandler(functionClass,handler,isSysHandler); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AEGetSpecialHandler æFp AppleEvents.p æT FUNCTION æD FUNCTION AEGetSpecialHandler(functionClass: AEKeyword; VAR handler: ProcPtr; isSysHandler: BOOLEAN): OSErr; INLINE $303C, $052D, $A816; æDT myVariable := AEGetSpecialHandler(functionClass,handler,isSysHandler); æC FUNCTION StringWidth (s: Str255 ) : INTEGER; StringWidth returns the width of the given text string, which it calculates by adding the CharWidths of all the characters in the string (see above). This value will be added to the pen horizontal coordinate if the specified string is drawn. æKY AppleTalk.p æKL AFPCommand ASPAbortOS ASPCloseAll ASPCloseSession ASPGetParms ASPGetStatus ASPOpenSession ASPUserCommand ASPUserWrite ATEvent ATPAddRsp ATPCloseSocket ATPGetRequest ATPKillAllGetReq ATPLoad ATPOpenSocket ATPreFlightEvent ATPReqCancel ATPRequest ATPResponse ATPRspCancel ATPSndRequest ATPSndRsp ATPUnload BuildBDS BuildDDPwds BuildLAPwds DDPCloseSocket DDPOpenSocket DDPRdCancel DDPRead DDPWrite GetBridgeAddress GetLocalZones GetMyZone GetNodeAddress GetZoneList IsATPOpen IsMPPOpen LAPAddATQ LAPCloseProtocol LAPOpenProtocol LAPRdCancel LAPRead LAPRmvATQ LAPWrite MPPClose MPPOpen NBPConfirm NBPExtract NBPLoad NBPLookup NBPRegister NBPRemove NBPSetEntity NBPSetNTE NBPUnload OpenXPP PAddResponse PATalkClosePrep PAttachPH PCloseATPSkt PCloseSkt PConfirmName PDetachPH PGetAppleTalkInfo PGetRequest PKillGetReq PKillNBP PKillSendReq PLookupName PNSendRequest POpenATPSkt POpenSkt PRegisterName PRelRspCB PRelTCB PRemoveName PSendRequest PSendResponse PSetSelfSend PWriteDDP PWriteLAP ABByte ABCallType abortOS ABProtoType ABRecHandle ABRecPtr ABusRecord AddrBlock addResponse afpAddAPPL afpAddCmt afpAddIcon afpByteRangeLock afpCall AFPCommandBlock afpContLogin afpCopyFile afpDelete afpDirClose afpDirCreate afpDTClose afpDTOpen afpEnumerate afpFileCreate afpFlush afpForkClose afpForkFlush afpGetAPPL afpGetCmt afpGetDirParms afpGetFileParms afpGetFlDrParms afpGetForkParms afpGetIcon afpGetSInfo afpGetSParms afpGetVolParms afpGtIcnInfo afpLogin afpLogout afpMapID afpMapName afpMove afpOpenDir afpOpenFork afpOpenVol afpRead afpRename afpRmvAPPL afpRmvCmt afpSetDirParms afpSetFileParms afpSetFlDrParms afpSetForkParms afpSetVolParms afpVolClose afpWrite ATalkClosePrep atpEOMvalue ATPParamBlock ATPPBPtr atpProto atpRefNum atpSendChkvalue atpSize atpSTSvalue atpTIDValidvalue atpUnitNum atpXOvalue ATQEntry ATQEntryPtr attachPH ATTransCancelClose ATTransClose ATTransClosePrep ATTransOpen BDSElement BDSPtr BDSType BitMapType closeAll closeATPSkt closeSess closeSkt confirmName ddpProto ddpSize detachPH EntityName EntityPtr GetATalkInfo getParms getRequest getStatus killAllGetReq killGetReq killNBP killSendReq LAddAEQ LAPAdrBlock LAPMgrCall LAPMgrPtr lapProto lapSize lastResident loadNBP lookupName lookupReply LRmvAEQ MPPParamBlock MPPParmType MPPPBPtr mppRefNum mppUnitNum NamesTableEntry nbpProto nbpSize nSendRequest openATPSkt openSess openSkt registerName relRspCB relTCB removeName RetransType scbMemSize sendRequest sendResponse SetMyZone setSelfSend tATPAddRsp tATPGetRequest tATPRequest tATPResponse tATPSdRsp tATPSndRequest tDDPRead tDDPWrite tLAPRead tLAPWrite tNBPConfirm tNBPLookup tNBPRegister unloadNBP userCommand userWrite WDSElement writeDDP writeLAP xCall XPPEndPrmType xppFlagClr xppFlagSet xppLoadedBit XPPParamBlock XPPParmBlkPtr XPPPrmBlkType xppRefNum XPPSubPrmType xppUnitNum zipGetLocalZones zipGetMyZone zipGetZoneList æKY mppUnitNum æFp AppleTalk.p æT CONST æD mppUnitNum = 9; {MPP unit number} æC æKY atpUnitNum æFp AppleTalk.p æT CONST æD atpUnitNum = 10; { ATP unit number } æC æKY xppUnitNum æFp AppleTalk.p æT CONST æD xppUnitNum = 40; { XPP unit number } æC æKY mppRefNum æFp AppleTalk.p æT CONST æD mppRefNum = -10; {MPP reference number } æC æKY atpRefNum æFp AppleTalk.p æT CONST æD atpRefNum = -11; { ATP reference number } æC æKY xppRefNum æFp AppleTalk.p æT CONST æD xppRefNum = -41; { XPP reference number } æC æKY lookupReply æFp AppleTalk.p æT CONST æD lookupReply = 242; { This command queued to ourself } æC æKY writeLAP æFp AppleTalk.p æT CONST æD writeLAP = 243; { Write out LAP packet } æC æKY detachPH æFp AppleTalk.p æT CONST æD detachPH = 244; { Detach LAP protocol handler } æC æKY attachPH æFp AppleTalk.p æT CONST æD attachPH = 245; { Attach LAP protocol handler } æC æKY writeDDP æFp AppleTalk.p æT CONST æD writeDDP = 246; { Write out DDP packet } æC æKY closeSkt æFp AppleTalk.p æT CONST æD closeSkt = 247; { Close DDP socket } æC æKY openSkt æFp AppleTalk.p æT CONST æD openSkt = 248; { Open DDP socket } æC æKY loadNBP æFp AppleTalk.p æT CONST æD loadNBP = 249; { Load NBP command-executing code } æC æKY lastResident æFp AppleTalk.p æT CONST æD lastResident = 249; { Last resident command } æC æKY confirmName æFp AppleTalk.p æT CONST æD confirmName = 250; { Confirm name } æC æKY lookupName æFp AppleTalk.p æT CONST æD lookupName = 251; { Look up name on internet } æC æKY removeName æFp AppleTalk.p æT CONST æD removeName = 252; { Remove name from Names Table } æC æKY registerName æFp AppleTalk.p æT CONST æD registerName = 253; { Register name in Names Table } æC æKY killNBP æFp AppleTalk.p æT CONST æD killNBP = 254; { Kill outstanding NBP request } æC æKY unloadNBP æFp AppleTalk.p æT CONST æD unloadNBP = 255; { Unload NBP command code } æC æKY setSelfSend æFp AppleTalk.p æT CONST æD setSelfSend = 256; { MPP: Set to allow writes to self } æC æKY SetMyZone æFp AppleTalk.p æT CONST æD SetMyZone = 257; { Set my zone name } æC æKY GetATalkInfo æFp AppleTalk.p æT CONST æD GetATalkInfo = 258; { get AppleTalk information } æC æKY ATalkClosePrep æFp AppleTalk.p æT CONST æD ATalkClosePrep = 259; { AppleTalk close query } æC æKY nSendRequest æFp AppleTalk.p æT CONST æD nSendRequest = 248; { NSendRequest code } æC æKY relRspCB æFp AppleTalk.p æT CONST æD relRspCB = 249; { Release RspCB } æC æKY closeATPSkt æFp AppleTalk.p æT CONST æD closeATPSkt = 250; { Close ATP socket } æC æKY addResponse æFp AppleTalk.p æT CONST æD addResponse = 251; { Add response code | Require open skt } æC æKY sendResponse æFp AppleTalk.p æT CONST æD sendResponse = 252; { Send response code } æC æKY getRequest æFp AppleTalk.p æT CONST æD getRequest = 253; { Get request code } æC æKY openATPSkt æFp AppleTalk.p æT CONST æD openATPSkt = 254; { Open ATP socket } æC æKY sendRequest æFp AppleTalk.p æT CONST æD sendRequest = 255; { Send request code } æC æKY relTCB æFp AppleTalk.p æT CONST æD relTCB = 256; { Release TCB } æC æKY killGetReq æFp AppleTalk.p æT CONST æD killGetReq = 257; { Kill GetRequest } æC æKY killSendReq æFp AppleTalk.p æT CONST æD killSendReq = 258; { Kill SendRequest } æC æKY killAllGetReq æFp AppleTalk.p æT CONST æD killAllGetReq = 259; { Kill all getRequests for a skt } æC æKY openSess æFp AppleTalk.p æT CONST æD openSess = 255; { Open session } æC æKY closeSess æFp AppleTalk.p æT CONST æD closeSess = 254; { Close session } æC æKY userCommand æFp AppleTalk.p æT CONST æD userCommand = 253; { User command } æC æKY userWrite æFp AppleTalk.p æT CONST æD userWrite = 252; { User write } æC æKY getStatus æFp AppleTalk.p æT CONST æD getStatus = 251; { Get status } æC æKY afpCall æFp AppleTalk.p æT CONST æD afpCall = 250; { AFP command (buffer has command code) } æC æKY getParms æFp AppleTalk.p æT CONST æD getParms = 249; { Get parameters } æC æKY abortOS æFp AppleTalk.p æT CONST æD abortOS = 248; { Abort open session request } æC æKY closeAll æFp AppleTalk.p æT CONST æD closeAll = 247; { Close all open sessions } æC æKY xCall æFp AppleTalk.p æT CONST æD xCall = 246; { .XPP extended calls } æC æKY ATTransOpen æFp AppleTalk.p æT CONST æD ATTransOpen = 0; {AppleTalk has opened} æC æKY ATTransClose æFp AppleTalk.p æT CONST æD ATTransClose = 2; {AppleTalk is about to close} æC æKY ATTransClosePrep æFp AppleTalk.p æT CONST æD ATTransClosePrep = 3; {Is it OK to close AppleTalk ?} æC æKY ATTransCancelClose æFp AppleTalk.p æT CONST æD ATTransCancelClose = 4; {Cancel the ClosePrep transition} æC æKY afpByteRangeLock æFp AppleTalk.p æT CONST æD afpByteRangeLock = 1; {AFPCall command codes} æC æKY afpVolClose æFp AppleTalk.p æT CONST æD afpVolClose = 2; {AFPCall command codes} æC æKY afpDirClose æFp AppleTalk.p æT CONST æD afpDirClose = 3; {AFPCall command codes} æC æKY afpForkClose æFp AppleTalk.p æT CONST æD afpForkClose = 4; {AFPCall command codes} æC æKY afpCopyFile æFp AppleTalk.p æT CONST æD afpCopyFile = 5; {AFPCall command codes} æC æKY afpDirCreate æFp AppleTalk.p æT CONST æD afpDirCreate = 6; {AFPCall command codes} æC æKY afpFileCreate æFp AppleTalk.p æT CONST æD afpFileCreate = 7; {AFPCall command codes} æC æKY afpDelete æFp AppleTalk.p æT CONST æD afpDelete = 8; {AFPCall command codes} æC æKY afpEnumerate æFp AppleTalk.p æT CONST æD afpEnumerate = 9; {AFPCall command codes} æC æKY afpFlush æFp AppleTalk.p æT CONST æD afpFlush = 10; {AFPCall command codes} æC æKY afpForkFlush æFp AppleTalk.p æT CONST æD afpForkFlush = 11; {AFPCall command codes} æC æKY afpGetDirParms æFp AppleTalk.p æT CONST æD afpGetDirParms = 12; {AFPCall command codes} æC æKY afpGetFileParms æFp AppleTalk.p æT CONST æD afpGetFileParms = 13; {AFPCall command codes} æC æKY afpGetForkParms æFp AppleTalk.p æT CONST æD afpGetForkParms = 14; {AFPCall command codes} æC æKY afpGetSInfo æFp AppleTalk.p æT CONST æD afpGetSInfo = 15; {AFPCall command codes} æC æKY afpGetSParms æFp AppleTalk.p æT CONST æD afpGetSParms = 16; {AFPCall command codes} æC æKY afpGetVolParms æFp AppleTalk.p æT CONST æD afpGetVolParms = 17; {AFPCall command codes} æC æKY afpLogin æFp AppleTalk.p æT CONST æD afpLogin = 18; {AFPCall command codes} æC æKY afpContLogin æFp AppleTalk.p æT CONST æD afpContLogin = 19; {AFPCall command codes} æC æKY afpLogout æFp AppleTalk.p æT CONST æD afpLogout = 20; {AFPCall command codes} æC æKY afpMapID æFp AppleTalk.p æT CONST æD afpMapID = 21; {AFPCall command codes} æC æKY afpMapName æFp AppleTalk.p æT CONST æD afpMapName = 22; {AFPCall command codes} æC æKY afpMove æFp AppleTalk.p æT CONST æD afpMove = 23; {AFPCall command codes} æC æKY afpOpenVol æFp AppleTalk.p æT CONST æD afpOpenVol = 24; {AFPCall command codes} æC æKY afpOpenDir æFp AppleTalk.p æT CONST æD afpOpenDir = 25; {AFPCall command codes} æC æKY afpOpenFork æFp AppleTalk.p æT CONST æD afpOpenFork = 26; {AFPCall command codes} æC æKY afpRead æFp AppleTalk.p æT CONST æD afpRead = 27; {AFPCall command codes} æC æKY afpRename æFp AppleTalk.p æT CONST æD afpRename = 28; {AFPCall command codes} æC æKY afpSetDirParms æFp AppleTalk.p æT CONST æD afpSetDirParms = 29; {AFPCall command codes} æC æKY afpSetFileParms æFp AppleTalk.p æT CONST æD afpSetFileParms = 30; {AFPCall command codes} æC æKY afpSetForkParms æFp AppleTalk.p æT CONST æD afpSetForkParms = 31; {AFPCall command codes} æC æKY afpSetVolParms æFp AppleTalk.p æT CONST æD afpSetVolParms = 32; {AFPCall command codes} æC æKY afpWrite æFp AppleTalk.p æT CONST æD afpWrite = 33; {AFPCall command codes} æC æKY afpGetFlDrParms æFp AppleTalk.p æT CONST æD afpGetFlDrParms = 34; {AFPCall command codes} æC æKY afpSetFlDrParms æFp AppleTalk.p æT CONST æD afpSetFlDrParms = 35; {AFPCall command codes} æC æKY afpDTOpen æFp AppleTalk.p æT CONST æD afpDTOpen = 48; {AFPCall command codes} æC æKY afpDTClose æFp AppleTalk.p æT CONST æD afpDTClose = 49; {AFPCall command codes} æC æKY afpGetIcon æFp AppleTalk.p æT CONST æD afpGetIcon = 51; {AFPCall command codes} æC æKY afpGtIcnInfo æFp AppleTalk.p æT CONST æD afpGtIcnInfo = 52; {AFPCall command codes} æC æKY afpAddAPPL æFp AppleTalk.p æT CONST æD afpAddAPPL = 53; {AFPCall command codes} æC æKY afpRmvAPPL æFp AppleTalk.p æT CONST æD afpRmvAPPL = 54; {AFPCall command codes} æC æKY afpGetAPPL æFp AppleTalk.p æT CONST æD afpGetAPPL = 55; {AFPCall command codes} æC æKY afpAddCmt æFp AppleTalk.p æT CONST æD afpAddCmt = 56; {AFPCall command codes} æC æKY afpRmvCmt æFp AppleTalk.p æT CONST æD afpRmvCmt = 57; {AFPCall command codes} æC æKY afpGetCmt æFp AppleTalk.p æT CONST æD afpGetCmt = 58; {AFPCall command codes} æC æKY afpAddIcon æFp AppleTalk.p æT CONST æD afpAddIcon = 192; {Special code for ASP Write commands} æC æKY xppLoadedBit æFp AppleTalk.p æT CONST æD xppLoadedBit = 5; { XPP bit in PortBUse } æC æKY scbMemSize æFp AppleTalk.p æT CONST æD scbMemSize = 192; {Size of memory for SCB } æC æKY xppFlagClr æFp AppleTalk.p æT CONST æD xppFlagClr = 0; {Cs for AFPCommandBlock } æC æKY xppFlagSet æFp AppleTalk.p æT CONST æD xppFlagSet = 128; {StartEndFlag & NewLineFlag fields. } æC æKY lapSize æFp AppleTalk.p æT CONST æD lapSize = 20; æC æKY ddpSize æFp AppleTalk.p æT CONST æD ddpSize = 26; æC æKY nbpSize æFp AppleTalk.p æT CONST æD nbpSize = 26; æC æKY atpSize æFp AppleTalk.p æT CONST æD atpSize = 56; æC æKY atpXOvalue æFp AppleTalk.p æT CONST æD atpXOvalue = 32; {ATP exactly-once bit } æC æKY atpEOMvalue æFp AppleTalk.p æT CONST æD atpEOMvalue = 16; {ATP End-Of-Message bit } æC æKY atpSTSvalue æFp AppleTalk.p æT CONST æD atpSTSvalue = 8; {ATP Send-Transmission-Status bit } æC æKY atpTIDValidvalue æFp AppleTalk.p æT CONST æD atpTIDValidvalue = 2; {ATP trans. ID valid bit } æC æKY atpSendChkvalue æFp AppleTalk.p æT CONST æD atpSendChkvalue = 1; {ATP send checksum bit } æC æKY zipGetLocalZones æFp AppleTalk.p æT CONST æD zipGetLocalZones = 5; æC æKY zipGetZoneList æFp AppleTalk.p æT CONST æD zipGetZoneList = 6; æC æKY zipGetMyZone æFp AppleTalk.p æT CONST æD zipGetMyZone = 7; æC æKY LAPMgrPtr æFp AppleTalk.p æT CONST æD LAPMgrPtr = $B18; {Entry point for LAP Manager} æC æKY LAPMgrCall æFp AppleTalk.p æT CONST æD LAPMgrCall = 2; {Offset to LAP routines} æC æKY LAddAEQ æFp AppleTalk.p æT CONST æD LAddAEQ = 23; {LAPAddATQ routine selector} æC æKY LRmvAEQ æFp AppleTalk.p æT CONST æD LRmvAEQ = 24; {LAPRmvATQ routine selector} æC æKY ABCallType tLAPRead tLAPWrite tDDPRead tDDPWrite tNBPLookup tNBPConfirm tNBPRegister tATPSndRequest tATPGetRequest tATPSdRsp tATPAddRsp tATPRequest tATPResponse æFp AppleTalk.p æT TYPE æD ABCallType = (tLAPRead,tLAPWrite,tDDPRead,tDDPWrite,tNBPLookup,tNBPConfirm, tNBPRegister,tATPSndRequest,tATPGetRequest,tATPSdRsp,tATPAddRsp,tATPRequest, tATPResponse); æC æKY ABProtoType lapProto ddpProto nbpProto atpProto æFp AppleTalk.p æT TYPE æD ABProtoType = (lapProto,ddpProto,nbpProto,atpProto); æC æKY ABByte æFp AppleTalk.p æT TYPE æD ABByte=1..127; æC æKY LAPAdrBlock æFp AppleTalk.p æT RECORD æD LAPAdrBlock = PACKED RECORD dstNodeID: Byte; srcNodeID: Byte; lapProtType: ABByte; END; æC æKY ATQEntry ATQEntryPtr æFp AppleTalk.p æT RECORD æD ATQEntryPtr = ^ATQEntry; ATQEntry = RECORD qLink: ATQEntryPtr; {next queue entry} qType: INTEGER; {queue type} CallAddr: ProcPtr; {pointer to your routine} END; æC æKY AddrBlock æFp AppleTalk.p æT RECORD æD AddrBlock = PACKED RECORD aNet: INTEGER; aNode: Byte; aSocket: Byte; END; æC æKY EntityName EntityPtr æFp AppleTalk.p æT RECORD æD EntityPtr = ^EntityName; EntityName = RECORD objStr: Str32; typeStr: Str32; zoneStr: Str32; END; æC { Real definition of EntityName is 3 PACKED strings of any length (32 is just an example). No offsets for Asm since each String address must be calculated by adding length byte to last string ptr. In Pascal, String(32) will be 34 bytes long since fields never start on an odd byte unless they are only a byte long. So this will generate correct looking interfaces for Pascal and C, but they will not be the same, which is OK since they are not used. } æKY RetransType æFp AppleTalk.p æT RECORD æD RetransType = PACKED RECORD retransInterval: Byte; retransCount: Byte; END; æC æKY BDSElement æFp AppleTalk.p æT RECORD æD BDSElement = RECORD buffSize: INTEGER; buffPtr: Ptr; dataSize: INTEGER; userBytes: LONGINT; END; æC æKY BDSType æFp AppleTalk.p æT TYPE æD BDSType = ARRAY [0..7] OF BDSElement; æC æKY BDSPtr æFp AppleTalk.p æT TYPE æD BDSPtr = ^BDSType; æC æKY BitMapType æFp AppleTalk.p æT TYPE æD BitMapType = PACKED ARRAY [0..7] OF BOOLEAN; æC æKY ABusRecord ABRecPtr ABRecHandle æFp AppleTalk.p æT RECORD æD ABRecPtr = ^ABusRecord; ABRecHandle = ^ABRecPtr; ABusRecord = RECORD abOpcode: ABCallType; abResult: INTEGER; abUserReference: LONGINT; CASE ABProtoType OF lapProto: (lapAddress: LAPAdrBlock; lapReqCount: INTEGER; lapActCount: INTEGER; lapDataPtr: Ptr); ddpProto: (ddpType: Byte; ddpSocket: Byte; ddpAddress: AddrBlock; ddpReqCount: INTEGER; ddpActCount: INTEGER; ddpDataPtr: Ptr; ddpNodeID: Byte); nbpProto: (nbpEntityPtr: EntityPtr; nbpBufPtr: Ptr; nbpBufSize: INTEGER; nbpDataField: INTEGER; nbpAddress: AddrBlock; nbpRetransmitInfo: RetransType); atpProto: (atpSocket: Byte; atpAddress: AddrBlock; atpReqCount: INTEGER; atpDataPtr: Ptr; atpRspBDSPtr: BDSPtr; atpBitmap: BitMapType; atpTransID: INTEGER; atpActCount: INTEGER; atpUserData: LONGINT; atpXO: BOOLEAN; atpEOM: BOOLEAN; atpTimeOut: Byte; atpRetries: Byte; atpNumBufs: Byte; atpNumRsp: Byte; atpBDSSize: Byte; atpRspUData: LONGINT; atpRspBuf: Ptr; atpRspSize: INTEGER); END; æC _______________________________________________________________________________ »CALLING THE APPLETALK MANAGER FROM PASCAL _______________________________________________________________________________ This section discusses how to use the AppleTalk Manager from Pascal. Equivalent assembly-language information is given in the “Calling the AppleTalk Manager from Assembly Language” section. You can execute many AppleTalk Manager routines either synchronously (meaning that the application can’t continue until the routine is completed) or asynchronously (meaning that the application is free to perform other tasks while the routine is being executed). When an application calls an AppleTalk Manager routine asynchronously, an I/O request is placed in the appropriate driver’s I/O queue, and control returns to the calling program—possibly even before the actual I/O is completed. Requests are taken from the queue one at a time, and processed; meanwhile, the calling program is free to work on other things. The routines that can be executed asynchronously contain a Boolean parameter called async. If async is TRUE, the call is executed asynchronously; otherwise the call is executed synchronously. Every time an asynchronous routine call is completed, the AppleTalk Manager posts a network event. The message field of the event record will contain a handle to the parameter block that was used to make that call. Most AppleTalk Manager routines return an integer result code of type OSErr. Each routine description lists all of the applicable result codes generated by the AppleTalk Manager, along with a short description of what the result code means. Lengthier explanations of all the result codes can be found in the summary at the end of the chapter. Result codes from other parts of the Operating System may also be returned. (See Appendix A for a list of all result codes.) Many Pascal calls to the AppleTalk Manager require information passed in a parameter block of type ABusRecord. The exact content of an ABusRecord depends on the protocol being called: TYPE ABProtoType = (lapProto,ddpProto,nbpProto,atpProto); ABusRecord = RECORD abOpcode: ABCallType; {type of call} abResult: INTEGER; {result code} abUserReference: LONGINT; {for your use} CASE ABProtoType OF lapProto: . . . {ALAP parameters} ddpProto: . . . {DDP parameters} nbpProto: . . . {NBP parameters} atpProto: . . . {ATP parameters} END; END; ABRecPtr = ^ABusRecord; ABRecHandle = ^ABRecPtr; The value of the abOpcode field is inserted by the AppleTalk Manager when the call is made, and is always a member of the following set: TYPE ABCallType = (tLAPRead,tLAPWrite,tDDPRead,tDDPWrite,tNBPLookup, tNBPConfirm,tNBPRegister,tATPSndRequest, tATPGetRequest,tATPSdRsp,tATPAddRsp,tATPRequest, tATPRespond); The abUserReference field is available for use by the calling program in any way it wants. This field isn’t used by the AppleTalk Manager routines or drivers. The size of an ABusRecord data structure in bytes is given by one of the following constants: CONST lapSize = 20; ddpSize = 26; nbpSize = 26; atpSize = 56; Variables of type ABusRecord must be allocated in the heap with Memory Manager NewHandle calls. For example: myABRecord := ABRecHandle(NewHandle(ddpSize)) Warning: These Memory Manager calls can’t be made inside interrupts. Routines that are executed asynchronously return control to the calling program with the result code noErr as soon as the call is placed in the driver’s I/O queue. This isn’t an indication of successful call completion; it simply indicates that the call was successfully queued to the appropriate driver. To determine when the call is actually completed, you can either check for a network event or poll the abResult field of the call’s ABusRecord. The abResult field, set to 1 when the call is made, receives the actual result code upon completion of the call. Warning: A data structure of type ABusRecord is often used by the AppleTalk Manager during an asynchronous call, and so is locked by the AppleTalk Manager. Don’t attempt to unlock or use such a variable. Each routine description includes a list of the ABusRecord fields affected by the routine. The arrow next to each field name indicates whether it’s an input, output, or input/output parameter: Arrow Meaning --> Parameter is passed to the routine <-- Parameter is returned by the routine <-> Parameter is passed to and returned by the routine æKY AFPCommandBlock æFp AppleTalk.p æT RECORD æD AFPCommandBlock = PACKED RECORD cmdByte: Byte; startEndFlag: Byte; forkRefNum: INTEGER; rwOffset: LONGINT; reqCount: LONGINT; newLineFlag: Byte; newLineChar: CHAR; END; æC æKY WDSElement æFp AppleTalk.p æT RECORD æD WDSElement = RECORD entryLength: INTEGER; entryPtr: Ptr; END; æC æKY NamesTableEntry æFp AppleTalk.p æT RECORD æD NamesTableEntry = RECORD qLink: QElemPtr; nteAddress: AddrBlock; nteData: PACKED ARRAY [1..100] OF CHAR; END; æC æKY MPPParmType æFp AppleTalk.p æT RECORD æD MPPParmType = (LAPWriteParm,AttachPHParm,DetachPHParm,OpenSktParm,CloseSktParm, WriteDDPParm,OpenATPSktParm,CloseATPSktParm,SendRequestParm,GetRequestParm, SendResponseParm,AddResponseParm,RelTCBParm,RelRspCBParm,RegisterNameParm, LookupNameParm,ConfirmNameParm,RemoveNameParm,SetSelfSendParm,NSendRequestParm, KillSendReqParm,KillGetReqParm,KillNBPParm,GetAppleTalkInfoParm,KillAllGetReqParm, ATalkClosePrepParm,CancelATalkClosePrepParm); æC æKY MPPParamBlock MPPPBPtr æFp AppleTalk.p æT RECORD æD MPPPBPtr = ^MPPParamBlock; MPPParamBlock = PACKED RECORD qLink: QElemPtr; {next queue entry} qType: INTEGER; {queue type} ioTrap: INTEGER; {routine trap} ioCmdAddr: Ptr; {routine address} ioCompletion: ProcPtr; {completion routine} ioResult: OSErr; {result code} ioNamePtr: StringPtr; {->filename} ioVRefNum: INTEGER; {volume reference or drive number} ioRefNum: INTEGER; {driver reference number} csCode: INTEGER; {call command code AUTOMATICALLY set} CASE MPPParmType OF LAPWriteParm: (filler0: INTEGER; wdsPointer: Ptr); {->Write Data Structure} AttachPHParm,DetachPHParm: (protType: Byte; {ALAP Protocol Type} filler1: Byte; handler: Ptr); {->protocol handler routine} OpenSktParm,CloseSktParm,WriteDDPParm: (socket: Byte; {socket number} checksumFlag: Byte; {checksum flag} listener: Ptr); {->socket listener routine} RegisterNameParm,LookupNameParm,ConfirmNameParm,RemoveNameParm: (interval: Byte; {retry interval} count: Byte; {retry count} entityPtr: Ptr; {->names table element or ->entity name} CASE MPPParmType OF RegisterNameParm: (verifyFlag: Byte; {set if verify needed} filler3: Byte); LookupNameParm: (retBuffPtr: Ptr; {->return buffer} retBuffSize: INTEGER; {return buffer size} maxToGet: INTEGER; {matches to get} numGotten: INTEGER); {matched gotten} ConfirmNameParm: (confirmAddr: AddrBlock; {->entity} newSocket: Byte; {socket number} filler4: Byte)); SetSelfSendParm: (newSelfFlag: Byte; {self-send toggle flag} oldSelfFlag: Byte); {previous self-send state} KillNBPParm: (nKillQEl: Ptr); {ptr to Q element to cancel} GetAppleTalkInfoParm: (version: INTEGER; {requested info version} varsPtr: Ptr; {pointer to well known MPP vars} DCEPtr: Ptr; {pointer to MPP DCE} portID: INTEGER; {port number [0..7]} configuration: LONGINT; {32-bit configuration word} selfSend: INTEGER; {non zero if SelfSend enabled} netLo: INTEGER; {low value of network range} netHi: INTEGER; {high value of network range} ourAddr: LONGINT; {our 24-bit AppleTalk address} routerAddr: LONGINT; {24-bit address of (last) router} numOfPHs: INTEGER; {max. number of protocol handlers} numOfSkts: INTEGER; {max. number of static sockets} numNBPEs: INTEGER; {max. concurrent NBP requests} nTQueue: Ptr; {pointer to registered name queue} LAlength: INTEGER; {length in bytes of data link addr} linkAddr: Ptr; {data link address returned} zoneName: Ptr); {zone name returned} ATalkClosePrepParm: (appName: Ptr); {pointer to application name in buffer} END; æC æKY ATPParamBlock ATPPBPtr æFp AppleTalk.p æT RECORD æD ATPPBPtr = ^ATPParamBlock; ATPParamBlock = PACKED RECORD qLink: QElemPtr; {next queue entry} qType: INTEGER; {queue type} ioTrap: INTEGER; {routine trap} ioCmdAddr: Ptr; {routine address} ioCompletion: ProcPtr; {completion routine} ioResult: OSErr; {result code} userData: LONGINT; {ATP user bytes} reqTID: INTEGER; {request transaction ID} ioRefNum: INTEGER; {driver reference number} csCode: INTEGER; {Call command code automatically set} atpSocket: Byte; {currBitMap or socket number} CASE MPPParmType OF SendRequestParm, SendResponseParm, GetRequestParm, AddResponseParm, KillSendReqParm: (atpFlags: Byte; {control information} addrBlock: AddrBlock; {source/dest. socket address} reqLength: INTEGER; {request/response length} reqPointer: Ptr; {-> request/response data} bdsPointer: Ptr; {-> response BDS} CASE MPPParmType OF SendRequestParm: (numOfBuffs: Byte; {number of responses expected} timeOutVal: Byte; {timeout interval} numOfResps: Byte; {number of responses actually received} retryCount: Byte; {number of retries} intBuff: INTEGER; {used internally for NSendRequest} TRelTime: Byte); {TRelease time for extended send request} SendResponseParm: (filler0: Byte; {numOfBuffs} bdsSize: Byte; {number of BDS elements} transID: INTEGER); {transaction ID} GetRequestParm: (bitMap: Byte; {bit map} filler1: Byte); AddResponseParm: (rspNum: Byte; {sequence number} filler2: Byte); KillSendReqParm: (aKillQEl: Ptr)); {ptr to Q element to cancel} END; æC æKY XPPPrmBlkType æFp AppleTalk.p æT RECORD æD XPPPrmBlkType = (XPPPrmBlk,ASPSizeBlk,ASPAbortPrm,XCallParam); æC æKY XPPSubPrmType æFp AppleTalk.p æT RECORD æD XPPSubPrmType = (ASPOpenPrm,ASPSubPrm); æC æKY XPPEndPrmType æFp AppleTalk.p æT RECORD æD XPPEndPrmType = (AFPLoginPrm,ASPEndPrm); æC æKY XPPParamBlock XPPParmBlkPtr æFp AppleTalk.p æT RECORD æD XPPParmBlkPtr = ^XPPParamBlock; XPPParamBlock = PACKED RECORD qLink: QElemPtr; {next queue entry} qType: INTEGER; {queue type} ioTrap: INTEGER; {routine trap} ioCmdAddr: Ptr; {routine address} ioCompletion: ProcPtr; {completion routine} ioResult: OSErr; {result code} cmdResult: LONGINT; {command result (ATP user bytes)} ioVRefNum: INTEGER; {volume reference or drive number} ioRefNum: INTEGER; {driver reference number} csCode: INTEGER; {call command code} CASE XPPPrmBlkType OF ASPAbortPrm: (abortSCBPtr: Ptr); {SCB pointer for AbortOS} ASPSizeBlk: (aspMaxCmdSize: INTEGER; {for SPGetParms} aspQuantumSize: INTEGER; {for SPGetParms} numSesss: INTEGER); {for SPGetParms} XPPPrmBlk: (sessRefnum: INTEGER; {offset to session refnum} aspTimeout: Byte; {timeout for ATP} aspRetry: Byte; {retry count for ATP} CASE XPPSubPrmType OF ASPOpenPrm: (serverAddr: AddrBlock; {server address block} scbPointer: Ptr; {SCB pointer} attnRoutine: Ptr); {attention routine pointer} ASPSubPrm: (cbSize: INTEGER; {command block size} cbPtr: Ptr; {command block pointer} rbSize: INTEGER; {reply buffer size} rbPtr: Ptr; {reply buffer pointer} CASE XPPEndPrmType OF AFPLoginPrm: (afpAddrBlock: AddrBlock; {address block in AFP login} afpSCBPtr: Ptr; {SCB pointer in AFP login} afpAttnRoutine: Ptr); {Attn routine pointer in AFP login} ASPEndPrm: (wdSize: INTEGER; {write data size} wdPtr: Ptr; {write data pointer} ccbStart: ARRAY [0..295] OF Byte))); {afpWrite max size = 296, else 150} XCallParam: (xppSubCode: INTEGER; xppTimeout: Byte; {retry interval (seconds)} xppRetry: Byte; {retry count} filler1: INTEGER; {word space for rent. see the super.} zipBuffPtr: Ptr; {pointer to buffer (must be 578 bytes)} zipNumZones: INTEGER; {no. of zone names in this response} zipLastFlag: Byte; {non-zero if no more zones} filler2: Byte; {filler} zipInfoField: PACKED ARRAY [1..70] OF Byte); {on initial call, set first word to zero} END; æC æKY OpenXPP æFp AppleTalk.p æT FUNCTION æD FUNCTION OpenXPP(VAR xppRefnum: INTEGER): OSErr; æDT myVariable := OpenXPP(xppRefnum); æRI æRI æC »Opening the .XPP Driver To open the .XPP driver, issue a Device Manager Open call. (Refer to the Device Manager chapter.) The name of the .XPP driver is '.XPP'. The original Macintosh ROMs require that .XPP be opened only once. With new ROMs, the .XPP unit number can always be obtained through an Open call. With old ROMs only, the .XPP unit number must be hard coded to XPPUnitNum (40) since only one Open call can be issued to the driver. The .XPP driver cannot be opened unless AppleTalk is open. The application must ensure that the .MPP and .ATP drivers are opened, as described earlier in this chapter. The xppLoaded bit (bit 5) in the PortBUse byte in low memory indicates whether or not the .XPP driver is open. »Example The following is an example of the procedure an application might use to open the .XPP driver. ; Routine: OpenXPP ; ; Open the .XPP driver and return the driver refNum for it. ; ; Exit: D0 = error code (ccr's set) ; D1 = XPP driver refNum (if no errors) ; ; All other registers preserved ; xppUnitNum EQU 40 ;default XPP driver number xppTfRNum EQU -(xppUnitNum+1) ;default XPP driver refNum OpenXPP MOVE.L A0-A1/D2,-(SP) ;save registers MOVE ROM85,D0 ;check ROM type byte BPL.S @10 ;branch if >=128K ROMs BTST #xppLoadedBit,PortBUse ;is the XPP driver open already? BEQ.S @10 ;if not open, then branch to Open code MOVE #xppTfRNum,D1 ;else use this as driver refnum MOVEQ #0,D0 ;set noErr BRA.S @90 ;and exit ; ; XPP driver not open. Make an _Open call to it. If using a 128K ; ROM machine and the driver is already open, we will make another ; Open call to it just so we get the correct driver refNum. ; @10 SUB #ioQElSize,SP ;allocate temporary param block MOVE.L SP,A0 ;A0 -> param block LEA XPPName, A1 ;A1 -> XPP (ASP/AFP) driver name MOVE.L A1,ioFileName(A0) ;driver name into param block CLR.B ioPermssn(A0) ;clear permissions byte _Open MOVE ioRefNum(A0),D1 ;D1=driver refNum (invalid if error) ADD #ioQElSize,SP ;deallocate temp param block @90 MOVE.L (SP)+,A0-A1/D2 ;restore registers TST D0 ;error? (set ccr's) RTS XPPName DC.B 4 ;length of string DC.B '.XPP' ;driver name From Pascal, XPP can be opened through the OpenXPP call, which returns the driver’s reference number: FUNCTION OpenXPP (VAR xppRefnum: INTEGER) : OSErr; »Open Errors Errors returned when calling the Device Manager Open routine if the function does not execute properly include the following: • errors returned by System • portInUse is returned if the AppleTalk port is in use by a driver other than AppleTalk or if AppleTalk is not open. »Closing the .XPP Driver To close the .XPP driver, call the Device Manager Close routine. Warning: There is generally no reason to close the driver. Use this call sparingly, if at all. This call should generally be used only by system-level applications. »Close Errors Errors returned when calling the Device Manager Close routine if the function does not execute properly include the following: • errors returned by System • closeErr (new ROMs only) is returned if you try to close the driver and there are sessions active through that driver. When sessions are active, closeErr is returned and the driver remains open. • on old ROMs the driver is closed whether or not sessions are active and no error is returned. Results are unpredictable if sessions are still active. »Session Control Block The session control block (SCB) is a nonrelocatable block of data passed by the caller to XPP upon session opening. XPP reserves this block for use in maintaining an open session. The SCB size is defined by the constant scbMemSize. The SCB is a locked block, and as long as the session is open, the SCB cannot be modified in any way by the application. There is one SCB for each open session. This block can be reused once a CloseSess call is issued and completed for that session or when the session is indicated as closed. æKY ASPOpenSession æFp AppleTalk.p æT FUNCTION æD FUNCTION ASPOpenSession(thePBptr: XPPParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := ASPOpenSession(thePBptr,async); æRI V-536 æC »AppleTalk Session Protocol Functions This section contains descriptions of the .XPP driver functions that you can call. Each function description shows the required parameter block fields, their offsets within the parameter block and a brief definition of the field. Possible result codes are also described. »Note on Result Codes An important distinction exists between the aspParamErr and aspSessClose result codes that may be returned by the .XPP driver. When the driver returns aspParamErr to a call that takes as an input a session reference number, the session reference number does not relate to a valid open session. There could be several reasons for this, such as the workstation or server end closed the session or the server end of the session died. The aspSessClosed result code indicates that even though the session reference number relates to a valid session, that particular session is in the process of closing down (although the session is not yet closed). FUNCTION ASPOpenSession (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr; Parameter block --> 26 csCode word Always ASPOpenSess --> 28 sessRefnum word Session reference number --> 30 aspTimeout byte Retry interval in seconds --> 31 aspRetry byte Number of retries --> 32 serverAddr long word Server socket address --> 36 scbPointer pointer Pointer to session control block --> 40 attnRoutine pointer Pointer to attention routine ASPOpenSession initiates (opens) a session between the workstation and a server. The required parameter block is shown above. A brief definition of the fields follows. SessRefnum is a unique number identifying the open session between the workstation and the server. The SessRefnum is returned when the function completes successfully and is used in all calls to identify the session. ASPTimeOut is the interval in seconds between retries of the open session request. ASPRetry is the number of retries that will be attempted. ServerAddr is the network identifier or address of the socket on which the server is listening. SCBPointer points to a nonrelocatable block of data for the session control block (SCB) that the .XPP driver reserves for use in maintaining an open session. The SCB size is defined by the constant scbMemSize. The SCB is a locked block and as long as the session is open, the SCB cannot be modified in any way by the application. There is one SCB for each open session. This block can be reused when a CloseSess call is issued and completed for that session, or when the session is indicated as closed through return of aspParamErr as the result of a call for that session. AttnRoutine is a pointer to a routine that is invoked if an attention from the server is received, or upon session closing. If this pointer is equal to zero, no attention routine will be invoked. Result codes aspNoMoreSess Driver cannot support another session aspParamErr Server returned bad (positive) error code aspNoServers No servers at that address, or the server did not respond to the request reqAborted OpenSess was aborted by an AbortOS aspBadVersNum Server cannot support the offered version number aspServerBusy Server cannot open another session Note: The number of sessions that the driver is capable of supporting depends on the machine that the driver is running on. æKY ASPCloseSession æFp AppleTalk.p æT FUNCTION æD FUNCTION ASPCloseSession(thePBptr: XPPParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := ASPCloseSession(thePBptr,async); æRI V-537 æC Parameter block --> 26 csCode word Always ASPCloseSession --> 28 sessRefnum word Session reference number ASPCloseSession closes the session identified by the sessRefnum returned in the ASPOpenSession call. ASPCloseSession aborts any calls that are active on the session, closes the session, and calls the attention routine, if any, with an attention code of zero (zero is invalid as a real attention code). Result codes aspParamErr Parameter error, indicates an invalid session reference number aspSessClosed Session already in process of closing æKY ASPAbortOS æFp AppleTalk.p æT FUNCTION æD FUNCTION ASPAbortOS(thePBptr: XPPParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := ASPAbortOS(thePBptr,async); æRI V-537 æC Parameter block --> 26 csCode word Always ASPAbortOS --> 28 abortSCBPointer pointer Pointer to session control block ASPAbortOS aborts a pending (not yet completed) ASPOpenSession call. The aborted ASPOpenSession call will return a reqAborted error. AbortSCBPointer points to the original SCB used in the the pending ASPOpenSession call. Result codes cbNotFound SCB not found, no outstanding open session to be aborted. Pointer did not point to an open session SCB. æKY ASPGetParms æFp AppleTalk.p æT FUNCTION æD FUNCTION ASPGetParms(thePBptr: XPPParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := ASPGetParms(thePBptr,async); æRI V-538 æC Parameter block --> 26 csCode word Always ASPGetParms --> 28 aspMaxCmdSize word Maximum size of command block --> 30 aspQuantumSize word Maximum data size --> 32 numSesss word Number of sessions ASPGetParms returns three ASP parameters. This call does not require an open session. ASPMaxCmdSize is the maximum size of a command that can be sent to the server. ASPQuantumSize is the maximum size of data that can be transferred to the server in a Write request or from the server in a command reply. NumSess is the number of concurrent sessions supported by the driver. æKY ASPCloseAll æFp AppleTalk.p æT FUNCTION æD FUNCTION ASPCloseAll(thePBptr: XPPParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := ASPCloseAll(thePBptr,async); æRI V-538 æC Parameter block --> 26 csCode word Always ASPCloseAll ASPCloseAll closes every session that the driver has active, aborting all active requests and invoking the attention routines where provided. This call should be used carefully. ASPCloseAll can be used as a system level resource for making sure all sessions are closed prior to closing the driver. æKY ASPUserWrite æFp AppleTalk.p æT FUNCTION æD FUNCTION ASPUserWrite(thePBptr: XPPParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := ASPUserWrite(thePBptr,async); æRI V-538 æC Parameter block --> 18 cmdResult long word ASP command result --> 26 csCode word Always UserWrite --> 28 sessRefnum word Session reference number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command block size --> 34 cbPtr pointer Command block pointer <-> 38 rbSize word Reply buffer size and reply size --> 40 rbPtr pointer Reply buffer pointer <-> 44 wdSize word Write data size --> 46 wdPtr pointer Write data pointer --> 50 ccbStart record Start of memory for CCB ASPUserWrite transfers data on a session. ASPUserWrite is one of the two main calls that can be used to transfer data on an ASP session. The other call that performs a similar data transfer is ASPUserCommand described below. The ASPUserWrite command returns data in two different places. Four bytes of data are returned in the cmdResult field and a variable size reply buffer is also returned. CmdResult is four bytes of data returned by the server. SessRefnum is the session reference number returned in the ASPOpenSession call. ASPTimeOut is the interval in seconds between retries of the call. Notice that there is no aspRetry field (retries are infinite). The command will be retried at the prescribed interval until completion or the session is closed. CBSize is the size in bytes of the command data that is to be written on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the ASPGetParms call. Note that this buffer is not the data to be written by the command but only the data of the command itself. CBPtr points to the command data. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. WDSize is passed and indicates the size of the write data in bytes to be sent by the command. WDSize is also returned and indicates the size of the write data that was actually written. WDPointer points to the write data buffer. CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 296 bytes. To determine the exact requirement, refer to the CCB Sizes section of this document. Result codes aspParamErr Invalid session number, session has been closed aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer; the buffer will be filled, data will be truncated æKY ASPUserCommand æFp AppleTalk.p æT FUNCTION æD FUNCTION ASPUserCommand(thePBptr: XPPParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := ASPUserCommand(thePBptr,async); æRI V-539 æC Parameter block --> 18 cmdResult long word ASP command result --> 26 csCode word Always ASPUserCommand --> 28 sessRefnum word Session number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command block size --> 34 cbPtr pointer Command block pointer <-> 38 rbSize word Reply buffer and reply size --> 40 rbPtr pointer Reply buffer pointer --> 50 ccbStart record Start of memory for CCB ASPUserCommand is used to send a command to the server on a session. SessRefnum is the session reference number returned in the ASPOpenSession call. ASPTimeOut is the interval in seconds between retries of the call. Notice that there is no aspRetry field (retries are infinite). The command will be retried at the prescribed interval until completion or the session is closed. CBSize is the size in bytes of the block of data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the ASPGetParms call. CBPointer points to the block of data containing the command that is to be sent to the server on the session. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 150 bytes. To determine the exact requirement refer to the CCB Sizes section of this document. Result codes aspParamErr Invalid session number, session has been closed aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer; the buffer will be filled, data will be truncated æKY ASPGetStatus æFp AppleTalk.p æT FUNCTION æD FUNCTION ASPGetStatus(thePBptr: XPPParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := ASPGetStatus(thePBptr,async); æRI V-540 æC Parameter block --> 26 csCode word Always ASPGetStatus --> 30 aspTimeout byte Retry interval in seconds --> 31 aspRetry byte Number of retries --> 32 serverAddr long word Server socket address <-> 38 rbSize word Reply buffer and reply size --> 40 rbPtr pointer Reply buffer pointer --> 50 ccbStart record Start of memory for CCB ASPGetStatus returns server status. This call is also used as GetServerInfo at the AFP level. This call is unique in that it transfers data over the network without having a session open. This call does not pass any data but requests that server status be returned. ASPTimeOut is the interval in seconds between retries of the call. ASPRetry is the number of retries that will be attempted. ServerAddr is the network identifier or address of the socket on which the server is listening. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 150 bytes. To determine the exact requirement refer to the CCB Sizes section of this document. Result codes aspBufTooSmall Reply is bigger than response buffer, or Replysize is bigger than ReplyBuffsize aspNoServer No response from server at address used in call æKY AFPCommand æFp AppleTalk.p æT FUNCTION æD FUNCTION AFPCommand(thePBptr: XPPParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := AFPCommand(thePBptr,async); æRI V-542 æC »AFPCall Function The AFPCall function can have one of the following command formats. • General • Login • AFPWrite • AFPRead »General Command Format FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr; Parameter block --> 18 cmdResult long word AFP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session reference number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer <-> 38 rbSize word Reply buffer size and reply size --> 40 rbPtr pointer Reply buffer pointer <-> 44 wdSize word Write data size --> 46 wdPtr pointer Write data pointer --> 50 ccbStart record Start of memory for CCB The general command format for the AFPCall function passes an AFP command to the server. This format is used for all AFP calls except AFPLogin, AFPRead, and AFPWrite. Note that from Pascal this call is referred to as AFPCommand. CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number returned in the AFPLogin call. ASPTimeOut is the interval in seconds between retries of the call by the driver. CBSize is the size in bytes of the block of data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the ASPGetParms call. CBPtr points to start of the block of data (command block) containing the command that is to be sent to the server on the session. The first byte of the command block must contain the AFP command byte. Subsequent bytes in the command buffer contain the parameters associated with the command as defined in the AFP document. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. WDSize is the size of data to be written to the server (only used if the command is one that is mapped to an ASPUserWrite). WDPtr points to the write data buffer (only used if the command is one that is mapped to an ASPUserWrite). CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 296 bytes. To determine the exact requirement refer to the CCB Sizes section of this document. Result codes aspParamErr Invalid session number; session has been closed aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer or buffer will be filled, data will be truncated afpParmError AFP command block size is equal to zero. This error will also be returned if the command byte in the command block is equal to 0 or $FF (255) or GetSrvrStatus (15). »Login Command Format The AFP login command executes a series of AFP operations as defined in the AFP Draft Proposal. For further information, refer to the AFP document. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN): OSErr; Parameter block --> 18 cmdResult long word AFP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session reference number --> 30 aspTimeout byte Retry interval in seconds --> 31 aspRetry byte Number of retries --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer <-> 38 rbSize word Reply buffer size and reply size --> 40 rbPtr pointer Reply buffer pointer --> 44 afpAddrBlock long word Server address block <-> 48 afpSCBPtr pointer SCB pointer <-> 52 afpAttnRoutine pointer Attention routine pointer --> 50 ccbStart record Start of command control block CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number (returned by the AFPLogin call). ASPTimeOut is the interval in seconds between retries of the call. ASPRetry is the number of retries that will be attempted. CBSize is the size in bytes of the block data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the ASPGetParms call. CBPtr points to the block of data (command block) containing the AFP login command that is to be sent to the server on the session. The first byte of the command block must be the AFP login command byte. Subsequent bytes in the command buffer contain the parameters associated with the command. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. AFPServerAddr is the network identifier or address of the socket on which the server is listening. AFPSCBPointer points to a locked block of data for the session control block (SCB). The SCB size is defined by scbMemSize. The SCB is a locked block, and as long as the session is open, the SCB cannot be modified in any way by the application. There is one SCB for each open session. AFPAttnRoutine is a pointer to a routine that is invoked if an attention from the server is received. When afpAttnRoutine is equal to zero, no attention routine will be invoked. CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 150 bytes. To determine the exact requirement refer to the CCB Sizes section later in this chapter. Note: In the parameter block, the afpSCBPointer and the afpAttnRoutine fields overlap with the start of the CCB and are modified by the call. Result codes aspSizeErr Command block size is bigger than MaxCmdSize aspBufTooSmall Reply is bigger than response buffer or buffer will be filled, data will be truncated aspNoServer Server not responding aspServerBusy Server cannot open another session aspBadVersNum Server cannot support the offered ASP version number aspNoMoreSess Driver cannot support another session. »AFPWrite Command Format The AFPWrite and AFPRead command formats allow the calling application to make AFP-level calls that read or write a data block that is larger than a single ASP-level call is capable of reading or writing. The maximum number of bytes of data that can be read or written at the ASP level is equal to quantumSize. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr; Parameter block --> 18 cmdResult long word AFP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer <-> 38 rbSize word Reply buffer size and reply size --> 40 rbPtr pointer Reply buffer pointer --> 44 wdSize word (used internally) <-> 46 wdPtr pointer Write data pointer (updated) --> 50 ccbStart record Start of memory for CCB CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number returned in the AFPLogin call. ASPTimeOut is the interval in seconds between retries of the call. CBSize is the size in bytes of the block data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the aspGetParms call. CBPtr points to the block of data (see command block structure below) containing the AFP write command that is to be sent to the server on the session. The first byte of the Command Block must contain the AFP write command byte. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. WDSize is used internally. Note: This command does not pass the write data size in the queue element but in the command buffer. XPP will look for the size in that buffer. WDPtr is a pointer to the block of data to be written. Note that this field will be updated by XPP as it proceeds and will always point to that section of the data which XPP is currently writing. CCBStart is the start of the memory to be used by the XPP driver for the command control block. The size of this block is equal to a maximum of 296 bytes. To determine the exact requirement refer to the CCB Sizes section later in this chapter. Command Block Structure: The AFP write command passes several arguments to XPP in the command buffer itself. The byte offsets are relative to the location pointed to by cbPtr. --> 0 cmdByte byte AFP call command byte --> 1 startEndFlag byte Start/end Flag <-> 4 rwOffset long word Offset within fork to write <-> 8 reqCount long word Requested count CmdByte is the AFP call command byte and must contain the AFP write command code. StartEndFlag is a one-bit flag (the high bit of the byte) indicating whether the rwOffset field is relative to the beginning or the end of the fork (all other bits are zero). 0 = relative to the beginning of the fork 1 = relative to the end of the fork RWOffset is the byte offset within the fork at which the write is to begin. ReqCount indicates the size of the data to be written and is returned as the actual size written. The rwOffset and reqCount fields are modified by XPP as the write proceeds and will always indicate the current value of these fields. The Pascal structure of the AFP command buffer follows: AFPCommandBlock = PACKED RECORD cmdByte: Byte; startEndFlag: Byte; forkRefNum: INTEGER; {used by server} rwOffset: LONGINT; reqCount: LONGINT; newLineFlag: Byte; {unused by write} newLineChar: CHAR; {unused by write} END; Result codes aspParamErr Invalid session number aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer »AFPRead Command Format The AFPWrite and AFPRead command formats allow the calling application to make AFP-level calls that read or write a data block that is larger than a single ASP-level call is capable of reading or writing. The maximum number of bytes of data that can be read or written at the ASP level is equal to quantumSize. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr; Parameter block --> 18 cmdResult long word ASP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer --> 38 rbSize word Used internally <-> 40 rbPtr pointer Reply buffer pointer (updated) --> 50 ccbStart record Start of memory for CCB CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number returned in the AFPLogin call. ASPTimeOut is the interval in seconds between retries of the call. CBSize is the size in bytes of the block data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the GetParms call. CBPtr points to the block of data (command block) containing the AFP read command that is to be sent to the server on the session. The first byte of the command block must contain the AFP read command byte. The command block structure is shown below. RBSize is used internally. Note: This command does not pass the read size in the queue element but in the command buffer. XPP will look for the size in that buffer. RBPtr points to the reply buffer. Note that this field will be updated by XPP as it proceeds and will always point to that section of the buffer that XPP is currently reading into. CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 150 bytes. To determine the exact requirement refer to The CCB Sizes section later in this chapter. Command Block Structure: The AFP read command passes several arguments to XPP in the command buffer itself. The byte offsets are relative to the location pointed to by cbPointer. --> 0 cmdByte byte AFP call command byte <-> 4 rwOffset long word Offset within fork to read <-> 8 reqCount long word Requested count --> 12 newLineFlag byte Newline Flag --> 13 newLineChar byte Newline Character CmdByte is the AFP call command byte and must contain the AFP read command code. RWOffset is the byte offset within the fork at which the read is to begin. ReqCount indicates the size of the read data buffer and is returned as the actual size read. The rwOffset and reqCount fields are modified by XPP as the read proceeds and will always indicate the current value of these fields. NewLineFlag is a one-bit flag (the high bit of the byte) indicating whether or not the read is to terminate at a specified character (all other bits are zero). 0 = no Newline Character is specified 1 = a Newline Character is specified NewLineChar is any character from $00 to $FF (inclusive) that, when encountered in reading the fork, causes the read operation to terminate. The Pascal structure of the AFPCommand follows: AFPCommandBlock = PACKED RECORD cmdByte: Byte; startEndFlag: Byte; {unused for read} forkRefNum: INTEGER; {used by server} rwOffset: LONGINT; reqCount: LONGINT; newLineFlag: Byte; newLineChar: CHAR; END; Result codes aspParamErr Invalid session number aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer æKY GetLocalZones æFp AppleTalk.p æT FUNCTION æD FUNCTION GetLocalZones(thePBptr: XPPParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := GetLocalZones(thePBptr,async); æRI V-542 æC »AFPCall Function The AFPCall function can have one of the following command formats. • General • Login • AFPWrite • AFPRead »General Command Format FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr; Parameter block --> 18 cmdResult long word AFP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session reference number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer <-> 38 rbSize word Reply buffer size and reply size --> 40 rbPtr pointer Reply buffer pointer <-> 44 wdSize word Write data size --> 46 wdPtr pointer Write data pointer --> 50 ccbStart record Start of memory for CCB The general command format for the AFPCall function passes an AFP command to the server. This format is used for all AFP calls except AFPLogin, AFPRead, and AFPWrite. Note that from Pascal this call is referred to as AFPCommand. CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number returned in the AFPLogin call. ASPTimeOut is the interval in seconds between retries of the call by the driver. CBSize is the size in bytes of the block of data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the ASPGetParms call. CBPtr points to start of the block of data (command block) containing the command that is to be sent to the server on the session. The first byte of the command block must contain the AFP command byte. Subsequent bytes in the command buffer contain the parameters associated with the command as defined in the AFP document. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. WDSize is the size of data to be written to the server (only used if the command is one that is mapped to an ASPUserWrite). WDPtr points to the write data buffer (only used if the command is one that is mapped to an ASPUserWrite). CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 296 bytes. To determine the exact requirement refer to the CCB Sizes section of this document. Result codes aspParamErr Invalid session number; session has been closed aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer or buffer will be filled, data will be truncated afpParmError AFP command block size is equal to zero. This error will also be returned if the command byte in the command block is equal to 0 or $FF (255) or GetSrvrStatus (15). »Login Command Format The AFP login command executes a series of AFP operations as defined in the AFP Draft Proposal. For further information, refer to the AFP document. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN): OSErr; Parameter block --> 18 cmdResult long word AFP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session reference number --> 30 aspTimeout byte Retry interval in seconds --> 31 aspRetry byte Number of retries --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer <-> 38 rbSize word Reply buffer size and reply size --> 40 rbPtr pointer Reply buffer pointer --> 44 afpAddrBlock long word Server address block <-> 48 afpSCBPtr pointer SCB pointer <-> 52 afpAttnRoutine pointer Attention routine pointer --> 50 ccbStart record Start of command control block CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number (returned by the AFPLogin call). ASPTimeOut is the interval in seconds between retries of the call. ASPRetry is the number of retries that will be attempted. CBSize is the size in bytes of the block data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the ASPGetParms call. CBPtr points to the block of data (command block) containing the AFP login command that is to be sent to the server on the session. The first byte of the command block must be the AFP login command byte. Subsequent bytes in the command buffer contain the parameters associated with the command. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. AFPServerAddr is the network identifier or address of the socket on which the server is listening. AFPSCBPointer points to a locked block of data for the session control block (SCB). The SCB size is defined by scbMemSize. The SCB is a locked block, and as long as the session is open, the SCB cannot be modified in any way by the application. There is one SCB for each open session. AFPAttnRoutine is a pointer to a routine that is invoked if an attention from the server is received. When afpAttnRoutine is equal to zero, no attention routine will be invoked. CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 150 bytes. To determine the exact requirement refer to the CCB Sizes section later in this chapter. Note: In the parameter block, the afpSCBPointer and the afpAttnRoutine fields overlap with the start of the CCB and are modified by the call. Result codes aspSizeErr Command block size is bigger than MaxCmdSize aspBufTooSmall Reply is bigger than response buffer or buffer will be filled, data will be truncated aspNoServer Server not responding aspServerBusy Server cannot open another session aspBadVersNum Server cannot support the offered ASP version number aspNoMoreSess Driver cannot support another session. »AFPWrite Command Format The AFPWrite and AFPRead command formats allow the calling application to make AFP-level calls that read or write a data block that is larger than a single ASP-level call is capable of reading or writing. The maximum number of bytes of data that can be read or written at the ASP level is equal to quantumSize. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr; Parameter block --> 18 cmdResult long word AFP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer <-> 38 rbSize word Reply buffer size and reply size --> 40 rbPtr pointer Reply buffer pointer --> 44 wdSize word (used internally) <-> 46 wdPtr pointer Write data pointer (updated) --> 50 ccbStart record Start of memory for CCB CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number returned in the AFPLogin call. ASPTimeOut is the interval in seconds between retries of the call. CBSize is the size in bytes of the block data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the aspGetParms call. CBPtr points to the block of data (see command block structure below) containing the AFP write command that is to be sent to the server on the session. The first byte of the Command Block must contain the AFP write command byte. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. WDSize is used internally. Note: This command does not pass the write data size in the queue element but in the command buffer. XPP will look for the size in that buffer. WDPtr is a pointer to the block of data to be written. Note that this field will be updated by XPP as it proceeds and will always point to that section of the data which XPP is currently writing. CCBStart is the start of the memory to be used by the XPP driver for the command control block. The size of this block is equal to a maximum of 296 bytes. To determine the exact requirement refer to the CCB Sizes section later in this chapter. Command Block Structure: The AFP write command passes several arguments to XPP in the command buffer itself. The byte offsets are relative to the location pointed to by cbPtr. --> 0 cmdByte byte AFP call command byte --> 1 startEndFlag byte Start/end Flag <-> 4 rwOffset long word Offset within fork to write <-> 8 reqCount long word Requested count CmdByte is the AFP call command byte and must contain the AFP write command code. StartEndFlag is a one-bit flag (the high bit of the byte) indicating whether the rwOffset field is relative to the beginning or the end of the fork (all other bits are zero). 0 = relative to the beginning of the fork 1 = relative to the end of the fork RWOffset is the byte offset within the fork at which the write is to begin. ReqCount indicates the size of the data to be written and is returned as the actual size written. The rwOffset and reqCount fields are modified by XPP as the write proceeds and will always indicate the current value of these fields. The Pascal structure of the AFP command buffer follows: AFPCommandBlock = PACKED RECORD cmdByte: Byte; startEndFlag: Byte; forkRefNum: INTEGER; {used by server} rwOffset: LONGINT; reqCount: LONGINT; newLineFlag: Byte; {unused by write} newLineChar: CHAR; {unused by write} END; Result codes aspParamErr Invalid session number aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer »AFPRead Command Format The AFPWrite and AFPRead command formats allow the calling application to make AFP-level calls that read or write a data block that is larger than a single ASP-level call is capable of reading or writing. The maximum number of bytes of data that can be read or written at the ASP level is equal to quantumSize. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr; Parameter block --> 18 cmdResult long word ASP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer --> 38 rbSize word Used internally <-> 40 rbPtr pointer Reply buffer pointer (updated) --> 50 ccbStart record Start of memory for CCB CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number returned in the AFPLogin call. ASPTimeOut is the interval in seconds between retries of the call. CBSize is the size in bytes of the block data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the GetParms call. CBPtr points to the block of data (command block) containing the AFP read command that is to be sent to the server on the session. The first byte of the command block must contain the AFP read command byte. The command block structure is shown below. RBSize is used internally. Note: This command does not pass the read size in the queue element but in the command buffer. XPP will look for the size in that buffer. RBPtr points to the reply buffer. Note that this field will be updated by XPP as it proceeds and will always point to that section of the buffer that XPP is currently reading into. CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 150 bytes. To determine the exact requirement refer to The CCB Sizes section later in this chapter. Command Block Structure: The AFP read command passes several arguments to XPP in the command buffer itself. The byte offsets are relative to the location pointed to by cbPointer. --> 0 cmdByte byte AFP call command byte <-> 4 rwOffset long word Offset within fork to read <-> 8 reqCount long word Requested count --> 12 newLineFlag byte Newline Flag --> 13 newLineChar byte Newline Character CmdByte is the AFP call command byte and must contain the AFP read command code. RWOffset is the byte offset within the fork at which the read is to begin. ReqCount indicates the size of the read data buffer and is returned as the actual size read. The rwOffset and reqCount fields are modified by XPP as the read proceeds and will always indicate the current value of these fields. NewLineFlag is a one-bit flag (the high bit of the byte) indicating whether or not the read is to terminate at a specified character (all other bits are zero). 0 = no Newline Character is specified 1 = a Newline Character is specified NewLineChar is any character from $00 to $FF (inclusive) that, when encountered in reading the fork, causes the read operation to terminate. The Pascal structure of the AFPCommand follows: AFPCommandBlock = PACKED RECORD cmdByte: Byte; startEndFlag: Byte; {unused for read} forkRefNum: INTEGER; {used by server} rwOffset: LONGINT; reqCount: LONGINT; newLineFlag: Byte; newLineChar: CHAR; END; Result codes aspParamErr Invalid session number aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer æKY GetZoneList æFp AppleTalk.p æT FUNCTION æD FUNCTION GetZoneList(thePBptr: XPPParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := GetZoneList(thePBptr,async); æRI V-542 æC »AFPCall Function The AFPCall function can have one of the following command formats. • General • Login • AFPWrite • AFPRead »General Command Format FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr; Parameter block --> 18 cmdResult long word AFP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session reference number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer <-> 38 rbSize word Reply buffer size and reply size --> 40 rbPtr pointer Reply buffer pointer <-> 44 wdSize word Write data size --> 46 wdPtr pointer Write data pointer --> 50 ccbStart record Start of memory for CCB The general command format for the AFPCall function passes an AFP command to the server. This format is used for all AFP calls except AFPLogin, AFPRead, and AFPWrite. Note that from Pascal this call is referred to as AFPCommand. CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number returned in the AFPLogin call. ASPTimeOut is the interval in seconds between retries of the call by the driver. CBSize is the size in bytes of the block of data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the ASPGetParms call. CBPtr points to start of the block of data (command block) containing the command that is to be sent to the server on the session. The first byte of the command block must contain the AFP command byte. Subsequent bytes in the command buffer contain the parameters associated with the command as defined in the AFP document. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. WDSize is the size of data to be written to the server (only used if the command is one that is mapped to an ASPUserWrite). WDPtr points to the write data buffer (only used if the command is one that is mapped to an ASPUserWrite). CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 296 bytes. To determine the exact requirement refer to the CCB Sizes section of this document. Result codes aspParamErr Invalid session number; session has been closed aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer or buffer will be filled, data will be truncated afpParmError AFP command block size is equal to zero. This error will also be returned if the command byte in the command block is equal to 0 or $FF (255) or GetSrvrStatus (15). »Login Command Format The AFP login command executes a series of AFP operations as defined in the AFP Draft Proposal. For further information, refer to the AFP document. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN): OSErr; Parameter block --> 18 cmdResult long word AFP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session reference number --> 30 aspTimeout byte Retry interval in seconds --> 31 aspRetry byte Number of retries --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer <-> 38 rbSize word Reply buffer size and reply size --> 40 rbPtr pointer Reply buffer pointer --> 44 afpAddrBlock long word Server address block <-> 48 afpSCBPtr pointer SCB pointer <-> 52 afpAttnRoutine pointer Attention routine pointer --> 50 ccbStart record Start of command control block CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number (returned by the AFPLogin call). ASPTimeOut is the interval in seconds between retries of the call. ASPRetry is the number of retries that will be attempted. CBSize is the size in bytes of the block data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the ASPGetParms call. CBPtr points to the block of data (command block) containing the AFP login command that is to be sent to the server on the session. The first byte of the command block must be the AFP login command byte. Subsequent bytes in the command buffer contain the parameters associated with the command. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. AFPServerAddr is the network identifier or address of the socket on which the server is listening. AFPSCBPointer points to a locked block of data for the session control block (SCB). The SCB size is defined by scbMemSize. The SCB is a locked block, and as long as the session is open, the SCB cannot be modified in any way by the application. There is one SCB for each open session. AFPAttnRoutine is a pointer to a routine that is invoked if an attention from the server is received. When afpAttnRoutine is equal to zero, no attention routine will be invoked. CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 150 bytes. To determine the exact requirement refer to the CCB Sizes section later in this chapter. Note: In the parameter block, the afpSCBPointer and the afpAttnRoutine fields overlap with the start of the CCB and are modified by the call. Result codes aspSizeErr Command block size is bigger than MaxCmdSize aspBufTooSmall Reply is bigger than response buffer or buffer will be filled, data will be truncated aspNoServer Server not responding aspServerBusy Server cannot open another session aspBadVersNum Server cannot support the offered ASP version number aspNoMoreSess Driver cannot support another session. »AFPWrite Command Format The AFPWrite and AFPRead command formats allow the calling application to make AFP-level calls that read or write a data block that is larger than a single ASP-level call is capable of reading or writing. The maximum number of bytes of data that can be read or written at the ASP level is equal to quantumSize. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr; Parameter block --> 18 cmdResult long word AFP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer <-> 38 rbSize word Reply buffer size and reply size --> 40 rbPtr pointer Reply buffer pointer --> 44 wdSize word (used internally) <-> 46 wdPtr pointer Write data pointer (updated) --> 50 ccbStart record Start of memory for CCB CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number returned in the AFPLogin call. ASPTimeOut is the interval in seconds between retries of the call. CBSize is the size in bytes of the block data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the aspGetParms call. CBPtr points to the block of data (see command block structure below) containing the AFP write command that is to be sent to the server on the session. The first byte of the Command Block must contain the AFP write command byte. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. WDSize is used internally. Note: This command does not pass the write data size in the queue element but in the command buffer. XPP will look for the size in that buffer. WDPtr is a pointer to the block of data to be written. Note that this field will be updated by XPP as it proceeds and will always point to that section of the data which XPP is currently writing. CCBStart is the start of the memory to be used by the XPP driver for the command control block. The size of this block is equal to a maximum of 296 bytes. To determine the exact requirement refer to the CCB Sizes section later in this chapter. Command Block Structure: The AFP write command passes several arguments to XPP in the command buffer itself. The byte offsets are relative to the location pointed to by cbPtr. --> 0 cmdByte byte AFP call command byte --> 1 startEndFlag byte Start/end Flag <-> 4 rwOffset long word Offset within fork to write <-> 8 reqCount long word Requested count CmdByte is the AFP call command byte and must contain the AFP write command code. StartEndFlag is a one-bit flag (the high bit of the byte) indicating whether the rwOffset field is relative to the beginning or the end of the fork (all other bits are zero). 0 = relative to the beginning of the fork 1 = relative to the end of the fork RWOffset is the byte offset within the fork at which the write is to begin. ReqCount indicates the size of the data to be written and is returned as the actual size written. The rwOffset and reqCount fields are modified by XPP as the write proceeds and will always indicate the current value of these fields. The Pascal structure of the AFP command buffer follows: AFPCommandBlock = PACKED RECORD cmdByte: Byte; startEndFlag: Byte; forkRefNum: INTEGER; {used by server} rwOffset: LONGINT; reqCount: LONGINT; newLineFlag: Byte; {unused by write} newLineChar: CHAR; {unused by write} END; Result codes aspParamErr Invalid session number aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer »AFPRead Command Format The AFPWrite and AFPRead command formats allow the calling application to make AFP-level calls that read or write a data block that is larger than a single ASP-level call is capable of reading or writing. The maximum number of bytes of data that can be read or written at the ASP level is equal to quantumSize. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr; Parameter block --> 18 cmdResult long word ASP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer --> 38 rbSize word Used internally <-> 40 rbPtr pointer Reply buffer pointer (updated) --> 50 ccbStart record Start of memory for CCB CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number returned in the AFPLogin call. ASPTimeOut is the interval in seconds between retries of the call. CBSize is the size in bytes of the block data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the GetParms call. CBPtr points to the block of data (command block) containing the AFP read command that is to be sent to the server on the session. The first byte of the command block must contain the AFP read command byte. The command block structure is shown below. RBSize is used internally. Note: This command does not pass the read size in the queue element but in the command buffer. XPP will look for the size in that buffer. RBPtr points to the reply buffer. Note that this field will be updated by XPP as it proceeds and will always point to that section of the buffer that XPP is currently reading into. CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 150 bytes. To determine the exact requirement refer to The CCB Sizes section later in this chapter. Command Block Structure: The AFP read command passes several arguments to XPP in the command buffer itself. The byte offsets are relative to the location pointed to by cbPointer. --> 0 cmdByte byte AFP call command byte <-> 4 rwOffset long word Offset within fork to read <-> 8 reqCount long word Requested count --> 12 newLineFlag byte Newline Flag --> 13 newLineChar byte Newline Character CmdByte is the AFP call command byte and must contain the AFP read command code. RWOffset is the byte offset within the fork at which the read is to begin. ReqCount indicates the size of the read data buffer and is returned as the actual size read. The rwOffset and reqCount fields are modified by XPP as the read proceeds and will always indicate the current value of these fields. NewLineFlag is a one-bit flag (the high bit of the byte) indicating whether or not the read is to terminate at a specified character (all other bits are zero). 0 = no Newline Character is specified 1 = a Newline Character is specified NewLineChar is any character from $00 to $FF (inclusive) that, when encountered in reading the fork, causes the read operation to terminate. The Pascal structure of the AFPCommand follows: AFPCommandBlock = PACKED RECORD cmdByte: Byte; startEndFlag: Byte; {unused for read} forkRefNum: INTEGER; {used by server} rwOffset: LONGINT; reqCount: LONGINT; newLineFlag: Byte; newLineChar: CHAR; END; Result codes aspParamErr Invalid session number aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer æKY GetMyZone æFp AppleTalk.p æT FUNCTION æD FUNCTION GetMyZone(thePBptr: XPPParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := GetMyZone(thePBptr,async); æRI V-542 æC »AFPCall Function The AFPCall function can have one of the following command formats. • General • Login • AFPWrite • AFPRead »General Command Format FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr; Parameter block --> 18 cmdResult long word AFP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session reference number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer <-> 38 rbSize word Reply buffer size and reply size --> 40 rbPtr pointer Reply buffer pointer <-> 44 wdSize word Write data size --> 46 wdPtr pointer Write data pointer --> 50 ccbStart record Start of memory for CCB The general command format for the AFPCall function passes an AFP command to the server. This format is used for all AFP calls except AFPLogin, AFPRead, and AFPWrite. Note that from Pascal this call is referred to as AFPCommand. CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number returned in the AFPLogin call. ASPTimeOut is the interval in seconds between retries of the call by the driver. CBSize is the size in bytes of the block of data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the ASPGetParms call. CBPtr points to start of the block of data (command block) containing the command that is to be sent to the server on the session. The first byte of the command block must contain the AFP command byte. Subsequent bytes in the command buffer contain the parameters associated with the command as defined in the AFP document. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. WDSize is the size of data to be written to the server (only used if the command is one that is mapped to an ASPUserWrite). WDPtr points to the write data buffer (only used if the command is one that is mapped to an ASPUserWrite). CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 296 bytes. To determine the exact requirement refer to the CCB Sizes section of this document. Result codes aspParamErr Invalid session number; session has been closed aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer or buffer will be filled, data will be truncated afpParmError AFP command block size is equal to zero. This error will also be returned if the command byte in the command block is equal to 0 or $FF (255) or GetSrvrStatus (15). »Login Command Format The AFP login command executes a series of AFP operations as defined in the AFP Draft Proposal. For further information, refer to the AFP document. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN): OSErr; Parameter block --> 18 cmdResult long word AFP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session reference number --> 30 aspTimeout byte Retry interval in seconds --> 31 aspRetry byte Number of retries --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer <-> 38 rbSize word Reply buffer size and reply size --> 40 rbPtr pointer Reply buffer pointer --> 44 afpAddrBlock long word Server address block <-> 48 afpSCBPtr pointer SCB pointer <-> 52 afpAttnRoutine pointer Attention routine pointer --> 50 ccbStart record Start of command control block CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number (returned by the AFPLogin call). ASPTimeOut is the interval in seconds between retries of the call. ASPRetry is the number of retries that will be attempted. CBSize is the size in bytes of the block data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the ASPGetParms call. CBPtr points to the block of data (command block) containing the AFP login command that is to be sent to the server on the session. The first byte of the command block must be the AFP login command byte. Subsequent bytes in the command buffer contain the parameters associated with the command. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. AFPServerAddr is the network identifier or address of the socket on which the server is listening. AFPSCBPointer points to a locked block of data for the session control block (SCB). The SCB size is defined by scbMemSize. The SCB is a locked block, and as long as the session is open, the SCB cannot be modified in any way by the application. There is one SCB for each open session. AFPAttnRoutine is a pointer to a routine that is invoked if an attention from the server is received. When afpAttnRoutine is equal to zero, no attention routine will be invoked. CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 150 bytes. To determine the exact requirement refer to the CCB Sizes section later in this chapter. Note: In the parameter block, the afpSCBPointer and the afpAttnRoutine fields overlap with the start of the CCB and are modified by the call. Result codes aspSizeErr Command block size is bigger than MaxCmdSize aspBufTooSmall Reply is bigger than response buffer or buffer will be filled, data will be truncated aspNoServer Server not responding aspServerBusy Server cannot open another session aspBadVersNum Server cannot support the offered ASP version number aspNoMoreSess Driver cannot support another session. »AFPWrite Command Format The AFPWrite and AFPRead command formats allow the calling application to make AFP-level calls that read or write a data block that is larger than a single ASP-level call is capable of reading or writing. The maximum number of bytes of data that can be read or written at the ASP level is equal to quantumSize. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr; Parameter block --> 18 cmdResult long word AFP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer <-> 38 rbSize word Reply buffer size and reply size --> 40 rbPtr pointer Reply buffer pointer --> 44 wdSize word (used internally) <-> 46 wdPtr pointer Write data pointer (updated) --> 50 ccbStart record Start of memory for CCB CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number returned in the AFPLogin call. ASPTimeOut is the interval in seconds between retries of the call. CBSize is the size in bytes of the block data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the aspGetParms call. CBPtr points to the block of data (see command block structure below) containing the AFP write command that is to be sent to the server on the session. The first byte of the Command Block must contain the AFP write command byte. RBSize is passed and indicates the size of the reply buffer in bytes expected by the command. RBSize is also returned and indicates the size of the reply that was actually returned. RBPtr points to the reply buffer. WDSize is used internally. Note: This command does not pass the write data size in the queue element but in the command buffer. XPP will look for the size in that buffer. WDPtr is a pointer to the block of data to be written. Note that this field will be updated by XPP as it proceeds and will always point to that section of the data which XPP is currently writing. CCBStart is the start of the memory to be used by the XPP driver for the command control block. The size of this block is equal to a maximum of 296 bytes. To determine the exact requirement refer to the CCB Sizes section later in this chapter. Command Block Structure: The AFP write command passes several arguments to XPP in the command buffer itself. The byte offsets are relative to the location pointed to by cbPtr. --> 0 cmdByte byte AFP call command byte --> 1 startEndFlag byte Start/end Flag <-> 4 rwOffset long word Offset within fork to write <-> 8 reqCount long word Requested count CmdByte is the AFP call command byte and must contain the AFP write command code. StartEndFlag is a one-bit flag (the high bit of the byte) indicating whether the rwOffset field is relative to the beginning or the end of the fork (all other bits are zero). 0 = relative to the beginning of the fork 1 = relative to the end of the fork RWOffset is the byte offset within the fork at which the write is to begin. ReqCount indicates the size of the data to be written and is returned as the actual size written. The rwOffset and reqCount fields are modified by XPP as the write proceeds and will always indicate the current value of these fields. The Pascal structure of the AFP command buffer follows: AFPCommandBlock = PACKED RECORD cmdByte: Byte; startEndFlag: Byte; forkRefNum: INTEGER; {used by server} rwOffset: LONGINT; reqCount: LONGINT; newLineFlag: Byte; {unused by write} newLineChar: CHAR; {unused by write} END; Result codes aspParamErr Invalid session number aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer »AFPRead Command Format The AFPWrite and AFPRead command formats allow the calling application to make AFP-level calls that read or write a data block that is larger than a single ASP-level call is capable of reading or writing. The maximum number of bytes of data that can be read or written at the ASP level is equal to quantumSize. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr; Parameter block --> 18 cmdResult long word ASP command result --> 26 csCode word Always AFPCall --> 28 sessRefnum word Session number --> 30 aspTimeout byte Retry interval in seconds --> 32 cbSize word Command buffer size --> 34 cbPtr pointer Command buffer --> 38 rbSize word Used internally <-> 40 rbPtr pointer Reply buffer pointer (updated) --> 50 ccbStart record Start of memory for CCB CmdResult is four bytes of data returned from the server containing an indication of the result of the AFP command. SessRefnum is the session reference number returned in the AFPLogin call. ASPTimeOut is the interval in seconds between retries of the call. CBSize is the size in bytes of the block data that contains the command to be sent to the server on the session. The size of the command block must not exceed the value of aspMaxCmdSize returned by the GetParms call. CBPtr points to the block of data (command block) containing the AFP read command that is to be sent to the server on the session. The first byte of the command block must contain the AFP read command byte. The command block structure is shown below. RBSize is used internally. Note: This command does not pass the read size in the queue element but in the command buffer. XPP will look for the size in that buffer. RBPtr points to the reply buffer. Note that this field will be updated by XPP as it proceeds and will always point to that section of the buffer that XPP is currently reading into. CCBStart is the start of the memory to be used by the .XPP driver for the command control block. The size of this block is equal to a maximum of 150 bytes. To determine the exact requirement refer to The CCB Sizes section later in this chapter. Command Block Structure: The AFP read command passes several arguments to XPP in the command buffer itself. The byte offsets are relative to the location pointed to by cbPointer. --> 0 cmdByte byte AFP call command byte <-> 4 rwOffset long word Offset within fork to read <-> 8 reqCount long word Requested count --> 12 newLineFlag byte Newline Flag --> 13 newLineChar byte Newline Character CmdByte is the AFP call command byte and must contain the AFP read command code. RWOffset is the byte offset within the fork at which the read is to begin. ReqCount indicates the size of the read data buffer and is returned as the actual size read. The rwOffset and reqCount fields are modified by XPP as the read proceeds and will always indicate the current value of these fields. NewLineFlag is a one-bit flag (the high bit of the byte) indicating whether or not the read is to terminate at a specified character (all other bits are zero). 0 = no Newline Character is specified 1 = a Newline Character is specified NewLineChar is any character from $00 to $FF (inclusive) that, when encountered in reading the fork, causes the read operation to terminate. The Pascal structure of the AFPCommand follows: AFPCommandBlock = PACKED RECORD cmdByte: Byte; startEndFlag: Byte; {unused for read} forkRefNum: INTEGER; {used by server} rwOffset: LONGINT; reqCount: LONGINT; newLineFlag: Byte; newLineChar: CHAR; END; Result codes aspParamErr Invalid session number aspSizeErr Command block size is bigger than MaxCmdSize aspSessClosed Session is closing aspBufTooSmall Reply is bigger than response buffer æKY PAttachPH æFp AppleTalk.p æT FUNCTION æD FUNCTION PAttachPH(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PAttachPH(thePBptr,async); æRI II-308, V-513 æC AttachPH function Parameter block -> 26 csCode word ;always attachPH -> 28 protType byte ;ALAP protocol type -> 30 handler pointer ;protocol handler AttachPH adds the protocol handler pointed to by handler to the node's protocol table. ProtType specifies what kind of frame the protocol handler can service. After AttachPH is called, the protocol handler is called for each incoming frame whose ALAP protocol type equals protType. Result codes noErr No error lapProtErr Error attaching protocol type æKY PDetachPH æFp AppleTalk.p æT FUNCTION æD FUNCTION PDetachPH(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PDetachPH(thePBptr,async); æRI II-308, V-513 æC DetachPH function Parameter block -> 26 csCode word ;always detachPH -> 28 protType byte ;ALAP protocol type DetachPH removes from the node's protocol table the specified ALAP protocol type and corresponding protocol handler. Result codes noErr No error lapProtErr Error detaching protocol type æKY PWriteLAP æFp AppleTalk.p æT FUNCTION æD FUNCTION PWriteLAP(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PWriteLAP(thePBptr,async); æRI II-307, V-513 æC WriteLAP function Parameter block -> 26 csCode word ;always writeLAP -> 30 wdsPointer pointer ;write data structure WriteLAP sends a frame to another node. The frame data and destination of the frame are described by the write data structure pointed to by wdsPointer. The first two data bytes of an ALAP frame sent to another computer using the AppleTalk Manager must indicate the length of the frame in bytes. The ALAP protocol type byte must be in the range 1 to 127. Result codes noErr No error excessCollsns No CTS received after 32 RTS's ddpLengthErr Packet length exceeds maximum lapProtErr Invalid ALAP protocol type æKY POpenSkt æFp AppleTalk.p æT FUNCTION æD FUNCTION POpenSkt(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := POpenSkt(thePBptr,async); æRI II-311, V-513 æC OpenSkt function Parameter block -> 26 csCode word ;always openSkt <-> 28 socket byte ;socket number -> 30 listener pointer ;socket listener OpenSkt adds a socket and its socket listener to the socket table. If the socket parameter is nonzero, it must be in the range 64 to 127, and it specifies the socket's number; if socket is 0, OpenSkt opens a socket with a socket number in the range 128 to 254, and returns it in the socket parameter. Listener contains a pointer to the socket listener. OpenSkt will return ddpSktErr if you pass the number of an already opened socket, if you pass a socket number greater than 127, or if the socket table is full (the socket table can hold a maximum of 12 sockets). Result codes noErr No error ddpSktErr Socket error æKY PCloseSkt æFp AppleTalk.p æT FUNCTION æD FUNCTION PCloseSkt(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PCloseSkt(thePBptr,async); æRI II-312,V513 æC CloseSkt function Parameter block -> 26 csCode word ;always closeSkt -> 28 socket byte ;socket number CloseSkt removes the entry of the specified socket from the socket table. If you pass a socket number of 0, or if you attempt to close a socket that isn't open, CloseSkt will return ddpSktErr. Result codes noErr No error ddpSktErr Socket error æKY PWriteDDP æFp AppleTalk.p æT FUNCTION æD FUNCTION PWriteDDP(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PWriteDDP(thePBptr,async); æRI II-312,V-513 æC WriteDDP function Parameter block -> 26 csCode word ;always writeDDP -> 28 socket byte ;socket number -> 29 checksumFlag byte ;checksum flag -> 30 wdsPointer pointer ;write data structure WriteDDP sends a datagram to another socket. WDSPointer points to a write data structure containing the datagram and the address of the destination socket. If checksumFlag is TRUE, WriteDDP will compute the checksum for all datagrams requiring long headers. Result codes noErr No error ddpLenErr Datagram length too big ddpSktErr Socket error noBridgeErr No bridge found æKY PRegisterName æFp AppleTalk.p æT FUNCTION æD FUNCTION PRegisterName(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PRegisterName(thePBptr,async); æRI II-322,V-513 æC RegisterName function Parameter block -> 26 csCode word ;always registerName -> 28 interval byte ;retry interval <-> 29 count byte ;retry count -> 30 ntQElPtr pointer ;names table element pointer -> 34 verifyFlag byte ;set if verify needed RegisterName adds the name and address of an entity to the node's names table. NTQElPtr points to a names table entry containing the entity's name and internet address (in the form shown in Figure 13 above). Meta-characters aren't allowed in the object and type fields of the entity name; the zone field, however, must contain the meta-character "*". If verifyFlag is TRUE, RegisterName checks on the network to see if the name is already in use, and returns a result code of nbpDuplicate if so. Interval and count contain the retry interval in eight-tick units and the retry count. When a retry is made, the count field is modified. Warning: The names table entry passed to RegisterName remains the property of NBP until removed from the names table. Don't attempt to remove or modify it. If you've allocated memory using a NewHandle call, you must lock it as long as the name is registered. Warning: VerifyFlag should normally be set before calling RegisterName. Result codes noErr No error nbpDuplicate Duplicate name already exists nbpNISErr Error opening names information socket æKY PLookupName æFp AppleTalk.p æT FUNCTION æD FUNCTION PLookupName(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PLookupName(thePBptr,async); æRI II-323,V-513 æC LookupName function Parameter block -> 26 csCode word ;always lookupName -> 28 interval byte ;retry interval <-> 29 count byte ;retry count -> 30 entityPtr pointer ;pointer to entity name -> 34 retBuffPtr pointer ;pointer to buffer -> 38 retBuffSize word ;buffer size in bytes -> 40 maxToGet word ;matches to get <-> 42 numGotten word ;matches found LookupName returns the addresses of all entities with a specified name. EntityPtr points to the entity's name (in the form shown in Figure 13 above). Meta- characters are allowed in the entity name. RetBuffPtr and retBuffSize contain the location and size of an area of memory in which the tuples describing the entity names and their corresponding addresses should be returned. MaxToGet indicates the maximum number of matching names to find addresses for; the actual number of addresses found is returned in numGotten. Interval and count contain the retry interval and the retry count. LookupName completes when either the number of matches is equal to or greater than maxToGet, or the retry count has been exceeded. The count field is decremented for each retransmission. Note: NumGotten is first set to 0 and then incremented with each match found. You can test the value in this field, and can start examining the received addresses in the buffer while the lookup continues. Result codes noErr No error nbpBuffOvr Buffer overflow æKY PConfirmName æFp AppleTalk.p æT FUNCTION æD FUNCTION PConfirmName(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PConfirmName(thePBptr,async); æRI II-323,V-513 æC ConfirmName function Parameter block -> 26 csCode word ;always confirmName -> 28 interval byte ;retry interval <-> 29 count byte ;retry count -> 30 entityPtr pointer ;pointer to entity name -> 34 confirmAddr pointer ;entity address <- 38 newSocket byte ;socket number ConfirmName confirms that an entity known by name and address still exists (is still entered in the names directory). EntityPtr points to the entity's name (in the form shown in Figure 13 above). ConfirmAddr specifies the address to confirmed. No meta-characters are allowed in the entity name. Interval and count contain the retry interval and the retry count. The socket number of the entity is returned in newSocket. ConfirmName is more efficient than LookupName in terms of network traffic. Result codes noErr No error nbpConfDiff Name confirmed for different socket nbpNoConfirm Name not confirmed æKY PRemoveName æFp AppleTalk.p æT FUNCTION æD FUNCTION PRemoveName(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PRemoveName(thePBptr,async); æRI II-324,V-513 æC RemoveName function Parameter block -> 26 csCode word ;always removeName -> 30 entityPtr pointer ;pointer to entity name RemoveName removes an entity name from the names table of the given entity's node. Result codes noErr No error nbpNotFound Name not found æKY PSetSelfSend æFp AppleTalk.p æT FUNCTION æD FUNCTION PSetSelfSend(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PSetSelfSend(thePBptr,async); æRI V-516 æC _______________________________________________________________________________ »SENDING PACKETS TO ONE’S OWN NODE _______________________________________________________________________________ Upon opening, the ability to send a packet to one’s own node (intranode delivery) is disabled. This feature of the AppleTalk Manager can be manipulated through the SetSelfSend function. Once enabled, it is possible, at all levels, to send packets to entities within one’s own node. An example of where this might be desirable is an application sending data to a print spooler that is actually running in the background on the same node. Enabling (or disabling) this feature affects the entire node and should be performed with care. For instance, a desk accessory may not expect to receive names from within its own node as a response to an NBP look-up; enabling this feature from an application could break the desk accessory. All future programs should be written with this feature in mind. FUNCTION PSetSelfSend (thePBptr: MPPPBPtr; async: BOOLEAN) : OSErr; Parameter Block --> 26 csCode word Always PSetSelfSend --> 28 newSelfFlag byte New SelfSend flag <-- 29 oldSelfFlag byte Old SelfSend flag PSetSelfSend enables or disables the intranode delivery feature of the AppleTalk Manager. If newSelfFlag is nonzero, the feature will be enabled; otherwise it will be disabled. The previous value of the flag will be returned in oldSelfFlag. Result Codes noErr No error æKY PKillNBP æFp AppleTalk.p æT FUNCTION æD FUNCTION PKillNBP(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PKillNBP(thePBptr,async); æRI V-518 æC _______________________________________________________________________________ »NAME BINDING PROTOCOL CHANGES _______________________________________________________________________________ Changes to the Name Binding Protocol include supporting multiple concurrent requests and a means for aborting an active request. »Multiple Concurrent NBP Requests NBP now supports multiple concurrent active requests. Specifically, a number of LookupNames, RegisterNames and ConfirmNames can all be active concurrently. The maximum number of concurrent requests is machine dependent; if it is exceeded the error tooManyReqs will be returned. Active requests can be aborted by the PKillNBP call. »KillNBP function FUNCTION PKillNBP (thePBptr: ATPPBPtr; async: BOOLEAN) : OSErr; •••Refer to Technical Note #199:••• Parameter block --> 26 csCode word Always PKillNBP --> 28 aKillQEl pointer Pointer to queue element PKillNBP is used to abort an outstanding LookupName, RegisterName or ConfirmName request. To abort one of these calls, place a pointer to the queue element of the call to abort in a KillQEl and issue the PKillNBP call. The call will be completed with a ReqAborted error. Result Codes noErr No error cbNotFound aKillQEl does not point to a valid NBP queue element æKY PGetAppleTalkInfo æFp AppleTalk.p æT FUNCTION æD FUNCTION PGetAppleTalkInfo(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PGetAppleTalkInfo(thePBptr,async); æRI V-518 æC _______________________________________________________________________________ »NAME BINDING PROTOCOL CHANGES _______________________________________________________________________________ Changes to the Name Binding Protocol include supporting multiple concurrent requests and a means for aborting an active request. »Multiple Concurrent NBP Requests NBP now supports multiple concurrent active requests. Specifically, a number of LookupNames, RegisterNames and ConfirmNames can all be active concurrently. The maximum number of concurrent requests is machine dependent; if it is exceeded the error tooManyReqs will be returned. Active requests can be aborted by the PKillNBP call. »KillNBP function FUNCTION PKillNBP (thePBptr: ATPPBPtr; async: BOOLEAN) : OSErr; •••Refer to Technical Note #199:••• Parameter block --> 26 csCode word Always PKillNBP --> 28 aKillQEl pointer Pointer to queue element PKillNBP is used to abort an outstanding LookupName, RegisterName or ConfirmName request. To abort one of these calls, place a pointer to the queue element of the call to abort in a KillQEl and issue the PKillNBP call. The call will be completed with a ReqAborted error. Result Codes noErr No error cbNotFound aKillQEl does not point to a valid NBP queue element æKY PATalkClosePrep æFp AppleTalk.p æT FUNCTION æD FUNCTION PATalkClosePrep(thePBptr: MPPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PATalkClosePrep(thePBptr,async); æRI V-518 æC _______________________________________________________________________________ »NAME BINDING PROTOCOL CHANGES _______________________________________________________________________________ Changes to the Name Binding Protocol include supporting multiple concurrent requests and a means for aborting an active request. »Multiple Concurrent NBP Requests NBP now supports multiple concurrent active requests. Specifically, a number of LookupNames, RegisterNames and ConfirmNames can all be active concurrently. The maximum number of concurrent requests is machine dependent; if it is exceeded the error tooManyReqs will be returned. Active requests can be aborted by the PKillNBP call. »KillNBP function FUNCTION PKillNBP (thePBptr: ATPPBPtr; async: BOOLEAN) : OSErr; •••Refer to Technical Note #199:••• Parameter block --> 26 csCode word Always PKillNBP --> 28 aKillQEl pointer Pointer to queue element PKillNBP is used to abort an outstanding LookupName, RegisterName or ConfirmName request. To abort one of these calls, place a pointer to the queue element of the call to abort in a KillQEl and issue the PKillNBP call. The call will be completed with a ReqAborted error. Result Codes noErr No error cbNotFound aKillQEl does not point to a valid NBP queue element æKY POpenATPSkt æFp AppleTalk.p æT FUNCTION æD FUNCTION POpenATPSkt(thePBptr: ATPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := POpenATPSkt(thePBptr,async); æRI II-315,V-513 æC OpenATPSkt function Parameter block -> 26 csCode word ;always openATPSkt <-> 28 atpSocket byte ;socket number -> 30 addrBlock long word ;socket request specification OpenATPSkt opens a socket for the purpose of receiving requests. ATPSocket contains the socket number of the socket to open. If it's 0, a number is dynamically assigned and returned in atpSocket. AddrBlock contains a specification of the socket addresses from which requests will be accepted. A 0 in the network number, node ID, or socket number field of addrBlock means that requests will be accepted from every network, node, or socket, respectively. Result codes noErr No error tooManySkts Too many responding sockets noDataArea Too many outstanding ATP calls æKY PCloseATPSkt æFp AppleTalk.p æT FUNCTION æD FUNCTION PCloseATPSkt(thePBPtr: ATPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PCloseATPSkt(thePBPtr,async); æRI II-316,V-513 æC CloseATPSkt function Parameter block -> 26 csCode word ;always closeATPSkt -> 28 atpSocket byte ;socket number CloseATPSkt closes the socket whose number is specified by atpSocket, for the purpose of receiving requests. Result codes noErr No error æKY PSendRequest æFp AppleTalk.p æT FUNCTION æD FUNCTION PSendRequest(thePBPtr: ATPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PSendRequest(thePBPtr,async); æRI II-316,V-513 æC SendRequest function Parameter block -> 18 userData long word ;user bytes <- 22 reqTID word ;transaction ID used in request -> 26 csCode word ;always sendRequest <- 28 currBitMap byte ;bit map <-> 29 atpFlags byte ;control information -> 30 addrBlock long word ;destination socket address -> 34 reqLength word ;request size in bytes -> 36 reqPointer pointer ;pointer to request data -> 40 bdsPointer pointer ;pointer to response BDS -> 44 numOfBuffs byte ;number of responses expected -> 45 timeOutVal byte ;timeout interval <- 46 numOfResps byte ;number of responses received <-> 47 retryCount byte ;number of retries SendRequest sends a request to another socket and waits for a response. UserData contains the four user bytes. AddrBlock indicates the socket to which the request should be sent. ReqLength and reqPointer contain the size and location of the request to send. BDSPointer points to a response BDS where the responses are to be returned; numOfBuffs indicates the number of responses requested. The number of responses received is returned in numOfResps. If a nonzero value is returned in numOfResps, you can examine currBitMap to determine which packets of the transaction were actually received and to detect pieces for higher-level recovery, if desired. TimeOutVal indicates the number of seconds that SendRequest should wait for a response before resending the request. RetryCount indicates the maximum number of retries SendRequest should attempt. The end-of-message flag of atpFlags will be set if the EOM bit is set in the last packet received in a valid response sequence. The exactly-once flag should be set if you want the request to be part of an exactly-once transaction. To cancel a SendRequest call, you need the transaction ID; it's returned in reqTID. You can examine reqTID before the completion of the call, but its contents are valid only after the tidValid bit of atpFlags has been set. SendRequest completes when either an entire response is received or the retry count is exceeded. Note: The value provided in retryCount will be modified during SendRequest if any retries are made. This field is used to monitor the number of retries; for each retry, it's decremented by 1. Result codes noErr No error reqFailed Retry count exceeded tooManyReqs Too many concurrent requests noDataArea Too many outstanding ATP calls reqAborted Request canceled by user æKY PGetRequest æFp AppleTalk.p æT FUNCTION æD FUNCTION PGetRequest(thePBPtr: ATPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PGetRequest(thePBPtr,async); æRI II-317,V-513 æC GetRequest function Parameter block <- 18 userData long word ;user bytes -> 26 csCode word ;always getRequest -> 28 atpSocket byte ;socket number <- 29 atpFlags byte ;control information <- 30 addrBlock long word ;source of request <-> 34 reqLength word ;request buffer size -> 36 reqPointer pointer ;pointer to request buffer <- 44 bitMap byte ;bit map <- 46 transID word ;transaction ID GetRequest sets up the mechanism to receive a request sent by a SendRequest call. UserData returns the four user bytes from the request. ATPSocket contains the socket number of the socket that should listen for a request. The internet address of the socket from which the request was sent is returned in addrBlock. ReqLength and reqPointer indicate the size (in bytes) and location of a buffer to store the incoming request. The actual size of the request is returned in reqLength. The transaction bit map and transaction ID will be returned in bitMap and transID. The exactly-once flag in atpFlags will be set if the request is part of an exactly-once transaction. GetRequest completes when a request is received. Result codes noErr No error badATPSkt Bad responding socket æKY PSendResponse æFp AppleTalk.p æT FUNCTION æD FUNCTION PSendResponse(thePBPtr: ATPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PSendResponse(thePBPtr,async); æRI II-317,V-513 æC SendResponse function Parameter block <- 18 userData long word ;user bytes from TRel <- 22 reqTID word ;transaction ID used in request -> 26 csCode word ;always sendResponse -> 28 atpSocket byte ;socket number -> 29 atpFlags byte ;control information -> 30 addrBlock long word ;response destination -> 40 bdsPointer pointer ;pointer to response BDS -> 44 numOfBuffs byte ;number of response packets being sent -> 45 bdsSize byte ;BDS size in elements -> 46 transID word ;transaction ID SendResponse sends a response to a socket. If the response was part of an exactly- once transaction, userData will contain the user bytes from the TRel packet. ATPSocket contains the socket number from which the response should be sent. The end-of-message flag in atpFlags should be set if the response contains the final packet in a transaction composed of a group of packets and the number of responses is less than requested. AddrBlock indicates the address of the socket to which the response should be sent. BDSPointer points to a response BDS containing room for the maximum number of responses to be sent; bdsSize contains this maximum number. NumOfBuffs contains the number of response packets to be sent in this call; you may wish to make AddResponse calls to complete the response. TransID indicates the transaction ID of the associated request. During exactly-once transactions, SendResponse doesn't complete until either a TRel packet is received from the socket that made the request, or the retry count is exceeded. Result codes noErr No error badATPSkt Bad responding socket noRelErr No release received noDataArea Too many outstanding ATP calls badBuffNum Sequence number out of range æKY PAddResponse æFp AppleTalk.p æT FUNCTION æD FUNCTION PAddResponse(thePBPtr: ATPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PAddResponse(thePBPtr,async); æRI II-318,V-513 æC AddResponse function Parameter block -> 18 userData long word ;user bytes -> 26 csCode word ;always addResponse -> 28 atpSocket byte ;socket number -> 29 atpFlags byte ;control information -> 30 addrBlock long word ;response destination -> 34 reqLength word ;response size -> 36 reqPointer pointer ;pointer to response -> 44 rspNum byte ;sequence number -> 46 transID word ;transaction ID AddResponse sends an additional response packet to a socket that has already been sent the initial part of a response via SendResponse. UserData contains the four user bytes. ATPSocket contains the socket number from which the response should be sent. The end-of-message flag in atpFlags should be set if this response packet is the final packet in a transaction composed of a group of packets and the number of responses is less than requested. AddrBlock indicates the socket to which the response should be sent. ReqLength and reqPointer contain the size (in bytes) and location of the response to send; rspNum indicates the sequence number of the response (in the range 0 to 7). TransID must contain the transaction ID. Warning: If the transaction is part of an exactly-once transaction, the buffer used in the AddResponse call must not be altered or released until the corresponding SendResponse call has completed. Result codes noErr No error badATPSkt Bad responding socket noSendResp AddResponse issued before SendResponse badBuffNum Sequence number out of range noDataArea Too many outstanding ATP calls æKY PRelTCB æFp AppleTalk.p æT FUNCTION æD FUNCTION PRelTCB(thePBPtr: ATPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PRelTCB(thePBPtr,async); æRI II-319,V-513 æC RelTCB function Parameter block -> 26 csCode word ;always relTCB -> 30 addrBlock long word ;destination of request -> 46 transID word ;transaction ID of request RelTCB dequeues the specified SendRequest call and returns the result code reqAborted for the aborted call. The transaction ID can be obtained from the reqTID field of the SendRequest queue entry; see the description of SendRequest for details. Result codes noErr No error cbNotFound ATP control block not found noDataArea Too many outstanding ATP calls æKY PRelRspCB æFp AppleTalk.p æT FUNCTION æD FUNCTION PRelRspCB(thePBPtr: ATPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PRelRspCB(thePBPtr,async); æRI II-319,V-514 æC RelRspCB function Parameter block -> 26 csCode word ;always relRspCB -> 28 atpSocket byte ;socket number that request was received on -> 30 addrBlock long word ;source of request -> 46 transID word ;transaction ID of request In an exactly-once transaction, RelRspCB cancels the specified SendResponse, without waiting for the release timer to expire or a TRel packet to be received. No error is returned for the SendResponse call. Whan called to cancel a transaction that isn't using exactly-once service, RelRspCB returns cbNotFound. The transaction ID can be obtained from the reqTID field of the SendResponse queue entry; see the description of SendResponse for details. Result codes noErr No error cbNotFound ATP control block not found æKY PNSendRequest æFp AppleTalk.p æT FUNCTION æD FUNCTION PNSendRequest(thePBPtr: ATPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PNSendRequest(thePBPtr,async); æRI V-516 æC »Sending an ATP Request Through a Specified Socket ATP requests can now be sent through client-specified sockets. ATP previously would open a dynamic socket, send the request through it, and close the socket when the request was completed. The client can now choose to send a request through an already-opened socket; this also allows more than one request to be sent per socket. A new call, PNSendRequest, has been added for this purpose. The function of the old SendRequest call itself remains unchanged. FUNCTION PNSendRequest (thePBptr: ATPBPtr; async: BOOLEAN) : OSErr; Parameter block --> 18 userData longword User bytes <-- 22 reqTID word Transaction ID used in request --> 26 csCode word Always sendRequest <-> 28 atpSocket byte Socket to send request on or current bitmap <-> 29 atpFlags byte Control information --> 30 addrBlock longword Destination socket address --> 34 reqLength word Request size in bytes --> 36 reqPointer pointer Pointer to request data --> 40 bdsPointer pointer Pointer to response BDS --> 44 numOfBuffs byte Number of responses expected --> 45 timeOutVal byte Timeout interval <-- 46 numOf Resps byte Number of responses received <-> 47 retryCount byte Number of retries <-- 48 intBuff word Used internally The PNSendRequest call is functionally equivalent to the SendRequest call, however PNSendRequest allows you to specify, in the atpSocket field, the socket through which the request is to be sent. This socket must have been previously opened through an OpenATPSkt request (otherwise a badATPSkt error will be returned). Note that PNSendRequest requires two additional bytes of memory at the end of the parameter block, immediately following the retryCount. These bytes are for the internal use of the AppleTalk Manager and should not be modified while the PNSendRequest call is active. There is a machine-dependent limit as to the number of concurrent PNSendRequests that can be active on a given socket. If this limit is exceeded, the error tooManyReqs is returned. One additional difference between SendRequest and PNSendRequest is that a PNSendRequest can only be aborted by a PKillSendReq call (see below), whereas a SendRequest can be aborted by either a RelTCB or KillSendReq call. Result Codes noErr No error reqFailed Retry count exceeded tooManyReqs Too many concurrent requests noDataArea Too many outstanding ATP calls reqAborted Request cancelled by user æKY PKillSendReq æFp AppleTalk.p æT FUNCTION æD FUNCTION PKillSendReq(thePBPtr: ATPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PKillSendReq(thePBPtr,async); æRI V-517 æC »Aborting ATP SendRequests The RelTCB call is still supported, but only for aborting SendRequests. To abort PNSendRequests, a new call, PKillSendReq, has been added. This call will abort both SendRequests and PNSendRequests. PKillSendReq’s only argument is the queue element pointer of the request to be aborted. The queue element pointer is passed at the offset of the PKillSendReq queue element specified by aKillQE1. FUNCTION PKillSendReq (thePBptr: ATPPBPtr; async: BOOLEAN) : OSErr; Parameter block --> 26 csCode word Always PKillSendReq --> 44 aKillQEl pointer Pointer to queue element PKillSendReq is functionally equivalent to RelTCB, except that it takes different arguments and will abort both SendRequests and PNSendRequests. To abort one of these calls, place a pointer to the queue element of the call to abort in aKillQEl and issue the PKillSendReq call. Result Codes noErr No error cbNotFound aKillQEl does not point to a SendReq or NSendReq queue element æKY PKillGetReq æFp AppleTalk.p æT FUNCTION æD FUNCTION PKillGetReq(thePBPtr: ATPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PKillGetReq(thePBPtr,async); æRI V-518 æC »Aborting ATP GetRequests ATP GetRequests can now be aborted through the PKillGetReq call. This call looks and works just like the PKillSendReq call, and is used to abort a specific GetRequest call. Previously it was necessary to close the socket to abort all GetRequest calls on the socket. FUNCTION PKillGetReq (thePBptr: ATPPBPtr; async: BOOLEAN) : OSErr; Parameter block --> 26 csCode word Always PKillGetReq --> 44 aKillQEl pointer Pointer to queue element PKillGetReq will abort a specific outstanding GetRequest call (as opposed to closing the socket, which aborts all outstanding GetRequests on that socket). The call will be completed with a reqAborted error. To abort a GetRequest, place a pointer to the queue element of the call to abort in aKillQEl and issue the PKillGetReq call. Result Codes noErr No error cbNotFound aKillQEl does not point to a GetReq queue element æKY ATPKillAllGetReq æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPKillAllGetReq(thePBPtr: ATPPBPtr;async: BOOLEAN): OSErr; æDT myVariable := ATPKillAllGetReq(thePBPtr,async); æRI V-518 æC »Aborting ATP GetRequests ATP GetRequests can now be aborted through the PKillGetReq call. This call looks and works just like the PKillSendReq call, and is used to abort a specific GetRequest call. Previously it was necessary to close the socket to abort all GetRequest calls on the socket. FUNCTION PKillGetReq (thePBptr: ATPPBPtr; async: BOOLEAN) : OSErr; Parameter block --> 26 csCode word Always PKillGetReq --> 44 aKillQEl pointer Pointer to queue element PKillGetReq will abort a specific outstanding GetRequest call (as opposed to closing the socket, which aborts all outstanding GetRequests on that socket). The call will be completed with a reqAborted error. To abort a GetRequest, place a pointer to the queue element of the call to abort in aKillQEl and issue the PKillGetReq call. Result Codes noErr No error cbNotFound aKillQEl does not point to a GetReq queue element æKY BuildLAPwds æFp AppleTalk.p æT PROCEDURE æD PROCEDURE BuildLAPwds(wdsPtr: Ptr;dataPtr: Ptr;destHost: INTEGER;prototype: INTEGER; frameLen: INTEGER); æDT BuildLAPwds(wdsPtr,dataPtr,destHost,prototype,frameLen); æRI V-514 æC This routine builds a single-frame write data structure LAP WDS for use with the PWriteLAP call. Given a buffer of length frameLen pointed to by dataPtr, it fills in the WDS pointed to by wdsPtr and sets the destination node and protocol type as indicated by destHost and protoType, respectively. The WDS indicated must contain at least two elements. æKY BuildDDPwds æFp AppleTalk.p æT PROCEDURE æD PROCEDURE BuildDDPwds(wdsPtr: Ptr;headerPtr: Ptr;dataPtr: Ptr;netAddr: AddrBlock; ddpType: INTEGER;dataLen: INTEGER); æDT BuildDDPwds(wdsPtr,headerPtr,dataPtr,netAddr,ddpType,dataLen); æRI V-514 æC This routine builds a single-frame write data structure DDP WDS, for use with the PWriteDDP call. Given a header buffer of at least 17 bytes pointed to by headerPtr and a data buffer of length dataLen pointed to by dataPtr, it fills in the WDS pointed to by wdsPtr, and sets the destination address and protocol type as indicated by destaddress and DDPtype, respectively. The WDS indicated must contain at least 3 elements. æKY NBPSetEntity æFp AppleTalk.p æT PROCEDURE æD PROCEDURE NBPSetEntity(buffer: Ptr;nbpObject: Str32;nbpType: Str32;nbpZone: Str32); æDT NBPSetEntity(buffer,nbpObject,nbpType,nbpZone); æRI V-514 æC This routine builds an NBP entity structure, for use with the PLookupNBP and PConfirmName calls. Given a buffer of at least the size of the EntityName data structure (99 bytes) pointed to by buffer, this routine sets the indicated object, type, and zone in that buffer. æKY NBPSetNTE æFp AppleTalk.p æT PROCEDURE æD PROCEDURE NBPSetNTE(ntePtr: Ptr;nbpObject: Str32;nbpType: Str32;nbpZone: Str32; socket: INTEGER); æDT NBPSetNTE(ntePtr,nbpObject,nbpType,nbpZone,socket); æRI V-515 æC This routine builds an NBP names table entry, for use with the PRegisterName call. Given a names table entry of at least the size of the EntityName data structure plus nine bytes (108 bytes) pointed to by ntePtr, this routine sets the indicated object, type, zone, and socket in that names table entry. æKY GetBridgeAddress æFp AppleTalk.p æT FUNCTION æD FUNCTION GetBridgeAddress: INTEGER; æDT myVariable := GetBridgeAddress; æRT 132 æRI V-515, N132-2 æC This routine returns the current address of a bridge in the low byte, or zero if there is none. æKY BuildBDS æFp AppleTalk.p æT FUNCTION æD FUNCTION BuildBDS(buffPtr: Ptr;bdsPtr: Ptr;buffSize: INTEGER): INTEGER; æDT myVariable := BuildBDS(buffPtr,bdsPtr,buffSize); æRI V-515 æC This routine builds a BDS, for use with the ATP calls. Given a data buffer of length buffSize pointed to by buffPtr, it fills in the BDS pointed to by bdsPtr. The buffer will be broken up into pieces of maximum size (578 bytes). The user bytes in the BDS are not modified by this routine. This routine is provided only as a convenience; generally the caller will be able to build the BDS completely from Pascal without it. æKY MPPOpen æFp AppleTalk.p æT FUNCTION æD FUNCTION MPPOpen: OSErr; æDT myVariable := MPPOpen; æMM æRT 224 æRI II-275 æC MPPOpen first checks whether the .MPP driver has already been loaded; if it has, MPPOpen does nothing and returns noErr. If MPP hasn’t been loaded, MPPOpen attempts to load it into the system heap. If it succeeds, it then initializes the driver’s variables and goes through the process of dynamically assigning a node ID to that Macintosh. On a Macintosh 512K or XL, it also loads the .ATP driver and NBP code into the system heap. If serial port B isn’t configured for AppleTalk, or is already in use, the .MPP driver isn’t loaded and an appropriate result code is returned. Result codes noErr No error portInUse Port B is already in use portNotCf Port B not configured for AppleTalk æKY MPPClose æFp AppleTalk.p æT FUNCTION æD FUNCTION MPPClose: OSErr; æDT myVariable := MPPClose; æMM æRI II-275 æC MPPClose removes the .MPP driver, and any data structures associated with it, from memory. If the .ATP driver or NBP code were also installed, they’re removed as well. MPPClose also returns the use of port B to the Serial Driver. Warning: Since other co-resident programs may be using AppleTalk, it’s strongly recommended that you never use this call. MPPClose will completely disable AppleTalk; the only way to restore AppleTalk is to call MPPOpen again. æKY LAPOpenProtocol æFp AppleTalk.p æT FUNCTION æD FUNCTION LAPOpenProtocol(theLAPType: ABByte;protoPtr: Ptr): OSErr; æDT myVariable := LAPOpenProtocol(theLAPType,protoPtr); æMM æRI II-277 æC æKY LAPCloseProtocol æFp AppleTalk.p æT FUNCTION æD FUNCTION LAPCloseProtocol(theLAPType: ABByte): OSErr; æDT myVariable := LAPCloseProtocol(theLAPType); æMM æRI II-277 æC LAPCloseProtocol removes from the node’s protocol table the specified ALAP protocol type, as well as its protocol handler. Warning: Don’t close ALAP protocol type values 1 or 2. If you close these protocol types, DDP will be disabled; once disabled, the only way to restore DDP is to restart the system, or to close and then reopen AppleTalk. Result codes noErr No error lapProtErr Error detaching protocol type æKY LAPWrite æFp AppleTalk.p æT FUNCTION æD FUNCTION LAPWrite(abRecord: ABRecHandle;async: BOOLEAN): OSErr; æDT myVariable := LAPWrite(abRecord,async); æMM æRI II-277 æC ABusRecord <-- abOpcode {always tLAPWrite} <-- abResult {result code} --> abUserReference {for your use} --> lapAddress.dstNodeID {destination node ID} --> lapAddress.lapProtType {ALAP protocol type} --> lapReqCount {length of frame data} --> lapDataPtr {pointer to frame data} LAPWrite sends a frame to another node. LAPReqCount and lapDataPtr specify the length and location of the data to send. The lapAddress.lapProtType field indicates the ALAP protocol type of the frame and the lapAddress.dstNodeID indicates the node ID of the node to which the frame should be sent. Note: The first two bytes of an ALAP frame’s data must contain the length in bytes of that data, including the length bytes themselves. Result codes noErr No error excessCollsns Unable to contact destination node; packet not sent ddpLenErr ALAP data length too big lapProtErr Invalid ALAP protocol type æKY LAPRead æFp AppleTalk.p æT FUNCTION æD FUNCTION LAPRead(abRecord: ABRecHandle;async: BOOLEAN): OSErr; æDT myVariable := LAPRead(abRecord,async); æMM æRI II-278 æC ABusRecord <-- abOpcode {always tLAPRead} <-- abResult {result code} --> abUserReference {for your use} <-- lapAddress.dstNodeID {destination node ID} <-- lapAddress.srcNodeID {source node ID} --> lapAddress.lapProtType {ALAP protocol type} --> lapReqCount {buffer size in bytes} <-- lapActCount {number of frame data bytes actually received} --> lapDataPtr {pointer to buffer} LAPRead receives a frame from another node. LAPReqCount and lapDataPtr specify the size and location of the buffer that will receive the frame data. If the buffer isn’t large enough to hold all of the incoming frame data, the extra bytes will be discarded and buf2SmallErr will be returned. The number of bytes actually received is returned in lapActCount. Only frames with ALAP protocol type equal to lapAddress.lapProtType will be received. The node IDs of the frame’s source and destination nodes are returned in lapAddress.srcNodeID and lapAddress.dstNodeID. You can determine whether the packet was broadcast to you by examining the value of lapAddress.dstNodeID—if the packet was broadcast it’s equal to 255, otherwise it’s equal to your node ID. Note: You should issue LAPRead calls only for ALAP protocol types that were opened (via LAPOpenProtocol) to use the default protocol handler. Warning: If you close a protocol type for which there are still LAPRead calls pending, the calls will be canceled but the memory occupied by their ABusRecords will not be released. For this reason, before closing a protocol type, call LAPRdCancel to cancel any pending LAPRead calls associated with that protocol type. Result codes noErr No error buf2SmallErr Frame too large for buffer readQErr Invalid protocol type or protocol type not found in table æKY LAPRdCancel æFp AppleTalk.p æT FUNCTION æD FUNCTION LAPRdCancel(abRecord: ABRecHandle): OSErr; æDT myVariable := LAPRdCancel(abRecord); æMM æRI II-279 æC Given the handle to the ABusRecord of a previously made LAPRead call, LAPRdCancel dequeues the LAPRead call, provided that a packet satisfying the LAPRead has not already arrived. LAPRdCancel returns noErr if the LAPRead call is successfully removed from the queue. If LAPRdCancel returns recNotFnd, check the abResult field to verify that the LAPRead has been completed and determine its outcome. Result codes noErr No error readQErr Invalid protocol type or protocol type not found in table recNotFnd ABRecord not found in queue »Example This example sends an ALAP packet synchronously and waits asynchronously for a response. Assume that both nodes are using a known protocol type (in this case, 73) to receive packets, and that the destination node has a node ID of 4. VAR myABRecord: ABRecHandle; myBuffer: PACKED ARRAY [0..599] OF CHAR; {buffer for both send and receive} myLAPType: Byte; errCode, index, dataLen: INTEGER; someText: Str255; async: BOOLEAN; BEGIN errCode := MPPOpen; IF errCode <> noErr THEN WRITELN('Error in opening AppleTalk') {Maybe serial port B isn't available for use by AppleTalk} ELSE BEGIN {Call Memory Manager to allocate ABusRecord} myABRecord := ABRecHandle(NewHandle(lapSize)); myLAPType := 73; {Enter myLAPType into protocol handler table and install default handler to } { service frames of that ALAP type. No packets of that ALAP type will be } { received until we call LAPRead.} errCode := LAPOpenProtocol(myLAPType, NIL); IF errCode <> noErr THEN WRITELN('Error while opening the protocol type') {Have we opened too many protocol types? Remember that DDP uses two of } { them.} ELSE BEGIN {Prepare data to be sent} someText := 'This data will be in the ALAP data area'; {The .MPP implementation requires that the first two bytes of the ALAP } { data field contain the length of the data, including the length bytes } { themselves.} dataLen := LENGTH(someText) + 2; buffer[0] := CHR(dataLen DIV 256); {high byte of data length} buffer[1] := CHR(dataLen MOD 256); {low byte of data length} FOR index := 1 TO dataLen - 2 DO {stuff buffer with packet data} buffer[index + 1] := someText[index]; async := FALSE; WITH myABRecord^^ DO {fill parameters in the ABusRecord} BEGIN lapAddress.lapProtType := myLAPType; lapAddress.dstNodeID := 4; lapReqCount := dataLen; lapDataPtr := @buffer; END; {Send the frame} errCode := LAPWrite(myABRecord, async); {In the case of a sync call, errCode and the abResult field of } { the myABRecord will contain the same result code. We can also } { reuse myABRecord, since we know whether the call has completed.} IF errCode <> noErr THEN WRITELN('Error while writing out the packet') {Maybe the receiving node wasn't on-line} ELSE BEGIN {We have sent out the packet and are now waiting for a response. We } { issue an async LAPRead call so that we don't “hang” waiting for a } { response that may not come.} async := TRUE; WITH myABRecord^^ DO BEGIN lapAddress.lapProtType := myLAPType; {ALAP type we want to receive } lapReqCount := 600; {our buffer is maximum size} lapDataPtr := @buffer; END; errCode := LAPRead(myABRecord, async); {wait for a packet} IF errCode <> noErr THEN WRITELN('Error while trying to queue up a LAPRead') {Was the protocol handler installed correctly?} ELSE BEGIN {We can either sit here in a loop and poll the abResult } { field or just exit our code and use the event } { mechanism to flag us when the packet arrives.} CheckForMyEvent; {your procedure for checking for a network event} errCode := LAPCloseProtocol(myLAPType); IF errCode <> noErr THEN WRITELN('Error while closing the protocol type'); END; END; END; END; END. æKY LAPAddATQ æFp AppleTalk.p æT FUNCTION æD FUNCTION LAPAddATQ(theATQEntry: ATQEntryPtr): OSErr; æDT myVariable := LAPAddATQ(theATQEntry); æMM æRI II-279 æC Given the handle to the ABusRecord of a previously made LAPRead call, LAPRdCancel dequeues the LAPRead call, provided that a packet satisfying the LAPRead has not already arrived. LAPRdCancel returns noErr if the LAPRead call is successfully removed from the queue. If LAPRdCancel returns recNotFnd, check the abResult field to verify that the LAPRead has been completed and determine its outcome. Result codes noErr No error readQErr Invalid protocol type or protocol type not found in table recNotFnd ABRecord not found in queue »Example This example sends an ALAP packet synchronously and waits asynchronously for a response. Assume that both nodes are using a known protocol type (in this case, 73) to receive packets, and that the destination node has a node ID of 4. VAR myABRecord: ABRecHandle; myBuffer: PACKED ARRAY [0..599] OF CHAR; {buffer for both send and receive} myLAPType: Byte; errCode, index, dataLen: INTEGER; someText: Str255; async: BOOLEAN; BEGIN errCode := MPPOpen; IF errCode <> noErr THEN WRITELN('Error in opening AppleTalk') {Maybe serial port B isn't available for use by AppleTalk} ELSE BEGIN {Call Memory Manager to allocate ABusRecord} myABRecord := ABRecHandle(NewHandle(lapSize)); myLAPType := 73; {Enter myLAPType into protocol handler table and install default handler to } { service frames of that ALAP type. No packets of that ALAP type will be } { received until we call LAPRead.} errCode := LAPOpenProtocol(myLAPType, NIL); IF errCode <> noErr THEN WRITELN('Error while opening the protocol type') {Have we opened too many protocol types? Remember that DDP uses two of } { them.} ELSE BEGIN {Prepare data to be sent} someText := 'This data will be in the ALAP data area'; {The .MPP implementation requires that the first two bytes of the ALAP } { data field contain the length of the data, including the length bytes } { themselves.} dataLen := LENGTH(someText) + 2; buffer[0] := CHR(dataLen DIV 256); {high byte of data length} buffer[1] := CHR(dataLen MOD 256); {low byte of data length} FOR index := 1 TO dataLen - 2 DO {stuff buffer with packet data} buffer[index + 1] := someText[index]; async := FALSE; WITH myABRecord^^ DO {fill parameters in the ABusRecord} BEGIN lapAddress.lapProtType := myLAPType; lapAddress.dstNodeID := 4; lapReqCount := dataLen; lapDataPtr := @buffer; END; {Send the frame} errCode := LAPWrite(myABRecord, async); {In the case of a sync call, errCode and the abResult field of } { the myABRecord will contain the same result code. We can also } { reuse myABRecord, since we know whether the call has completed.} IF errCode <> noErr THEN WRITELN('Error while writing out the packet') {Maybe the receiving node wasn't on-line} ELSE BEGIN {We have sent out the packet and are now waiting for a response. We } { issue an async LAPRead call so that we don't “hang” waiting for a } { response that may not come.} async := TRUE; WITH myABRecord^^ DO BEGIN lapAddress.lapProtType := myLAPType; {ALAP type we want to receive } lapReqCount := 600; {our buffer is maximum size} lapDataPtr := @buffer; END; errCode := LAPRead(myABRecord, async); {wait for a packet} IF errCode <> noErr THEN WRITELN('Error while trying to queue up a LAPRead') {Was the protocol handler installed correctly?} ELSE BEGIN {We can either sit here in a loop and poll the abResult } { field or just exit our code and use the event } { mechanism to flag us when the packet arrives.} CheckForMyEvent; {your procedure for checking for a network event} errCode := LAPCloseProtocol(myLAPType); IF errCode <> noErr THEN WRITELN('Error while closing the protocol type'); END; END; END; END; END. æKY LAPRmvATQ æFp AppleTalk.p æT FUNCTION æD FUNCTION LAPRmvATQ(theATQEntry: ATQEntryPtr): OSErr; æDT myVariable := LAPRmvATQ(theATQEntry); æMM æRI II-279 æC Given the handle to the ABusRecord of a previously made LAPRead call, LAPRdCancel dequeues the LAPRead call, provided that a packet satisfying the LAPRead has not already arrived. LAPRdCancel returns noErr if the LAPRead call is successfully removed from the queue. If LAPRdCancel returns recNotFnd, check the abResult field to verify that the LAPRead has been completed and determine its outcome. Result codes noErr No error readQErr Invalid protocol type or protocol type not found in table recNotFnd ABRecord not found in queue »Example This example sends an ALAP packet synchronously and waits asynchronously for a response. Assume that both nodes are using a known protocol type (in this case, 73) to receive packets, and that the destination node has a node ID of 4. VAR myABRecord: ABRecHandle; myBuffer: PACKED ARRAY [0..599] OF CHAR; {buffer for both send and receive} myLAPType: Byte; errCode, index, dataLen: INTEGER; someText: Str255; async: BOOLEAN; BEGIN errCode := MPPOpen; IF errCode <> noErr THEN WRITELN('Error in opening AppleTalk') {Maybe serial port B isn't available for use by AppleTalk} ELSE BEGIN {Call Memory Manager to allocate ABusRecord} myABRecord := ABRecHandle(NewHandle(lapSize)); myLAPType := 73; {Enter myLAPType into protocol handler table and install default handler to } { service frames of that ALAP type. No packets of that ALAP type will be } { received until we call LAPRead.} errCode := LAPOpenProtocol(myLAPType, NIL); IF errCode <> noErr THEN WRITELN('Error while opening the protocol type') {Have we opened too many protocol types? Remember that DDP uses two of } { them.} ELSE BEGIN {Prepare data to be sent} someText := 'This data will be in the ALAP data area'; {The .MPP implementation requires that the first two bytes of the ALAP } { data field contain the length of the data, including the length bytes } { themselves.} dataLen := LENGTH(someText) + 2; buffer[0] := CHR(dataLen DIV 256); {high byte of data length} buffer[1] := CHR(dataLen MOD 256); {low byte of data length} FOR index := 1 TO dataLen - 2 DO {stuff buffer with packet data} buffer[index + 1] := someText[index]; async := FALSE; WITH myABRecord^^ DO {fill parameters in the ABusRecord} BEGIN lapAddress.lapProtType := myLAPType; lapAddress.dstNodeID := 4; lapReqCount := dataLen; lapDataPtr := @buffer; END; {Send the frame} errCode := LAPWrite(myABRecord, async); {In the case of a sync call, errCode and the abResult field of } { the myABRecord will contain the same result code. We can also } { reuse myABRecord, since we know whether the call has completed.} IF errCode <> noErr THEN WRITELN('Error while writing out the packet') {Maybe the receiving node wasn't on-line} ELSE BEGIN {We have sent out the packet and are now waiting for a response. We } { issue an async LAPRead call so that we don't “hang” waiting for a } { response that may not come.} async := TRUE; WITH myABRecord^^ DO BEGIN lapAddress.lapProtType := myLAPType; {ALAP type we want to receive } lapReqCount := 600; {our buffer is maximum size} lapDataPtr := @buffer; END; errCode := LAPRead(myABRecord, async); {wait for a packet} IF errCode <> noErr THEN WRITELN('Error while trying to queue up a LAPRead') {Was the protocol handler installed correctly?} ELSE BEGIN {We can either sit here in a loop and poll the abResult } { field or just exit our code and use the event } { mechanism to flag us when the packet arrives.} CheckForMyEvent; {your procedure for checking for a network event} errCode := LAPCloseProtocol(myLAPType); IF errCode <> noErr THEN WRITELN('Error while closing the protocol type'); END; END; END; END; END. æKY DDPOpenSocket æFp AppleTalk.p æT FUNCTION æD FUNCTION DDPOpenSocket(VAR theSocket: Byte;sktListener: Ptr): OSErr; æDT myVariable := DDPOpenSocket(theSocket,sktListener); æMM æRI II-282 æC DDPOpenSocket adds a socket and its socket listener to the socket table. If theSocket is nonzero, it must be in the range 64 to 127, and it specifies the socket’s number; if theSocket is 0, DDPOpenSocket dynamically assigns a socket number in the range 128 to 254, and returns it in theSocket. SktListener contains a pointer to the socket listener; if it’s NIL, the default listener will be used. If you’re using the default socket listener, you must then call DDPRead to receive a datagram (in order to specify buffer space for the default socket listener). If, however, you’ve written your own socket listener and sktListener points to it, your listener will provide buffers for receiving datagrams and you shouldn’t use DDPRead calls. DDPOpenSocket will return ddpSktErr if you pass the number of an already opened socket, if you pass a socket number greater than 127, or if the socket table is full. Note: The range of static socket numbers 1 through 63 is reserved by Apple for internal use. Socket numbers 64 through 127 are available for unrestricted experimental use. Result codes noErr No error ddpSktErr Socket error æKY DDPCloseSocket æFp AppleTalk.p æT FUNCTION æD FUNCTION DDPCloseSocket(theSocket: Byte): OSErr; æDT myVariable := DDPCloseSocket(theSocket); æMM æRI II-282 æC æKY DDPRead æFp AppleTalk.p æT FUNCTION æD FUNCTION DDPRead(abRecord: ABRecHandle;retCksumErrs: BOOLEAN;async: BOOLEAN): OSErr; æDT myVariable := DDPRead(abRecord,retCksumErrs,async); æMM æRI II-283 æC ABusRecord <-- abOpcode {always tDDPRead} <-- abResult {result code} --> abUserReference {for your use} <-- ddpType {DDP protocol type} --> ddpSocket {listening socket number} <-- ddpAddress {source socket address} --> ddpReqCount {buffer size in bytes} <-- ddpActCount {number of bytes actually received} --> ddpDataPtr {pointer to buffer} <-- ddpNodeID {original destination node ID} DDPRead receives a datagram from another socket. The size and location of the buffer that will receive the data are specified by ddpReqCount and ddpDataPtr. If the buffer isn’t large enough to hold all of the incoming frame data, the extra bytes will be discarded and buf2SmallErr will be returned. The number of bytes actually received is returned in ddpActCount. DDPSocket specifies the socket to receive the datagram (the “listening” socket). The node to which the packet was sent is returned in ddpNodeID; if the packet was broadcast ddpNodeID will contain 255. The address of the socket that sent the packet is returned in ddpAddress. If retCksumErrs is FALSE, DDPRead will discard any packets received with an invalid checksum and inform the caller of the error. If retCksumErrs is TRUE, DDPRead will deliver all packets, whether or not the checksum is valid; it will also notify the caller when there’s a checksum error. Note: The sender of the datagram must be in a different node from the receiver. You should issue DDPRead calls only for receiving datagrams for sockets opened with the default socket listener; see the description of DDPOpenSocket. Note: If the buffer provided isn’t large enough to hold all of the incoming frame data (buf2SmallErr), the checksum can’t be calculated; in this case, DDPRead will deliver packets even if retCksumErrs is FALSE. Result codes noErr No error buf2SmallErr Datagram too large for buffer cksumErr Checksum error ddpLenErr Datagram length too big ddpSktErr Socket error readQErr Invalid socket or socket not found in table æKY DDPWrite æFp AppleTalk.p æT FUNCTION æD FUNCTION DDPWrite(abRecord: ABRecHandle;doChecksum: BOOLEAN;async: BOOLEAN): OSErr; æDT myVariable := DDPWrite(abRecord,doChecksum,async); æMM æRI II-283 æC ABusRecord <-- abOpcode {always tDDPWrite} <-- abResult {result code} --> abUserReference {for your use} --> ddpType {DDP protocol type} --> ddpSocket {source socket number} --> ddpAddress {destination socket address} --> ddpReqCount {length of datagram data} --> ddpDataPtr {pointer to buffer} DDPWrite sends a datagram to another socket. DDPReqCount and ddpDataPtr specify the length and location of the data to send. The ddpType field indicates the DDP protocol type of the frame, and ddpAddress is the complete internet address of the socket to which the datagram should be sent. DDPSocket specifies the socket from which the datagram should be sent. Datagrams sent over the internet to a node on an AppleTalk network different from the sending node’s network have an optional software checksum to detect errors that might occur inside the intermediate bridges. If doChecksum is TRUE, DDPWrite will compute this checksum; if it’s FALSE, this software checksum feature is ignored. Note: The destination socket can’t be in the same node as the program making the DDPWrite call. Result codes noErr No error ddpLenErr Datagram length too big ddpSktErr Source socket not open noBridgeErr No bridge found æKY DDPRdCancel æFp AppleTalk.p æT FUNCTION æD FUNCTION DDPRdCancel(abRecord: ABRecHandle): OSErr; æDT myVariable := DDPRdCancel(abRecord); æMM æRI II-284 æC Given the handle to the ABusRecord of a previously made DDPRead call, DDPRdCancel dequeues the DDPRead call, provided that a packet satisfying the DDPRead hasn’t already arrived. DDPRdCancel returns noErr if the DDPRead call is successfully removed from the queue. If DDPRdCancel returns recNotFnd, check the abResult field of abRecord to verify that the DDPRead has been completed and determine its outcome. Result codes noErr No error readQErr Invalid socket or socket not found in table recNotFnd ABRecord not found in queue »Example This example sends a DDP packet synchronously and waits asynchronously for a response. Assume that both nodes are using a known socket number (in this case, 30) to receive packets. Normally, you would want to use NBP to look up your destination’s socket address. VAR myABRecord: ABRecHandle; myBuffer: PACKED ARRAY [0..599] OF CHAR; {buffer for both send and receive} mySocket: Byte; errCode, index, dataLen: INTEGER; someText: Str255; async, retCksumErrs, doChecksum: BOOLEAN; BEGIN errCode := MPPOpen; IF errCode <> noErr THEN WRITELN('Error in opening AppleTalk') {Maybe serial port B isn't available for use by AppleTalk} ELSE BEGIN {Call Memory Manager to allocate ABusRecord} myABRecord := ABRecHandle(NewHandle(ddpSize)); mySocket := 30; {Add mySocket to socket table and install default socket listener to service } { datagrams addressed to that socket. No packets addressed to mySocket will be } { received until we call DDPRead. } errCode := DDPOpenSocket(mySocket, NIL); IF errCode <> noErr THEN WRITELN('Error while opening the socket') {Have we opened too many socket listeners? Remember that DDP uses two of } { them.} ELSE BEGIN {Prepare data to be sent} someText := 'This is a sample datagram'; dataLen := LENGTH(someText); FOR index := 0 TO dataLen - 1 DO {stuff buffer with packet data} myBuffer[index] := someText[index + 1]; async := FALSE; WITH myABRecord^^ DO {fill the parameters in the ABusRecord} BEGIN ddpType := 5; ddpAddress.aNet := 0; {send on “our” network} ddpAddress.aNode := 34; ddpAddress.aSocket := mySocket; ddpReqCount := dataLen; ddpDataPtr := @myBuffer; END; doChecksum := FALSE; {If packet contains a DDP long header, compute checksum and insert it into } { the header.} errCode := DDPWrite(myABRecord, doChecksum, async); {send packet} {In the case of a sync call, errCode and the abResult field of myABRecord } { will contain the same result code. We can also reuse myABRecord, since we } { know whether the call has completed.} IF errCode <> noErr THEN WRITELN('Error while writing out the packet') {Maybe the receiving node wasn't on-line} ELSE BEGIN {We have sent out the packet and are now waiting for a response. We } { issue an async DDPRead call so that we don't “hang” waiting for a } { response that may not come. To cancel the async read call, we must } { close the socket associated with the call or call DDPRdCancel.} async := TRUE; retCksumErrs := TRUE; {return packets even if } { they have a checksum error} WITH myABRecord^^ DO BEGIN ddpSocket := mySocket; ddpReqCount := 600; {our reception buffer is max size} ddpDataPtr := @myBuffer; END; {Wait for a packet asynchronously} errCode := DDPRead(myABRecord, retCksumErrs, async); IF errCode <> noErr THEN WRITELN('Error while trying to queue up a DDPRead') {Was the socket listener installed correctly?} ELSE BEGIN {We can either sit here in a loop and poll the } { abResult field or just exit our code and use the } { event mechanism to flag us when the packet arrives.} CheckForMyEvent; {your procedure for checking for a } { network event} {If there were no errors, a packet is inside the array } { mybuffer, the length is in ddpActCount, and the } { address of the sending socket is in ddpAddress. } { Process the packet received here and report any errors.} errCode := DDPCloseSocket(mySocket); {we're done with it} IF errCode <> noErr THEN WRITELN('Error while closing the socket'); END; END; END; END; END. æKY ATPLoad æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPLoad: OSErr; æDT myVariable := ATPLoad; æMM æRT 20, 224 æRI II-290, N20-2 æC •••Refer to Technical Note #224:••• ATPLoad first verifies that the .MPP driver is loaded and running. If it isn’t, ATPLoad verifies that port B is configured for AppleTalk and isn’t in use, and then loads MPP into the system heap. ATPLoad then loads the .ATP driver, unless it’s already in memory. On a Macintosh 128K, ATPLoad reads the .ATP driver from the system resource file into the application heap; on a Macintosh 512K or XL, ATP is read into the system heap. Note: On a Macintosh 512K or XL, ATPLoad and MPPOpen perform essentially the same function. Result codes noErr No error portInUse Port B is already in use portNotCf Port B not configured for AppleTalk æKY ATPUnload æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPUnload: OSErr; æDT myVariable := ATPUnload; æRI II-290 æC ATPUnload makes the .ATP driver purgeable; the space isn’t actually released by the Memory Manager until necessary. Note: This call applies only to a Macintosh 128K; on a Macintosh 512K or Macintosh XL, ATPUnload has no effect. Result codes noErr No error æKY ATPOpenSocket æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPOpenSocket(addrRcvd: AddrBlock;VAR atpSocket: Byte): OSErr; æDT myVariable := ATPOpenSocket(addrRcvd,atpSocket); æMM æRI II-290 æC ATPOpenSocket opens a socket for the purpose of receiving requests. ATPSocket contains the socket number of the socket to open; if it’s 0, a number is dynamically assigned and returned in atpSocket. AddrRcvd contains a filter of the sockets from which requests will be accepted. A 0 in the network number, node ID, or socket number field of the addrRcvd record acts as a “wild card”; for instance, a 0 in the socket number field means that requests will be accepted from all sockets in the node(s) specified by the network and node fields. Result codes noErr No error tooManySkts Socket table full noDataArea Too many outstanding ATP calls Note: If you’re only going to send requests and receive responses to these requests, you don’t need to open an ATP socket. When you make the ATPSndRequest or ATPRequest call, ATP automatically opens a dynamically assigned socket for that purpose. æKY ATPCloseSocket æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPCloseSocket(atpSocket: Byte): OSErr; æDT myVariable := ATPCloseSocket(atpSocket); æMM æRI II-291 æC ATPCloseSocket closes the responding socket whose number is specified by atpSocket. It releases the data structures associated with all pending, asynchronous calls involving that socket; these pending calls are completed immediately and return the result code sktClosed. Result codes noErr No error noDataArea Too many outstanding ATP calls æKY ATPSndRequest æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPSndRequest(abRecord: ABRecHandle;async: BOOLEAN): OSErr; æDT myVariable := ATPSndRequest(abRecord,async); æMM æRI II-291 æC ABusRecord <-- abOpcode {always tATPSndRequest} <-- abResult {result code} --> abUserReference {for your use} --> atpAddress {destination socket address} --> atpReqCount {request size in bytes} --> atpDataPtr {pointer to buffer} --> atpRspBDSPtr {pointer to response BDS} --> atpUserData {user bytes} --> atpXO {exactly-once flag} <-- atpEOM {end-of-message flag} --> atpTimeOut {retry timeout interval in seconds} --> atpRetries {maximum number of retries} --> atpNumBufs {number of elements in response BDS} <-- atpNumRsp {number of response packets actually received} ATPSndRequest sends a request to another socket. ATPAddress is the internet address of the socket to which the request should be sent. ATPDataPtr and atpReqCount specify the location and size of a buffer that contains the request information to be sent. ATPUserData contains the user bytes for the ATP header. ATPSndRequest requires you to allocate a response BDS. ATPRspBDSPtr is a pointer to the response BDS; atpNumBufs indicates the number of elements in the BDS (this is also the maximum number of response datagrams that will be accepted). The number of response datagrams actually received is returned in atpNumRsp; if a nonzero value is returned, you can examine the response BDS to determine which packets of the transaction were actually received. If the number returned is less than requested, one of the following is true: • Some of the packets have been lost and the retry count has been exceeded. • ATPEOM is TRUE; this means that the response consisted of fewer packets than were expected, but that all packets sent were received (the last packet came with the atpEOM flag set). ATPTimeOut indicates the length of time that ATPSndRequest should wait for a response before retransmitting the request. ATPRetries indicates the maximum number of retries ATPSndRequest should attempt. ATPXO should be TRUE if you want the request to be part of an exactly-once transaction. ATPSndRequest completes when either the transaction is completed or the retry count is exceeded. Result codes noErr No error reqFailed Retry count exceeded tooManyReqs Too many concurrent requests noDataArea Too many outstanding ATP calls æKY ATPRequest æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPRequest(abRecord: ABRecHandle;async: BOOLEAN): OSErr; æDT myVariable := ATPRequest(abRecord,async); æMM æRI II-292 æC ABusRecord <-- abOpcode {always tATPRequest} <-- abResult {result code} --> abUserReference {for your use} --> atpAddress {destination socket address} --> atpReqCount {request size in bytes} --> atpDataPtr {pointer to buffer} <-- atpActCount {number of bytes actually received} --> atpUserData {user bytes} --> atpXO {exactly-once flag} <-- atpEOM {end-of-message flag} --> atpTimeOut {retry timeout interval in seconds} --> atpRetries {maximum number of retries} <-- atpRspUData {user bytes received in transaction response} --> atpRspBuf {pointer to response message buffer} --> atpRspSize {size of response message buffer} ATPRequest is functionally analogous to ATPSndRequest. It sends a request to another socket, but doesn’t require the caller to set up and use the BDS data structure to describe the response buffers. ATPAddress indicates the socket to which the request should be sent. ATPDataPtr and atpReqCount specify the location and size of a buffer that contains the request information to be sent. ATPUserData contains the user bytes to be sent in the request’s ATP header. ATPTimeOut indicates the length of time that ATPRequest should wait for a response before retransmitting the request. ATPRetries indicates the maximum number of retries ATPRequest should attempt. To use this call, you must have an area of contiguous buffer space that’s large enough to receive all expected datagrams. The various datagrams will be assembled in this buffer and returned to you as a complete message upon completion of the transaction. The location and size of this buffer are passed in atpRspBuf and atpRspSize. Upon completion of the call, the size of the received response message is returned in atpActCount. The user bytes received in the ATP header of the first response packet are returned in atpRspUData. ATPXO should be TRUE if you want the request to be part of an exactly-once transaction. Although you don’t provide a BDS, ATPRequest in fact creates one and calls the .ATP driver (as in an ATPSndRequest call). For this reason, the abRecord fields atpRspBDSPtr and atpNumBufs are used by ATPRequest; you should not expect these fields to remain unaltered during or after the function’s execution. For ATPRequest to receive and correctly deliver the response as a single message, the responding end must, upon receiving the request (with an ATPGetRequest call), generate the complete response as a message in a single buffer and then call ATPResponse. Note: The responding end could also use ATPSndRsp and ATPAddRsp provided that each response packet (except the last one) contains exactly 578 ATP data bytes; the last packet in the response can contain less than 578 ATP data bytes. Also, if this method is used, only the ATP user bytes of the first response packet will be delivered to the requester; any information in the user bytes of the remaining response packets will not be delivered. ATPRequest completes when either the transaction is completed or the retry count is exceeded. Result codes noErr No error reqFailed Retry count exceeded tooManyReqs Too many concurrent requests sktClosed Socket closed by a cancel call noDataArea Too many outstanding ATP calls æKY ATPReqCancel æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPReqCancel(abRecord: ABRecHandle;async: BOOLEAN): OSErr; æDT myVariable := ATPReqCancel(abRecord,async); æMM æRI II-293 æC Given the handle to the ABusRecord of a previously made ATPSndRequest or ATPRequest call, ATPReqCancel dequeues the ATPSndRequest or ATPRequest call, provided that the call hasn’t already completed. ATPReqCancel returns noErr if the ATPSndRequest or ATPRequest call is successfully removed from the queue. If it returns cbNotFound, check the abResult field of abRecord to verify that the ATPSndRequest or ATPRequest call has completed and determine its outcome. Result codes noErr No error cbNotFound ATP control block not found æKY ATPGetRequest æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPGetRequest(abRecord: ABRecHandle;async: BOOLEAN): OSErr; æDT myVariable := ATPGetRequest(abRecord,async); æMM æRT 20 æRI II-293, N20-2 æC ABusRecord <-- abOpcode {always tATPGetRequest} <-- abResult {result code} --> abUserReference {for your use} --> atpSocket {listening socket number} <-- atpAddress {source socket address} --> atpReqCount {buffer size in bytes} --> atpDataPtr {pointer to buffer} <-- atpBitMap {transaction bit map} <-- atpTransID {transaction ID} <-- atpActCount {number of bytes actually received} <-- atpUserData {user bytes} <-- atpXO {exactly-once flag} ATPGetRequest sets up the mechanism to receive a request sent by either an ATPSndRequest or an ATPRequest call. ATPSocket contains the socket number of the socket that should listen for a request; this socket must already have been opened by calling ATPOpenSocket. The address of the socket from which the request was sent is returned in atpAddress. ATPDataPtr specifies a buffer to store the incoming request; atpReqCount indicates the size of the buffer in bytes. The number of bytes actually received in the request is returned in atpActCount. ATPUserData contains the user bytes from the ATP header. The transaction bit map is returned in atpBitMap. The transaction ID is returned in atpTransID. ATPXO will be TRUE if the request is part of an exactly-once transaction. ATPGetRequest completes when a request is received. To cancel an asynchronous ATPGetRequest call, you must call ATPCloseSocket, but this cancels all pending calls involving that socket. Result codes noErr No error badATPSkt Bad responding socket sktClosed Socket closed by a cancel call æKY ATPSndRsp æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPSndRsp(abRecord: ABRecHandle;async: BOOLEAN): OSErr; æDT myVariable := ATPSndRsp(abRecord,async); æMM æRI II-294 æC ABusRecord <-- abOpcode {always tATPSdRsp} <-- abResult {result code} --> abUserReference {for your use} --> atpSocket {responding socket number} --> atpAddress {destination socket address} --> atpRspBDSPtr {pointer to response BDS} --> atpTransID {transaction ID} --> atpEOM {end-of-message flag} --> atpNumBufs {number of response packets being sent} --> atpBDSSize {number of elements in response BDS} ATPSndRsp sends a response to another socket. ATPSocket contains the socket number from which the response should be sent and atpAddress contains the internet address of the socket to which the response should be sent. ATPTransID must contain the transaction ID. ATPEOM is TRUE if the response BDS contains the final packet in a transaction composed of a group of packets and the number of packets in the response is less than expected. ATPRspBDSPtr points to the buffer data structure containing the responses to be sent. ATPBDSSize indicates the number of elements in the response BDS, and must be in the range 1 to 8. ATPNumBufs indicates the number of response packets being sent with this call, and must be in the range 0 to 8. Note: In some situations, you may want to send only part (or possibly none) of your response message back immediately. For instance, you might be requested to send back seven disk blocks, but have only enough internal memory to store one block. In this case, set atpBDSSize to 7 (total number of response packets), atpNumBufs to 0 (number of response packets currently being sent), and call ATPSndRsp. Then as you read in one block at a time, call ATPAddRsp until all seven response datagrams have been sent. During exactly-once transactions, ATPSndRsp won’t complete until the release packet is received or the release timer expires. Result codes noErr No error badATPSkt Bad responding socket noRelErr No release received sktClosed Socket closed by a cancel call noDataArea Too many outstanding ATP calls badBuffNum Bad sequence number æKY ATPAddRsp æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPAddRsp(abRecord: ABRecHandle): OSErr; æDT myVariable := ATPAddRsp(abRecord); æMM æRI II-295 æC ABusRecord <-- abOpcode {always tATPAddRsp} <-- abResult {result code} --> abUserReference {for your use} --> atpSocket {responding socket number} --> atpAddress {destination socket address} --> atpReqCount {buffer size in bytes} --> atpDataPtr {pointer to buffer} --> atpTransID {transaction ID} --> atpUserData {user bytes} --> atpEOM {end-of-message flag} --> atpNumRsp {sequence number} ATPAddRsp sends one additional response packet to a socket that has already been sent the initial part of a response via ATPSndRsp. ATPSocket contains the socket number from which the response should be sent and atpAddress contains the internet address of the socket to which the response should be sent. ATPTransID must contain the transaction ID. ATPDataPtr and atpReqCount specify the location and size of a buffer that contains the information to send; atpNumRsp is the sequence number of the response. ATPEOM is TRUE if this response datagram is the final packet in a transaction composed of a group of packets. ATPUserData contains the user bytes to be sent in this response datagram’s ATP header. Note: No BDS is needed with ATPAddRsp because all pertinent information is passed within the record. Result codes noErr No error badATPSkt Bad responding socket badBuffNum Bad sequence number noSendResp ATPAddRsp issued before ATPSndRsp noDataArea Too many outstanding ATP calls æKY ATPResponse æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPResponse(abRecord: ABRecHandle;async: BOOLEAN): OSErr; æDT myVariable := ATPResponse(abRecord,async); æMM æRT 20 æRI II-296, N20-2 æC ABusRecord <-- abOpcode {always tATPResponse} <-- abResult {result code} --> abUserReference {for your use} --> atpSocket {responding socket number} --> atpAddress {destination socket address} --> atpTransID {transaction ID) --> atpRspUData {user bytes sent in transaction response} --> atpRspBuf {pointer to response message buffer} --> atpRspSize {size of response message buffer} ATPResponse is functionally analogous to ATPSndRsp. It sends a response to another socket, but doesn’t require the caller to provide a BDS. ATPAddress must contain the complete network address of the socket to which the response should be sent (taken from the data provided by an ATPGetRequest call). ATPTransID must contain the transaction ID. ATPSocket indicates the socket from which the response should be sent (the socket on which the corresponding ATPGetRequest was issued). ATPRspBuf points to the buffer containing the response message; the size of this buffer must be passed in atpRspSize. The four user bytes to be sent in the ATP header of the first response packet are passed in atpRspUData. The last packet of the transaction response is sent with the EOM flag set. Although you don’t provide a BDS, ATPResponse in fact creates one and calls the .ATP driver (as in an ATPSndRsp call). For this reason, the abRecord fields atpRspBDSPtr and atpNumBufs are used by ATPResponse; you should not expect these fields to remain unaltered during or after the function’s execution. During exactly-once transactions ATPResponse won’t complete until the release packet is received or the release timer expires. Warning: The maximum permissible size of the response message is 4624 bytes. Result codes noErr No error badATPSkt Bad responding socket noRelErr No release received atpLenErr Response too big sktClosed Socket closed by a cancel call noDataArea Too many outstanding ATP calls æKY ATPRspCancel æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPRspCancel(abRecord: ABRecHandle;async: BOOLEAN): OSErr; æDT myVariable := ATPRspCancel(abRecord,async); æMM æRI II-296 æC Given the handle to the ABusRecord of a previously made ATPSndRsp or ATPResponse call, ATPRspCancel dequeues the ATPSndRsp or ATPResponse call, provided that the call hasn’t already completed. ATPRspCancel returns noErr if the ATPSndRsp or ATPResponse call is successfully removed from the queue. If it returns cbNotFound, check the abResult field of abRecord to verify that the ATPSndRsp or ATPResponse call has completed and determine its outcome. Result codes noErr No error cbNotFound ATP control block not found »Example This example shows the requesting side of an ATP transaction that asks for a 512-byte disk block from the responding end. The block number of the file is a byte and is contained in myBuffer[0]. VAR myABRecord: ABRecHandle; myBDSPtr: BDSPtr; myBuffer: PACKED ARRAY [0..511] OF CHAR; errCode: INTEGER; async: BOOLEAN; BEGIN errCode := ATPLoad; IF errCode <> noErr THEN WRITELN('Error in opening AppleTalk') {Maybe serial port B isn't available for use by AppleTalk} ELSE BEGIN {Prepare the BDS; allocate space for a one-element BDS} myBDSPtr := BDSPtr(NewPtr(SIZEOF(BDSElement))); WITH myBDSPtr^[0] DO BEGIN buffSize := 512; {size of our buffer used in reception} buffPtr := @myBuffer; {pointer to the buffer} END; {Prepare the ABusRecord} myBuffer[0] := CHR(1); {requesting disk block number 1} myABRecord := ABRecHandle(NewHandle(atpSize)); WITH myABRecord^^ DO BEGIN atpAddress.aNet := 0; atpAddress.aNode := 30; {we probably got this from an NBP call} atpAddress.aSocket := 15; {socket to send request to} atpReqCount := 1; {size of request data field (disk block #)} atpDataPtr := @myBuffer; {ptr to request to be sent} atpRspBDSPtr := @myBDSPtr; atpUserData := 0; {for your use} atpXO := FALSE; {at-least-once service} atpTimeOut := 5; {5-second timeout} atpRetries := 3; {3 retries; request will be sent 4 times max} atpNumBufs := 1; {we're only expecting 1 block to be returned} END; async := FALSE; {Send the request and wait for the response} errCode := ATPSndRequest(myABRecord, async); IF errCode <> noErr THEN WRITELN('An error occurred in the ATPSndRequest call') ELSE BEGIN {The disk block requested is now in myBuffer. We can verify } { that atpNumRsp contains 1, meaning one response received.} . . . END; END; END. æKY NBPRegister æFp AppleTalk.p æT FUNCTION æD FUNCTION NBPRegister(abRecord: ABRecHandle;async: BOOLEAN): OSErr; æDT myVariable := NBPRegister(abRecord,async); æMM æRT 20 æRI II-299, N20-2 æC ABusRecord <-- abOpcode {always tNBPRegister} <-- abResult {result code} --> abUserReference {for your use} --> nbpEntityPtr {pointer to entity name} --> nbpBufPtr {pointer to buffer} --> nbpBufSize {buffer size in bytes} --> nbpAddress.aSocket {socket address} --> nbpRetransmitInfo {retransmission information} NBPRegister adds the name and address of an entity to the node’s names table. NBPEntityPtr points to a variable of type EntityName containing the entity’s name. If the name is already registered, NBPRegister returns the result code nbpDuplicate. NBPAddress indicates the socket for which the name should be registered. NBPBufPtr and nbpBufSize specify the location and size of a buffer for NBP to use internally. While the variable of type EntityName is declared as three 32-byte strings, only the actual characters of the name are placed in the buffer pointed to by nbpBufPtr. For this reason, nbpBufSize needs only to be equal to the actual length of the name, plus an additional 12 bytes for use by NBP. Warning: This buffer must not be altered or released until the name is removed from the names table via an NBPRemove call. If you allocate the buffer through a NewHandle call, you must lock it as long as the name is registered. Warning: The zone field of the entity name must be set to the meta-character “*”. Result codes noErr No error nbpDuplicate Duplicate name already exists æKY NBPLookup æFp AppleTalk.p æT FUNCTION æD FUNCTION NBPLookup(abRecord: ABRecHandle;async: BOOLEAN): OSErr; æDT myVariable := NBPLookup(abRecord,async); æMM æRT 9, 20 æRI II-300, N9-1, 2, N20-2 æC ABusRecord <-- abOpcode {always tNBPLookup} <-- abResult {result code} --> abUserReference {for your use} --> nbpEntityPtr {pointer to entity name} --> nbpBufPtr {pointer to buffer} --> nbpBufSize {buffer size in bytes} <-> nbpDataField {number of addresses received} --> nbpRetransmitInfo {retransmission information} NBPLookup returns the addresses of all entities with a specified name. NBPEntityPtr points to a variable of type EntityName containing the name of the entity whose address should be returned. (Meta-characters are allowed in the entity name.) NBPBufPtr and nbpBufSize contain the location and size of an area of memory in which the entity names and their corresponding addresses should be returned. NBPDataField indicates the maximum number of matching names to find addresses for; the actual number of addresses found is returned in nbpDataField. NBPRetransmitInfo contains the retry interval and the retry count. When specifying nbpBufSize, for each NBP tuple expected, allow space for the actual characters of the name, the address, and four bytes for use by NBP. Result codes noErr No error nbpBuffOvr Buffer overflow æKY NBPExtract æFp AppleTalk.p æT FUNCTION æD FUNCTION NBPExtract(theBuffer: Ptr;numInBuf: INTEGER;whichOne: INTEGER; VAR abEntity: EntityName;VAR address: AddrBlock): OSErr; æDT myVariable := NBPExtract(theBuffer,numInBuf,whichOne,abEntity,address); æMM æRI II-300,V-515 æC This routine is provided in the alternate interface, but can be used as provided for extracting NBP entity names from a look-up response buffer. NBPExtract returns one address from the list of addresses returned by NBPLookup. TheBuffer and numInBuf indicate the location and number of tuples in the buffer. WhichOne specifies which one of the tuples in the buffer should be returned in the abEntity and address parameters. Result codes noErr No error extractErr Can’t find tuple in buffer æKY NBPConfirm æFp AppleTalk.p æT FUNCTION æD FUNCTION NBPConfirm(abRecord: ABRecHandle;async: BOOLEAN): OSErr; æDT myVariable := NBPConfirm(abRecord,async); æMM æRT 9 æRI II-301, N9-2 æC ABusRecord <-- abOpcode {always tNBPConfirm} <-- abResult {result code} --> abUserReference {for your use} --> nbpEntityPtr {pointer to entity name} <-- nbpDataField {socket number} --> nbpAddress {socket address} --> nbpRetransmitInfo {retransmission information} NBPConfirm confirms that an entity known by name and address still exists (is still entered in the names directory). NBPEntityPtr points to a variable of type EntityName that contains the name to confirm, and nbpAddress specifies the address to be confirmed. (No meta-characters are allowed in the entity name.) NBPRetransmitInfo contains the retry interval and the retry count. The socket number of the entity is returned in nbpDataField. NBPConfirm is more efficient than NBPLookup in terms of network traffic. Result codes noErr No error nbpConfDiff Name confirmed for different socket nbpNoConfirm Name not confirmed æKY NBPRemove æFp AppleTalk.p æT FUNCTION æD FUNCTION NBPRemove(abEntity: EntityPtr): OSErr; æDT myVariable := NBPRemove(abEntity); æMM æRI II-301 æC NBPRemove removes an entity name from the names table of the given entity’s node. Result codes noErr No error nbpNotFound Name not found æKY NBPLoad æFp AppleTalk.p æT FUNCTION æD FUNCTION NBPLoad: OSErr; æDT myVariable := NBPLoad; æMM æRI II-301 æC On a Macintosh 128K, NBPLoad reads the NBP code from the system resource file into the application heap. On a Macintosh 512K or XL, NBPLoad has no effect since the NBP code should have already been loaded when the .MPP driver was opened. Normally you’ll never need to call NBPLoad, because the AppleTalk Manager calls it when necessary. Result codes noErr No error æKY NBPUnload æFp AppleTalk.p æT FUNCTION æD FUNCTION NBPUnload: OSErr; æDT myVariable := NBPUnload; æMM æRI II-301 æC On a Macintosh 128K, NBPUnload makes the NBP code purgeable; the space isn’t actually released by the Memory Manager until necessary. On a Macintosh 512K or Macintosh XL, NBPUnload has no effect. Result codes noErr No error »Example This example of NBP registers our node as a print spooler, searches for any print spoolers registered on the network, and then extracts the information for the first one found. CONST mySocket = 20; VAR myABRecord: ABRecHandle; myEntity: EntityName; entityAddr: AddrBlock; nbpNamePtr: Ptr; myBuffer: PACKED ARRAY [0..999] OF CHAR; errCode: INTEGER; async: BOOLEAN; BEGIN errCode := MPPOpen; IF errCode <> noErr THEN WRITELN('Error in opening AppleTalk') {Maybe serial port B isn't available for use by AppleTalk} ELSE BEGIN {Call Memory Manager to allocate ABusRecord} myABRecord := ABRecHandle(NewHandle(nbpSize)); {Set up our entity name to register} WITH myEntity DO BEGIN objStr := 'Gene Station'; {we are called 'Gene Station' } typeStr := 'PrintSpooler'; { and are of type 'PrintSpooler'} zoneStr := '*'; {Allocate data space for the entity name (used by NBP)} nbpNamePtr := NewPtr(LENGTH(objStr) + LENGTH(typeStr) + LENGTH(zoneStr) + 12); END; {Set up the ABusRecord for the NBPRegister call} WITH myABRecord^^ DO BEGIN nbpEntityPtr := @myEntity; nbpBufPtr := nbpNamePtr; {buffer used by NBP internally} nbpBufSize := nbpNameBufSize; nbpAddress.aSocket := mySocket; {socket to register us on} nbpRetransmitInfo.retransInterval := 8; {retransmit every 64 } nbpRetransmitInfo.retransCount := 3; { ticks and try 3 times} END; async := FALSE; errCode := NBPRegister(myABRecord, async); IF errCode <> noErr THEN WRITELN('Error occurred in the NBPRegister call') {Maybe the name is already registered somewhere else on the } { network.} ELSE BEGIN {Now that we've registered our name, find others of type } { 'PrintSpooler'.} WITH myEntity DO BEGIN objStr := '='; {any one of type } typeStr := 'PrintSpooler'; { “PrintSpooler” } zoneStr := '*'; { in our zone} END; WITH myABRecord^^ DO BEGIN nbpEntityPtr := @myEntity; nbpBufPtr := @myBuffer; {buffer to place responses in} nbpBufSize := SIZEOF(myBuffer); {The field nbpDataField, before the NBPLookup call, represents an } { approximate number of responses. After the call, nbpDataField } { contains the actual number of responses received.} nbpDataField := 100; {we want about 100 responses back} END; errCode := NBPLookup(myABRecord, async); {make sync call} IF errCode <> noErr THEN WRITELN('An error occurred in the NBPLookup') {Did the buffer overflow?} ELSE BEGIN {Get the first reply} errCode := NBPExtract(@mybuffer, myABRecord^^.nbpDataField, 1, myEntity, entityAddr); {The socket address and name of the entity are returned here. If we } { want all of them, we'll have to loop for each one in the buffer.} IF errCode <> noErr THEN WRITELN('Error in NBPExtract'); {Maybe the one we wanted wasn't in the buffer} END; END; END; END. æKY GetNodeAddress æFp AppleTalk.p æT FUNCTION æD FUNCTION GetNodeAddress(VAR myNode: INTEGER;VAR myNet: INTEGER): OSErr; æDT myVariable := GetNodeAddress(myNode,myNet); æRI II-303 æC GetNodeAddress returns the current node ID and network number of the caller. If the .MPP driver isn’t installed, it returns noMPPErr. If myNet contains 0, this means that a bridge hasn’t yet been found. Result codes noErr No error noMPPErr MPP driver not installed æKY IsMPPOpen æFp AppleTalk.p æT FUNCTION æD FUNCTION IsMPPOpen: BOOLEAN; æDT myVariable := IsMPPOpen; æRI II-304 æC [Not in ROM] IsMPPOpen returns TRUE if the .MPP driver is loaded and running. æKY IsATPOpen æFp AppleTalk.p æT FUNCTION æD FUNCTION IsATPOpen: BOOLEAN; æDT myVariable := IsATPOpen; æRI II-304 æC [Not in ROM] IsATPOpen returns TRUE if the .ATP driver is loaded and running. æKY ATEvent æFp AppleTalk.p æT PROCEDURE æD PROCEDURE ATEvent(event: LONGINT;infoPtr: Ptr); æDT ATEvent(event,infoPtr); æRI II-304 æC [Not in ROM] IsATPOpen returns TRUE if the .ATP driver is loaded and running. æKY ATPreFlightEvent æFp AppleTalk.p æT FUNCTION æD FUNCTION ATPreFlightEvent(event: LONGINT;cancel: LONGINT;infoPtr: Ptr): OSErr; æDT myVariable := ATPreFlightEvent(event,cancel,infoPtr); æRI II-304 æC [Not in ROM] IsATPOpen returns TRUE if the .ATP driver is loaded and running. æKY Balloons.p æKL HMBalloonPict HMBalloonRect HMExtractHelpMsg HMGetBalloons HMGetBalloonWindow HMGetDialogResID HMGetFont HMGetFontSize HMGetHelpMenuHandle HMGetIndHelpMsg HMGetMenuResID HMIsBalloon HMRemoveBalloon HMScanTemplateItems HMSetBalloons HMSetDialogResID HMSetFont HMSetFontSize HMSetMenuResID HMShowBalloon HMShowMenuBalloon helpItem hmAbsoluteCoords hmBalloonAborted hmBalloonHelpVersion hmCloseViewActive hmDefaultOptions hmHelpDisabled hmHelpManagerNotInited hmMatchInTitle HMMessageRecord HMMessageRecPtr hmNoBalloonUp hmOperationUnsupported hmSameAsLastBalloon hmSaveBitsNoWindow hmSaveBitsWindow hmSkippedBalloon HMStringResType hmUnknownHelpType hmUseSubID hmWrongVersion kBalloonWDEFID kHMAboutHelpItem kHMCheckedItem kHMCompareItem kHMDialogResType kHMDisabledItem kHMEnabledItem kHMFinderApplResType kHMHelpID kHMHelpMenuID kHMMenuResType khmmPict khmmPictHandle khmmString khmmStringRes khmmSTRRes khmmTEHandle khmmTERes kHMNamedResourceItem kHMOtherItem kHMOverrideResType kHMPictItem kHMRectListResType kHMRegularWindow kHMSaveBitsNoWindow kHMSaveBitsWindow kHMShowBalloonsItem kHMSkipItem kHMStringItem kHMStringResItem kHMSTRResItem kHMTEResItem kHMTEStyleResType kHMTETextResType kHMTrackCntlItem kHMWindListResType æKY hmBalloonHelpVersion æFp Balloons.p æT CONST æD hmBalloonHelpVersion = $0002; { The real version of the Help Manager } æC æKY hmHelpDisabled æFp Balloons.p æT CONST æD hmHelpDisabled = -850; { Show Balloons mode was off, call to routine ignored } æC æKY hmBalloonAborted æFp Balloons.p æT CONST æD hmBalloonAborted = -853; { Returned if mouse was moving or mouse wasn't in window port rect } æC æKY hmSameAsLastBalloon æFp Balloons.p æT CONST æD hmSameAsLastBalloon = -854; { Returned from HMShowMenuBalloon if menu & item is same as last time } æC æKY hmHelpManagerNotInited æFp Balloons.p æT CONST æD hmHelpManagerNotInited = -855; { Returned from HMGetHelpMenuHandle if help menu not setup } æC æKY hmSkippedBalloon æFp Balloons.p æT CONST æD hmSkippedBalloon = -857; { Returned from calls if helpmsg specified a skip balloon } æC æKY hmWrongVersion æFp Balloons.p æT CONST æD hmWrongVersion = -858; { Returned if help mgr resource was the wrong version } æC æKY hmUnknownHelpType æFp Balloons.p æT CONST æD hmUnknownHelpType = -859; { Returned if help msg record contained a bad type } æC æKY hmOperationUnsupported æFp Balloons.p æT CONST æD hmOperationUnsupported = -861; { Returned from HMShowBalloon call if bad method passed to routine } æC æKY hmNoBalloonUp æFp Balloons.p æT CONST æD hmNoBalloonUp = -862; { Returned from HMRemoveBalloon if no balloon was visible when call was made } æC æKY hmCloseViewActive æFp Balloons.p æT CONST æD hmCloseViewActive = -863; { Returned from HMRemoveBalloon if CloseView was active } æC æKY kHMHelpMenuID æFp Balloons.p æT CONST æD kHMHelpMenuID = -16490; { Resource ID and menu ID of help menu } æC æKY kHMAboutHelpItem æFp Balloons.p æT CONST æD kHMAboutHelpItem = 1; { help menu item number of About Balloon Help… } æC æKY kHMShowBalloonsItem æFp Balloons.p æT CONST æD kHMShowBalloonsItem = 3; { help menu item number of Show/Hide Balloons } æC æKY kHMHelpID æFp Balloons.p æT CONST æD kHMHelpID = -5696; { ID of various Help Mgr package resources (in Pack14 range) } æC æKY kBalloonWDEFID æFp Balloons.p æT CONST æD kBalloonWDEFID = 126; { Resource ID of the WDEF proc used in standard balloons } æC æKY helpItem æFp Balloons.p æT CONST æD helpItem = 1; { key value in DITL template that corresponds to the help item } æC æKY hmDefaultOptions æFp Balloons.p æT CONST æD hmDefaultOptions = 0; { default options for help manager resources } æC æKY hmUseSubID æFp Balloons.p æT CONST æD hmUseSubID = 1; { treat resID's in resources as subID's of driver base ID } æC æKY hmAbsoluteCoords æFp Balloons.p æT CONST æD hmAbsoluteCoords = 2; { ignore window port origin and treat rectangles as absolute coords } æC æKY hmSaveBitsNoWindow æFp Balloons.p æT CONST æD hmSaveBitsNoWindow = 4; { don't create a window, just blast bits on screen. No update event is generated } æC æKY hmSaveBitsWindow æFp Balloons.p æT CONST æD hmSaveBitsWindow = 8; { create a window, but restore bits behind window when window goes away } æC æKY hmMatchInTitle æFp Balloons.p æT CONST æD hmMatchInTitle = 16; { for hwin resources, match string anywhere in window title string } æC æKY kHMStringItem æFp Balloons.p æT CONST æD kHMStringItem = 1; { pstring used in resource } æC æKY kHMPictItem æFp Balloons.p æT CONST æD kHMPictItem = 2; { 'PICT' ResID used in resource } æC æKY kHMStringResItem æFp Balloons.p æT CONST æD kHMStringResItem = 3; { 'STR#' ResID & index used in resource } æC æKY kHMTEResItem æFp Balloons.p æT CONST æD kHMTEResItem = 6; { Styled Text Edit ResID used in resource ('TEXT' & 'styl') } æC æKY kHMSTRResItem æFp Balloons.p æT CONST æD kHMSTRResItem = 7; { 'STR ' ResID used in resource } æC æKY kHMSkipItem æFp Balloons.p æT CONST æD kHMSkipItem = 256; { don't display a balloon } æC æKY kHMCompareItem æFp Balloons.p æT CONST æD kHMCompareItem = 512; { Compare pstring in menu item w/ PString in resource item } æC æKY kHMNamedResourceItem æFp Balloons.p æT CONST æD kHMNamedResourceItem = 1024; { Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) } æC æKY kHMTrackCntlItem æFp Balloons.p æT CONST æD kHMTrackCntlItem = 2048; { Reserved } æC æKY khmmString æFp Balloons.p æT CONST æD khmmString = 1; { help message contains a PString } æC æKY khmmPict æFp Balloons.p æT CONST æD khmmPict = 2; { help message contains a resource ID to a 'PICT' resource } æC æKY khmmStringRes æFp Balloons.p æT CONST æD khmmStringRes = 3; { help message contains a res ID & index to a 'STR#' resource } æC æKY khmmTEHandle æFp Balloons.p æT CONST æD khmmTEHandle = 4; { help message contains a Text Edit handle } æC æKY khmmPictHandle æFp Balloons.p æT CONST æD khmmPictHandle = 5; { help message contains a Picture handle } æC æKY khmmTERes æFp Balloons.p æT CONST æD khmmTERes = 6; { help message contains a res ID to 'TEXT' & 'styl' resources } æC æKY khmmSTRRes æFp Balloons.p æT CONST æD khmmSTRRes = 7; { help message contains a res ID to a 'STR ' resource } æC æKY kHMTETextResType æFp Balloons.p æT CONST æD kHMTETextResType = 'TEXT'; { Resource Type of text data for styled TE record w/o style info } æC æKY kHMTEStyleResType æFp Balloons.p æT CONST æD kHMTEStyleResType = 'styl'; { Resource Type of style information for styled TE record } æC æKY kHMEnabledItem æFp Balloons.p æT CONST æD kHMEnabledItem = 0; { item is enabled, but not checked or control value = 0 } æC æKY kHMDisabledItem æFp Balloons.p æT CONST æD kHMDisabledItem = 1; { item is disabled, grayed in menus or disabled in dialogs } æC æKY kHMCheckedItem æFp Balloons.p æT CONST æD kHMCheckedItem = 2; { item is enabled, and checked or control value = 1 } æC æKY kHMOtherItem æFp Balloons.p æT CONST æD kHMOtherItem = 3; { item is enabled, and control value > 1 } æC æKY kHMMenuResType æFp Balloons.p æT CONST æD kHMMenuResType = 'hmnu'; { ResType of help resource for supporting menus } æC æKY kHMDialogResType æFp Balloons.p æT CONST æD kHMDialogResType = 'hdlg'; { ResType of help resource for supporting dialogs } æC æKY kHMWindListResType æFp Balloons.p æT CONST æD kHMWindListResType = 'hwin'; { ResType of help resource for supporting windows } æC æKY kHMRectListResType æFp Balloons.p æT CONST æD kHMRectListResType = 'hrct'; { ResType of help resource for rectangles in windows } æC æKY kHMOverrideResType æFp Balloons.p æT CONST æD kHMOverrideResType = 'hovr'; { ResType of help resource for overriding system balloons } æC æKY kHMFinderApplResType æFp Balloons.p æT CONST æD kHMFinderApplResType = 'hfdr'; { ResType of help resource for custom balloon in Finder } æC æKY kHMRegularWindow æFp Balloons.p æT CONST æD kHMRegularWindow = 0; { Create a regular window floating above all windows } æC æKY kHMSaveBitsNoWindow æFp Balloons.p æT CONST æD kHMSaveBitsNoWindow = 1; { Just save the bits and draw (for MDEF calls) } æC æKY kHMSaveBitsWindow æFp Balloons.p æT CONST æD kHMSaveBitsWindow = 2; { Regular window, save bits behind, AND generate update event } æC æKY HMStringResType æFp Balloons.p æT RECORD æD HMStringResType = RECORD hmmResID: INTEGER; hmmIndex: INTEGER; END; æC æKY HMMessageRecord HMMessageRecPtr æFp Balloons.p æT RECORD æD HMMessageRecPtr = ^HMMessageRecord; HMMessageRecord = RECORD hmmHelpType : INTEGER; CASE INTEGER OF khmmString: (hmmString: STR255); khmmPict: (hmmPict: INTEGER); khmmStringRes: (hmmStringRes: HMStringResType); khmmTEHandle: (hmmTEHandle: TEHandle); khmmPictHandle: (hmmPictHandle: PicHandle); khmmTERes: (hmmTERes: INTEGER); khmmSTRRes: (hmmSTRRes: INTEGER); END; æC æKY HMGetHelpMenuHandle æFp Balloons.p æT FUNCTION æD FUNCTION HMGetHelpMenuHandle(VAR mh: MenuHandle): OSErr; INLINE $303C,$0200,_Pack14; æDT myVariable := HMGetHelpMenuHandle(mh); æC æKY HMShowBalloon æFp Balloons.p æT FUNCTION æD FUNCTION HMShowBalloon(aHelpMsg: HMMessageRecord; tip: Point; alternateRect: RectPtr; tipProc: Ptr; theProc: INTEGER; variant: INTEGER; method: INTEGER): OSErr; INLINE $303C,$0B01,_Pack14; æDT myVariable := HMShowBalloon(aHelpMsg,tip,alternateRect,tipProc,theProc,variant,method); æC æKY HMRemoveBalloon æFp Balloons.p æT FUNCTION æD FUNCTION HMRemoveBalloon: OSErr; INLINE $303C,$0002,_Pack14; æDT myVariable := HMRemoveBalloon; æC æKY HMGetBalloons æFp Balloons.p æT FUNCTION æD FUNCTION HMGetBalloons: BOOLEAN; INLINE $303C,$0003,_Pack14; æDT myVariable := HMGetBalloons; æC æKY HMSetBalloons æFp Balloons.p æT FUNCTION æD FUNCTION HMSetBalloons(flag: BOOLEAN): OSErr; INLINE $303C,$0104,_Pack14; æDT myVariable := HMSetBalloons(flag); æC æKY HMShowMenuBalloon æFp Balloons.p æT FUNCTION æD FUNCTION HMShowMenuBalloon(itemNum: INTEGER; itemMenuID: INTEGER; itemFlags: LONGINT; itemReserved: LONGINT; tip: Point; alternateRect: RectPtr; tipProc: Ptr; theProc: INTEGER; variant: INTEGER): OSErr; INLINE $303C,$0E05,_Pack14; æDT myVariable := HMShowMenuBalloon(itemNum,itemMenuID,itemFlags,itemReserved,tip,alternateRect,tipProc,theProc,variant); æC æKY HMGetIndHelpMsg æFp Balloons.p æT FUNCTION æD FUNCTION HMGetIndHelpMsg(whichType: ResType; whichResID: INTEGER; whichMsg: INTEGER; whichState: INTEGER; VAR options: LONGINT; VAR tip: Point; VAR altRect: Rect; VAR theProc: INTEGER; VAR variant: INTEGER; VAR aHelpMsg: HMMessageRecord; VAR count: INTEGER): OSErr; INLINE $303C,$1306,_Pack14; æDT myVariable := HMGetIndHelpMsg(whichType,whichResID,whichMsg,whichState,options,tip,altRect,theProc,variant,aHelpMsg,count); æC æKY HMIsBalloon æFp Balloons.p æT FUNCTION æD FUNCTION HMIsBalloon: BOOLEAN; INLINE $303C,$0007,_Pack14; æDT myVariable := HMIsBalloon; æC æKY HMSetFont æFp Balloons.p æT FUNCTION æD FUNCTION HMSetFont(font: INTEGER): OSErr; INLINE $303C,$0108,_Pack14; æDT myVariable := HMSetFont(font); æC æKY HMSetFontSize æFp Balloons.p æT FUNCTION æD FUNCTION HMSetFontSize(fontSize: INTEGER): OSErr; INLINE $303C,$0109,_Pack14; æDT myVariable := HMSetFontSize(fontSize); æC æKY HMGetFont æFp Balloons.p æT FUNCTION æD FUNCTION HMGetFont(VAR font: INTEGER): OSErr; INLINE $303C,$020A,_Pack14; æDT myVariable := HMGetFont(font); æC æKY HMGetFontSize æFp Balloons.p æT FUNCTION æD FUNCTION HMGetFontSize(VAR fontSize: INTEGER): OSErr; INLINE $303C,$020B,_Pack14; æDT myVariable := HMGetFontSize(fontSize); æC æKY HMSetDialogResID æFp Balloons.p æT FUNCTION æD FUNCTION HMSetDialogResID(resID: INTEGER): OSErr; INLINE $303C,$010C,_Pack14; æDT myVariable := HMSetDialogResID(resID); æC æKY HMSetMenuResID æFp Balloons.p æT FUNCTION æD FUNCTION HMSetMenuResID(menuID: INTEGER; resID: INTEGER): OSErr; INLINE $303C,$020D,_Pack14; æDT myVariable := HMSetMenuResID(menuID,resID); æC æKY HMBalloonRect æFp Balloons.p æT FUNCTION æD FUNCTION HMBalloonRect(aHelpMsg: HMMessageRecord; VAR coolRect: Rect): OSErr; INLINE $303C,$040E,_Pack14; æDT myVariable := HMBalloonRect(aHelpMsg,coolRect); æC æKY HMBalloonPict æFp Balloons.p æT FUNCTION æD FUNCTION HMBalloonPict(aHelpMsg: HMMessageRecord; VAR coolPict: PicHandle): OSErr; INLINE $303C,$040F,_Pack14; æDT myVariable := HMBalloonPict(aHelpMsg,coolPict); æC æKY HMScanTemplateItems æFp Balloons.p æT FUNCTION æD FUNCTION HMScanTemplateItems(whichID: INTEGER; whichResFile: INTEGER; whichType: ResType): OSErr; INLINE $303C,$0410,_Pack14; æDT myVariable := HMScanTemplateItems(whichID,whichResFile,whichType); æC æKY HMExtractHelpMsg æFp Balloons.p æT FUNCTION æD FUNCTION HMExtractHelpMsg(whichType: ResType;whichResID: INTEGER;whichMsg: INTEGER; whichState: INTEGER;VAR aHelpMsg: HMMessageRecord): OSErr; INLINE $303C,$0711,_Pack14; æDT myVariable := HMExtractHelpMsg(whichType,whichResID,whichMsg,whichState,aHelpMsg); æC æKY HMGetDialogResID æFp Balloons.p æT FUNCTION æD FUNCTION HMGetDialogResID(VAR resID: INTEGER): OSErr; INLINE $303C,$0213,_Pack14; æDT myVariable := HMGetDialogResID(resID); æC æKY HMGetMenuResID æFp Balloons.p æT FUNCTION æD FUNCTION HMGetMenuResID(menuID: INTEGER;VAR resID: INTEGER): OSErr; INLINE $303C,$0314,_Pack14; æDT myVariable := HMGetMenuResID(menuID,resID); æC æKY HMGetBalloonWindow æFp Balloons.p æT FUNCTION æD FUNCTION HMGetBalloonWindow(VAR window: WindowPtr): OSErr; INLINE $303C,$0215,_Pack14; æDT myVariable := HMGetBalloonWindow(window); æC æKY CommResources.p æKL CRMFindCommunications CRMGet1IndResource CRMGet1NamedResource CRMGet1Resource CRMGetCRMVersion CRMGetHeader CRMGetIndex CRMGetIndResource CRMGetIndToolName CRMGetNamedResource CRMGetResource CRMGetToolResource CRMInstall CRMLocalToRealID CRMRealToLocalID CRMReleaseResource CRMReleaseToolResource CRMRemove CRMSearch InitCRM classCM classFT classTM CRMErr crmGenericError crmNoErr CRMRec CRMRecPtr crmRecVersion crmType curCRMVersion æKY curCRMVersion æFp CommResources.p æT CONST æD curCRMVersion = 2; æC æKY classCM æFp CommResources.p æT CONST æD classCM = 'cbnd'; æC æKY classFT æFp CommResources.p æT CONST æD classFT = 'fbnd'; æC æKY classTM æFp CommResources.p æT CONST æD classTM = 'tbnd'; æC æKY crmType æFp CommResources.p æT CONST æD crmType = 9; { queue type } æC æKY crmRecVersion æFp CommResources.p æT CONST æD crmRecVersion = 1; { version of queue structure } æC æKY crmGenericError æFp CommResources.p æT CONST æD crmGenericError = -1; æC æKY crmNoErr æFp CommResources.p æT CONST æD crmNoErr = 0; æC æKY CRMErr æFp CommResources.p æT TYPE æD CRMErr = OSErr; æC æKY CRMRec CRMRecPtr æFp CommResources.p æT RECORD æD CRMRecPtr = ^CRMRec; CRMRec = RECORD qLink: QElemPtr; {reserved} qType: INTEGER; {queue type -- ORD(crmType) = 9} crmVersion: INTEGER; {version of queue element data structure} crmPrivate: LONGINT; {reserved} crmReserved: INTEGER; {reserved} crmDeviceType: LONGINT; {type of device, assigned by DTS} crmDeviceID: LONGINT; {device ID; assigned when CRMInstall is called} crmAttributes: LONGINT; {pointer to attribute block} crmStatus: LONGINT; {status variable - device specific} crmRefCon: LONGINT; {for device private use} END; æC æKY InitCRM æFp CommResources.p æT FUNCTION æD FUNCTION InitCRM: CRMErr; æDT myVariable := InitCRM; æC æKY CRMGetHeader æFp CommResources.p æT FUNCTION æD FUNCTION CRMGetHeader: QHdrPtr; æDT myVariable := CRMGetHeader; æC æKY CRMInstall æFp CommResources.p æT PROCEDURE æD PROCEDURE CRMInstall(crmReqPtr: QElemPtr); æDT CRMInstall(crmReqPtr); æC æKY CRMRemove æFp CommResources.p æT FUNCTION æD FUNCTION CRMRemove(crmReqPtr: QElemPtr): OSErr; æDT myVariable := CRMRemove(crmReqPtr); æC æKY CRMSearch æFp CommResources.p æT FUNCTION æD FUNCTION CRMSearch(crmReqPtr: QElemPtr): QElemPtr; æDT myVariable := CRMSearch(crmReqPtr); æC æKY CRMGetCRMVersion æFp CommResources.p æT FUNCTION æD FUNCTION CRMGetCRMVersion: INTEGER; æDT myVariable := CRMGetCRMVersion; æC æKY CRMGetResource æFp CommResources.p æT FUNCTION æD FUNCTION CRMGetResource(theType: ResType;theID: INTEGER): Handle; æDT myVariable := CRMGetResource(theType,theID); æC æKY CRMGet1Resource æFp CommResources.p æT FUNCTION æD FUNCTION CRMGet1Resource(theType: ResType;theID: INTEGER): Handle; æDT myVariable := CRMGet1Resource(theType,theID); æC æKY CRMGetIndResource æFp CommResources.p æT FUNCTION æD FUNCTION CRMGetIndResource(theType: ResType;index: INTEGER): Handle; æDT myVariable := CRMGetIndResource(theType,index); æC æKY CRMGet1IndResource æFp CommResources.p æT FUNCTION æD FUNCTION CRMGet1IndResource(theType: ResType;index: INTEGER): Handle; æDT myVariable := CRMGet1IndResource(theType,index); æC æKY CRMGetNamedResource æFp CommResources.p æT FUNCTION æD FUNCTION CRMGetNamedResource(theType: ResType;name: Str255): Handle; æDT myVariable := CRMGetNamedResource(theType,name); æC æKY CRMGet1NamedResource æFp CommResources.p æT FUNCTION æD FUNCTION CRMGet1NamedResource(theType: ResType;name: Str255): Handle; æDT myVariable := CRMGet1NamedResource(theType,name); æC æKY CRMReleaseResource æFp CommResources.p æT PROCEDURE æD PROCEDURE CRMReleaseResource(theResource: Handle); æDT CRMReleaseResource(theResource); æC æKY CRMGetToolResource æFp CommResources.p æT FUNCTION æD FUNCTION CRMGetToolResource(procID: INTEGER;theType: ResType;theID: INTEGER): Handle; æDT myVariable := CRMGetToolResource(procID,theType,theID); æC æKY CRMReleaseToolResource æFp CommResources.p æT PROCEDURE æD PROCEDURE CRMReleaseToolResource(procID: INTEGER;theResource: Handle); æDT CRMReleaseToolResource(procID,theResource); æC æKY CRMGetIndex æFp CommResources.p æT FUNCTION æD FUNCTION CRMGetIndex(theResource: Handle): LONGINT; æDT myVariable := CRMGetIndex(theResource); æC æKY CRMLocalToRealID æFp CommResources.p æT FUNCTION æD FUNCTION CRMLocalToRealID(bundleType: ResType;toolID: INTEGER;theType: ResType; localID: INTEGER): INTEGER; æDT myVariable := CRMLocalToRealID(bundleType,toolID,theType,localID); æC æKY CRMRealToLocalID æFp CommResources.p æT FUNCTION æD FUNCTION CRMRealToLocalID(bundleType: ResType;toolID: INTEGER;theType: ResType; realID: INTEGER): INTEGER; æDT myVariable := CRMRealToLocalID(bundleType,toolID,theType,realID); æC æKY CRMGetIndToolName æFp CommResources.p æT FUNCTION æD FUNCTION CRMGetIndToolName(bundleType: ResType;index: INTEGER;VAR toolName: Str255): OSErr; æDT myVariable := CRMGetIndToolName(bundleType,index,toolName); æC æKY CRMFindCommunications æFp CommResources.p æT FUNCTION æD FUNCTION CRMFindCommunications(VAR vRefNum: INTEGER;VAR dirID: LONGINT): OSErr; æDT myVariable := CRMFindCommunications(vRefNum,dirID); æC æKY Connections.p æKL CMAbort CMAccept CMActivate CMAddSearch CMBreak CMChoose CMClearSearch CMClose CMDefault CMDispose CMEnglishToIntl CMEvent CMGetCMVersion CMGetConfig CMGetConnEnvirons CMGetProcID CMGetRefCon CMGetToolName CMGetUserData CMGetVersion CMIdle CMIntlToEnglish CMIOKill CMListen CMMenu CMNew CMOpen CMRead CMRemoveSearch CMReset CMResume CMSetConfig CMSetRefCon CMSetupCleanup CMSetupFilter CMSetupItem CMSetupPostflight CMSetupPreflight CMSetupSetup CMSetUserData CMStatus CMValidate CMWrite InitCM cmAttn cmAttnClean cmAttnIn cmAttnNoTimeout cmAttnOut CMBuffers CMBufferSizes CMBufFields CMChannel cmCntl cmCntlClean cmCntlIn cmCntlNoTimeout cmCntlOut cmData cmDataClean cmDataIn cmDataNoTimeout cmDataOut CMErr cmFailed CMFlags cmFlagsEOM cmGenericError cmNoErr cmNoMenus cmNoRequestPending cmNotClosed cmNoTools cmNotOpen cmNotSupported cmQuiet CMRecFlags cmRejected cmRsrvIn cmRsrvOut CMSearchFlags cmSearchSevenBit CMStatFlags cmStatusARPend cmStatusAttnAvail cmStatusAWPend cmStatusBreakPend cmStatusClosing cmStatusCntlAvail cmStatusCRPend cmStatusCWPend cmStatusDataAvail cmStatusDRPend cmStatusDWPend cmStatusIncomingCallPresent cmStatusListenPend cmStatusOpen cmStatusOpening cmStatusReserved0 cmTimeOut cmUnknownError cmUserCancel ConnEnvironRec ConnEnvironRecPtr ConnHandle ConnPtr ConnRecord curCMVersion curConnEnvRecVers æKY curCMVersion æFp Connections.p æT CONST æD curCMVersion = 2; æC æKY curConnEnvRecVers æFp Connections.p æT CONST æD curConnEnvRecVers = 0; æC æKY cmGenericError æFp Connections.p æT CONST æD cmGenericError = -1; æC æKY cmNoErr æFp Connections.p æT CONST æD cmNoErr = 0; æC æKY cmRejected æFp Connections.p æT CONST æD cmRejected = 1; æC æKY cmFailed æFp Connections.p æT CONST æD cmFailed = 2; æC æKY cmTimeOut æFp Connections.p æT CONST æD cmTimeOut = 3; æC æKY cmNotOpen æFp Connections.p æT CONST æD cmNotOpen = 4; æC æKY cmNotClosed æFp Connections.p æT CONST æD cmNotClosed = 5; æC æKY cmNoRequestPending æFp Connections.p æT CONST æD cmNoRequestPending = 6; æC æKY cmNotSupported æFp Connections.p æT CONST æD cmNotSupported = 7; æC æKY cmNoTools æFp Connections.p æT CONST æD cmNoTools = 8; æC æKY cmUserCancel æFp Connections.p æT CONST æD cmUserCancel = 9; æC æKY cmUnknownError æFp Connections.p æT CONST æD cmUnknownError = 11; æC æKY CMErr æFp Connections.p æT TYPE æD CMErr = OSErr; æC æKY cmData æFp Connections.p æT CONST æD cmData = $00000001; æC æKY cmCntl æFp Connections.p æT CONST æD cmCntl = $00000002; æC æKY cmAttn æFp Connections.p æT CONST æD cmAttn = $00000004; æC æKY cmDataNoTimeout æFp Connections.p æT CONST æD cmDataNoTimeout = $00000010; æC æKY cmCntlNoTimeout æFp Connections.p æT CONST æD cmCntlNoTimeout = $00000020; æC æKY cmAttnNoTimeout æFp Connections.p æT CONST æD cmAttnNoTimeout = $00000040; æC æKY cmDataClean æFp Connections.p æT CONST æD cmDataClean = $00000100; æC æKY cmCntlClean æFp Connections.p æT CONST æD cmCntlClean = $00000200; æC æKY cmAttnClean æFp Connections.p æT CONST æD cmAttnClean = $00000400; æC æKY cmNoMenus æFp Connections.p æT CONST æD cmNoMenus = $00010000; æC æKY cmQuiet æFp Connections.p æT CONST æD cmQuiet = $00020000; æC æKY CMRecFlags æFp Connections.p æT TYPE æD CMRecFlags = LONGINT; æC æKY CMChannel æFp Connections.p æT TYPE æD CMChannel = INTEGER; æC æKY cmStatusOpening æFp Connections.p æT CONST æD cmStatusOpening = $00000001; æC æKY cmStatusOpen æFp Connections.p æT CONST æD cmStatusOpen = $00000002; æC æKY cmStatusClosing æFp Connections.p æT CONST æD cmStatusClosing = $00000004; æC æKY cmStatusDataAvail æFp Connections.p æT CONST æD cmStatusDataAvail = $00000008; æC æKY cmStatusCntlAvail æFp Connections.p æT CONST æD cmStatusCntlAvail = $00000010; æC æKY cmStatusAttnAvail æFp Connections.p æT CONST æD cmStatusAttnAvail = $00000020; æC æKY cmStatusDRPend æFp Connections.p æT CONST æD cmStatusDRPend = $00000040; {data read pending} æC æKY cmStatusDWPend æFp Connections.p æT CONST æD cmStatusDWPend = $00000080; {data write pending} æC æKY cmStatusCRPend æFp Connections.p æT CONST æD cmStatusCRPend = $00000100; {cntl read pending} æC æKY cmStatusCWPend æFp Connections.p æT CONST æD cmStatusCWPend = $00000200; {cntl write pending} æC æKY cmStatusARPend æFp Connections.p æT CONST æD cmStatusARPend = $00000400; {attn read pending} æC æKY cmStatusAWPend æFp Connections.p æT CONST æD cmStatusAWPend = $00000800; {attn write pending} æC æKY cmStatusBreakPend æFp Connections.p æT CONST æD cmStatusBreakPend = $00001000; æC æKY cmStatusListenPend æFp Connections.p æT CONST æD cmStatusListenPend = $00002000; æC æKY cmStatusIncomingCallPresent æFp Connections.p æT CONST æD cmStatusIncomingCallPresent = $00004000; æC æKY cmStatusReserved0 æFp Connections.p æT CONST æD cmStatusReserved0 = $00008000; æC æKY CMStatFlags æFp Connections.p æT TYPE æD CMStatFlags = LONGINT; æC æKY CMBufFields cmDataIn cmDataOut cmCntlIn cmCntlOut cmAttnIn cmAttnOut cmRsrvIn cmRsrvOut æFp Connections.p æT TYPE æD CMBufFields = (cmDataIn,cmDataOut,cmCntlIn,cmCntlOut,cmAttnIn,cmAttnOut, cmRsrvIn,cmRsrvOut); æC æKY CMBuffers æFp Connections.p æT TYPE æD CMBuffers = ARRAY[CMBufFields] OF Ptr; æC æKY CMBufferSizes æFp Connections.p æT TYPE æD CMBufferSizes = ARRAY[CMBufFields] OF LONGINT; æC æKY cmSearchSevenBit æFp Connections.p æT CONST æD cmSearchSevenBit = $0001; æC æKY CMSearchFlags æFp Connections.p æT TYPE æD CMSearchFlags = INTEGER; æC æKY cmFlagsEOM æFp Connections.p æT CONST æD cmFlagsEOM = $0001; æC æKY CMFlags æFp Connections.p æT TYPE æD CMFlags = INTEGER; æC æKY ConnEnvironRec ConnEnvironRecPtr æFp Connections.p æT RECORD æD ConnEnvironRecPtr = ^ConnEnvironRec; ConnEnvironRec = RECORD version: INTEGER; baudRate: LONGINT; dataBits: INTEGER; channels: CMChannel; swFlowControl: BOOLEAN; hwFlowControl: BOOLEAN; flags: CMFlags; END; æC æKY ConnRecord ConnPtr ConnHandle æFp Connections.p æT RECORD æD ConnPtr = ^ConnRecord; ConnHandle = ^ConnPtr; ConnRecord = RECORD procID: INTEGER; flags: CMRecFlags; errCode: CMErr; refCon: LONGINT; userData: LONGINT; defProc: ProcPtr; config: Ptr; oldConfig: Ptr; asyncEOM: LONGINT; reserved1: LONGINT; reserved2: LONGINT; cmPrivate: Ptr; bufferArray: CMBuffers; bufSizes: CMBufferSizes; mluField: LONGINT; asyncCount: CMBufferSizes; END; æC æKY InitCM æFp Connections.p æT FUNCTION æD FUNCTION InitCM: CMErr; æDT myVariable := InitCM; æC æKY CMGetVersion æFp Connections.p æT FUNCTION æD FUNCTION CMGetVersion(hConn: ConnHandle): Handle; æDT myVariable := CMGetVersion(hConn); æC æKY CMGetCMVersion æFp Connections.p æT FUNCTION æD FUNCTION CMGetCMVersion: INTEGER; æDT myVariable := CMGetCMVersion; æC æKY CMNew æFp Connections.p æT FUNCTION æD FUNCTION CMNew(procID: INTEGER;flags: CMRecFlags;desiredSizes: CMBufferSizes; refCon: LONGINT;userData: LONGINT): ConnHandle; æDT myVariable := CMNew(procID,flags,desiredSizes,refCon,userData); æC æKY CMDispose æFp Connections.p æT PROCEDURE æD PROCEDURE CMDispose(hConn: ConnHandle); æDT CMDispose(hConn); æC æKY CMListen æFp Connections.p æT FUNCTION æD FUNCTION CMListen(hConn: ConnHandle;async: BOOLEAN;completor: ProcPtr;timeout: LONGINT): CMErr; æDT myVariable := CMListen(hConn,async,completor,timeout); æC æKY CMAccept æFp Connections.p æT FUNCTION æD FUNCTION CMAccept(hConn: ConnHandle;accept: BOOLEAN): CMErr; æDT myVariable := CMAccept(hConn,accept); æC æKY CMOpen æFp Connections.p æT FUNCTION æD FUNCTION CMOpen(hConn: ConnHandle;async: BOOLEAN;completor: ProcPtr;timeout: LONGINT): CMErr; æDT myVariable := CMOpen(hConn,async,completor,timeout); æC æKY CMClose æFp Connections.p æT FUNCTION æD FUNCTION CMClose(hConn: ConnHandle;async: BOOLEAN;completor: ProcPtr;timeout: LONGINT; now: BOOLEAN): CMErr; æDT myVariable := CMClose(hConn,async,completor,timeout,now); æC æKY CMAbort æFp Connections.p æT FUNCTION æD FUNCTION CMAbort(hConn: ConnHandle): CMErr; æDT myVariable := CMAbort(hConn); æC æKY CMStatus æFp Connections.p æT FUNCTION æD FUNCTION CMStatus(hConn: ConnHandle;VAR sizes: CMBufferSizes;VAR flags: CMStatFlags): CMErr; æDT myVariable := CMStatus(hConn,sizes,flags); æC æKY CMIdle æFp Connections.p æT PROCEDURE æD PROCEDURE CMIdle(hConn: ConnHandle); æDT CMIdle(hConn); æC æKY CMReset æFp Connections.p æT PROCEDURE æD PROCEDURE CMReset(hConn: ConnHandle); æDT CMReset(hConn); æC æKY CMBreak æFp Connections.p æT PROCEDURE æD PROCEDURE CMBreak(hConn: ConnHandle;duration: LONGINT;async: BOOLEAN;completor: ProcPtr); æDT CMBreak(hConn,duration,async,completor); æC æKY CMRead æFp Connections.p æT FUNCTION æD FUNCTION CMRead(hConn: ConnHandle;theBuffer: Ptr;VAR toRead: LONGINT;theChannel: CMChannel; async: BOOLEAN;completor: ProcPtr;timeout: LONGINT;VAR flags: CMFlags): CMErr; æDT myVariable := CMRead(hConn,theBuffer,toRead,theChannel,async,completor,timeout,flags); æC æKY CMWrite æFp Connections.p æT FUNCTION æD FUNCTION CMWrite(hConn: ConnHandle;theBuffer: Ptr;VAR toWrite: LONGINT; theChannel: CMChannel;async: BOOLEAN;completor: ProcPtr;timeout: LONGINT; flags: CMFlags): CMErr; æDT myVariable := CMWrite(hConn,theBuffer,toWrite,theChannel,async,completor,timeout,flags); æC æKY CMIOKill æFp Connections.p æT FUNCTION æD FUNCTION CMIOKill(hConn: ConnHandle;which: INTEGER): CMErr; æDT myVariable := CMIOKill(hConn,which); æC æKY CMActivate æFp Connections.p æT PROCEDURE æD PROCEDURE CMActivate(hConn: ConnHandle;activate: BOOLEAN); æDT CMActivate(hConn,activate); æC æKY CMResume æFp Connections.p æT PROCEDURE æD PROCEDURE CMResume(hConn: ConnHandle;resume: BOOLEAN); æDT CMResume(hConn,resume); æC æKY CMMenu æFp Connections.p æT FUNCTION æD FUNCTION CMMenu(hConn: ConnHandle;menuID: INTEGER;item: INTEGER): BOOLEAN; æDT myVariable := CMMenu(hConn,menuID,item); æC æKY CMValidate æFp Connections.p æT FUNCTION æD FUNCTION CMValidate(hConn: ConnHandle): BOOLEAN; æDT myVariable := CMValidate(hConn); æC æKY CMDefault æFp Connections.p æT PROCEDURE æD PROCEDURE CMDefault(VAR theConfig: Ptr;procID: INTEGER;allocate: BOOLEAN); æDT CMDefault(theConfig,procID,allocate); æC æKY CMSetupPreflight æFp Connections.p æT FUNCTION æD FUNCTION CMSetupPreflight(procID: INTEGER;VAR magicCookie: LONGINT): Handle; æDT myVariable := CMSetupPreflight(procID,magicCookie); æC æKY CMSetupFilter æFp Connections.p æT FUNCTION æD FUNCTION CMSetupFilter(procID: INTEGER;theConfig: Ptr;count: INTEGER;theDialog: DialogPtr; VAR theEvent: EventRecord;VAR theItem: INTEGER;VAR magicCookie: LONGINT): BOOLEAN; æDT myVariable := CMSetupFilter(procID,theConfig,count,theDialog,theEvent,theItem,magicCookie); æC æKY CMSetupSetup æFp Connections.p æT PROCEDURE æD PROCEDURE CMSetupSetup(procID: INTEGER;theConfig: Ptr;count: INTEGER;theDialog: DialogPtr; VAR magicCookie: LONGINT); æDT CMSetupSetup(procID,theConfig,count,theDialog,magicCookie); æC æKY CMSetupItem æFp Connections.p æT PROCEDURE æD PROCEDURE CMSetupItem(procID: INTEGER;theConfig: Ptr;count: INTEGER;theDialog: DialogPtr; VAR theItem: INTEGER;VAR magicCookie: LONGINT); æDT CMSetupItem(procID,theConfig,count,theDialog,theItem,magicCookie); æC æKY CMSetupCleanup æFp Connections.p æT PROCEDURE æD PROCEDURE CMSetupCleanup(procID: INTEGER;theConfig: Ptr;count: INTEGER; theDialog: DialogPtr;VAR magicCookie: LONGINT); æDT CMSetupCleanup(procID,theConfig,count,theDialog,magicCookie); æC æKY CMSetupPostflight æFp Connections.p æT PROCEDURE æD PROCEDURE CMSetupPostflight(procID: INTEGER); æDT CMSetupPostflight(procID); æC æKY CMGetConfig æFp Connections.p æT FUNCTION æD FUNCTION CMGetConfig(hConn: ConnHandle): Ptr; æDT myVariable := CMGetConfig(hConn); æC æKY CMSetConfig æFp Connections.p æT FUNCTION æD FUNCTION CMSetConfig(hConn: ConnHandle;thePtr: Ptr): INTEGER; æDT myVariable := CMSetConfig(hConn,thePtr); æC æKY CMIntlToEnglish æFp Connections.p æT FUNCTION æD FUNCTION CMIntlToEnglish(hConn: ConnHandle;inputPtr: Ptr;VAR outputPtr: Ptr; language: INTEGER): OSErr; æDT myVariable := CMIntlToEnglish(hConn,inputPtr,outputPtr,language); æC æKY CMEnglishToIntl æFp Connections.p æT FUNCTION æD FUNCTION CMEnglishToIntl(hConn: ConnHandle;inputPtr: Ptr;VAR outputPtr: Ptr; language: INTEGER): OSErr; æDT myVariable := CMEnglishToIntl(hConn,inputPtr,outputPtr,language); æC æKY CMAddSearch æFp Connections.p æT FUNCTION æD FUNCTION CMAddSearch(hConn: ConnHandle;theString: Str255;flags: CMSearchFlags; callBack: ProcPtr): LONGINT; æDT myVariable := CMAddSearch(hConn,theString,flags,callBack); æC æKY CMRemoveSearch æFp Connections.p æT PROCEDURE æD PROCEDURE CMRemoveSearch(hConn: ConnHandle;refnum: LONGINT); æDT CMRemoveSearch(hConn,refnum); æC æKY CMClearSearch æFp Connections.p æT PROCEDURE æD PROCEDURE CMClearSearch(hConn: ConnHandle); æDT CMClearSearch(hConn); æC æKY CMGetConnEnvirons æFp Connections.p æT FUNCTION æD FUNCTION CMGetConnEnvirons(hConn: ConnHandle;VAR theEnvirons: ConnEnvironRec): CMErr; æDT myVariable := CMGetConnEnvirons(hConn,theEnvirons); æC æKY CMChoose æFp Connections.p æT FUNCTION æD FUNCTION CMChoose(VAR hConn: ConnHandle;where: Point;idleProc: ProcPtr): INTEGER; æDT myVariable := CMChoose(hConn,where,idleProc); æC æKY CMEvent æFp Connections.p æT PROCEDURE æD PROCEDURE CMEvent(hConn: ConnHandle;theEvent: EventRecord); æDT CMEvent(hConn,theEvent); æC æKY CMGetToolName æFp Connections.p æT PROCEDURE æD PROCEDURE CMGetToolName(procID: INTEGER;VAR name: Str255); æDT CMGetToolName(procID,name); æC æKY CMGetProcID æFp Connections.p æT FUNCTION æD FUNCTION CMGetProcID(name: Str255): INTEGER; æDT myVariable := CMGetProcID(name); æC æKY CMSetRefCon æFp Connections.p æT PROCEDURE æD PROCEDURE CMSetRefCon(hConn: ConnHandle;refCon: LONGINT); æDT CMSetRefCon(hConn,refCon); æC æKY CMGetRefCon æFp Connections.p æT FUNCTION æD FUNCTION CMGetRefCon(hConn: ConnHandle): LONGINT; æDT myVariable := CMGetRefCon(hConn); æC æKY CMGetUserData æFp Connections.p æT FUNCTION æD FUNCTION CMGetUserData(hConn: ConnHandle): LONGINT; æDT myVariable := CMGetUserData(hConn); æC æKY CMSetUserData æFp Connections.p æT PROCEDURE æD PROCEDURE CMSetUserData(hConn: ConnHandle;userData: LONGINT); æDT CMSetUserData(hConn,userData); æC æKY ConnectionTools.p æKL cbndType cdefType clocType cmAbortMsg cmAcceptMsg cmActivateMsg cmBreakMsg cmCloseMsg CMCompletorPtr CMCompletorRecord CMDataBuffer CMDataBufferPtr cmDeactivateMsg cmDefaultMsg cmDisposeMsg cmEnvironsMsg cmEventMsg cmIdleMsg cmInitMsg cmIOKillMsg cmL2English cmL2Intl cmListenMsg cmMenuMsg cmMgetMsg cmMsetMsg cmOpenMsg cmReadMsg cmResetMsg cmResumeMsg cmScleanupMsg CMSetupPtr CMSetupStruct cmSfilterMsg cmSitemMsg cmSpreflightMsg cmSsetupMsg cmStatusMsg cmSuspendMsg cmValidateMsg cmWriteMsg cscrType csetType cvalType cverType æKY cmInitMsg æFp ConnectionTools.p æT CONST æD cmInitMsg = 0; æC æKY cmDisposeMsg æFp ConnectionTools.p æT CONST æD cmDisposeMsg = 1; æC æKY cmSuspendMsg æFp ConnectionTools.p æT CONST æD cmSuspendMsg = 2; æC æKY cmResumeMsg æFp ConnectionTools.p æT CONST æD cmResumeMsg = 3; æC æKY cmMenuMsg æFp ConnectionTools.p æT CONST æD cmMenuMsg = 4; æC æKY cmEventMsg æFp ConnectionTools.p æT CONST æD cmEventMsg = 5; æC æKY cmActivateMsg æFp ConnectionTools.p æT CONST æD cmActivateMsg = 6; æC æKY cmDeactivateMsg æFp ConnectionTools.p æT CONST æD cmDeactivateMsg = 7; æC æKY cmIdleMsg æFp ConnectionTools.p æT CONST æD cmIdleMsg = 50; æC æKY cmResetMsg æFp ConnectionTools.p æT CONST æD cmResetMsg = 51; æC æKY cmAbortMsg æFp ConnectionTools.p æT CONST æD cmAbortMsg = 52; æC æKY cmReadMsg æFp ConnectionTools.p æT CONST æD cmReadMsg = 100; æC æKY cmWriteMsg æFp ConnectionTools.p æT CONST æD cmWriteMsg = 101; æC æKY cmStatusMsg æFp ConnectionTools.p æT CONST æD cmStatusMsg = 102; æC æKY cmListenMsg æFp ConnectionTools.p æT CONST æD cmListenMsg = 103; æC æKY cmAcceptMsg æFp ConnectionTools.p æT CONST æD cmAcceptMsg = 104; æC æKY cmCloseMsg æFp ConnectionTools.p æT CONST æD cmCloseMsg = 105; æC æKY cmOpenMsg æFp ConnectionTools.p æT CONST æD cmOpenMsg = 106; æC æKY cmBreakMsg æFp ConnectionTools.p æT CONST æD cmBreakMsg = 107; æC æKY cmIOKillMsg æFp ConnectionTools.p æT CONST æD cmIOKillMsg = 108; æC æKY cmEnvironsMsg æFp ConnectionTools.p æT CONST æD cmEnvironsMsg = 109; æC æKY cmValidateMsg æFp ConnectionTools.p æT CONST æD cmValidateMsg = 0; æC æKY cmDefaultMsg æFp ConnectionTools.p æT CONST æD cmDefaultMsg = 1; æC æKY cmSpreflightMsg æFp ConnectionTools.p æT CONST æD cmSpreflightMsg = 0; æC æKY cmSsetupMsg æFp ConnectionTools.p æT CONST æD cmSsetupMsg = 1; æC æKY cmSitemMsg æFp ConnectionTools.p æT CONST æD cmSitemMsg = 2; æC æKY cmSfilterMsg æFp ConnectionTools.p æT CONST æD cmSfilterMsg = 3; æC æKY cmScleanupMsg æFp ConnectionTools.p æT CONST æD cmScleanupMsg = 4; æC æKY cmMgetMsg æFp ConnectionTools.p æT CONST æD cmMgetMsg = 0; æC æKY cmMsetMsg æFp ConnectionTools.p æT CONST æD cmMsetMsg = 1; æC æKY cmL2English æFp ConnectionTools.p æT CONST æD cmL2English = 0; æC æKY cmL2Intl æFp ConnectionTools.p æT CONST æD cmL2Intl = 1; æC æKY cdefType æFp ConnectionTools.p æT CONST æD cdefType = 'cdef'; { main connection definition procedure } æC æKY cvalType æFp ConnectionTools.p æT CONST æD cvalType = 'cval'; { validation definition procedure } æC æKY csetType æFp ConnectionTools.p æT CONST æD csetType = 'cset'; { connection setup definition procedure } æC æKY clocType æFp ConnectionTools.p æT CONST æD clocType = 'cloc'; { connection configuration localization defProc } æC æKY cscrType æFp ConnectionTools.p æT CONST æD cscrType = 'cscr'; { connection scripting defProc interfaces } æC æKY cbndType æFp ConnectionTools.p æT CONST æD cbndType = 'cbnd'; { bundle type for connection } æC æKY cverType æFp ConnectionTools.p æT CONST æD cverType = 'vers'; æC æKY CMDataBuffer CMDataBufferPtr æFp ConnectionTools.p æT RECORD æD CMDataBufferPtr = ^CMDataBuffer; CMDataBuffer = RECORD thePtr: Ptr; count: LONGINT; channel: CMChannel; flags: CMFlags; END; æC æKY CMCompletorRecord CMCompletorPtr æFp ConnectionTools.p æT RECORD æD CMCompletorPtr = ^CMCompletorRecord; CMCompletorRecord = RECORD async: BOOLEAN; completionRoutine: ProcPtr; END; æC æKY CMSetupStruct CMSetupPtr æFp ConnectionTools.p æT RECORD æD CMSetupPtr = ^CMSetupStruct; CMSetupStruct = RECORD theDialog: DialogPtr; count: INTEGER; theConfig: Ptr; procID: INTEGER; { procID of the tool } END; æC æKY Controls.p æKL DisposeControl DragControl Draw1Control DrawControls FindControl GetAuxCtl GetCRefCon GetCTitle GetCtlAction GetCtlMax GetCtlMin GetCtlValue GetCVariant GetNewControl HideControl HiliteControl KillControls MoveControl NewControl SetCRefCon SetCTitle SetCtlAction SetCtlColor SetCtlMax SetCtlMin SetCtlValue ShowControl SizeControl TestControl TrackControl UpdateControls UpdtControl autoTrack AuxCtlHandle AuxCtlPtr AuxCtlRec calcCntlRgn calcCRgns calcThumbRgn cBodyColor CCTabHandle CCTabPtr cFrameColor checkBoxProc ControlHandle ControlPtr ControlRecord cTextColor cThumbColor CtlCTab dispCntl dragCntl drawCntl hAxisOnly inButton inCheckBox inDownButton initCntl inPageDown inPageUp inThumb inUpButton noConstraint popupFixedWidth popupMenuCDEFproc popupMenuProc popupTitleBold popupTitleCenterJust popupTitleCondense popupTitleExtend popupTitleItalic popupTitleLeftJust popupTitleNoStyle popupTitleOutline popupTitleRightJust popupTitleShadow popupTitleUnderline popupUseAddResMenu popupUseWFont posCntl pushButProc radioButProc scrollBarProc testCntl thumbCntl useWFont vAxisOnly æKY pushButProc æFp Controls.p æT CONST æD pushButProc = 0; æC æKY checkBoxProc æFp Controls.p æT CONST æD checkBoxProc = 1; æC æKY radioButProc æFp Controls.p æT CONST æD radioButProc = 2; æC æKY useWFont æFp Controls.p æT CONST æD useWFont = 8; æC æKY scrollBarProc æFp Controls.p æT CONST æD scrollBarProc = 16; æC æKY inButton æFp Controls.p æT CONST æD inButton = 10; æC æKY inCheckBox æFp Controls.p æT CONST æD inCheckBox = 11; æC æKY inUpButton æFp Controls.p æT CONST æD inUpButton = 20; æC æKY inDownButton æFp Controls.p æT CONST æD inDownButton = 21; æC æKY inPageUp æFp Controls.p æT CONST æD inPageUp = 22; æC æKY inPageDown æFp Controls.p æT CONST æD inPageDown = 23; æC æKY inThumb æFp Controls.p æT CONST æD inThumb = 129; æC æKY popupMenuProc æFp Controls.p æT CONST æD popupMenuProc = 1008; { 63 * 16 } æC æKY popupFixedWidth æFp Controls.p æT CONST æD popupFixedWidth = $0001; { popup menu CDEF variation codes } æC æKY popupUseAddResMenu æFp Controls.p æT CONST æD popupUseAddResMenu = $0004; æC æKY popupUseWFont æFp Controls.p æT CONST æD popupUseWFont = $0008; æC æKY popupTitleBold æFp Controls.p æT CONST æD popupTitleBold = $00000100; { Popup Title characteristics } æC æKY popupTitleItalic æFp Controls.p æT CONST æD popupTitleItalic = $00000200; æC æKY popupTitleUnderline æFp Controls.p æT CONST æD popupTitleUnderline = $00000400; æC æKY popupTitleOutline æFp Controls.p æT CONST æD popupTitleOutline = $00000800; æC æKY popupTitleShadow æFp Controls.p æT CONST æD popupTitleShadow = $00001000; æC æKY popupTitleCondense æFp Controls.p æT CONST æD popupTitleCondense = $00002000; æC æKY popupTitleExtend æFp Controls.p æT CONST æD popupTitleExtend = $00004000; æC æKY popupTitleNoStyle æFp Controls.p æT CONST æD popupTitleNoStyle = $00008000; æC æKY popupTitleLeftJust æFp Controls.p æT CONST æD popupTitleLeftJust = $00000000; æC æKY popupTitleCenterJust æFp Controls.p æT CONST æD popupTitleCenterJust = $00000001; æC æKY popupTitleRightJust æFp Controls.p æT CONST æD popupTitleRightJust = $000000FF; æC æKY noConstraint æFp Controls.p æT CONST æD noConstraint = 0; æC æKY hAxisOnly æFp Controls.p æT CONST æD hAxisOnly = 1; æC æKY vAxisOnly æFp Controls.p æT CONST æD vAxisOnly = 2; æC æKY drawCntl æFp Controls.p æT CONST æD drawCntl = 0; æC æKY testCntl æFp Controls.p æT CONST æD testCntl = 1; æC æKY calcCRgns æFp Controls.p æT CONST æD calcCRgns = 2; æC æKY initCntl æFp Controls.p æT CONST æD initCntl = 3; æC æKY dispCntl æFp Controls.p æT CONST æD dispCntl = 4; æC æKY posCntl æFp Controls.p æT CONST æD posCntl = 5; æC æKY thumbCntl æFp Controls.p æT CONST æD thumbCntl = 6; æC æKY dragCntl æFp Controls.p æT CONST æD dragCntl = 7; æC æKY autoTrack æFp Controls.p æT CONST æD autoTrack = 8; æC æKY calcCntlRgn æFp Controls.p æT CONST æD calcCntlRgn = 10; æC æKY calcThumbRgn æFp Controls.p æT CONST æD calcThumbRgn = 11; æC æKY cFrameColor æFp Controls.p æT CONST æD cFrameColor = 0; æC æKY cBodyColor æFp Controls.p æT CONST æD cBodyColor = 1; æC æKY cTextColor æFp Controls.p æT CONST æD cTextColor = 2; æC æKY cThumbColor æFp Controls.p æT CONST æD cThumbColor = 3; æC æKY popupMenuCDEFproc æFp Controls.p æT CONST æD popupMenuCDEFproc = popupMenuProc; { synonym for compatibility } æC æKY ControlRecord ControlPtr ControlHandle æFp Controls.p æT RECORD æD ControlPtr = ^ControlRecord; ControlHandle = ^ControlPtr; ControlRecord = PACKED RECORD nextControl: ControlHandle; contrlOwner: WindowPtr; contrlRect: Rect; contrlVis: Byte; contrlHilite: Byte; contrlValue: INTEGER; contrlMin: INTEGER; contrlMax: INTEGER; contrlDefProc: Handle; contrlData: Handle; contrlAction: ProcPtr; contrlRfCon: LONGINT; contrlTitle: Str255; END; æC Every control is represented internally by a control record containing all pertinent information about that control. The control record contains the following: • A pointer to the window the control belongs to. • A handle to the next control in the window’s control list. • A handle to the control definition function. • The control’s title, if any. • A rectangle that completely encloses the control, which determines the control’s size and location within its window. The entire control, including the title of a check box or radio button, is drawn inside this rectangle. • An indication of whether the control is currently active and how it’s to be highlighted. • The current setting of the control (if this type of control retains a setting) and the minimum and maximum values the setting can assume. For check boxes and radio buttons, a setting of 0 means the control is off and 1 means it’s on. The control record also contains an indication of whether the control is currently visible or invisible. These terms refer only to whether the control is drawn in its window, not to whether you can see it on the screen. A control may be “visible” and still not appear on the screen, because it’s obscured by overlapping windows or other objects. There’s a field in the control record for a pointer to the control’s default action procedure. An action procedure defines some action to be performed repeatedly for as long as the user holds down the mouse button inside the control. The default action procedure may be used by the Control Manager function TrackControl if you call it without passing a pointer to an action procedure; this is discussed in detail in the description of TrackControl in the “Control Manager Routines” section. Finally, the control record includes a 32-bit reference value field, which is reserved for use by your application. You specify an initial reference value when you create a control, and can then read or change the reference value whenever you wish. The data type for a control record is called ControlRecord. A control record is referred to by a handle: TYPE ControlPtr = ^ControlRecord; ControlHandle = ^ControlPtr; The Control Manager functions for creating a control return a handle to a newly allocated control record; thereafter, your program should normally refer to the control by this handle. Most of the Control Manager routines expect a control handle as their first parameter. You can store into and access most of a control record’s fields with Control Manager routines, so normally you don’t have to know the exact field names. However, if you want more information about the exact structure of a control record—if you’re defining your own control types, for instance—it’s given below. _______________________________________________________________________________ »The ControlRecord Data Type The ControlRecord data type is defined as follows: TYPE ControlRecord = PACKED RECORD nextControl: ControlHandle; {next control} contrlOwner: WindowPtr; {control's window} contrlRect: Rect; {enclosing rectangle} contrlVis: Byte; {255 if visible} contrlHilite: Byte; {highlight state} contrlValue: INTEGER; {control's current setting} contrlMin: INTEGER; {control's minimum setting} contrlMax: INTEGER; {control's maximum setting} contrlDefProc: Handle; {control definition function} contrlData: Handle; {data used by contrlDefProc} contrlAction: ProcPtr; {default action procedure} contrlRfCon: LONGINT; {control's reference value} contrlTitle: Str255 {control's title} END; NextControl is a handle to the next control associated with this control’s window. All the controls belonging to a given window are kept in a linked list, beginning in the controlList field of the window record and chained together through the nextControl fields of the individual control records. The end of the list is marked by a NIL value; as new controls are created, they’re added to the beginning of the list. ContrlOwner is a pointer to the window that this control belongs to. ContrlRect is the rectangle that completely encloses the control, in the local coordinates of the control’s window. When contrlVis is 0, the control is currently invisible; when it’s 255, the control is visible. ContrlHilite specifies whether and how the control is to be highlighted, indicating whether it’s active or inactive. The HiliteControl procedure lets you set this field; see the description of HiliteControl for more information about the meaning of the field’s value. ContrlValue is the control’s current setting. For check boxes and radio buttons, 0 means the control is off and 1 means it’s on. For dials, the fields contrlMin and contrlMax define the range of possible settings; contrlValue may take on any value within that range. Other (custom) control types can use these three fields as they see fit. ContrlDefProc is a handle to the control definition function for this type of control. When you create a control, you identify its type with a control definition ID, which is converted into a handle to the control definition function and stored in the contrlDefProc field. Thereafter, the Control Manager uses this handle to access the definition function; you should never need to refer to this field directly. Note: When not running in 32-bit mode, the high-order byte of the contrlDefProc field contains some additional information that the Control Manager gets from the control definition ID; for details, see the section “Defining Your Own Controls”. ContrlData is reserved for use by the control definition function, typically to hold additional information specific to a particular control type. For example, the standard definition function for scroll bars uses this field for a handle to the region containing the scroll bar’s thumb. If no more than four bytes of additional information are needed, the definition function can store the information directly in the contrlData field rather than use a handle. ContrlAction is a pointer to the control’s default action procedure, if any. The Control Manager function TrackControl may call this procedure to respond to the user’s dragging the mouse inside the control. ContrlRfCon is the control’s reference value field, which the application may store into and access for any purpose. ContrlTitle is the control’s title, if any. æKY CtlCTab CCTabPtr CCTabHandle æFp Controls.p æT RECORD æD CCTabPtr = ^CtlCTab; CCTabHandle = ^CCTabPtr; CtlCTab = RECORD ccSeed: LONGINT; {reserved} ccRider: INTEGER; {see what you have done - reserved} ctSize: INTEGER; {usually 3 for controls} ctTable: ARRAY [0..3] OF ColorSpec; END; æC The contents and meaning of a control’s color table are determined by its control definition function (see “The Control Color Table Resource” section). The CTabHandle parameter used in the Color Control Manager routines provides a handle to the control color table. The components of a control color table are defined as follows: TYPE CCTabHandle = ^CCTabPtr; CCTabPtr = ^CtlCTab; CtlCTab = RECORD ccSeed: LONGINT; {not used for controls} ccRider: INTEGER; {not used for controls} ctSize: INTEGER; {number of entries in table –1} ctTable: cSpecArray {array of ColorSpec records} END; Field descriptions ccSeed The ccSeed field is unused in control color tables. ccRider The ccRider field is unused in control color tables. ctSize The ctSize field defines the number of elements in the table, minus one. For controls drawn with the standard definition procedure, this field is always 3. ctTable The ctTable field holds an array of colorSpec records. Each colorSpec is made up of a partIdentifier field and a partRGB field. The partIdentifier field holds an integer which associates an RGBColor to a particular part of the control. The definition procedures attempt to find the appropriate part identifier when preparing to draw a part. If that part identifier is not found, the first color in the table is used to draw the part. The part identifiers can appear in any order in the table. The partRGB field specifies a standard RGB color record, indicating what absolute color will be used to draw the control part found in the partIdentifier field. A standard control color table is shown in Figure 6. •••Refer to Figure 6.••• Figure 6–Control Color Table The 'cctb' resource is an exact image of this control table data structure, and is stored in the same format as 'clut' color table resources. Standard buttons, check boxes, and radio buttons use a four-element color table with part identifiers as shown below: cFrameColor (0) Frame color cBodyColor (1) Fill color for body of control cTextColor (2) Text color cThumbColor (3) Unused When highlighted, plain buttons exchange their body and text colors (colors 1 and 2); check boxes and radio buttons change their appearance without changing colors. All three types indicate deactivation by dimming their text with no change in colors. Standard scroll bars use a four-element color table with part identifiers as shown below: cFrameColor (0) Frame color, foreground color for shaft and arrows cBodyColor (1 Background color for shaft and arrows cTextColor (2) Unused cThumbColor (3) Fill color for thumb When highlighted, the arrows are filled with the foreground color (color 0) within the arrow outline. A deactivated scroll bar shows no indicator, and displays its shaft in solid background color (color 1), with no pattern. The 'cctb' resource = 0 is read into the application heap when the application starts, and serves as the default control color table. The last record in the auxiliary control list points to the default 'cctb' resource. When drawing a control, the standard control definition function searches the list for an auxiliary control record whose acOwner points to the control being drawn. If it finds such a record, it uses the color table designated by that record; if it doesn’t find one before reaching the default record at the end of the list, it uses the default color table instead. All types of controls share the same default record. The default auxiliary control record is recognized by NIL values in both its acNext and acOwner fields; the application must not change these fields. A nonstandard control definition function can use color tables of any desired size and define their contents in any way it wishes, except that part indices 1 to 127 are reserved for system definition. Any such nonstandard function should take care to bypass the defaulting mechanism just described, by allocating an explicit auxiliary record for every control it creates. æKY AuxCtlRec AuxCtlPtr AuxCtlHandle æFp Controls.p æT RECORD æD AuxCtlPtr = ^AuxCtlRec; AuxCtlHandle = ^AuxCtlPtr; AuxCtlRec = RECORD acNext: AuxCtlHandle; {handle to next AuxCtlRec} acOwner: ControlHandle; {handle for aux record's control} acCTable: CCTabHandle; {color table for this control} acFlags: INTEGER; {misc flag byte} acReserved: LONGINT; {reserved for use by Apple} acRefCon: LONGINT; {for use by application} END; æC The information needed for drawing controls in color is kept in a linked list of auxiliary control records, beginning in the global variable AuxCtlHead. (Notice that there is just one global list for all controls in all windows, not a separate one for each window.) Each window record has a handle to the list of controls. Figure 5 shows the auxiliary control list structure. •••Refer to Figure 5.••• Figure 5–Auxiliary Control List Each auxiliary control record is a relocatable object residing in the application heap. The most important information it holds is a handle to the control’s individual color table (see the “Control Color Tables” section). The rest of the record consists of a link to the next record in the list, a field that identifies the control’s owner, a 4-byte field reserved for future expansion, and a 4-byte reference constant for use by the application: TYPE AuxCtlHandle = ^AuxCtlPtr; AuxCtlPtr = ^AuxCtlRec; AuxCtlRec = RECORD acNext: AuxCtlHandle; {handle to next record in list} acOwner: ControlHandle; {handle to owning control} acCTable: CCTabHandle; {handle to control's color } { table} acFlags: INTEGER; {miscellaneous flags; reserved} acReserved: LONGINT; {reserved for future expansion} acRefCon: LONGINT {reserved for application use} END; Field descriptions acNext The acNext field contains a handle to the next record in the auxiliary control list. acOwner The acOwner field contains the handle of the control to which this auxiliary record belongs. Used as an ID field. acCTable The acCTable contains the handle to the control’s color table (see “Control Color Tables” below). acFlags The acFlags field contains miscellaneous flags for use by the Control Manager; this field is reserved. acReserved The acReserved field is reserved for future expansion; this must be set to 0 for future compatibility. acRefCon The acRefCon field is a reference constant for use by the application. Not every control needs an auxiliary control record. When an application is started, a resource containing a default color table is loaded from the system resource file; this resource defines a standard set of control colors. Since there is no InitControls routine, this happens when an application calls InitWindows. Separate auxiliary control records are needed only for controls whose color usage differs from the default. Each such nonstandard control must have its own auxiliary record, even if it uses the same colors as another control. This allows two or more auxiliary records to share the same control color table. If the control color table is a resource, it won’t be deleted by DisposeControl. When using an auxiliary record that is not stored as a resource, the application should not deallocate the color table if another control is still using it. A control created from scratch will initially have no auxiliary control record. If it is to use nonstandard colors, it must be given an auxiliary record and a color table with SetCtlColor (see the “Control Manager Routines” section). Such a control should normally be made invisible at creation and then displayed with ShowControl after the colors are set. For controls created from a 'CNTL' resource, the color table can be specified as a resource as well. See the section titled “The Control Color Table Resource”. A/UX systems: When using 32-bit mode. every control has its own auxiliary record. If there is no specific set of control colors for this control, the acCTable will point to the default color table. æKY NewControl æFp Controls.p æT FUNCTION æTN A954 æD FUNCTION NewControl(theWindow: WindowPtr;boundsRect: Rect;title: Str255; visible: BOOLEAN;value: INTEGER;min: INTEGER;max: INTEGER;procID: INTEGER; refCon: LONGINT): ControlHandle; INLINE $A954; æDT myVariable := NewControl(theWindow,boundsRect,title,visible,value,min,max,procID,refCon); æMM æRI I-319, P-112, 114, 177 æC NewControl creates a control, adds it to the beginning of theWindow’s control list, and returns a handle to the new control. The values passed as parameters are stored in the corresponding fields of the control record, as described below. The field that determines highlighting is set to 0 (no highlighting) and the pointer to the default action procedure is set to NIL (none). Note: The control definition function may do additional initialization, including changing any of the fields of the control record. The only standard control for which additional initialization is done is the scroll bar; its control definition function allocates space for a region to hold the thumb and stores the region handle in the contrlData field of the control record. TheWindow is the window the new control will belong to. All coordinates pertaining to the control will be interpreted in this window’s local coordinate system. BoundsRect, given in theWindow’s local coordinates, is the rectangle that encloses the control and thus determines its size and location. Note the following about the enclosing rectangle for the standard controls: • Simple buttons are drawn to fit the rectangle exactly. (The control definition function calls the QuickDraw procedure FrameRoundRect.) To allow for the tallest characters in the system font, there should be at least a 20-point difference between the top and bottom coordinates of the rectangle. • For check boxes and radio buttons, there should be at least a 16-point difference between the top and bottom coordinates. • By convention, scroll bars are 16 pixels wide, so there should be a 16-point difference between the left and right (or top and bottom) coordinates. (If there isn’t, the scroll bar will be scaled to fit the rectangle.) A standard scroll bar should be at least 48 pixels long, to allow room for the scroll arrows and thumb. Title is the control’s title, if any (if none, you can just pass the empty string as the title). Be sure the title will fit in the control’s enclosing rectangle; if it won’t it will be truncated on the right for check boxes and radio buttons, or centered and truncated on both ends for simple buttons. Note: Some non-Roman systems write text from right-to-left, in which case radio buttons and check boxes are drawn with their titles on the left of the control. They are also truncated on the left. See the Script Manager chapter for more information. If the visible parameter is TRUE, NewControl draws the control. Note: It does not use the standard window updating mechanism, but instead draws the control immediately in the window. The min and max parameters define the control’s range of possible settings; the value parameter gives the initial setting. For controls that don’t retain a setting, such as buttons, the values you supply for these parameters will be stored in the control record but will never be used. So it doesn’t matter what values you give for those controls—0 for all three parameters will do. For controls that just retain an on-or-off setting, such as check boxes or radio buttons, min should be 0 (meaning the control is off) and max should be 1 (meaning it’s on). For dials, you can specify whatever values are appropriate for min, max, and value. ProcID is the control definition ID, which leads to the control definition function for this type of control. (The function is read into memory if it isn’t already in memory.) The control definition IDs for the standard control types are listed above under “Controls and Resources”. Control definition IDs for custom control types are discussed later under “Defining Your Own Controls”. RefCon is the control’s reference value, set and used only by your application. æKY SetCTitle æFp Controls.p æT PROCEDURE æTN A95F æD PROCEDURE SetCTitle(theControl: ControlHandle;title: Str255); INLINE $A95F; æDT SetCTitle(theControl,title); æMM æRI I-321 æC SetCTitle sets theControl’s title to the given string and redraws the control. æKY GetCTitle æFp Controls.p æT PROCEDURE æTN A95E æD PROCEDURE GetCTitle(theControl: ControlHandle;VAR title: Str255); INLINE $A95E; æDT GetCTitle(theControl,title); æRI I-321 æC GetCTitle returns theControl’s title as the value of the title parameter. æKY GetNewControl æFp Controls.p æT FUNCTION æTN A9BE æD FUNCTION GetNewControl(controlID: INTEGER;owner: WindowPtr): ControlHandle; INLINE $A9BE; æDT myVariable := GetNewControl(controlID,owner); æMM æRT 203 æRI I-321, P-112, 113, 114, 172 æC GetNewControl creates a control from a control template stored in a resource file, adds it to the beginning of theWindow’s control list, and returns a handle to the new control. ControlID is the resource ID of the template. GetNewControl works exactly the same as NewControl (above), except that it gets the initial values for the new control’s fields from the specified control template instead of accepting them as parameters. If the control template can’t be read from the resource file, GetNewControl returns NIL. It releases the memory occupied by the resource before returning. The system default control colors are stored in the System file and ROMResources as 'cctb' resource = 0. By including a 'cctb' resource = 0 in your application, it is possible to change the default colors that will be used for all controls, unless a specific 'cctb' exists for a control defined within the application. When you use GetNewControl for the control resource 'CNTL', GetNewControl will attempt to load a 'cctb' resource with the same ID as the 'CNTL' resource ID, if one is present. It then executes the SetCtlColor call. The following part identifiers for control elements should be present in the ColorSpec.value field: cFrameColor (0) Frame color cBodyColor (1) Fill color for body of control cTextColor (2) Text color cThumbColor (3) Thumb color These identifiers may be present in any order; for instance, the text or indicator color values may be stored before the fill and frame colors in the ColorSpec record structure. If a part identifier is not found, then the first color in the color table will be used. æKY DisposeControl æFp Controls.p æT PROCEDURE æTN A955 æD PROCEDURE DisposeControl(theControl: ControlHandle); INLINE $A955; æDT DisposeControl(theControl); æMM æRI I-321, P-168 æC Assembly-language note: The macro you invoke to call DisposeControl from assembly language is named _DisposControl. DisposeControl removes theControl from the screen, deletes it from its window’s control list, and releases the memory occupied by the control record and any data structures associated with the control. æKY KillControls æFp Controls.p æT PROCEDURE æTN A956 æD PROCEDURE KillControls(theWindow: WindowPtr); INLINE $A956; æDT KillControls(theWindow); æMM æRI I-321, P-113, 175 æC KillControls disposes of all controls associated with theWindow by calling DisposeControl (above) for each. Note: Remember that the Window Manager procedures CloseWindow and DisposeWindow automatically dispose of all controls associated with the given window. æKY HideControl æFp Controls.p æT PROCEDURE æTN A958 æD PROCEDURE HideControl(theControl: ControlHandle); INLINE $A958; æDT HideControl(theControl); æMM æRI I-322, P-113, 114, 174 æC HideControl makes theControl invisible. It fills the region the control occupies within its window with the background pattern of the window’s grafPort. It also adds the control’s enclosing rectangle to the window’s update region, so that anything else that was previously obscured by the control will reappear on the screen. If the control is already invisible, HideControl has no effect. æKY ShowControl æFp Controls.p æT PROCEDURE æTN A957 æD PROCEDURE ShowControl(theControl: ControlHandle); INLINE $A957; æDT ShowControl(theControl); æMM æRT 197 æRI I-322, P-113, 114, 181 æC ShowControl makes theControl visible. The control is drawn in its window but may be completely or partially obscured by overlapping windows or other objects. If the control is already visible, ShowControl has no effect. æKY DrawControls æFp Controls.p æT PROCEDURE æTN A969 æD PROCEDURE DrawControls(theWindow: WindowPtr); INLINE $A969; æDT DrawControls(theWindow); æRT 203 æRI I-322, P-169 æC DrawControls draws all controls currently visible in theWindow. The controls are drawn in reverse order of creation; thus in case of overlap the earliest-created controls appear frontmost in the window. Note: Window Manager routines such as SelectWindow, ShowWindow, and BringToFront do not automatically call DrawControls to display the window’s controls. They just add the appropriate regions to the window’s update region, generating an update event. Your program should always call DrawControls explicitly upon receiving an update event for a window that contains controls. æKY Draw1Control æFp Controls.p æT PROCEDURE æTN A96D æD PROCEDURE Draw1Control(theControl: ControlHandle); INLINE $A96D; æDT Draw1Control(theControl); æMM æRI IV-53 æC [128K ROM] Draw1Control draws the specified control if it’s visible within the window. æKY HiliteControl æFp Controls.p æT PROCEDURE æTN A95D æD PROCEDURE HiliteControl(theControl: ControlHandle;hiliteState: INTEGER); INLINE $A95D; æDT HiliteControl(theControl,hiliteState); æMM æRI I-322 æC HiliteControl changes the way theControl is highlighted. HiliteState has one of the following values: • The value 0 means no highlighting. (The control is active.) • A value between 1 and 253 is interpreted as a part code designating the part of the (active) control to be highlighted. • The value 255 means that the control is to be made inactive and highlighted accordingly. Note: The value 254 should not be used; this value is reserved for future use. HiliteControl calls the control definition function to redraw the control with its new highlighting. æKY UpdtControl æFp Controls.p æT PROCEDURE æTN A953 æD PROCEDURE UpdtControl(theWindow: WindowPtr;updateRgn: RgnHandle); INLINE $A953; æDT UpdtControl(theWindow,updateRgn); æMM æRI IV-53 æC [128K ROM] UpdtControl is a faster version of the DrawControls procedure. Instead of drawing all of the controls in theWindow, UpdtControl draws only the controls that are in the specified update region. UpdtControl is called in response to an update event, and is usually bracketed by calls to the Window Manager procedures BeginUpdate and EndUpdate. UpdateRgn should be set to the visRgn of theWindow’s port (for more details, see the BeginUpdate procedure in the Window Manager chapter). Note: In general, controls are in a dialog box and are automatically drawn by the DrawDialog procedure. æKY UpdateControls æFp Controls.p æT PROCEDURE æTN A953 æD PROCEDURE UpdateControls(theWindow: WindowPtr;updateRgn: RgnHandle); INLINE $A953; æDT UpdateControls(theWindow,updateRgn); æMM æRI IV-53 æC [128K ROM] UpdtControl is a faster version of the DrawControls procedure. Instead of drawing all of the controls in theWindow, UpdtControl draws only the controls that are in the specified update region. UpdtControl is called in response to an update event, and is usually bracketed by calls to the Window Manager procedures BeginUpdate and EndUpdate. UpdateRgn should be set to the visRgn of theWindow’s port (for more details, see the BeginUpdate procedure in the Window Manager chapter). Note: In general, controls are in a dialog box and are automatically drawn by the DrawDialog procedure. æKY MoveControl æFp Controls.p æT PROCEDURE æTN A959 æD PROCEDURE MoveControl(theControl: ControlHandle;h: INTEGER;v: INTEGER); INLINE $A959; æDT MoveControl(theControl,h,v); æMM æRI I-325, P-113, 176 æC MoveControl moves theControl to a new location within its window. The top left corner of the control’s enclosing rectangle is moved to the horizontal and vertical coordinates h and v (given in the local coordinates of the control’s window); the bottom right corner is adjusted accordingly, to keep the size of the rectangle the same as before. If the control is currently visible, it’s hidden and then redrawn at its new location. æKY SizeControl æFp Controls.p æT PROCEDURE æTN A95C æD PROCEDURE SizeControl(theControl: ControlHandle;w: INTEGER;h: INTEGER); INLINE $A95C; æDT SizeControl(theControl,w,h); æMM æRI I-326, P-113, 181 æC SizeControl changes the size of theControl’s enclosing rectangle. The bottom right corner of the rectangle is adjusted to set the rectangle’s width and height to the number of pixels specified by w and h; the position of the top left corner is not changed. If the control is currently visible, it’s hidden and then redrawn in its new size. æKY SetCtlValue æFp Controls.p æT PROCEDURE æTN A963 æD PROCEDURE SetCtlValue(theControl: ControlHandle;theValue: INTEGER); INLINE $A963; æDT SetCtlValue(theControl,theValue); æMM æRT 197 æRI I-326 æC SetCtlValue sets theControl’s current setting to theValue and redraws the control to reflect the new setting. For check boxes and radio buttons, the value 1 fills the control with the appropriate mark, and 0 clears it. For scroll bars, SetCtlValue redraws the thumb where appropriate. If the specified value is out of range, it’s forced to the nearest endpoint of the current range (that is, if theValue is less than the minimum setting, SetCtlValue sets the current setting to the minimum; if theValue is greater than the maximum setting, it sets the current setting to the maximum). æKY GetCtlValue æFp Controls.p æT FUNCTION æTN A960 æD FUNCTION GetCtlValue(theControl: ControlHandle): INTEGER; INLINE $A960; æDT myVariable := GetCtlValue(theControl); æRI I-326, P-114, 171 æC GetCtlValue returns theControl’s current setting. æKY SetCtlMin æFp Controls.p æT PROCEDURE æTN A964 æD PROCEDURE SetCtlMin(theControl: ControlHandle;minValue: INTEGER); INLINE $A964; æDT SetCtlMin(theControl,minValue); æMM æRI I-326 æC Assembly-language note: The macro you invoke to call SetCtlMin from assembly language is named _SetMinCtl. SetCtlMin sets theControl’s minimum setting to minValue and redraws the control to reflect the new range. If the control’s current setting is less than minValue, the setting is changed to the new minimum. æKY GetCtlMin æFp Controls.p æT FUNCTION æTN A961 æD FUNCTION GetCtlMin(theControl: ControlHandle): INTEGER; INLINE $A961; æDT myVariable := GetCtlMin(theControl); æRI I-327 æC Assembly-language note: The macro you invoke to call GetCtlMin from assembly language is named _GetMinCtl. GetCtlMin returns theControl’s minimum setting. æKY SetCtlMax æFp Controls.p æT PROCEDURE æTN A965 æD PROCEDURE SetCtlMax(theControl: ControlHandle;maxValue: INTEGER); INLINE $A965; æDT SetCtlMax(theControl,maxValue); æMM æRI I-327 æC Assembly-language note: The macro you invoke to call SetCtlMax from assembly language is named _SetMaxCtl. SetCtlMax sets theControl’s maximum setting to maxValue and redraws the control to reflect the new range. If the control’s current setting is greater than maxValue, the setting is changed to the new maximum. Note: If you set the maximum setting of a scroll bar equal to its minimum setting, the control definition function will make the scroll bar inactive. æKY GetCtlMax æFp Controls.p æT FUNCTION æTN A962 æD FUNCTION GetCtlMax(theControl: ControlHandle): INTEGER; INLINE $A962; æDT myVariable := GetCtlMax(theControl); æRI I-327 æC Assembly-language note: The macro you invoke to call GetCtlMax from assembly language is named _GetMaxCtl. GetCtlMax returns theControl’s maximum setting. æKY SetCRefCon æFp Controls.p æT PROCEDURE æTN A95B æD PROCEDURE SetCRefCon(theControl: ControlHandle;data: LONGINT); INLINE $A95B; æDT SetCRefCon(theControl,data); æRI I-327 æC SetCRefCon sets theControl’s reference value to the given data. æKY GetCRefCon æFp Controls.p æT FUNCTION æTN A95A æD FUNCTION GetCRefCon(theControl: ControlHandle): LONGINT; INLINE $A95A; æDT myVariable := GetCRefCon(theControl); æRI I-327 æC GetCRefCon returns theControl’s current reference value. æKY SetCtlAction æFp Controls.p æT PROCEDURE æTN A96B æD PROCEDURE SetCtlAction(theControl: ControlHandle;actionProc: ProcPtr); INLINE $A96B; æDT SetCtlAction(theControl,actionProc); æRI I-328 æC SetCtlAction sets theControl’s default action procedure to actionProc. æKY GetCtlAction æFp Controls.p æT FUNCTION æTN A96A æD FUNCTION GetCtlAction(theControl: ControlHandle): ProcPtr; INLINE $A96A; æDT myVariable := GetCtlAction(theControl); æRI I-328, IV-53 æC GetCtlAction returns a pointer to theControl’s default action procedure, if any. (It returns whatever is in that field of the control record.) æKY DragControl æFp Controls.p æT PROCEDURE æTN A967 æD PROCEDURE DragControl(theControl: ControlHandle;startPt: Point;limitRect: Rect; slopRect: Rect;axis: INTEGER); INLINE $A967; æDT DragControl(theControl,startPt,limitRect,slopRect,axis); æMM æRI I-325 æC Called with the mouse button down inside theControl, DragControl pulls a dotted outline of the control around the screen, following the movements of the mouse until the button is released. When the mouse button is released, DragControl calls MoveControl to move the control to the location to which it was dragged. Note: Before beginning to follow the mouse, DragControl calls the control definition function to allow it to do its own “custom dragging” if it chooses. If the definition function doesn’t choose to do any custom dragging, DragControl uses the default method of dragging described here. The startPt, limitRect, slopRect, and axis parameters have the same meaning as for the Window Manager function DragGrayRgn. These parameters are reviewed briefly below; see the description of DragGrayRgn in the Window Manager chapter for more details. • StartPt is assumed to be the point where the mouse button was originally pressed, in the local coordinates of the control’s window. • LimitRect limits the travel of the control’s outline, and should normally coincide with or be contained within the window’s content region. • SlopRect allows the user some “slop” in moving the mouse; it should completely enclose limitRect. • The axis parameter allows you to constrain the control’s motion to only one axis. It has one of the following values: CONST noConstraint = 0; {no constraint} hAxisOnly = 1; {horizontal axis only} vAxisOnly = 2; {vertical axis only} Assembly-language note: Like TrackControl, DragControl invokes the macro _DragTheRgn, so you can use the global variables DragHook and DragPattern. æKY TestControl æFp Controls.p æT FUNCTION æTN A966 æD FUNCTION TestControl(theControl: ControlHandle;thePt: Point): INTEGER; INLINE $A966; æDT myVariable := TestControl(theControl,thePt); æMM æRI I-325 æC If theControl is visible and active, TestControl tests which part of the control contains thePoint (in the local coordinates of the control’s window); it returns the corresponding part code, or 0 if the point is outside the control. If the control is invisible or inactive, TestControl returns 0. TestControl is called by FindControl and TrackControl; normally you won’t need to call it yourself. æKY TrackControl æFp Controls.p æT FUNCTION æTN A968 æD FUNCTION TrackControl(theControl: ControlHandle;thePoint: Point;actionProc: ProcPtr): INTEGER; INLINE $A968; æDT myVariable := TrackControl(theControl,thePoint,actionProc); æMM æRI I-323, P-114, 184 æC When the mouse button is pressed in a visible, active control, the application should call TrackControl with theControl equal to the control handle and startPt equal to the point where the mouse button was pressed (in the local coordinates of the control’s window). TrackControl follows the movements of the mouse and responds in whatever way is appropriate until the mouse button is released; the exact response depends on the type of control and the part of the control in which the mouse button was pressed. If highlighting is appropriate, TrackControl does the highlighting, and undoes it before returning. When the mouse button is released, TrackControl returns with the part code if the mouse is in the same part of the control that it was originally in, or with 0 if not (in which case the application should do nothing). If the mouse button was pressed in an indicator, TrackControl drags a dotted outline of it to follow the mouse. When the mouse button is released, TrackControl calls the control definition function to reposition the control’s indicator. The control definition function for scroll bars responds by redrawing the thumb, calculating the control’s current setting based on the new relative position of the thumb, and storing the current setting in the control record; for example, if the minimum and maximum settings are 0 and 10, and the thumb is in the middle of the scroll bar, 5 is stored as the current setting. The application must then scroll to the corresponding relative position in the document. TrackControl may take additional actions beyond highlighting the control or dragging the indicator, depending on the value passed in the actionProc parameter, as described below. The following tells you what to pass for the standard control types; for a custom control, what you pass will depend on how the control is defined. • If actionProc is NIL, TrackControl performs no additional actions. This is appropriate for simple buttons, check boxes, radio buttons, and the thumb of a scroll bar. • ActionProc may be a pointer to an action procedure that defines some action to be performed repeatedly for as long as the user holds down the mouse button. (See below for details.) • If actionProc is POINTER(–1), TrackControl looks in the control record for a pointer to the control’s default action procedure. If that field of the control record contains a procedure pointer, TrackControl uses the action procedure it points to; if the field contains POINTER (–1), TrackControl calls the control definition function to perform the necessary action. (If the field contains NIL, TrackControl does nothing.) The action procedure in the control definition function is described in the section “Defining Your Own Controls”. The following paragraphs describe only the action procedure whose pointer is passed in the actionProc parameter or stored in the control record. If the mouse button was pressed in an indicator, the action procedure (if any) should have no parameters. This procedure must allow for the fact that the mouse may not be inside the original control part. If the mouse button was pressed in a control part other than an indicator, the action procedure should be of the form PROCEDURE MyAction (theControl: ControlHandle; partCode: INTEGER); In this case, TrackControl passes the control handle and the part code to the action procedure. (It passes 0 in the partCode parameter if the mouse has moved outside the original control part.) As an example of this type of action procedure, consider what should happen when the mouse button is pressed in a scroll arrow or paging region in a scroll bar. For these cases, your action procedure should examine the part code to determine exactly where the mouse button was pressed, scroll up or down a line or page as appropriate, and call SetCtlValue to change the control’s setting and redraw the thumb. Warning: Since it has a different number of parameters depending on whether the mouse button was pressed in an indicator or elsewhere, the action procedure you pass to TrackControl (or whose pointer you store in the control record) can be set up for only one case or the other. If you store a pointer to a default action procedure in a control record, be sure it will be used only when appropriate for that type of action procedure. The only way to specify actions in response to all mouse-down events in a control, regardless of whether they’re in an indicator, is via the control definition function. Assembly-language note: If you store a pointer to a procedure in the global variable DragHook, that procedure will be called repeatedly (with no parameters) for as long as the user holds down the mouse button. TrackControl invokes the Window Manager macro _DragTheRgn, which calls the DragHook procedure. _DragTheRgn uses the pattern stored in the global variable DragPattern for the dragged outline of the indicator. æKY FindControl æFp Controls.p æT FUNCTION æTN A96C æD FUNCTION FindControl(thePoint: Point;theWindow: WindowPtr;VAR theControl: ControlHandle): INTEGER; INLINE $A96C; æDT myVariable := FindControl(thePoint,theWindow,theControl); æMM æRI I-323, P-98, 114, 170 æC When the Window Manager function FindWindow reports that the mouse button was pressed in the content region of a window, and the window contains controls, the application should call FindControl with theWindow equal to the window pointer and thePoint equal to the point where the mouse button was pressed (in the window’s local coordinates). FindControl tells which of the window’s controls, if any, the mouse button was pressed in: • If it was pressed in a visible, active control, FindControl sets the whichControl parameter to the control handle and returns a part code identifying the part of the control that it was pressed in. • If it was pressed in an invisible or inactive control, or not in any control, FindControl sets whichControl to NIL and returns 0 as its result. Warning: Notice that FindControl expects the mouse point in the window’s local coordinates, whereas FindWindow expects it in global coordinates. Always be sure to convert the point to local coordinates with the QuickDraw procedure GlobalToLocal before calling FindControl. Note: FindControl also returns NIL for whichControl and 0 as its result if the window is invisible or doesn’t contain the given point. In these cases, however, FindWindow wouldn’t have returned this window in the first place, so the situation should never arise. æKY SetCtlColor æFp Controls.p æT PROCEDURE æTN AA43 æD PROCEDURE SetCtlColor(theControl: ControlHandle;newColorTable: CCTabHandle); INLINE $AA43; æDT SetCtlColor(theControl,newColorTable); æMM æRI V-222 æC [Macintosh II] The SetCtlColor procedure sets or modifies a control’s color table. If the control currently has no auxiliary control record, a new one is created with the given color table and added to the head of the auxiliary control list. If there is already an auxiliary record for the control, its color table is replaced by the contents of newColorTable. If newColorTable has the same contents as the default color table, the control’s existing auxiliary record and color table are removed from the auxiliary control list and deallocated. If theControl = NIL, the operation modifies the default color table itself. If the control is visible, it will be redrawn by SetCtlColor using the new color table. æKY GetAuxCtl æFp Controls.p æT FUNCTION æTN AA44 æD FUNCTION GetAuxCtl(theControl: ControlHandle;VAR acHndl: AuxCtlHandle): BOOLEAN; INLINE $AA44; æDT myVariable := GetAuxCtl(theControl,acHndl); æMM æRI V-222 æC [Macintosh II] The GetAuxCtl function returns a handle to a control’s AuxCtlRec: • If the given control has its own color table, the function returns TRUE. • If the control used the default color set, the function returns FALSE. • If the control asked to receive the default color set (theControl = NIL), then the function returns TRUE. æKY GetCVariant æFp Controls.p æT FUNCTION æTN A809 æD FUNCTION GetCVariant(theControl: ControlHandle): INTEGER; INLINE $A809; æDT myVariable := GetCVariant(theControl); æRI V-222 æC [Macintosh Plus, Macintosh SE, and Macintosh II] The GetVariant function returns the variant control value for the control described by theControl. This value was formerly stored in the high four bits of the control defproc handle; for future compatibility, use the GetCVariant routine to access this value. æKY CRMSerialDevices.p æKL CRMIconHandle CRMIconPtr CRMIconRecord crmSerialDevice CRMSerialPtr CRMSerialRecord curCRMSerRecVers æKY crmSerialDevice æFp CRMSerialDevices.p æT CONST æD crmSerialDevice = 1; æC æKY curCRMSerRecVers æFp CRMSerialDevices.p æT CONST æD curCRMSerRecVers = 1; æC æKY CRMIconRecord CRMIconPtr CRMIconHandle æFp CRMSerialDevices.p æT RECORD æD CRMIconPtr = ^CRMIconRecord; CRMIconHandle = ^CRMIconPtr; CRMIconRecord = RECORD oldIcon: ARRAY [0..31] OF LONGINT; { ICN# } oldMask: ARRAY [0..31] OF LONGINT; theSuite: Handle; { Handle to an IconSuite } reserved: LONGINT; END; æC æKY CRMSerialRecord CRMSerialPtr æFp CRMSerialDevices.p æT RECORD æD CRMSerialPtr = ^CRMSerialRecord; CRMSerialRecord = RECORD version: INTEGER; inputDriverName: StringHandle; outputDriverName: StringHandle; name: StringHandle; deviceIcon: CRMIconHandle; ratedSpeed: LONGINT; maxSpeed: LONGINT; reserved: LONGINT; END; æC æKY CTBUtilities.p æKL AppendDITL CountDITL CTBGetCTBVersion CustomNBP InitCTBUtilities NuLookup NuPLookup ShortenDITL StandardNBP appendDITLBottom appendDITLRight chooseAborted chooseCancel chooseDisaster chooseFailed chooseOKMajor chooseOKMinor CTBUErr ctbuGenericError ctbuNoErr curCTBUVersion DITLMethod hookCancel hookEject hookItemList hookItemRefresh hookKeyBase hookLine hookNull hookOK hookOutline hookPostflight hookPreflight hookReserved1 hookReserved2 hookReserved3 hookReserved4 hookTitle hookVersion hookZoneList hookZoneRefresh hookZoneTitle nameDisable NameFilterProcPtr nameInclude nameReject NBPReply nlCancel nlEject nlOk NLType NLTypeEntry overlayDITL zoneDisable ZoneFilterProcPtr zoneInclude zoneReject æKY curCTBUVersion æFp CTBUtilities.p æT CONST æD curCTBUVersion = 2; æC æKY ctbuGenericError æFp CTBUtilities.p æT CONST æD ctbuGenericError = -1; æC æKY ctbuNoErr æFp CTBUtilities.p æT CONST æD ctbuNoErr = 0; æC æKY overlayDITL æFp CTBUtilities.p æT CONST æD overlayDITL = 0; æC æKY appendDITLRight æFp CTBUtilities.p æT CONST æD appendDITLRight = 1; æC æKY appendDITLBottom æFp CTBUtilities.p æT CONST æD appendDITLBottom = 2; æC æKY chooseDisaster æFp CTBUtilities.p æT CONST æD chooseDisaster = -2; æC æKY chooseFailed æFp CTBUtilities.p æT CONST æD chooseFailed = -1; æC æKY chooseAborted æFp CTBUtilities.p æT CONST æD chooseAborted = 0; æC æKY chooseOKMinor æFp CTBUtilities.p æT CONST æD chooseOKMinor = 1; æC æKY chooseOKMajor æFp CTBUtilities.p æT CONST æD chooseOKMajor = 2; æC æKY chooseCancel æFp CTBUtilities.p æT CONST æD chooseCancel = 3; æC æKY nlOk æFp CTBUtilities.p æT CONST æD nlOk = 0; æC æKY nlCancel æFp CTBUtilities.p æT CONST æD nlCancel = 1; æC æKY nlEject æFp CTBUtilities.p æT CONST æD nlEject = 2; æC æKY nameInclude æFp CTBUtilities.p æT CONST æD nameInclude = 1; æC æKY nameDisable æFp CTBUtilities.p æT CONST æD nameDisable = 2; æC æKY nameReject æFp CTBUtilities.p æT CONST æD nameReject = 3; æC æKY zoneInclude æFp CTBUtilities.p æT CONST æD zoneInclude = 1; æC æKY zoneDisable æFp CTBUtilities.p æT CONST æD zoneDisable = 2; æC æKY zoneReject æFp CTBUtilities.p æT CONST æD zoneReject = 3; æC æKY hookOK æFp CTBUtilities.p æT CONST æD hookOK = 1; æC æKY hookCancel æFp CTBUtilities.p æT CONST æD hookCancel = 2; æC æKY hookOutline æFp CTBUtilities.p æT CONST æD hookOutline = 3; æC æKY hookTitle æFp CTBUtilities.p æT CONST æD hookTitle = 4; æC æKY hookItemList æFp CTBUtilities.p æT CONST æD hookItemList = 5; æC æKY hookZoneTitle æFp CTBUtilities.p æT CONST æD hookZoneTitle = 6; æC æKY hookZoneList æFp CTBUtilities.p æT CONST æD hookZoneList = 7; æC æKY hookLine æFp CTBUtilities.p æT CONST æD hookLine = 8; æC æKY hookVersion æFp CTBUtilities.p æT CONST æD hookVersion = 9; æC æKY hookReserved1 æFp CTBUtilities.p æT CONST æD hookReserved1 = 10; æC æKY hookReserved2 æFp CTBUtilities.p æT CONST æD hookReserved2 = 11; æC æKY hookReserved3 æFp CTBUtilities.p æT CONST æD hookReserved3 = 12; æC æKY hookReserved4 æFp CTBUtilities.p æT CONST æD hookReserved4 = 13; æC æKY hookNull æFp CTBUtilities.p æT CONST æD hookNull = 100; æC æKY hookItemRefresh æFp CTBUtilities.p æT CONST æD hookItemRefresh = 101; æC æKY hookZoneRefresh æFp CTBUtilities.p æT CONST æD hookZoneRefresh = 102; æC æKY hookEject æFp CTBUtilities.p æT CONST æD hookEject = 103; æC æKY hookPreflight æFp CTBUtilities.p æT CONST æD hookPreflight = 104; æC æKY hookPostflight æFp CTBUtilities.p æT CONST æD hookPostflight = 105; æC æKY hookKeyBase æFp CTBUtilities.p æT CONST æD hookKeyBase = 1000; æC æKY CTBUErr æFp CTBUtilities.p æT TYPE æD CTBUErr = OSErr; æC æKY DITLMethod æFp CTBUtilities.p æT TYPE æD DITLMethod = INTEGER; æC æKY NLTypeEntry æFp CTBUtilities.p æT RECORD æD NLTypeEntry = RECORD hIcon: Handle; typeStr: Str32; END; æC æKY NLType æFp CTBUtilities.p æT TYPE æD NLType = ARRAY [0..3] OF NLTypeEntry; æC æKY NBPReply æFp CTBUtilities.p æT RECORD æD NBPReply = RECORD theEntity: EntityName; theAddr: AddrBlock; END; æC æKY NameFilterProcPtr æFp CTBUtilities.p æT TYPE æD NameFilterProcPtr = ProcPtr; æC æKY ZoneFilterProcPtr æFp CTBUtilities.p æT TYPE æD ZoneFilterProcPtr = ProcPtr; æC æKY InitCTBUtilities æFp CTBUtilities.p æT FUNCTION æD FUNCTION InitCTBUtilities: CTBUErr; æDT myVariable := InitCTBUtilities; æC æKY CTBGetCTBVersion æFp CTBUtilities.p æT FUNCTION æD FUNCTION CTBGetCTBVersion: INTEGER; æDT myVariable := CTBGetCTBVersion; æC æKY AppendDITL æFp CTBUtilities.p æT PROCEDURE æD PROCEDURE AppendDITL(theDialog: DialogPtr;theHandle: Handle;method: DITLMethod); æDT AppendDITL(theDialog,theDITL,method); æC æKY CountDITL æFp CTBUtilities.p æT FUNCTION æD FUNCTION CountDITL(theDialog: DialogPtr): INTEGER; æDT myVariable := CountDITL(theDialog); æC æKY ShortenDITL æFp CTBUtilities.p æT PROCEDURE æD PROCEDURE ShortenDITL(theDialog: DialogPtr;numberItems: INTEGER); æDT ShortenDITL(theDialog,numberItems); æC æKY NuLookup æFp CTBUtilities.p æT FUNCTION æD FUNCTION NuLookup(where: Point;prompt: Str255;numTypes: INTEGER;typeList: NLType; nameFilter: NameFilterProcPtr;zoneFilter: ZoneFilterProcPtr;hookProc: DlgHookProcPtr; VAR theReply: NBPReply): INTEGER; æDT myVariable := NuLookup(where,prompt,numTypes,typeList,nameFilter,zoneFilter,hookProc,theReply); æC æKY NuPLookup æFp CTBUtilities.p æT FUNCTION æD FUNCTION NuPLookup(where: Point;prompt: Str255;numTypes: INTEGER;typeList: NLType; nameFilter: NameFilterProcPtr;zoneFilter: ZoneFilterProcPtr;hookProc: DlgHookProcPtr; userData: LONGINT;dialogID: INTEGER;filterProc: ModalFilterProcPtr;VAR theReply: NBPReply): INTEGER; æDT myVariable := NuPLookup(where,prompt,numTypes,typeList,nameFilter,zoneFilter,hookProc,userData,dialogID,filterProc,theReply); æC æKY StandardNBP æFp CTBUtilities.p æT FUNCTION æD FUNCTION StandardNBP(where: Point;prompt: Str255;numTypes: INTEGER;typeList: NLType; nameFilter: NameFilterProcPtr;zoneFilter: ZoneFilterProcPtr;hookProc: DlgHookProcPtr; VAR theReply: NBPReply): INTEGER; æDT myVariable := StandardNBP(where,prompt,numTypes,typeList,nameFilter,zoneFilter,hookProc,theReply); æC æKY CustomNBP æFp CTBUtilities.p æT FUNCTION æD FUNCTION CustomNBP(where: Point;prompt: Str255;numTypes: INTEGER;typeList: NLType; nameFilter: NameFilterProcPtr;zoneFilter: ZoneFilterProcPtr;hookProc: DlgHookProcPtr; userData: LONGINT;dialogID: INTEGER;filterProc: ModalFilterProcPtr;VAR theReply: NBPReply): INTEGER; æDT myVariable := CustomNBP(where,prompt,numTypes,typeList,nameFilter,zoneFilter,hookProc,userData,dialogID,filterProc,theReply); æC æKY CursorCtl.p æKL Hide_Cursor InitCursorCtl RotateCursor Show_Cursor SpinCursor Acur acurHandle acurPtr ARROW_CURSOR CROSS_CURSOR Cursors HIDDEN_CURSOR I_BEAM_CURSOR PLUS_CURSOR WATCH_CURSOR æKY Acur acurPtr acurHandle æFp CursorCtl.p æT TYPE æD acurPtr = ^Acur; acurHandle = ^acurPtr; Acur = RECORD n: INTEGER; {Number of cursors ("frames of film")} index: INTEGER; { Next frame to show <for internal use>} frame1: INTEGER; {'CURS' resource id for frame #1} fill1: INTEGER; {<for internal use>} frame2: INTEGER; {'CURS' resource id for frame #2} fill2: INTEGER; {<for internal use>} frameN: INTEGER; {'CURS' resource id for frame #N} fillN: INTEGER; {<for internal use>} END; æKY Cursors HIDDEN_CURSOR I_BEAM_CURSOR CROSS_CURSOR PLUS_CURSOR WATCH_CURSOR ARROW_CURSOR æFp CursorCtl.p æD Cursors = (HIDDEN_CURSOR,I_BEAM_CURSOR,CROSS_CURSOR,PLUS_CURSOR,WATCH_CURSOR, ARROW_CURSOR); æKY Hide_Cursor æFp CursorCtl.p æT PROCEDURE æD PROCEDURE Hide_Cursor; æDT Hide_Cursor; æC { Hide the cursor if it is showing.This is this unit's call to the Mac HideCursor routine.Thus the Mac cursor level is decremented by one when this routine is called. } æKY InitCursorCtl æFp CursorCtl.p æT PROCEDURE æD PROCEDURE InitCursorCtl(newCursors: UNIV acurHandle); æDT InitCursorCtl(newCursors); æC { Initialize the CursorCtl unit. This should be called once prior to calling RotateCursor or SpinCursor. It need not be called if only Hide_Cursor or Show_Cursor are used. If NewCursors is NULL, InitCursorCtl loads in the 'acur' resource and the 'CURS' resources specified by the 'acur' resource ids. If any of the resources cannot be loaded, the cursor will not be changed. The 'acur' resource is assumed to either be in the currently running tool or application, or the MPW Shell for a tool, or in the System file. The 'acur' resource id must be 0 for a tool or application, 1 for the Shell, and 2 for the System file. If NewCursors is not NULL, it is ASSUMED to be a handle to an 'acur' formatted resource designated by the caller and it will be used instead of doing a GetResource on 'acur'. Note, if RotateCursor or SpinCursor are called without calling InitCursorCtl, then RotateCursor and SpinCursor will do the call for the user the first time it is called. However, the possible disadvantage of using this technique is that the resource memory allocated may have undesirable affect (fragmentation?) on the application. Using InitCursorCtl has the advantage of causing the allocation at a specific time determined by the user. Caution: InitCursorCtl MODIFIES the 'acur' resource in memory. Specifically, it changes each FrameN/fillN integer pair to a handle to the corresponding 'CURS' resource also in memory. Thus if NewCursors is not NULL when InitCursorCtl is called, the caller must guarantee NewCursors always points to a "fresh" copy of an 'acur' resource. This need only be of concern to a caller who wants to repeatly use multiple 'acur' resources during execution of their programs. } æKY RotateCursor æFp CursorCtl.p æT PROCEDURE æD PROCEDURE RotateCursor(counter: LONGINT); æDT RotateCursor(counter); æC { RotateCursor is called to rotate the "I am active" "beach ball" cursor, or to animate whatever sequence of cursors set up by InitCursorCtl. The next cursor ("frame") is used when Counter % 32 = 0 (Counter is some kind of incrementing or decrementing index maintained by the caller). A positive counter sequences forward through the cursors (e.g., it rotates the "beach ball" cursor clockwise), and a negative cursor sequences through the cursors backwards (e.g., it rotates the "beach ball" cursor counterclockwise). Note, RotateCursor just does a Mac SetCursor call for the proper cursor picture. It is assumed the cursor is visible from a prior Show_Cursor call. } æKY Show_Cursor æFp CursorCtl.p æT PROCEDURE æD PROCEDURE Show_Cursor(cursorKind: Cursors); æDT Show_Cursor(cursorKind); æC { Increment the cursor level, which may have been decremented by Hide_Cursor, and display the specified cursor if the level becomes 0 (it is never incremented beyond 0).The CursorKind is the kind of cursor to show. It is one of the values HIDDEN_CURSOR, I_BEAM_CURSOR, CROSS_CURSOR, PLUS_CURSOR, WATCH_CURSOR, and ARROW_CURSOR. Except for HIDDEN_CURSOR, a Mac SetCursor is done for the specified cursor prior to doing a ShowCursor. HIDDEN_CURSOR just causes a ShowCursor call. Note, ARROW_CURSOR will only work correctly if there is already a grafPort set up pointed to by 0(A5). } æKY SpinCursor æFp CursorCtl.p æT PROCEDURE æD PROCEDURE SpinCursor(increment: INTEGER); æDT SpinCursor(increment); æC { SpinCursor is similar in function to RotateCursor, except that instead of passing a counter, an Increment is passed an added to a counter maintained here. SpinCursor is provided for those users who do not happen to have a convenient counter handy but still want to use the spinning "beach ball" cursor, or any sequence of cursors set up by InitCursorCtl. A positive increment sequences forward through the curos (rotating the "beach ball" cursor clockwise), and a negative increment sequences backward through the cursors (rotating the "beach ball" cursor counter-clockwise). A zero value for the increment resets the counter to zero. Note, it is the increment, and not the value of the counter that determines the sequencing direction of the cursor (and hence the spin direction of the "beach ball" cursor). } æKY DatabaseAccess.p æKL DBBreak DBDisposeQuery DBEnd DBExec DBGetConnInfo DBGetErr DBGetItem DBGetNewQuery DBGetQueryResults DBGetResultHandler DBGetSessionNum DBInit DBInstallResultHandler DBKill DBRemoveResultHandler DBResultsToText DBSend DBSendItem DBStartQuery DBState DBUnGetItem InitDBPack ColInfoArray ColInfoHandle ColInfoPtr ColTypesArray ColTypesHandle ColTypesPtr DBAsyncParamBlockRec DBAsyncParmBlkPtr DBColInfoRecord DBType kDBAboutToInit kDBExecComplete kDBGetItemComplete kDBGetQueryResultsComplete kDBInitComplete kDBLastColFlag kDBNullFlag kDBSendComplete kDBStartQueryComplete kDBUpdateWind kDBWaitForever QueryArray QueryHandle QueryListHandle QueryListPtr QueryPtr QueryRecord rcDBAsyncNotSupp rcDBBadAsyncPB rcDBBadDDEV rcDBBadSessID rcDBBadSessNum rcDBBadType rcDBBreak rcDBError rcDBExec rcDBNoHandler rcDBNull rcDBPackNotInited rcDBValue rcDBWrongVersion ResListArray ResListElem ResListHandle ResListPtr ResultsRecord typeAnyType typeColBreak typeDate typeDecimal typeDiscard typeLBin typeLChar typeMoney typeNone typeRowBreak typeTime typeTimeStamp typeUnknown typeVBin typeVChar æKY rcDBNull æFp DatabaseAccess.p æT CONST æD rcDBNull = -800; æC æKY rcDBValue æFp DatabaseAccess.p æT CONST æD rcDBValue = -801; æC æKY rcDBError æFp DatabaseAccess.p æT CONST æD rcDBError = -802; æC æKY rcDBBadType æFp DatabaseAccess.p æT CONST æD rcDBBadType = -803; æC æKY rcDBBreak æFp DatabaseAccess.p æT CONST æD rcDBBreak = -804; æC æKY rcDBExec æFp DatabaseAccess.p æT CONST æD rcDBExec = -805; æC æKY rcDBBadSessID æFp DatabaseAccess.p æT CONST æD rcDBBadSessID = -806; æC æKY rcDBBadSessNum æFp DatabaseAccess.p æT CONST æD rcDBBadSessNum = -807; { bad session number for DBGetConnInfo } æC æKY rcDBBadDDEV æFp DatabaseAccess.p æT CONST æD rcDBBadDDEV = -808; { bad ddev specified on DBInit } æC æKY rcDBAsyncNotSupp æFp DatabaseAccess.p æT CONST æD rcDBAsyncNotSupp = -809; { ddev does not support async calls } æC æKY rcDBBadAsyncPB æFp DatabaseAccess.p æT CONST æD rcDBBadAsyncPB = -810; { tried to kill a bad pb } æC æKY rcDBNoHandler æFp DatabaseAccess.p æT CONST æD rcDBNoHandler = -811; { no app handler for specified data type } æC æKY rcDBWrongVersion æFp DatabaseAccess.p æT CONST æD rcDBWrongVersion = -812; { incompatible versions } æC æKY rcDBPackNotInited æFp DatabaseAccess.p æT CONST æD rcDBPackNotInited = -813; { attempt to call other routine before InitDBPack } æC æKY kDBUpdateWind æFp DatabaseAccess.p æT CONST æD kDBUpdateWind = 0; æC æKY kDBAboutToInit æFp DatabaseAccess.p æT CONST æD kDBAboutToInit = 1; æC æKY kDBInitComplete æFp DatabaseAccess.p æT CONST æD kDBInitComplete = 2; æC æKY kDBSendComplete æFp DatabaseAccess.p æT CONST æD kDBSendComplete = 3; æC æKY kDBExecComplete æFp DatabaseAccess.p æT CONST æD kDBExecComplete = 4; æC æKY kDBStartQueryComplete æFp DatabaseAccess.p æT CONST æD kDBStartQueryComplete = 5; æC æKY kDBGetItemComplete æFp DatabaseAccess.p æT CONST æD kDBGetItemComplete = 6; æC æKY kDBGetQueryResultsComplete æFp DatabaseAccess.p æT CONST æD kDBGetQueryResultsComplete = 7; æC æKY typeNone æFp DatabaseAccess.p æT CONST æD typeNone = 'none'; æC æKY typeDate æFp DatabaseAccess.p æT CONST æD typeDate = 'date'; æC æKY typeTime æFp DatabaseAccess.p æT CONST æD typeTime = 'time'; æC æKY typeTimeStamp æFp DatabaseAccess.p æT CONST æD typeTimeStamp = 'tims'; æC æKY typeDecimal æFp DatabaseAccess.p æT CONST æD typeDecimal = 'deci'; æC æKY typeMoney æFp DatabaseAccess.p æT CONST æD typeMoney = 'mone'; æC æKY typeVChar æFp DatabaseAccess.p æT CONST æD typeVChar = 'vcha'; æC æKY typeVBin æFp DatabaseAccess.p æT CONST æD typeVBin = 'vbin'; æC æKY typeLChar æFp DatabaseAccess.p æT CONST æD typeLChar = 'lcha'; æC æKY typeLBin æFp DatabaseAccess.p æT CONST æD typeLBin = 'lbin'; æC æKY typeDiscard æFp DatabaseAccess.p æT CONST æD typeDiscard = 'disc'; æC æKY typeUnknown æFp DatabaseAccess.p æT CONST æD typeUnknown = 'unkn'; æC æKY typeColBreak æFp DatabaseAccess.p æT CONST æD typeColBreak = 'colb'; æC æKY typeRowBreak æFp DatabaseAccess.p æT CONST æD typeRowBreak = 'rowb'; æC æKY typeAnyType æFp DatabaseAccess.p æT CONST æD typeAnyType = 0; æC æKY kDBWaitForever æFp DatabaseAccess.p æT CONST æD kDBWaitForever = -1; æC æKY kDBLastColFlag æFp DatabaseAccess.p æT CONST æD kDBLastColFlag = $0001; æC æKY kDBNullFlag æFp DatabaseAccess.p æT CONST æD kDBNullFlag = $0004; æC æKY DBType æFp DatabaseAccess.p æT TYPE æD DBType = OSType; æC æKY DBAsyncParamBlockRec DBAsyncParmBlkPtr æFp DatabaseAccess.p æT RECORD æD DBAsyncParmBlkPtr = ^DBAsyncParamBlockRec; DBAsyncParamBlockRec = RECORD completionProc: ProcPtr; { pointer to completion routine } result: OSErr; { result of call } userRef: LONGINT; { for application's use } ddevRef: LONGINT; { for ddev's use } reserved: LONGINT; { for internal use } END; æC æKY ResListElem æFp DatabaseAccess.p æT RECORD æD ResListElem = RECORD theType: ResType; { resource type } id: INTEGER; { resource id } END; æC æKY ResListArray ResListPtr ResListHandle æFp DatabaseAccess.p æT RECORD æD ResListPtr = ^ResListArray; ResListHandle = ^ResListPtr; ResListArray = ARRAY [0..255] OF ResListElem; æC æKY QueryArray QueryListPtr QueryListHandle æFp DatabaseAccess.p æT RECORD æD QueryListPtr = ^QueryArray; QueryListHandle = ^QueryListPtr; QueryArray = ARRAY [0..255] OF Handle; æC æKY QueryRecord QueryPtr QueryHandle æFp DatabaseAccess.p æT RECORD æD QueryPtr = ^QueryRecord; QueryHandle = ^QueryPtr; QueryRecord = RECORD version: INTEGER; { version } id: INTEGER; { id of 'qrsc' this came from } queryProc: Handle; { handle to query def proc } ddevName: Str63; { ddev name } host: Str255; { host name } user: Str255; { user name } password: Str255; { password } connStr: Str255; { connection string } currQuery: INTEGER; { index of current query } numQueries: INTEGER; { number of queries in list } queryList: QueryListHandle; { handle to array of handles to text } numRes: INTEGER; { number of resources in list } resList: ResListHandle; { handle to array of resource list elements } dataHandle: Handle; { for use by query def proc } refCon: LONGINT; { for use by application } END; æC æKY ColTypesArray ColTypesPtr ColTypesHandle æFp DatabaseAccess.p æT RECORD æD ColTypesPtr = ^ColTypesArray; ColTypesHandle = ^ColTypesPtr; ColTypesArray = ARRAY [0..255] OF DBType; æC æKY DBColInfoRecord æFp DatabaseAccess.p æT RECORD æD DBColInfoRecord = RECORD len: INTEGER; places: INTEGER; flags: INTEGER; END; æC æKY ColInfoArray ColInfoPtr ColInfoHandle æFp DatabaseAccess.p æT RECORD æD ColInfoPtr = ^ColInfoArray; ColInfoHandle = ^ColInfoPtr; ColInfoArray = ARRAY [0..255] OF DBColInfoRecord; æC æKY ResultsRecord æFp DatabaseAccess.p æT RECORD æD ResultsRecord = RECORD numRows: INTEGER; { number of rows in result } numCols: INTEGER; { number of columns per row } colTypes: ColTypesHandle; { data type array } colData: Handle; { actual results } colInfo: ColInfoHandle; { DBColInfoRecord array } END; æC æKY InitDBPack æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION InitDBPack: OSErr; INLINE $3F3C,$0004,$303C,$0100,$A82F; æDT myVariable := InitDBPack; æC æKY DBInit æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBInit(VAR sessID: LONGINT;ddevName: Str63;host: Str255;user: Str255; passwd: Str255;connStr: Str255;asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$0E02,$A82F; æDT myVariable := DBInit(sessID,ddevName,host,user,passwd,connStr,asyncPB); æC æKY DBEnd æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBEnd(sessID: LONGINT;asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$0403,$A82F; æDT myVariable := DBEnd(sessID,asyncPB); æC æKY DBGetConnInfo æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBGetConnInfo(sessID: LONGINT;sessNum: INTEGER;VAR returnedID: LONGINT; VAR version: LONGINT;VAR ddevName: Str63;VAR host: Str255;VAR user: Str255; VAR network: Str255;VAR connStr: Str255;VAR start: LONGINT;VAR state: OSErr; asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$1704,$A82F; æDT myVariable := DBGetConnInfo(sessID,sessNum,returnedID,version,ddevName,host,user,network,connStr,start,state,asyncPB); æC æKY DBGetSessionNum æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBGetSessionNum(sessID: LONGINT;VAR sessNum: INTEGER;asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$0605,$A82F; æDT myVariable := DBGetSessionNum(sessID,sessNum,asyncPB); æC æKY DBSend æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBSend(sessID: LONGINT;text: Ptr;len: INTEGER;asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$0706,$A82F; æDT myVariable := DBSend(sessID,text,len,asyncPB); æC æKY DBSendItem æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBSendItem(sessID: LONGINT;dataType: DBType;len: INTEGER;places: INTEGER; flags: INTEGER;buffer: Ptr;asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$0B07,$A82F; æDT myVariable := DBSendItem(sessID,dataType,len,places,flags,buffer,asyncPB); æC æKY DBExec æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBExec(sessID: LONGINT;asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$0408,$A82F; æDT myVariable := DBExec(sessID,asyncPB); æC æKY DBState æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBState(sessID: LONGINT;asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$0409,$A82F; æDT myVariable := DBState(sessID,asyncPB); æC æKY DBGetErr æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBGetErr(sessID: LONGINT;VAR err1: LONGINT;VAR err2: LONGINT;VAR item1: Str255; VAR item2: Str255;VAR errorMsg: Str255;asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$0E0A,$A82F; æDT myVariable := DBGetErr(sessID,err1,err2,item1,item2,errorMsg,asyncPB); æC æKY DBBreak æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBBreak(sessID: LONGINT;abort: BOOLEAN;asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$050B,$A82F; æDT myVariable := DBBreak(sessID,abort,asyncPB); æC æKY DBGetItem æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBGetItem(sessID: LONGINT;timeout: LONGINT;VAR dataType: DBType; VAR len: INTEGER;VAR places: INTEGER;VAR flags: INTEGER;buffer: Ptr;asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$100C,$A82F; æDT myVariable := DBGetItem(sessID,timeout,dataType,len,places,flags,buffer,asyncPB); æC æKY DBUnGetItem æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBUnGetItem(sessID: LONGINT;asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$040D,$A82F; æDT myVariable := DBUnGetItem(sessID,asyncPB); æC æKY DBKill æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBKill(asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$020E,$A82F; æDT myVariable := DBKill(asyncPB); æC æKY DBGetNewQuery æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBGetNewQuery(queryID: INTEGER;VAR query: QueryHandle): OSErr; INLINE $303C,$030F,$A82F; æDT myVariable := DBGetNewQuery(queryID,query); æC æKY DBDisposeQuery æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBDisposeQuery(query: QueryHandle): OSErr; INLINE $303C,$0210,$A82F; æDT myVariable := DBDisposeQuery(query); æC æKY DBStartQuery æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBStartQuery(VAR sessID: LONGINT;query: QueryHandle;statusProc: ProcPtr; asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$0811,$A82F; æDT myVariable := DBStartQuery(sessID,query,statusProc,asyncPB); æC æKY DBGetQueryResults æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBGetQueryResults(sessID: LONGINT;VAR results: ResultsRecord;timeout: LONGINT; statusProc: ProcPtr;asyncPB: DBAsyncParmBlkPtr): OSErr; INLINE $303C,$0A12,$A82F; æDT myVariable := DBGetQueryResults(sessID,results,timeout,statusProc,asyncPB); æC æKY DBResultsToText æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBResultsToText(results: ResultsRecord;VAR theText: Handle): OSErr; INLINE $303C,$0413,$A82F; æDT myVariable := DBResultsToText(results,theText); æC æKY DBInstallResultHandler æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBInstallResultHandler(dataType: DBType;theHandler: ProcPtr;isSysHandler: BOOLEAN): OSErr; INLINE $303C,$0514,$A82F; æDT myVariable := DBInstallResultHandler(dataType,theHandler,isSysHandler); æC æKY DBRemoveResultHandler æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBRemoveResultHandler(dataType: DBType): OSErr; INLINE $303C,$0215,$A82F; æDT myVariable := DBRemoveResultHandler(dataType); æC æKY DBGetResultHandler æFp DatabaseAccess.p æT FUNCTION æTN A82F æD FUNCTION DBGetResultHandler(dataType: DBType;VAR theHandler: ProcPtr;getSysHandler: BOOLEAN): OSErr; INLINE $303C,$0516,$A82F; æDT myVariable := DBGetResultHandler(dataType,theHandler,getSysHandler); æC æKY Desk.p æKL CloseDeskAcc OpenDeskAcc SystemClick SystemEdit SystemEvent SystemMenu SystemTask accClear accCopy accCursor accCut accEvent accMenu accPaste accRun accUndo goodbye æKY accEvent æFp Desk.p æT CONST æD accEvent = 64; æC æKY accRun æFp Desk.p æT CONST æD accRun = 65; æC æKY accCursor æFp Desk.p æT CONST æD accCursor = 66; æC æKY accMenu æFp Desk.p æT CONST æD accMenu = 67; æC æKY accUndo æFp Desk.p æT CONST æD accUndo = 68; æC æKY accCut æFp Desk.p æT CONST æD accCut = 70; æC æKY accCopy æFp Desk.p æT CONST æD accCopy = 71; æC æKY accPaste æFp Desk.p æT CONST æD accPaste = 72; æC æKY accClear æFp Desk.p æT CONST æD accClear = 73; æC æKY goodbye æFp Desk.p æT CONST æD goodbye = -1; {goodbye message} æC æKY OpenDeskAcc æFp Desk.p æT FUNCTION æTN A9B6 æD FUNCTION OpenDeskAcc(deskAccName: Str255): INTEGER; INLINE $A9B6; æDT myVariable := OpenDeskAcc(deskAccName); æMM æRI I-440 æC OpenDeskAcc opens the desk accessory having the given name and displays its window (if any) as the active window. The name is the accessory’s resource name, which you get from the Apple menu by calling the Menu Manager procedure GetItem. OpenDeskAcc calls the Resource Manager to read the desk accessory from the resource file into the application heap. You should ignore the value returned by OpenDeskAcc. If the desk accessory is successfully opened, the function result is its driver reference number. However, if the desk accessory can’t be opened, the function result is undefined; the accessory will have taken care of informing the user of the problem (such as memory full) and won’t display itself. Warning: Early versions of some desk accessories may set the current grafPort to the accessory’s port upon return from OpenDeskAcc. To be safe, you should bracket your call to OpenDeskAcc with calls to the QuickDraw procedures GetPort and SetPort, to save and restore the current port. Note: Programmers concerned about the amount of available memory should be aware that an open desk accessory uses from 1K to 3K bytes of heap space in addition to the space needed for the accessory itself. The desk accessory is responsible for determining whether there is sufficient memory for it to run; this can be done by calling SizeResource followed by ResrvMem. æKY CloseDeskAcc æFp Desk.p æT PROCEDURE æTN A9B7 æD PROCEDURE CloseDeskAcc(refNum: INTEGER); INLINE $A9B7; æDT CloseDeskAcc(refNum); æRI I-440 æC When a system window is active and the user chooses Close from the File menu, call CloseDeskAcc to close the desk accessory. RefNum is the driver reference number for the desk accessory, which you get from the windowKind field of its window. The Desk Manager automatically closes a desk accessory if the user clicks its close box. Also, since the application heap is released when the application terminates, every desk accessory goes away at that time. æKY SystemClick æFp Desk.p æT PROCEDURE æTN A9B3 æD PROCEDURE SystemClick(theEvent: EventRecord;theWindow: WindowPtr); INLINE $A9B3; æDT SystemClick(theEvent,theWindow); æMM æRI I-441, P-35, 182 æC When a mouse-down event occurs and the Window Manager function FindWindow reports that the mouse button was pressed in a system window, the application should call SystemClick with the event record and the window pointer. If the given window belongs to a desk accessory, SystemClick sees that the event gets handled properly. SystemClick determines which part of the desk accessory’s window the mouse button was pressed in, and responds accordingly (similar to the way your application responds to mouse activities in its own windows). • If the mouse button was pressed in the content region of the window and the window was active, SystemClick sends the mouse-down event to the desk accessory, which processes it as appropriate. • If the mouse button was pressed in the content region and the window was inactive, SystemClick makes it the active window. • If the mouse button was pressed in the drag region, SystemClick calls the Window Manager procedure DragWindow to pull an outline of the window across the screen and move the window to a new location. If the window was inactive, DragWindow also makes it the active window (unless the Command key was pressed along with the mouse button). • If the mouse button was pressed in the go-away region, SystemClick calls the Window Manager function TrackGoAway to determine whether the mouse is still inside the go-away region when the click is completed: If so, it tells the desk accessory to close itself; otherwise, it does nothing. æKY SystemEdit æFp Desk.p æT FUNCTION æTN A9C2 æD FUNCTION SystemEdit(editCmd: INTEGER): BOOLEAN; INLINE $A9C2; æDT myVariable := SystemEdit(editCmd); æMM æRT 180, 215 æRI I-441 æC Assembly-language note: The macro you invoke to call SystemEdit from assembly language is named _SysEdit. Call SystemEdit when there’s a mouse-down event in the menu bar and the user chooses one of the five standard editing commands from the Edit menu. Pass one of the following as the value of the editCmd parameter: editCmd Editing command 0 Undo 2 Cut 3 Copy 4 Paste 5 Clear If your Edit menu contains these five commands in the standard arrangement (the order listed above, with a dividing line between Undo and Cut), you can simply call SystemEdit(menuItem-1) where menuItem is the menu item number. If the active window doesn’t belong to a desk accessory, SystemEdit returns FALSE; the application should then process the editing command as usual. If the active window does belong to a desk accessory, SystemEdit asks that accessory to process the command and returns TRUE; in this case, the application should ignore the command. Note: It’s up to the application to make sure desk accessories get their editing commands that are chosen from the Edit menu. In particular, make sure your application hasn’t disabled the Edit menu or any of the five standard commands when a desk accessory is activated. æKY SystemTask æFp Desk.p æT PROCEDURE æTN A9B4 æD PROCEDURE SystemTask; INLINE $A9B4; æDT SystemTask; æRT 85 æRI I-442, 444, II-189, N85-1 æC For each open desk accessory (or other device driver performing periodic actions), SystemTask causes the accessory to perform the periodic action defined for it, if any such action has been defined and if the proper time period has passed since the action was last performed. For example, a clock accessory can be defined such that the second hand is to move once every second; the periodic action for the accessory will be to move the second hand to the next position, and SystemTask will alert the accessory every second to perform that action. You should call SystemTask as often as possible, usually once every time through your main event loop. Call it more than once if your application does an unusually large amount of processing each time through the loop. Note: SystemTask should be called at least every sixtieth of a second. æKY SystemEvent æFp Desk.p æT FUNCTION æTN A9B2 æD FUNCTION SystemEvent(theEvent: EventRecord): BOOLEAN; INLINE $A9B2; æDT myVariable := SystemEvent(theEvent); æRT 5,85 æRI I-442, N5-1, N85-1 æC SystemEvent is called only by the Toolbox Event Manager function GetNextEvent when it receives an event, to determine whether the event should be handled by the application or by the system. If the given event should be handled by the application, SystemEvent returns FALSE; otherwise, it calls the appropriate system code to handle the event and returns TRUE. In the case of a null or mouse-down event, SystemEvent does nothing but return FALSE. Notice that it responds this way to a mouse-down event even though the event may in fact have occurred in a system window (and therefore may have to be handled by the system). The reason for this is that the check for exactly where the event occurred (via the Window Manager function FindWindow) is made later by the application and so would be made twice if SystemEvent were also to do it. To avoid this duplication, SystemEvent passes the event on to the application and lets it make the sole call to FindWindow. Should FindWindow reveal that the mouse-down event did occur in a system window, the application can then call SystemClick, as described above, to get the system to handle it. If the given event is a mouse-up or any keyboard event (including keyboard equivalents of commands), SystemEvent checks whether the active window belongs to a desk accessory and whether that accessory can handle this type of event. If so, it sends the event to the desk accessory and returns TRUE; otherwise, it returns FALSE. If SystemEvent is passed an activate or update event, it checks whether the window the event occurred in is a system window belonging to a desk accessory and whether that accessory can handle this type of event. If so, it sends the event to the desk accessory and returns TRUE; otherwise, it returns FALSE. Note: It’s unlikely that a desk accessory would not be set up to handle keyboard, activate, and update events, or that it would handle mouse-up events. If the given event is a disk-inserted event, SystemEvent does some low-level processing (by calling the File Manager function MountVol) but passes the event on to the application by returning FALSE, in case the application wants to do further processing. Finally, SystemEvent returns FALSE for network, device driver, and application-defined events. Assembly-language note: Advanced programmers can make SystemEvent always return FALSE by setting the global variable SEvtEnb (a byte) to 0. æKY SystemMenu æFp Desk.p æT PROCEDURE æTN A9B5 æD PROCEDURE SystemMenu(menuResult: LONGINT); INLINE $A9B5; æDT SystemMenu(menuResult); æMM æRI I-443 æC SystemMenu is called only by the Menu Manager functions MenuSelect and MenuKey, when an item in a menu belonging to a desk accessory has been chosen. The menuResult parameter has the same format as the value returned by MenuSelect and MenuKey: the menu ID in the high-order word and the menu item number in the low-order word. (The menu ID will be negative.) SystemMenu directs the desk accessory to perform the appropriate action for the given menu item. æKY DeskBus.p æKL ADBOp ADBReInit CountADBs GetADBInfo GetIndADB SetADBInfo ADBAddress ADBDataBlock ADBDBlkPtr ADBOpBlock ADBOpBPtr ADBSetInfoBlock ADBSInfoPtr æKY ADBOpBlock ADBOpBPtr æFp DeskBus.p æT RECORD æD ADBOpBPtr = ^ADBOpBlock; ADBOpBlock = RECORD dataBuffPtr: Ptr; {address of data buffer} opServiceRtPtr: Ptr; {service routine pointer} opDataAreaPtr: Ptr; {optional data area address} END; æC æKY ADBDataBlock ADBDBlkPtr æFp DeskBus.p æT RECORD æD ADBDBlkPtr = ^ADBDataBlock; ADBDataBlock = PACKED RECORD devType: SignedByte; {device type} origADBAddr: SignedByte; {original ADB Address} dbServiceRtPtr: Ptr; {service routine pointer} dbDataAreaAddr: Ptr; {data area address} END; æC æKY ADBSetInfoBlock ADBSInfoPtr æFp DeskBus.p æT RECORD æD ADBSInfoPtr = ^ADBSetInfoBlock; ADBSetInfoBlock = RECORD siServiceRtPtr: Ptr; {service routine pointer} siDataAreaAddr: Ptr; {data area address} END; æC æKY ADBAddress æFp DeskBus.p æT RECORD æD ADBAddress = SignedByte; æC æKY ADBReInit æFp DeskBus.p æT PROCEDURE æTN A07B æD PROCEDURE ADBReInit; INLINE $A07B; æDT ADBReInit; æMM æRT 143, 206 æRI V-367, N143 æC Trap macro _ADBReInit ADBReInit reinitializes the entire Apple Desktop Bus. It clears the ADB device table to zeros and places a SendReset command on the bus to reset all devices to their original addresses. ADBReInit has no parameters. Because it does not deallocate ADB resources on the system heap, ADBReInit should not be used for routine bus initialization. Apple strongly recommends against adding devices while the system is running; therefore, you should never call ADBReInit. ADBReInit also calls a routine pointed to by the low memory global JADBProc at the beginning and end of its execution. You can insert your own preprocessing/postprocessing routine by changing the value of JADBProc; ADBReInit conditions it by setting D0 to 0 for preprocessing and to 1 for postprocessing. Your procedure must restore the value of D0 and branch to the original value of JADBProc on exit. JADBProc should be used to de-allocate memory used by the driver (see MacDTS Sample Code “TbltDrvr” for an example), and then it should chain to the procedure originally found in JADBProc. The complete ADBReInit sequence is therefore the following: • JSR to JADBProc with D0 set to 0 • reinitialize the Apple Desktop Bus • clear the ADB device table • JSR to JADBProc with D0 set to 1 æKY ADBOp æFp DeskBus.p æT FUNCTION æD FUNCTION ADBOp(data: Ptr;compRout: ProcPtr;buffer: Ptr;commandNum: INTEGER): OSErr; æDT myVariable := ADBOp(data,compRout,buffer,commandNum); æRT 206 æRI V-368 æC Trap macro _ADBOp On entry: A0: pointer to parameter block D0: commandNum (byte) Parameter block --> 0 buffer pointer --> 4 compRout pointer --> 8 data pointer On exit: D0: result code (byte) The completion routine pointed to by compRout will be passed the following parameters on entry: D0: commandNum (byte) A0: pointer to buffer, data stored as a Pascal string (maximum 8 bytes data preceded by one length byte) A1: pointer to completion routine (compRout) A2: pointer to optional data area (data) ADBOp transmits over the bus the command byte whose value is given by commandNum. The structure of the command byte is given earlier in Figure 1. ADBOp executes only when the ADB is otherwise idle; otherwise it is held in a command queue. It returns an error if the command queue is full. The length of the data buffer pointed to by buffer is contained in its first byte, like a Pascal string. The optional data area pointed to by data is for local storage by the completion routine pointed to by compRout. ADBop should be used sparingly; it is not intended for polling a device. The host automatically polls devices with data to deliver. Result codes noErr No error –1 Unsuccessful completion æKY CountADBs æFp DeskBus.p æT FUNCTION æTN A077 æD FUNCTION CountADBs: INTEGER; INLINE $A077,$3E80; æDT myVariable := CountADBs; æRT 206 æRI V-369 æC Trap macro _CountADBs On exit: D0: number of devices (byte) CountADBs returns a value representing the number of devices connected to the ADB by counting the number of entries in the device table. It has no arguments and returns no error codes. æKY GetIndADB æFp DeskBus.p æT FUNCTION æTN A078 æD FUNCTION GetIndADB(VAR info: ADBDataBlock;devTableIndex: INTEGER): ADBAddress; æDT myVariable := GetIndADB(info,devTableIndex,D0); æRT 206 æRI V-369 æC Trap macro _GetIndADB On entry: A0: pointer to parameter block D0: entry index number; range = 1..CountADBs (byte) Parameter block <-- 0 device type byte (handler ID) <-- 1 original ADB address byte <-- 2 service routine address pointer (compRout) <-- 6 data area address pointer (data) On exit: D0: positive value: current ADB address (byte) negative value: error code (byte) GetIndADB returns information from the ADB device table entry whose index number is given by devTableIndex. ADBDataBlock has this form: TYPE ADBDataBlock = PACKED RECORD devType: SignedByte; {device type (handler ID)} origADBAddr: SignedByte; {original ADB address} dbServiceRtPtr: Ptr; {service routine address (compRout)} dbDataAreaAddr: Ptr {data area address (data)} END; GetIndADB returns the current ADB address of the device. If it is unable to complete execution successfully, GetIndADB returns a negative value. æKY GetADBInfo æFp DeskBus.p æT FUNCTION æTN A079 æD FUNCTION GetADBInfo(VAR info: ADBDataBlock;adbAddr: ADBAddress): OSErr; æDT myVariable := GetADBInfo(info,adbAddr,D0); æRI V-370 æC Trap macro _GetADBInfo On entry: A0: pointer to parameter block D0: ADB address of the device (byte) Parameter block <-- 0 device handler ID byte <-- 1 original ADB address byte <-- 2 service routine address pointer (compRout) <-- 6 data area address pointer (data) On exit: D0: result code (byte) GetADBInfo returns information from the ADB device table entry of the device whose ADB address is given by ABDAddr. The structure of ADBDataBlock is given above under “GetIndADB”. Result codes noErr No error æKY SetADBInfo æFp DeskBus.p æT FUNCTION æTN A07A æD FUNCTION SetADBInfo(VAR info: ADBSetInfoBlock;adbAddr: ADBAddress): OSErr; æDT myVariable := SetADBInfo(info,adbAddr,D0); æRT 206 æRI V-370 æC Trap macro _SetADBInfo On entry: A0: pointer to parameter block D0: ADB address of the device (byte) Parameter block --> 0 service routine address pointer (compRout) --> 4 data area address pointer (data) On exit: D0: result code (byte) SetADBInfo sets the service routine address and the data area address in the ADB device table entry for the device whose ADB address is given by ABDAddr. ADBSetInfoBlock has this form: TYPE ADBSetInfoBlock = RECORD siServiceRtPtr: Ptr; {service routine address (compRout)} siDataAreaAddr: Ptr {data area address (data)} END; Result codes noErr No error Warning: You should send a Flush command to the device after calling it with SetADBInfo, to prevent it sending old data to the new data area address. æKY Devices.p æKL CloseDriver Control GetDCtlEntry KillIO OpenDriver PBControl PBControlAsync PBControlSync PBKillIO PBKillIOAsync PBKillIOSync PBStatus PBStatusAsync PBStatusSync SetChooserAlert Status activateMsg activDev AuxDCE AuxDCEHandle AuxDCEPtr buttonMsg cancelMsg cdevGenErr cdevMemErr cdevResErr cdevUnset chooserID clearDev closeDev copyDev cursorDev cutDev DCtlEntry DCtlHandle DCtlPtr deactivateMsg deactivDev deselectMsg fillListMsg getSelMsg hitDev hitMsg initDev initMsg keyEvtDev keyEvtMsg macDev newSelMsg normalMsg nulDev nulMsg okMsg pasteDev selectMsg startupMsg superMsg terminateMsg undoDev updateDev updateMsg æKY newSelMsg æFp Devices.p æT CONST æD newSelMsg = 12; æC æKY fillListMsg æFp Devices.p æT CONST æD fillListMsg = 13; æC æKY getSelMsg æFp Devices.p æT CONST æD getSelMsg = 14; æC æKY selectMsg æFp Devices.p æT CONST æD selectMsg = 15; æC æKY deselectMsg æFp Devices.p æT CONST æD deselectMsg = 16; æC æKY terminateMsg æFp Devices.p æT CONST æD terminateMsg = 17; æC æKY buttonMsg æFp Devices.p æT CONST æD buttonMsg = 19; æC æKY chooserID æFp Devices.p æT CONST æD chooserID = 1; æC æKY initDev æFp Devices.p æT CONST æD initDev = 0; {Time for cdev to initialize itself} æC »The initDev Message InitDev is an initialization message sent to allow the cdev to allocate its private storage (if any) and do any initial settings to buttons or controls. This message is sent when the user clicks on the cdev’s icon. Note that the dialog, cdev list, and all of the items in the cdev’s 'DITL' except user items will already have been drawn when the initDev message is sent. If your cdev doesn’t need any storage it should return the value that was passed to it in cdevValue. æKY hitDev æFp Devices.p æT CONST æD hitDev = 1; {Hit on one of my items} æC »The hitDev Message A hitDev message is sent when the user has clicked an enabled dialog item that belongs to the cdev. The dialog item number of the item hit is passed in the Item parameter. Remember that the Control Panel’s items precede yours, so you’ll want (Item – numItems) to determine which of your items was hit. If the Control Panel itself has n items, the first of the cdev’s items will be n+1 in the combined dialog item list. A cdev should not depend on any hardcoded value for numItems, since the number of items in Control Panel’s 'DITL' is likely to change in the future. Factoring in numItems need not mean an increase in your code size, or passing and adding numItems everywhere, or foregoing the constants that most developers use to identify specific items. You can do it easily, and neatly, as follows: 1. Subtract numItems from Item right away, and refer to your dialog items with constants as usual throughout the cdev. 2. Write simple envelope routines to enclose Dialog Manager procedures that require item number arguments. Add numItems only locally, within those routines and for the Dialog Manager calls only. This is demonstrated in the sample cdev. æKY closeDev æFp Devices.p æT CONST æD closeDev = 2; {Close yourself} æC »The closeDev Message A closeDev message is sent to the cdev when either the Control Panel is closed or the user selects another cdev. When a cdev receives a closeDev message it should dispose of any storage it has allocated, including the handle stored in cdevValue, if any. æKY nulDev æFp Devices.p æT CONST æD nulDev = 3; {Null event} æC »The nulDev Message A nulDev message is sent to the cdev on every Control Panel run event. This allows the cdev to perform tasks that need to be executed continuously (insertion point blinking, for example). A cdev cannot assume any particular timing of calls from applications. Don’t use nulDev to refresh settings; see activDev, above. æKY updateDev æFp Devices.p æT CONST æD updateDev = 4; {Update event} æC »The updateDev Message An updateDev message is sent to the cdev on every update event. It allows the cdev to perform any updating necessary aside from the standard dialog item updating provided by the Dialog Manager. For example, if the cdev resource contains a picture of the sound control bar, it will probably be a user item, and the picture of the control bar and the volume knob should be redrawn in response to update events. Note that there is no mechanism for determining what to update, as the update region has already been reset. You must redraw all of your user items completely. æKY activDev æFp Devices.p æT CONST æD activDev = 5; {Activate event} æC »The activDev Message An activDev message is sent to the cdev on every activate event. It allows the cdev to reset any items that may have changed while the Control Panel was inactive. It also allows the cdev to send things such as “lists activate” messages. æKY deactivDev æFp Devices.p æT CONST æD deactivDev = 6; {Deactivate event} æC »The deActivDev Message A deActivDev message is sent to the cdev on every deactivate event. It allows the cdev to send deactivate messages to items such as lists. æKY keyEvtDev æFp Devices.p æT CONST æD keyEvtDev = 7; {Key down/auto key} æC »The keyEvtDev Message A keyEvtDev message is sent to the cdev on every keyDown event and autoKey event. It allows the cdev to process key events. On return to the Control Panel, the key event will be processed by a call to dialogSelect in the Dialog Manager. A cdev that does not want the Toolbox Event Manager to do any further processing should change the what field of the EventRecord to nullEvent before returning to the Control Panel. æKY macDev æFp Devices.p æT CONST æD macDev = 8; {Decide whether or not to show up} æC »The macDev Message If the 'mach' resource has a 0 in Softmask and a –1 ($FFFF) in Hardmask, the first message a cdev will get is a macDev message. This is an opportunity for the cdev to determine whether it can run, and whether it should appear in the Control Panel’s cdev list. The cdev can do its own check to see which machine it is being run on, what hardware is connected, and what is in the slots (if it has slots). The cdev must then return a function result of 1 or 0. If a 0 is returned, the Control Panel will not display the cdev in the icon list. (Note that the Control Panel does not interpret this 0 or 1 as an error message as described under “Cdev Error Checking”.) The macDev call happens only once, and only when Softmask and Hardmask are 0 and FFFF. It is always the first call made to the cdev. æKY undoDev æFp Devices.p æT CONST æD undoDev = 9; æC æKY cutDev æFp Devices.p æT CONST æD cutDev = 10; æC æKY copyDev æFp Devices.p æT CONST æD copyDev = 11; æC æKY pasteDev æFp Devices.p æT CONST æD pasteDev = 12; æC æKY clearDev æFp Devices.p æT CONST æD clearDev = 13; æC æKY cursorDev æFp Devices.p æT CONST æD cursorDev = 14; æC æKY cdevGenErr æFp Devices.p æT CONST æD cdevGenErr = -1; {General error; gray cdev w/o alert} æC æKY cdevMemErr æFp Devices.p æT CONST æD cdevMemErr = 0; {Memory shortfall; alert user please} æC æKY cdevResErr æFp Devices.p æT CONST æD cdevResErr = 1; {Couldn't get a needed resource; alert} æC æKY cdevUnset æFp Devices.p æT CONST æD cdevUnset = 3; { cdevValue is initialized to this} æC »CDEV ERROR CHECKING _______________________________________________________________________________ Because a desk accessory may be called into many strange and wonderful situations, careful attention must be paid to error checking. The two most common error conditions are missing resources and lack of memory. Some error reporting and recovery facilities have been provided in the Control Panel to help with errors encountered in a cdev. Because the Control Panel has no direct information about the cdev, the cdev’s code must be able to detect and recover from error conditions on its own. If the recovery cannot be effected the cdev must dispose of any memory it has allocated, and exit back to the Control Panel with an error code. Following a shutdown, the Control Panel can help report the error condition to the user and prevent accidental reentry into the cdev that might result from such things as an update event. A cdev can request three different error reporting mechanisms from the Control Panel: • If a memory error has occured, then, after the cdev has safely shut itself down, it may request the Control Panel to issue an out-of-memory error message and gray out (paint over with the background pattern) the cdev area of the Control Panel window. It will remain grayed until another cdev is selected. The Control Panel window itself is not closed since other cdevs may still be able to function in the environment. • If a resource error is detected, the cdev may request that a can’t-find-needed-resource error message be issued. • The cdev may display its own error message and then call on the Control Panel to gray its area. The Control Panel uses the cdevValue parameter to send status information to the cdev, and a proper cdev uses its function value to send information back to the Control Panel. In the absence of errors, the same value passes back and forth: the Control Panel puts the last function value it received into cdevValue when it calls the cdev; the cdev returns the value it finds there as the function value. The cdev may want to keep a handle to its own storage, in which case passing it as the function value ensures its availability, since the Control Panel will pass it back in cdevValue at the next call. Four constants have been defined for this cdev/Control Panel communication: CONST cdevUnset = 3; {initial value passed in cdevValue} cdevGenErr = -1; {generic cdev error} cdevMemErr = 0; {insufficient memory for cdev execution} cdevResErr = 1; {missing resource needed by cdev} After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until an error occurs or the cdev uses its function value as a handle, cdevUnset is passed back and forth. If the cdev encounters an error, it should dispose of all handles and pointers it has set up, strip the stack back to the same position as a normal exit, and return one of the three error codes as the function result. The Control Panel will respond as follows: Function Message to Control Panel Action Result Control Panel cdevGenErr The cdev has encountered an Gray out the cdev’s area, error from which it cannot send a 0 in cdevValue in recover, but do not put up succeeding cdev calls an error dialog. cdevMemErr The cdev has determined that Gray out cdev’s area, put there is not enough memory to up error dialog, send a 0 execute; please put up a in cdevValue in succeeding memory error dialog. cdev calls. cdevResErr The cdev can’t find a needed Gray out cdev’s area, put resource; please put up a up error dialog, send a 0 resource error dialog. in cdevValue in succeeding cdev calls. all other values, No error conditions. Send the value back in either handles cdevValue. or cdevUnset The cdev code should check cdevValue at entry. A 0 means that the Control Panel has responded to a cdev error message by shutting down the cdev and displaying an error dialog if one was requested. The cdev should immediately exit. Once the Control Panel has responded to an error message from a cdev it will no longer respond to any return values until another cdev is launched. æKY initMsg æFp Devices.p æT CONST æD initMsg = 1; {initialization} æC »CDEV ERROR CHECKING _______________________________________________________________________________ Because a desk accessory may be called into many strange and wonderful situations, careful attention must be paid to error checking. The two most common error conditions are missing resources and lack of memory. Some error reporting and recovery facilities have been provided in the Control Panel to help with errors encountered in a cdev. Because the Control Panel has no direct information about the cdev, the cdev’s code must be able to detect and recover from error conditions on its own. If the recovery cannot be effected the cdev must dispose of any memory it has allocated, and exit back to the Control Panel with an error code. Following a shutdown, the Control Panel can help report the error condition to the user and prevent accidental reentry into the cdev that might result from such things as an update event. A cdev can request three different error reporting mechanisms from the Control Panel: • If a memory error has occured, then, after the cdev has safely shut itself down, it may request the Control Panel to issue an out-of-memory error message and gray out (paint over with the background pattern) the cdev area of the Control Panel window. It will remain grayed until another cdev is selected. The Control Panel window itself is not closed since other cdevs may still be able to function in the environment. • If a resource error is detected, the cdev may request that a can’t-find-needed-resource error message be issued. • The cdev may display its own error message and then call on the Control Panel to gray its area. The Control Panel uses the cdevValue parameter to send status information to the cdev, and a proper cdev uses its function value to send information back to the Control Panel. In the absence of errors, the same value passes back and forth: the Control Panel puts the last function value it received into cdevValue when it calls the cdev; the cdev returns the value it finds there as the function value. The cdev may want to keep a handle to its own storage, in which case passing it as the function value ensures its availability, since the Control Panel will pass it back in cdevValue at the next call. Four constants have been defined for this cdev/Control Panel communication: CONST cdevUnset = 3; {initial value passed in cdevValue} cdevGenErr = -1; {generic cdev error} cdevMemErr = 0; {insufficient memory for cdev execution} cdevResErr = 1; {missing resource needed by cdev} After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until an error occurs or the cdev uses its function value as a handle, cdevUnset is passed back and forth. If the cdev encounters an error, it should dispose of all handles and pointers it has set up, strip the stack back to the same position as a normal exit, and return one of the three error codes as the function result. The Control Panel will respond as follows: Function Message to Control Panel Action Result Control Panel cdevGenErr The cdev has encountered an Gray out the cdev’s area, error from which it cannot send a 0 in cdevValue in recover, but do not put up succeeding cdev calls an error dialog. cdevMemErr The cdev has determined that Gray out cdev’s area, put there is not enough memory to up error dialog, send a 0 execute; please put up a in cdevValue in succeeding memory error dialog. cdev calls. cdevResErr The cdev can’t find a needed Gray out cdev’s area, put resource; please put up a up error dialog, send a 0 resource error dialog. in cdevValue in succeeding cdev calls. all other values, No error conditions. Send the value back in either handles cdevValue. or cdevUnset The cdev code should check cdevValue at entry. A 0 means that the Control Panel has responded to a cdev error message by shutting down the cdev and displaying an error dialog if one was requested. The cdev should immediately exit. Once the Control Panel has responded to an error message from a cdev it will no longer respond to any return values until another cdev is launched. æKY okMsg æFp Devices.p æT CONST æD okMsg = 2; {user clicked OK button} æC »CDEV ERROR CHECKING _______________________________________________________________________________ Because a desk accessory may be called into many strange and wonderful situations, careful attention must be paid to error checking. The two most common error conditions are missing resources and lack of memory. Some error reporting and recovery facilities have been provided in the Control Panel to help with errors encountered in a cdev. Because the Control Panel has no direct information about the cdev, the cdev’s code must be able to detect and recover from error conditions on its own. If the recovery cannot be effected the cdev must dispose of any memory it has allocated, and exit back to the Control Panel with an error code. Following a shutdown, the Control Panel can help report the error condition to the user and prevent accidental reentry into the cdev that might result from such things as an update event. A cdev can request three different error reporting mechanisms from the Control Panel: • If a memory error has occured, then, after the cdev has safely shut itself down, it may request the Control Panel to issue an out-of-memory error message and gray out (paint over with the background pattern) the cdev area of the Control Panel window. It will remain grayed until another cdev is selected. The Control Panel window itself is not closed since other cdevs may still be able to function in the environment. • If a resource error is detected, the cdev may request that a can’t-find-needed-resource error message be issued. • The cdev may display its own error message and then call on the Control Panel to gray its area. The Control Panel uses the cdevValue parameter to send status information to the cdev, and a proper cdev uses its function value to send information back to the Control Panel. In the absence of errors, the same value passes back and forth: the Control Panel puts the last function value it received into cdevValue when it calls the cdev; the cdev returns the value it finds there as the function value. The cdev may want to keep a handle to its own storage, in which case passing it as the function value ensures its availability, since the Control Panel will pass it back in cdevValue at the next call. Four constants have been defined for this cdev/Control Panel communication: CONST cdevUnset = 3; {initial value passed in cdevValue} cdevGenErr = -1; {generic cdev error} cdevMemErr = 0; {insufficient memory for cdev execution} cdevResErr = 1; {missing resource needed by cdev} After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until an error occurs or the cdev uses its function value as a handle, cdevUnset is passed back and forth. If the cdev encounters an error, it should dispose of all handles and pointers it has set up, strip the stack back to the same position as a normal exit, and return one of the three error codes as the function result. The Control Panel will respond as follows: Function Message to Control Panel Action Result Control Panel cdevGenErr The cdev has encountered an Gray out the cdev’s area, error from which it cannot send a 0 in cdevValue in recover, but do not put up succeeding cdev calls an error dialog. cdevMemErr The cdev has determined that Gray out cdev’s area, put there is not enough memory to up error dialog, send a 0 execute; please put up a in cdevValue in succeeding memory error dialog. cdev calls. cdevResErr The cdev can’t find a needed Gray out cdev’s area, put resource; please put up a up error dialog, send a 0 resource error dialog. in cdevValue in succeeding cdev calls. all other values, No error conditions. Send the value back in either handles cdevValue. or cdevUnset The cdev code should check cdevValue at entry. A 0 means that the Control Panel has responded to a cdev error message by shutting down the cdev and displaying an error dialog if one was requested. The cdev should immediately exit. Once the Control Panel has responded to an error message from a cdev it will no longer respond to any return values until another cdev is launched. æKY cancelMsg æFp Devices.p æT CONST æD cancelMsg = 3; {user clicked Cancel button} æC »CDEV ERROR CHECKING _______________________________________________________________________________ Because a desk accessory may be called into many strange and wonderful situations, careful attention must be paid to error checking. The two most common error conditions are missing resources and lack of memory. Some error reporting and recovery facilities have been provided in the Control Panel to help with errors encountered in a cdev. Because the Control Panel has no direct information about the cdev, the cdev’s code must be able to detect and recover from error conditions on its own. If the recovery cannot be effected the cdev must dispose of any memory it has allocated, and exit back to the Control Panel with an error code. Following a shutdown, the Control Panel can help report the error condition to the user and prevent accidental reentry into the cdev that might result from such things as an update event. A cdev can request three different error reporting mechanisms from the Control Panel: • If a memory error has occured, then, after the cdev has safely shut itself down, it may request the Control Panel to issue an out-of-memory error message and gray out (paint over with the background pattern) the cdev area of the Control Panel window. It will remain grayed until another cdev is selected. The Control Panel window itself is not closed since other cdevs may still be able to function in the environment. • If a resource error is detected, the cdev may request that a can’t-find-needed-resource error message be issued. • The cdev may display its own error message and then call on the Control Panel to gray its area. The Control Panel uses the cdevValue parameter to send status information to the cdev, and a proper cdev uses its function value to send information back to the Control Panel. In the absence of errors, the same value passes back and forth: the Control Panel puts the last function value it received into cdevValue when it calls the cdev; the cdev returns the value it finds there as the function value. The cdev may want to keep a handle to its own storage, in which case passing it as the function value ensures its availability, since the Control Panel will pass it back in cdevValue at the next call. Four constants have been defined for this cdev/Control Panel communication: CONST cdevUnset = 3; {initial value passed in cdevValue} cdevGenErr = -1; {generic cdev error} cdevMemErr = 0; {insufficient memory for cdev execution} cdevResErr = 1; {missing resource needed by cdev} After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until an error occurs or the cdev uses its function value as a handle, cdevUnset is passed back and forth. If the cdev encounters an error, it should dispose of all handles and pointers it has set up, strip the stack back to the same position as a normal exit, and return one of the three error codes as the function result. The Control Panel will respond as follows: Function Message to Control Panel Action Result Control Panel cdevGenErr The cdev has encountered an Gray out the cdev’s area, error from which it cannot send a 0 in cdevValue in recover, but do not put up succeeding cdev calls an error dialog. cdevMemErr The cdev has determined that Gray out cdev’s area, put there is not enough memory to up error dialog, send a 0 execute; please put up a in cdevValue in succeeding memory error dialog. cdev calls. cdevResErr The cdev can’t find a needed Gray out cdev’s area, put resource; please put up a up error dialog, send a 0 resource error dialog. in cdevValue in succeeding cdev calls. all other values, No error conditions. Send the value back in either handles cdevValue. or cdevUnset The cdev code should check cdevValue at entry. A 0 means that the Control Panel has responded to a cdev error message by shutting down the cdev and displaying an error dialog if one was requested. The cdev should immediately exit. Once the Control Panel has responded to an error message from a cdev it will no longer respond to any return values until another cdev is launched. æKY hitMsg æFp Devices.p æT CONST æD hitMsg = 4; {user clicked control in Options dialog} æC »CDEV ERROR CHECKING _______________________________________________________________________________ Because a desk accessory may be called into many strange and wonderful situations, careful attention must be paid to error checking. The two most common error conditions are missing resources and lack of memory. Some error reporting and recovery facilities have been provided in the Control Panel to help with errors encountered in a cdev. Because the Control Panel has no direct information about the cdev, the cdev’s code must be able to detect and recover from error conditions on its own. If the recovery cannot be effected the cdev must dispose of any memory it has allocated, and exit back to the Control Panel with an error code. Following a shutdown, the Control Panel can help report the error condition to the user and prevent accidental reentry into the cdev that might result from such things as an update event. A cdev can request three different error reporting mechanisms from the Control Panel: • If a memory error has occured, then, after the cdev has safely shut itself down, it may request the Control Panel to issue an out-of-memory error message and gray out (paint over with the background pattern) the cdev area of the Control Panel window. It will remain grayed until another cdev is selected. The Control Panel window itself is not closed since other cdevs may still be able to function in the environment. • If a resource error is detected, the cdev may request that a can’t-find-needed-resource error message be issued. • The cdev may display its own error message and then call on the Control Panel to gray its area. The Control Panel uses the cdevValue parameter to send status information to the cdev, and a proper cdev uses its function value to send information back to the Control Panel. In the absence of errors, the same value passes back and forth: the Control Panel puts the last function value it received into cdevValue when it calls the cdev; the cdev returns the value it finds there as the function value. The cdev may want to keep a handle to its own storage, in which case passing it as the function value ensures its availability, since the Control Panel will pass it back in cdevValue at the next call. Four constants have been defined for this cdev/Control Panel communication: CONST cdevUnset = 3; {initial value passed in cdevValue} cdevGenErr = -1; {generic cdev error} cdevMemErr = 0; {insufficient memory for cdev execution} cdevResErr = 1; {missing resource needed by cdev} After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until an error occurs or the cdev uses its function value as a handle, cdevUnset is passed back and forth. If the cdev encounters an error, it should dispose of all handles and pointers it has set up, strip the stack back to the same position as a normal exit, and return one of the three error codes as the function result. The Control Panel will respond as follows: Function Message to Control Panel Action Result Control Panel cdevGenErr The cdev has encountered an Gray out the cdev’s area, error from which it cannot send a 0 in cdevValue in recover, but do not put up succeeding cdev calls an error dialog. cdevMemErr The cdev has determined that Gray out cdev’s area, put there is not enough memory to up error dialog, send a 0 execute; please put up a in cdevValue in succeeding memory error dialog. cdev calls. cdevResErr The cdev can’t find a needed Gray out cdev’s area, put resource; please put up a up error dialog, send a 0 resource error dialog. in cdevValue in succeeding cdev calls. all other values, No error conditions. Send the value back in either handles cdevValue. or cdevUnset The cdev code should check cdevValue at entry. A 0 means that the Control Panel has responded to a cdev error message by shutting down the cdev and displaying an error dialog if one was requested. The cdev should immediately exit. Once the Control Panel has responded to an error message from a cdev it will no longer respond to any return values until another cdev is launched. æKY nulMsg æFp Devices.p æT CONST æD nulMsg = 5; {periodic event} æC »CDEV ERROR CHECKING _______________________________________________________________________________ Because a desk accessory may be called into many strange and wonderful situations, careful attention must be paid to error checking. The two most common error conditions are missing resources and lack of memory. Some error reporting and recovery facilities have been provided in the Control Panel to help with errors encountered in a cdev. Because the Control Panel has no direct information about the cdev, the cdev’s code must be able to detect and recover from error conditions on its own. If the recovery cannot be effected the cdev must dispose of any memory it has allocated, and exit back to the Control Panel with an error code. Following a shutdown, the Control Panel can help report the error condition to the user and prevent accidental reentry into the cdev that might result from such things as an update event. A cdev can request three different error reporting mechanisms from the Control Panel: • If a memory error has occured, then, after the cdev has safely shut itself down, it may request the Control Panel to issue an out-of-memory error message and gray out (paint over with the background pattern) the cdev area of the Control Panel window. It will remain grayed until another cdev is selected. The Control Panel window itself is not closed since other cdevs may still be able to function in the environment. • If a resource error is detected, the cdev may request that a can’t-find-needed-resource error message be issued. • The cdev may display its own error message and then call on the Control Panel to gray its area. The Control Panel uses the cdevValue parameter to send status information to the cdev, and a proper cdev uses its function value to send information back to the Control Panel. In the absence of errors, the same value passes back and forth: the Control Panel puts the last function value it received into cdevValue when it calls the cdev; the cdev returns the value it finds there as the function value. The cdev may want to keep a handle to its own storage, in which case passing it as the function value ensures its availability, since the Control Panel will pass it back in cdevValue at the next call. Four constants have been defined for this cdev/Control Panel communication: CONST cdevUnset = 3; {initial value passed in cdevValue} cdevGenErr = -1; {generic cdev error} cdevMemErr = 0; {insufficient memory for cdev execution} cdevResErr = 1; {missing resource needed by cdev} After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until an error occurs or the cdev uses its function value as a handle, cdevUnset is passed back and forth. If the cdev encounters an error, it should dispose of all handles and pointers it has set up, strip the stack back to the same position as a normal exit, and return one of the three error codes as the function result. The Control Panel will respond as follows: Function Message to Control Panel Action Result Control Panel cdevGenErr The cdev has encountered an Gray out the cdev’s area, error from which it cannot send a 0 in cdevValue in recover, but do not put up succeeding cdev calls an error dialog. cdevMemErr The cdev has determined that Gray out cdev’s area, put there is not enough memory to up error dialog, send a 0 execute; please put up a in cdevValue in succeeding memory error dialog. cdev calls. cdevResErr The cdev can’t find a needed Gray out cdev’s area, put resource; please put up a up error dialog, send a 0 resource error dialog. in cdevValue in succeeding cdev calls. all other values, No error conditions. Send the value back in either handles cdevValue. or cdevUnset The cdev code should check cdevValue at entry. A 0 means that the Control Panel has responded to a cdev error message by shutting down the cdev and displaying an error dialog if one was requested. The cdev should immediately exit. Once the Control Panel has responded to an error message from a cdev it will no longer respond to any return values until another cdev is launched. æKY updateMsg æFp Devices.p æT CONST æD updateMsg = 6; {update event} æC »CDEV ERROR CHECKING _______________________________________________________________________________ Because a desk accessory may be called into many strange and wonderful situations, careful attention must be paid to error checking. The two most common error conditions are missing resources and lack of memory. Some error reporting and recovery facilities have been provided in the Control Panel to help with errors encountered in a cdev. Because the Control Panel has no direct information about the cdev, the cdev’s code must be able to detect and recover from error conditions on its own. If the recovery cannot be effected the cdev must dispose of any memory it has allocated, and exit back to the Control Panel with an error code. Following a shutdown, the Control Panel can help report the error condition to the user and prevent accidental reentry into the cdev that might result from such things as an update event. A cdev can request three different error reporting mechanisms from the Control Panel: • If a memory error has occured, then, after the cdev has safely shut itself down, it may request the Control Panel to issue an out-of-memory error message and gray out (paint over with the background pattern) the cdev area of the Control Panel window. It will remain grayed until another cdev is selected. The Control Panel window itself is not closed since other cdevs may still be able to function in the environment. • If a resource error is detected, the cdev may request that a can’t-find-needed-resource error message be issued. • The cdev may display its own error message and then call on the Control Panel to gray its area. The Control Panel uses the cdevValue parameter to send status information to the cdev, and a proper cdev uses its function value to send information back to the Control Panel. In the absence of errors, the same value passes back and forth: the Control Panel puts the last function value it received into cdevValue when it calls the cdev; the cdev returns the value it finds there as the function value. The cdev may want to keep a handle to its own storage, in which case passing it as the function value ensures its availability, since the Control Panel will pass it back in cdevValue at the next call. Four constants have been defined for this cdev/Control Panel communication: CONST cdevUnset = 3; {initial value passed in cdevValue} cdevGenErr = -1; {generic cdev error} cdevMemErr = 0; {insufficient memory for cdev execution} cdevResErr = 1; {missing resource needed by cdev} After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until an error occurs or the cdev uses its function value as a handle, cdevUnset is passed back and forth. If the cdev encounters an error, it should dispose of all handles and pointers it has set up, strip the stack back to the same position as a normal exit, and return one of the three error codes as the function result. The Control Panel will respond as follows: Function Message to Control Panel Action Result Control Panel cdevGenErr The cdev has encountered an Gray out the cdev’s area, error from which it cannot send a 0 in cdevValue in recover, but do not put up succeeding cdev calls an error dialog. cdevMemErr The cdev has determined that Gray out cdev’s area, put there is not enough memory to up error dialog, send a 0 execute; please put up a in cdevValue in succeeding memory error dialog. cdev calls. cdevResErr The cdev can’t find a needed Gray out cdev’s area, put resource; please put up a up error dialog, send a 0 resource error dialog. in cdevValue in succeeding cdev calls. all other values, No error conditions. Send the value back in either handles cdevValue. or cdevUnset The cdev code should check cdevValue at entry. A 0 means that the Control Panel has responded to a cdev error message by shutting down the cdev and displaying an error dialog if one was requested. The cdev should immediately exit. Once the Control Panel has responded to an error message from a cdev it will no longer respond to any return values until another cdev is launched. æKY activateMsg æFp Devices.p æT CONST æD activateMsg = 7; {not used} æC »CDEV ERROR CHECKING _______________________________________________________________________________ Because a desk accessory may be called into many strange and wonderful situations, careful attention must be paid to error checking. The two most common error conditions are missing resources and lack of memory. Some error reporting and recovery facilities have been provided in the Control Panel to help with errors encountered in a cdev. Because the Control Panel has no direct information about the cdev, the cdev’s code must be able to detect and recover from error conditions on its own. If the recovery cannot be effected the cdev must dispose of any memory it has allocated, and exit back to the Control Panel with an error code. Following a shutdown, the Control Panel can help report the error condition to the user and prevent accidental reentry into the cdev that might result from such things as an update event. A cdev can request three different error reporting mechanisms from the Control Panel: • If a memory error has occured, then, after the cdev has safely shut itself down, it may request the Control Panel to issue an out-of-memory error message and gray out (paint over with the background pattern) the cdev area of the Control Panel window. It will remain grayed until another cdev is selected. The Control Panel window itself is not closed since other cdevs may still be able to function in the environment. • If a resource error is detected, the cdev may request that a can’t-find-needed-resource error message be issued. • The cdev may display its own error message and then call on the Control Panel to gray its area. The Control Panel uses the cdevValue parameter to send status information to the cdev, and a proper cdev uses its function value to send information back to the Control Panel. In the absence of errors, the same value passes back and forth: the Control Panel puts the last function value it received into cdevValue when it calls the cdev; the cdev returns the value it finds there as the function value. The cdev may want to keep a handle to its own storage, in which case passing it as the function value ensures its availability, since the Control Panel will pass it back in cdevValue at the next call. Four constants have been defined for this cdev/Control Panel communication: CONST cdevUnset = 3; {initial value passed in cdevValue} cdevGenErr = -1; {generic cdev error} cdevMemErr = 0; {insufficient memory for cdev execution} cdevResErr = 1; {missing resource needed by cdev} After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until an error occurs or the cdev uses its function value as a handle, cdevUnset is passed back and forth. If the cdev encounters an error, it should dispose of all handles and pointers it has set up, strip the stack back to the same position as a normal exit, and return one of the three error codes as the function result. The Control Panel will respond as follows: Function Message to Control Panel Action Result Control Panel cdevGenErr The cdev has encountered an Gray out the cdev’s area, error from which it cannot send a 0 in cdevValue in recover, but do not put up succeeding cdev calls an error dialog. cdevMemErr The cdev has determined that Gray out cdev’s area, put there is not enough memory to up error dialog, send a 0 execute; please put up a in cdevValue in succeeding memory error dialog. cdev calls. cdevResErr The cdev can’t find a needed Gray out cdev’s area, put resource; please put up a up error dialog, send a 0 resource error dialog. in cdevValue in succeeding cdev calls. all other values, No error conditions. Send the value back in either handles cdevValue. or cdevUnset The cdev code should check cdevValue at entry. A 0 means that the Control Panel has responded to a cdev error message by shutting down the cdev and displaying an error dialog if one was requested. The cdev should immediately exit. Once the Control Panel has responded to an error message from a cdev it will no longer respond to any return values until another cdev is launched. æKY deactivateMsg æFp Devices.p æT CONST æD deactivateMsg = 8; {not used} æC »CDEV ERROR CHECKING _______________________________________________________________________________ Because a desk accessory may be called into many strange and wonderful situations, careful attention must be paid to error checking. The two most common error conditions are missing resources and lack of memory. Some error reporting and recovery facilities have been provided in the Control Panel to help with errors encountered in a cdev. Because the Control Panel has no direct information about the cdev, the cdev’s code must be able to detect and recover from error conditions on its own. If the recovery cannot be effected the cdev must dispose of any memory it has allocated, and exit back to the Control Panel with an error code. Following a shutdown, the Control Panel can help report the error condition to the user and prevent accidental reentry into the cdev that might result from such things as an update event. A cdev can request three different error reporting mechanisms from the Control Panel: • If a memory error has occured, then, after the cdev has safely shut itself down, it may request the Control Panel to issue an out-of-memory error message and gray out (paint over with the background pattern) the cdev area of the Control Panel window. It will remain grayed until another cdev is selected. The Control Panel window itself is not closed since other cdevs may still be able to function in the environment. • If a resource error is detected, the cdev may request that a can’t-find-needed-resource error message be issued. • The cdev may display its own error message and then call on the Control Panel to gray its area. The Control Panel uses the cdevValue parameter to send status information to the cdev, and a proper cdev uses its function value to send information back to the Control Panel. In the absence of errors, the same value passes back and forth: the Control Panel puts the last function value it received into cdevValue when it calls the cdev; the cdev returns the value it finds there as the function value. The cdev may want to keep a handle to its own storage, in which case passing it as the function value ensures its availability, since the Control Panel will pass it back in cdevValue at the next call. Four constants have been defined for this cdev/Control Panel communication: CONST cdevUnset = 3; {initial value passed in cdevValue} cdevGenErr = -1; {generic cdev error} cdevMemErr = 0; {insufficient memory for cdev execution} cdevResErr = 1; {missing resource needed by cdev} After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until an error occurs or the cdev uses its function value as a handle, cdevUnset is passed back and forth. If the cdev encounters an error, it should dispose of all handles and pointers it has set up, strip the stack back to the same position as a normal exit, and return one of the three error codes as the function result. The Control Panel will respond as follows: Function Message to Control Panel Action Result Control Panel cdevGenErr The cdev has encountered an Gray out the cdev’s area, error from which it cannot send a 0 in cdevValue in recover, but do not put up succeeding cdev calls an error dialog. cdevMemErr The cdev has determined that Gray out cdev’s area, put there is not enough memory to up error dialog, send a 0 execute; please put up a in cdevValue in succeeding memory error dialog. cdev calls. cdevResErr The cdev can’t find a needed Gray out cdev’s area, put resource; please put up a up error dialog, send a 0 resource error dialog. in cdevValue in succeeding cdev calls. all other values, No error conditions. Send the value back in either handles cdevValue. or cdevUnset The cdev code should check cdevValue at entry. A 0 means that the Control Panel has responded to a cdev error message by shutting down the cdev and displaying an error dialog if one was requested. The cdev should immediately exit. Once the Control Panel has responded to an error message from a cdev it will no longer respond to any return values until another cdev is launched. æKY keyEvtMsg æFp Devices.p æT CONST æD keyEvtMsg = 9; {keyboard event} æC »CDEV ERROR CHECKING _______________________________________________________________________________ Because a desk accessory may be called into many strange and wonderful situations, careful attention must be paid to error checking. The two most common error conditions are missing resources and lack of memory. Some error reporting and recovery facilities have been provided in the Control Panel to help with errors encountered in a cdev. Because the Control Panel has no direct information about the cdev, the cdev’s code must be able to detect and recover from error conditions on its own. If the recovery cannot be effected the cdev must dispose of any memory it has allocated, and exit back to the Control Panel with an error code. Following a shutdown, the Control Panel can help report the error condition to the user and prevent accidental reentry into the cdev that might result from such things as an update event. A cdev can request three different error reporting mechanisms from the Control Panel: • If a memory error has occured, then, after the cdev has safely shut itself down, it may request the Control Panel to issue an out-of-memory error message and gray out (paint over with the background pattern) the cdev area of the Control Panel window. It will remain grayed until another cdev is selected. The Control Panel window itself is not closed since other cdevs may still be able to function in the environment. • If a resource error is detected, the cdev may request that a can’t-find-needed-resource error message be issued. • The cdev may display its own error message and then call on the Control Panel to gray its area. The Control Panel uses the cdevValue parameter to send status information to the cdev, and a proper cdev uses its function value to send information back to the Control Panel. In the absence of errors, the same value passes back and forth: the Control Panel puts the last function value it received into cdevValue when it calls the cdev; the cdev returns the value it finds there as the function value. The cdev may want to keep a handle to its own storage, in which case passing it as the function value ensures its availability, since the Control Panel will pass it back in cdevValue at the next call. Four constants have been defined for this cdev/Control Panel communication: CONST cdevUnset = 3; {initial value passed in cdevValue} cdevGenErr = -1; {generic cdev error} cdevMemErr = 0; {insufficient memory for cdev execution} cdevResErr = 1; {missing resource needed by cdev} After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until an error occurs or the cdev uses its function value as a handle, cdevUnset is passed back and forth. If the cdev encounters an error, it should dispose of all handles and pointers it has set up, strip the stack back to the same position as a normal exit, and return one of the three error codes as the function result. The Control Panel will respond as follows: Function Message to Control Panel Action Result Control Panel cdevGenErr The cdev has encountered an Gray out the cdev’s area, error from which it cannot send a 0 in cdevValue in recover, but do not put up succeeding cdev calls an error dialog. cdevMemErr The cdev has determined that Gray out cdev’s area, put there is not enough memory to up error dialog, send a 0 execute; please put up a in cdevValue in succeeding memory error dialog. cdev calls. cdevResErr The cdev can’t find a needed Gray out cdev’s area, put resource; please put up a up error dialog, send a 0 resource error dialog. in cdevValue in succeeding cdev calls. all other values, No error conditions. Send the value back in either handles cdevValue. or cdevUnset The cdev code should check cdevValue at entry. A 0 means that the Control Panel has responded to a cdev error message by shutting down the cdev and displaying an error dialog if one was requested. The cdev should immediately exit. Once the Control Panel has responded to an error message from a cdev it will no longer respond to any return values until another cdev is launched. æKY superMsg æFp Devices.p æT CONST æD superMsg = 10; {show superuser controls} æC »CDEV ERROR CHECKING _______________________________________________________________________________ Because a desk accessory may be called into many strange and wonderful situations, careful attention must be paid to error checking. The two most common error conditions are missing resources and lack of memory. Some error reporting and recovery facilities have been provided in the Control Panel to help with errors encountered in a cdev. Because the Control Panel has no direct information about the cdev, the cdev’s code must be able to detect and recover from error conditions on its own. If the recovery cannot be effected the cdev must dispose of any memory it has allocated, and exit back to the Control Panel with an error code. Following a shutdown, the Control Panel can help report the error condition to the user and prevent accidental reentry into the cdev that might result from such things as an update event. A cdev can request three different error reporting mechanisms from the Control Panel: • If a memory error has occured, then, after the cdev has safely shut itself down, it may request the Control Panel to issue an out-of-memory error message and gray out (paint over with the background pattern) the cdev area of the Control Panel window. It will remain grayed until another cdev is selected. The Control Panel window itself is not closed since other cdevs may still be able to function in the environment. • If a resource error is detected, the cdev may request that a can’t-find-needed-resource error message be issued. • The cdev may display its own error message and then call on the Control Panel to gray its area. The Control Panel uses the cdevValue parameter to send status information to the cdev, and a proper cdev uses its function value to send information back to the Control Panel. In the absence of errors, the same value passes back and forth: the Control Panel puts the last function value it received into cdevValue when it calls the cdev; the cdev returns the value it finds there as the function value. The cdev may want to keep a handle to its own storage, in which case passing it as the function value ensures its availability, since the Control Panel will pass it back in cdevValue at the next call. Four constants have been defined for this cdev/Control Panel communication: CONST cdevUnset = 3; {initial value passed in cdevValue} cdevGenErr = -1; {generic cdev error} cdevMemErr = 0; {insufficient memory for cdev execution} cdevResErr = 1; {missing resource needed by cdev} After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until an error occurs or the cdev uses its function value as a handle, cdevUnset is passed back and forth. If the cdev encounters an error, it should dispose of all handles and pointers it has set up, strip the stack back to the same position as a normal exit, and return one of the three error codes as the function result. The Control Panel will respond as follows: Function Message to Control Panel Action Result Control Panel cdevGenErr The cdev has encountered an Gray out the cdev’s area, error from which it cannot send a 0 in cdevValue in recover, but do not put up succeeding cdev calls an error dialog. cdevMemErr The cdev has determined that Gray out cdev’s area, put there is not enough memory to up error dialog, send a 0 execute; please put up a in cdevValue in succeeding memory error dialog. cdev calls. cdevResErr The cdev can’t find a needed Gray out cdev’s area, put resource; please put up a up error dialog, send a 0 resource error dialog. in cdevValue in succeeding cdev calls. all other values, No error conditions. Send the value back in either handles cdevValue. or cdevUnset The cdev code should check cdevValue at entry. A 0 means that the Control Panel has responded to a cdev error message by shutting down the cdev and displaying an error dialog if one was requested. The cdev should immediately exit. Once the Control Panel has responded to an error message from a cdev it will no longer respond to any return values until another cdev is launched. æKY normalMsg æFp Devices.p æT CONST æD normalMsg = 11; {show only normal controls} æC »CDEV ERROR CHECKING _______________________________________________________________________________ Because a desk accessory may be called into many strange and wonderful situations, careful attention must be paid to error checking. The two most common error conditions are missing resources and lack of memory. Some error reporting and recovery facilities have been provided in the Control Panel to help with errors encountered in a cdev. Because the Control Panel has no direct information about the cdev, the cdev’s code must be able to detect and recover from error conditions on its own. If the recovery cannot be effected the cdev must dispose of any memory it has allocated, and exit back to the Control Panel with an error code. Following a shutdown, the Control Panel can help report the error condition to the user and prevent accidental reentry into the cdev that might result from such things as an update event. A cdev can request three different error reporting mechanisms from the Control Panel: • If a memory error has occured, then, after the cdev has safely shut itself down, it may request the Control Panel to issue an out-of-memory error message and gray out (paint over with the background pattern) the cdev area of the Control Panel window. It will remain grayed until another cdev is selected. The Control Panel window itself is not closed since other cdevs may still be able to function in the environment. • If a resource error is detected, the cdev may request that a can’t-find-needed-resource error message be issued. • The cdev may display its own error message and then call on the Control Panel to gray its area. The Control Panel uses the cdevValue parameter to send status information to the cdev, and a proper cdev uses its function value to send information back to the Control Panel. In the absence of errors, the same value passes back and forth: the Control Panel puts the last function value it received into cdevValue when it calls the cdev; the cdev returns the value it finds there as the function value. The cdev may want to keep a handle to its own storage, in which case passing it as the function value ensures its availability, since the Control Panel will pass it back in cdevValue at the next call. Four constants have been defined for this cdev/Control Panel communication: CONST cdevUnset = 3; {initial value passed in cdevValue} cdevGenErr = -1; {generic cdev error} cdevMemErr = 0; {insufficient memory for cdev execution} cdevResErr = 1; {missing resource needed by cdev} After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until an error occurs or the cdev uses its function value as a handle, cdevUnset is passed back and forth. If the cdev encounters an error, it should dispose of all handles and pointers it has set up, strip the stack back to the same position as a normal exit, and return one of the three error codes as the function result. The Control Panel will respond as follows: Function Message to Control Panel Action Result Control Panel cdevGenErr The cdev has encountered an Gray out the cdev’s area, error from which it cannot send a 0 in cdevValue in recover, but do not put up succeeding cdev calls an error dialog. cdevMemErr The cdev has determined that Gray out cdev’s area, put there is not enough memory to up error dialog, send a 0 execute; please put up a in cdevValue in succeeding memory error dialog. cdev calls. cdevResErr The cdev can’t find a needed Gray out cdev’s area, put resource; please put up a up error dialog, send a 0 resource error dialog. in cdevValue in succeeding cdev calls. all other values, No error conditions. Send the value back in either handles cdevValue. or cdevUnset The cdev code should check cdevValue at entry. A 0 means that the Control Panel has responded to a cdev error message by shutting down the cdev and displaying an error dialog if one was requested. The cdev should immediately exit. Once the Control Panel has responded to an error message from a cdev it will no longer respond to any return values until another cdev is launched. æKY startupMsg æFp Devices.p æT CONST æD startupMsg = 12; {code has been loaded} æC »CDEV ERROR CHECKING _______________________________________________________________________________ Because a desk accessory may be called into many strange and wonderful situations, careful attention must be paid to error checking. The two most common error conditions are missing resources and lack of memory. Some error reporting and recovery facilities have been provided in the Control Panel to help with errors encountered in a cdev. Because the Control Panel has no direct information about the cdev, the cdev’s code must be able to detect and recover from error conditions on its own. If the recovery cannot be effected the cdev must dispose of any memory it has allocated, and exit back to the Control Panel with an error code. Following a shutdown, the Control Panel can help report the error condition to the user and prevent accidental reentry into the cdev that might result from such things as an update event. A cdev can request three different error reporting mechanisms from the Control Panel: • If a memory error has occured, then, after the cdev has safely shut itself down, it may request the Control Panel to issue an out-of-memory error message and gray out (paint over with the background pattern) the cdev area of the Control Panel window. It will remain grayed until another cdev is selected. The Control Panel window itself is not closed since other cdevs may still be able to function in the environment. • If a resource error is detected, the cdev may request that a can’t-find-needed-resource error message be issued. • The cdev may display its own error message and then call on the Control Panel to gray its area. The Control Panel uses the cdevValue parameter to send status information to the cdev, and a proper cdev uses its function value to send information back to the Control Panel. In the absence of errors, the same value passes back and forth: the Control Panel puts the last function value it received into cdevValue when it calls the cdev; the cdev returns the value it finds there as the function value. The cdev may want to keep a handle to its own storage, in which case passing it as the function value ensures its availability, since the Control Panel will pass it back in cdevValue at the next call. Four constants have been defined for this cdev/Control Panel communication: CONST cdevUnset = 3; {initial value passed in cdevValue} cdevGenErr = -1; {generic cdev error} cdevMemErr = 0; {insufficient memory for cdev execution} cdevResErr = 1; {missing resource needed by cdev} After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until an error occurs or the cdev uses its function value as a handle, cdevUnset is passed back and forth. If the cdev encounters an error, it should dispose of all handles and pointers it has set up, strip the stack back to the same position as a normal exit, and return one of the three error codes as the function result. The Control Panel will respond as follows: Function Message to Control Panel Action Result Control Panel cdevGenErr The cdev has encountered an Gray out the cdev’s area, error from which it cannot send a 0 in cdevValue in recover, but do not put up succeeding cdev calls an error dialog. cdevMemErr The cdev has determined that Gray out cdev’s area, put there is not enough memory to up error dialog, send a 0 execute; please put up a in cdevValue in succeeding memory error dialog. cdev calls. cdevResErr The cdev can’t find a needed Gray out cdev’s area, put resource; please put up a up error dialog, send a 0 resource error dialog. in cdevValue in succeeding cdev calls. all other values, No error conditions. Send the value back in either handles cdevValue. or cdevUnset The cdev code should check cdevValue at entry. A 0 means that the Control Panel has responded to a cdev error message by shutting down the cdev and displaying an error dialog if one was requested. The cdev should immediately exit. Once the Control Panel has responded to an error message from a cdev it will no longer respond to any return values until another cdev is launched. æKY DCtlEntry DCtlPtr DCtlHandle æFp Devices.p æT RECORD æD DCtlPtr = ^DCtlEntry; DCtlHandle = ^DCtlPtr; DCtlEntry = RECORD dCtlDriver: Ptr; dCtlFlags: INTEGER; dCtlQHdr: QHdr; dCtlPosition: LONGINT; dCtlStorage: Handle; dCtlRefNum: INTEGER; dCtlCurTicks: LONGINT; dCtlWindow: WindowPtr; dCtlDelay: INTEGER; dCtlEMask: INTEGER; dCtlMenu: INTEGER; END; æC »Device Control Entry The first time a driver is opened, information about it is read into a structure in memory called a device control entry. A device control entry contains the header of the driver’s I/O queue, the location of the driver’s routines, and other information. A device control entry is a 40-byte relocatable block located in the system heap. It’s locked while the driver is open, and unlocked while the driver is closed. Most of the data in the device control entry is stored and accessed only by the Device Manager, but in some cases the driver itself must store into it. The structure of a device control entry is shown below; note that the first four words of the driver are copied into the dCtlFlags, dCtlDelay, dCtlEMask, and dCtlMenu fields. TYPE DCtlEntry = RECORD dCtlDriver: Ptr; {pointer to ROM driver or } { handle to RAM driver} dCtlFlags: INTEGER; {flags} dCtlQHdr: QHdr; {driver I/O queue header} dCtlPosition: LONGINT; {byte position used by Read } { and Write calls} dCtlStorage: Handle; {handle to RAM driver's } { private storage} dCtlRefNum: INTEGER; {driver reference number} dCtlCurTicks: LONGINT; {used internally} dCtlWindow: WindowPtr; {pointer to driver's window} dCtlDelay: INTEGER; {number of ticks between } { periodic actions} dCtlEMask: INTEGER; {desk accessory event mask} dCtlMenu: INTEGER {menu ID of menu associated { with driver} END; DCtlPtr = ^DCtlEntry; DCtlHandle = ^DCtlPtr; The low-order byte of the dCtlFlags word contains the following flags: Bit number Meaning 5 Set if driver is open 6 Set if driver is RAM-based 7 Set if driver is currently executing Assembly-language note: These flags can be accessed with the global constants dOpened, dRAMBased, and drvrActive. The high-order byte of the dCtlFlags word contains flags copied from the drvrFlags word of the driver, as described above. DCtlQHdr contains the header of the driver’s I/O queue (described below). DCtlPosition is used only by drivers of block devices, and indicates the current source or destination position of a Read or Write call. The position is given as a number of bytes beyond the physical beginning of the medium used by the device. For example, if one logical block of data has just been read from a 3 1/2-inch disk via the Disk Driver, dCtlPosition will be 512. ROM drivers generally use locations in low memory for their local storage. RAM drivers may reserve memory within their code space, or allocate a relocatable block and keep a handle to it in dCtlStorage (if the block resides in the application heap, its handle will be set to NIL when the heap is reinitialized). You can get a handle to a driver’s device control entry by calling the Device Manager function GetDCtlEntry. æKY AuxDCE AuxDCEPtr AuxDCEHandle æFp Devices.p æT RECORD æD AuxDCEPtr = ^AuxDCE; AuxDCEHandle = ^AuxDCEPtr; AuxDCE = PACKED RECORD dCtlDriver: Ptr; dCtlFlags: INTEGER; dCtlQHdr: QHdr; dCtlPosition: LONGINT; dCtlStorage: Handle; dCtlRefNum: INTEGER; dCtlCurTicks: LONGINT; dCtlWindow: GrafPtr; dCtlDelay: INTEGER; dCtlEMask: INTEGER; dCtlMenu: INTEGER; dCtlSlot: Byte; dCtlSlotId: Byte; dCtlDevBase: LONGINT; dCtlOwner: Ptr; dCtlExtDev: Byte; fillByte: Byte; END; æC æKY GetDCtlEntry æFp Devices.p æT FUNCTION æD FUNCTION GetDCtlEntry(refNum: INTEGER): DCtlHandle; æDT myVariable := GetDCtlEntry(refNum); æMM æRT 71 æRI II-190 æC [Not in ROM] GetDCtlEntry returns a handle to the device control entry of the device driver having the reference number refNum. Assembly-language note: You can get a handle to a driver’s device control entry from the unit table, as described below. æKY SetChooserAlert æFp Devices.p æT FUNCTION æD FUNCTION SetChooserAlert(f: BOOLEAN): BOOLEAN; æDT myVariable := SetChooserAlert(f); æRI V-431 æC f f is true, the Chooser will put up the page setup alert; if f is false it won’t. SetChooserAlert returns the original alert state. The application should restore the original alert state when it exits. _____________________________________________________________________________________ Assembly-language note: If the psAlert bit of the low-memory global HiliteMode is 0 then no page setup alert will be generated. Applications that set or clear this bit must be sure not to affect any other bits in the byte and to restore the bit as they leave. HiliteMode equ $938 psAlert equ 6 bclr #psAlert,HiliteMode bset #psAlert,HiliteMode _____________________________________________________________________________________ æKY OpenDriver æFp Devices.p æT FUNCTION æD FUNCTION OpenDriver(name: Str255;VAR drvrRefNum: INTEGER): OSErr; æDT myVariable := OpenDriver(name,drvrRefNum); æMM æRI II-178, N14-2 æC [Not in ROM] OpenDriver opens the device driver specified by name and returns its reference number in refNum. Result codes noErr No error badUnitErr Bad reference number dInstErr Couldn’t find driver in resource file openErr Driver can’t perform the requested reading or writing unitEmptyErr Bad reference number æKY CloseDriver æFp Devices.p æT FUNCTION æD FUNCTION CloseDriver(refNum: INTEGER): OSErr; æDT myVariable := CloseDriver(refNum); æRI II-178 æC [Not in ROM] CloseDriver closes the device driver having the reference number refNum. Any pending I/O is completed, and the memory used by the driver is released. Warning: Before using this command to close a particular driver, refer to the chapter describing the driver for the consequences of closing it. Result codes noErr No error badUnitErr Bad reference number dRemoveErr Attempt to remove an open driver unitEmptyErr Bad reference number æKY Control æFp Devices.p æT FUNCTION æD FUNCTION Control(refNum: INTEGER;csCode: INTEGER;csParamPtr: Ptr): OSErr; æDT myVariable := Control(refNum,csCode,csParamPtr); æMM æRI II-186 æC [Not in ROM] Control sends control information to the device driver having the reference number refNum. The type of information sent is specified by csCode, and the information itself is pointed to by csParamPtr. The values passed in csCode and pointed to by csParamPtr depend on the driver being called. Result codes noErr No error badUnitErr Bad reference number notOpenErr Driver isn’t open unitEmptyErr Bad reference number controlErr Driver can’t respond to this Control call æKY Status æFp Devices.p æT FUNCTION æD FUNCTION Status(refNum: INTEGER;csCode: INTEGER;csParamPtr: Ptr): OSErr; æDT myVariable := Status(refNum,csCode,csParamPtr); æMM æRI II-186 æC [Not in ROM] Status returns status information about the device driver having the reference number refNum. The type of information returned is specified by csCode, and the information itself is pointed to by csParamPtr. The values passed in csCode and pointed to by csParamPtr depend on the driver being called. Result codes noErr No error badUnitErr Bad reference number notOpenErr Driver isn’t open unitEmptyErr Bad reference number statusErr Driver can’t respond to this Status call æKY KillIO æFp Devices.p æT FUNCTION æD FUNCTION KillIO(refNum: INTEGER): OSErr; æDT myVariable := KillIO(refNum); æRI II-179 æC [Not in ROM] KillIO terminates all current and pending I/O with the device driver having the reference number refNum. Result codes noErr No error badUnitErr Bad reference number unitEmptyErr Bad reference number æKY PBControl æFp Devices.p æT FUNCTION æD FUNCTION PBControl(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBControl(paramBlock,async); æMM æRI II-186 æC Trap macro _Control Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 22 ioVRefNum word --> 24 ioRefNum word --> 26 csCode word --> 28 csParam record PBControl sends control information to the device driver having the reference number ioRefNum; the drive number, if any, is specified by ioVRefNum. The type of information sent is specified by csCode, and the information itself begins at csParam. The values passed in csCode and csParam depend on the driver being called. Result codes noErr No error badUnitErr Bad reference number notOpenErr Driver isn’t open unitEmptyErr Bad reference number controlErr Driver can’t respond to this Control call æKY PBControlSync æFp Devices.p æT FUNCTION æTN A004 æD FUNCTION PBControlSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A004,$3E80; æDT myVariable := PBControlSync(paramBlock,A0); æMM æRI II-186 æC Trap macro _Control Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 22 ioVRefNum word --> 24 ioRefNum word --> 26 csCode word --> 28 csParam record PBControl sends control information to the device driver having the reference number ioRefNum; the drive number, if any, is specified by ioVRefNum. The type of information sent is specified by csCode, and the information itself begins at csParam. The values passed in csCode and csParam depend on the driver being called. Result codes noErr No error badUnitErr Bad reference number notOpenErr Driver isn’t open unitEmptyErr Bad reference number controlErr Driver can’t respond to this Control call æKY PBControlAsync æFp Devices.p æT FUNCTION æTN A404 æD FUNCTION PBControlAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A404,$3E80; æDT myVariable := PBControlAsync(paramBlock,A0); æMM æRI II-186 æC Trap macro _Control Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 22 ioVRefNum word --> 24 ioRefNum word --> 26 csCode word --> 28 csParam record PBControl sends control information to the device driver having the reference number ioRefNum; the drive number, if any, is specified by ioVRefNum. The type of information sent is specified by csCode, and the information itself begins at csParam. The values passed in csCode and csParam depend on the driver being called. Result codes noErr No error badUnitErr Bad reference number notOpenErr Driver isn’t open unitEmptyErr Bad reference number controlErr Driver can’t respond to this Control call æKY PBStatus æFp Devices.p æT FUNCTION æD FUNCTION PBStatus(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBStatus(paramBlock,async); æMM æRI II-186 æC Trap macro _Status Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 22 ioVRefNum word --> 24 ioRefNum word --> 26 csCode word <-- 28 csParam record PBStatus returns status information about the device driver having the reference number ioRefNum; the drive number, if any, is specified by ioVRefNum. The type of information returned is specified by csCode, and the information itself begins at csParam. The values passed in csCode and csParam depend on the driver being called. Result codes noErr No error badUnitErr Bad reference number notOpenErr Driver isn’t open unitEmptyErr Bad reference number statusErr Driver can’t respond to this Status call æKY PBStatusSync æFp Devices.p æT FUNCTION æTN A005 æD FUNCTION PBStatusSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A005,$3E80; æDT myVariable := PBStatusSync(paramBlock,A0); æMM æRI II-186 æC Trap macro _Status Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 22 ioVRefNum word --> 24 ioRefNum word --> 26 csCode word <-- 28 csParam record PBStatus returns status information about the device driver having the reference number ioRefNum; the drive number, if any, is specified by ioVRefNum. The type of information returned is specified by csCode, and the information itself begins at csParam. The values passed in csCode and csParam depend on the driver being called. Result codes noErr No error badUnitErr Bad reference number notOpenErr Driver isn’t open unitEmptyErr Bad reference number statusErr Driver can’t respond to this Status call æKY PBStatusAsync æFp Devices.p æT FUNCTION æTN A405 æD FUNCTION PBStatusAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A405,$3E80; æDT myVariable := PBStatusAsync(paramBlock,A0); æMM æRI II-186 æC Trap macro _Status Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 22 ioVRefNum word --> 24 ioRefNum word --> 26 csCode word <-- 28 csParam record PBStatus returns status information about the device driver having the reference number ioRefNum; the drive number, if any, is specified by ioVRefNum. The type of information returned is specified by csCode, and the information itself begins at csParam. The values passed in csCode and csParam depend on the driver being called. Result codes noErr No error badUnitErr Bad reference number notOpenErr Driver isn’t open unitEmptyErr Bad reference number statusErr Driver can’t respond to this Status call æKY PBKillIO æFp Devices.p æT FUNCTION æD FUNCTION PBKillIO(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBKillIO(paramBlock,async); æRI II-187 æC Trap macro _KillIO Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word PBKillIO stops any current I/O request being processed, and removes all pending I/O requests from the I/O queue of the device driver having the reference number ioRefNum. The completion routine of each pending I/O request is called, with the ioResult field of each request equal to the result code abortErr. Result codes noErr No error badUnitErr Bad reference number unitEmptyErr Bad reference number æKY PBKillIOSync æFp Devices.p æT FUNCTION æTN A006 æD FUNCTION PBKillIOSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A006,$3E80; æDT myVariable := PBKillIOSync(paramBlock,A0); æRI II-187 æC Trap macro _KillIO Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word PBKillIO stops any current I/O request being processed, and removes all pending I/O requests from the I/O queue of the device driver having the reference number ioRefNum. The completion routine of each pending I/O request is called, with the ioResult field of each request equal to the result code abortErr. Result codes noErr No error badUnitErr Bad reference number unitEmptyErr Bad reference number æKY PBKillIOAsync æFp Devices.p æT FUNCTION æTN A406 æD FUNCTION PBKillIOAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A406,$3E80; æDT myVariable := PBKillIOAsync(paramBlock,A0); æRI II-187 æC Trap macro _KillIO Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word PBKillIO stops any current I/O request being processed, and removes all pending I/O requests from the I/O queue of the device driver having the reference number ioRefNum. The completion routine of each pending I/O request is called, with the ioResult field of each request equal to the result code abortErr. Result codes noErr No error badUnitErr Bad reference number unitEmptyErr Bad reference number æKY Dialogs.p æKL Alert CautionAlert CloseDialog CouldAlert CouldDialog DialogSelect DisposDialog DisposeDialog DlgCopy DlgCut DlgDelete DlgPaste DrawDialog ErrorSound FindDItem FreeAlert FreeDialog GetAlrtStage GetDItem GetIText GetNewDialog HideDItem InitDialogs IsDialogEvent ModalDialog NewCDialog NewDialog NoteAlert ParamText ResetAlrtStage SelIText SetDAFont SetDItem SetIText ShowDItem StopAlert UpdateDialog UpdtDialog AlertTemplate AlertTHndl AlertTPtr btnCtrl cancel cautionIcon chkCtrl ctrlItem DialogPeek DialogPtr DialogRecord DialogTemplate DialogTHndl DialogTPtr editText iconItem itemDisable ModalFilterProcPtr noteIcon ok picItem radCtrl resCtrl ResumeProcPtr SoundProcPtr StageList statText stopIcon userItem æKY ctrlItem æFp Dialogs.p æT CONST æD ctrlItem = 4; æC æKY btnCtrl æFp Dialogs.p æT CONST æD btnCtrl = 0; æC æKY chkCtrl æFp Dialogs.p æT CONST æD chkCtrl = 1; æC æKY radCtrl æFp Dialogs.p æT CONST æD radCtrl = 2; æC æKY resCtrl æFp Dialogs.p æT CONST æD resCtrl = 3; æC æKY statText æFp Dialogs.p æT CONST æD statText = 8; æC æKY editText æFp Dialogs.p æT CONST æD editText = 16; æC æKY iconItem æFp Dialogs.p æT CONST æD iconItem = 32; æC æKY picItem æFp Dialogs.p æT CONST æD picItem = 64; æC æKY userItem æFp Dialogs.p æT CONST æD userItem = 0; æC æKY itemDisable æFp Dialogs.p æT CONST æD itemDisable = 128; æC æKY ok æFp Dialogs.p æT CONST æD ok = 1; æC æKY cancel æFp Dialogs.p æT CONST æD cancel = 2; æC æKY stopIcon æFp Dialogs.p æT CONST æD stopIcon = 0; æC æKY noteIcon æFp Dialogs.p æT CONST æD noteIcon = 1; æC æKY cautionIcon æFp Dialogs.p æT CONST æD cautionIcon = 2; æC æKY ResumeProcPtr æFp Dialogs.p æT TYPE æD ResumeProcPtr = ProcPtr; { PROCEDURE Resume; } æC æKY SoundProcPtr æFp Dialogs.p æT TYPE æD SoundProcPtr = ProcPtr; { PROCEDURE DoSound; } æC æKY ModalFilterProcPtr æFp Dialogs.p æT TYPE æD ModalFilterProcPtr = ProcPtr; { FUNCTION Filter(theDialog: DialogPtr; VAR theEvent: EventRecord; VAR itemHit: INTEGER): BOOLEAN; } æC æKY DialogRecord DialogPeek æFp Dialogs.p æT RECORD æD DialogPeek = ^DialogRecord; DialogRecord = RECORD window: WindowRecord; items: Handle; textH: TEHandle; editField: INTEGER; editOpen: INTEGER; aDefItem: INTEGER; END; æC »The DialogRecord Data Type For those who want to know more about the data structure of a dialog record, the exact structure is given here. TYPE DialogRecord = RECORD window: WindowRecord; {dialog window} items: Handle; {item list} textH: TEHandle; {current editText item} editField: INTEGER; {editText item number minus 1} editOpen: INTEGER; {used internally} aDefItem: INTEGER {default button item number} END; The window field contains the window record for the dialog window. The items field contains a handle to the item list used for the dialog. (Remember that after reading an item list from a resource file, the Dialog Manager makes a copy of it and uses that copy.) Note: To get or change information about an item in a dialog, you pass the dialog pointer and the item number to a Dialog Manager procedure. You’ll never access information directly through the handle to the item list. The Dialog Manager uses the next three fields when there are one or more editText items in the dialog. If there’s more than one such item, these fields apply to the one that currently is selected or displays the insertion point. The textH field contains the handle to the edit record used by TextEdit. EditField is 1 less than the item number of the current editText item, or –1 if there’s no editText item in the dialog. The editOpen field is used internally by the Dialog Manager. Note: Actually, a single edit record is shared by all editText items; any changes you make to it will apply to all such items. See the TextEdit chapter for details about what kinds of changes you can make. The aDefItem field is used for modal dialogs and alerts, which are treated internally as special modal dialogs. It contains the item number of the default button. The default button for a modal dialog is the first item in the item list, so this field contains 1 for modal dialogs. The default button for an alert is specified in the alert template; see the following section for more information. æKY DialogPtr æFp Dialogs.p æT RECORD æD DialogPtr = WindowPtr; æC »Dialog Pointers There are two types of dialog pointer, DialogPtr and DialogPeek, analogous to the window pointer types WindowPtr and WindowPeek. Most programmers will only need to use DialogPtr. The Dialog Manager defines the following type of dialog pointer: TYPE DialogPtr = WindowPtr; It can do this because the first field of a dialog record contains the window record for the dialog window. This type of pointer can be used to access fields of the window record or can be passed to Window Manager routines that expect window pointers as parameters. Since the WindowPtr data type is itself defined as GrafPtr, this type of dialog pointer can also be used to access fields of the dialog window’s grafPort or passed to QuickDraw routines that expect pointers to grafPorts as parameters. For programmers who want to access dialog record fields beyond the window record, the Dialog Manager also defines the following type of dialog pointer: TYPE DialogPeek = ^DialogRecord; Assembly-language note: From assembly language, of course, there’s no type checking on pointers, and the two types of pointer are equal. _______________________________________________________________________________ »The DialogRecord Data Type For those who want to know more about the data structure of a dialog record, the exact structure is given here. TYPE DialogRecord = RECORD window: WindowRecord; {dialog window} items: Handle; {item list} textH: TEHandle; {current editText item} editField: INTEGER; {editText item number minus 1} editOpen: INTEGER; {used internally} aDefItem: INTEGER {default button item number} END; The window field contains the window record for the dialog window. The items field contains a handle to the item list used for the dialog. (Remember that after reading an item list from a resource file, the Dialog Manager makes a copy of it and uses that copy.) Note: To get or change information about an item in a dialog, you pass the dialog pointer and the item number to a Dialog Manager procedure. You’ll never access information directly through the handle to the item list. The Dialog Manager uses the next three fields when there are one or more editText items in the dialog. If there’s more than one such item, these fields apply to the one that currently is selected or displays the insertion point. The textH field contains the handle to the edit record used by TextEdit. EditField is 1 less than the item number of the current editText item, or –1 if there’s no editText item in the dialog. The editOpen field is used internally by the Dialog Manager. Note: Actually, a single edit record is shared by all editText items; any changes you make to it will apply to all such items. See the TextEdit chapter for details about what kinds of changes you can make. The aDefItem field is used for modal dialogs and alerts, which are treated internally as special modal dialogs. It contains the item number of the default button. The default button for a modal dialog is the first item in the item list, so this field contains 1 for modal dialogs. The default button for an alert is specified in the alert template; see the following section for more information. _______________________________________________________________________________ »THE DRAWING ENVIRONMENT: GRAFPORT _______________________________________________________________________________ A grafPort is a complete drawing environment that defines where and how graphic operations will take place. You can have many grafPorts open at once, and each one will have its own coordinate system, drawing pattern, background pattern, pen size and location, character font and style, and bit map in which drawing takes place. You can instantly switch from one port to another. GrafPorts are the structures upon which a program builds windows, which are fundamental to the Macintosh “overlapping windows” user interface. Besides being used for windows on the screen, grafPorts are used for printing and for off-screen drawing. A grafPort is defined as follows: TYPE GrafPtr = ^GrafPort; GrafPort = RECORD device: INTEGER; {device-specific information} portBits: BitMap; {grafPort's bit map} portRect: Rect; {grafPort's rectangle} visRgn: RgnHandle; {visible region} clipRgn: RgnHandle; {clipping region} bkPat: Pattern; {background pattern} fillPat: Pattern; {fill pattern} pnLoc: Point; {pen location} pnSize: Point; {pen size} pnMode: INTEGER; {pen's transfer mode} pnPat: Pattern; {pen pattern} pnVis: INTEGER; {pen visibility} txFont: INTEGER; {font number for text} txFace: Style; {text's character style} txMode: INTEGER; {text's transfer mode} txSize: INTEGER; {font size for text} spExtra: Fixed; {extra space} fgColor: LONGINT; {foreground color} bkColor: LONGINT; {background color} colrBit: INTEGER; {color bit} patStretch: INTEGER; {used internally} picSave: Handle; {picture being saved} rgnSave: Handle; {region being saved} polySave: Handle; {polygon being saved} grafProcs: QDProcsPtr {low-level drawing routines} END; Note that picSave is a Handle used internally by QuickDraw while it is saving a picture, and rgnSave and polySave are used by QuickDraw as flags; they are set to “1” when the corresponding action is taking place. All QuickDraw operations refer to grafPorts via grafPtrs. (For historical reasons, grafPort is one of the few objects in the Macintosh system software that’s referred to by a pointer rather than a handle.) Warning: You can access all fields and subfields of a grafPort normally, but you should not store new values directly into them. QuickDraw has routines for altering all fields of a grafPort, and using these routines ensures that changing a grafPort produces no unusual side effects. The device field of a grafPort contains device-specific information that’s used by the Font Manager to achieve the best possible results when drawing text in the grafPort. There may be physical differences in the same logical font for different output devices, to ensure the highest-quality printing on the device being used. The default value of the device field is 0, for best results on output to the screen. For more information, see the Font Manager chapter. The portBits field is the bit map that points to the bit image to be used by the grafPort. The default bit map uses the entire screen as its bit image. The bit map may be changed to indicate a different structure in memory: All graphics routines work in exactly the same way regardless of whether their effects are visible on the screen. A program can, for example, prepare an image to be printed on a printer without ever displaying the image on the screen, or develop a picture in an off-screen bit map before transferring it to the screen. The portBits.bounds rectangle determines the coordinate system of the grafPort; all other coordinates in the grafPort are expressed in this system. The portRect field is a rectangle that defines a subset of the bit map that will be used for drawing: All drawing done by the application occurs inside the portRect. Its coordinates are in the coordinate system defined by the portBits.bounds rectangle. The portRect usually falls within the portBits.bounds rectangle, but it’s not required to do so. The portRect usually defines the “writable” interior area of a window, document, or other object on the screen. The visRgn field is manipulated by the Window Manager; you will normally never change a grafPort’s visRgn. It indicates the region of the grafPort that’s actually visible on the screen, that is, the part of the window that’s not covered by other windows. For example, if you move one window in front of another, the Window Manager logically removes the area of overlap from the visRgn of the window in back. When you draw into the back window, whatever’s being drawn is clipped to the visRgn so that it doesn’t run over onto the front window. The default visRgn is set to the portRect. The clipRgn is the grafPort’s clipping region, an arbitrary region that you can use to limit drawing to any region within the portRect. If, for example, you want to draw a half circle on the screen, you can set the clipRgn to half the square that would enclose the whole circle, and then draw the whole circle. Only the half within the clipRgn will actually be drawn in the grafPort. The default clipRgn is set arbitrarily large, you have full control over its setting; as a matter of recommended programming practice, it is advisable to make the default clipRgn rectangle smaller. Figure 10 illustrates a typical bit map (as defined by portBits), portRect, visRgn, and clipRgn. •••Refer to Figure 10.••• Figure 10–GrafPort Regions The bkPat and fillPat fields of a grafPort contain patterns used by certain QuickDraw routines. BkPat is the “background” pattern that’s used when an area is erased or when bits are scrolled out of it. When asked to fill an area with a specified pattern, QuickDraw stores the given pattern in the fillPat field and then calls a low-level drawing routine that gets the pattern from that field. The various graphic operations are discussed in detail later in the descriptions of individual QuickDraw routines. Of the next ten fields, the first five determine characteristics of the graphics pen and the last five determine characteristics of any text that may be drawn; these are described in separate sections below. The fgColor, bkColor, and colrBit fields contain values related to drawing in color. FgColor is the grafPort’s foreground color and bkColor is its background color. ColrBit tells the color imaging software which plane of the color picture to draw into. For more information, see “Drawing in Color” in the section “General Discussion of Drawing”. The patStretch field is used during output to a printer to expand patterns if necessary. The application should not change its value. The picSave, rgnSave, and polySave fields reflect the state of picture, region, and polygon definition, respectively. The application shouldn’t be concerned about exactly what information the handle, if any, leads to; you may, however, save the current value of rgnSave, set the field to NIL to disable the region definition, and later restore it to the saved value to resume the region definition. The picSave and polySave fields work similarly for pictures and polygons. Finally, the grafProcs field may point to a special data structure that the application stores into if it wants to customize QuickDraw drawing routines or use QuickDraw in other advanced, highly specialized ways (see “Customizing QuickDraw Operations”). If grafProcs is NIL, QuickDraw responds in the standard ways described in this chapter. _______________________________________________________________________________ »Pen Characteristics The pnLoc, pnSize, pnMode, pnPat, and pnVis fields of a grafPort deal with the graphics “pen”. Each grafPort has one and only one such pen, which is used for drawing lines, shapes, and text. The pen has four characteristics: a location, a size (height and width), a drawing mode, and a drawing pattern (see Figure 11). •••Refer to Figure 11.••• Figure 11–A Graphics Pen The pnLoc field specifies the point where QuickDraw will begin drawing the next line, shape, or character. It can be anywhere on the coordinate plane: There are no restrictions on the movement or placement of the pen. Remember that the pen location is a point in the grafPort’s coordinate system, not a pixel in a bit image. The top left corner of the pen is at the pen location; the pen hangs below and to the right of this point. The pen is rectangular in shape, and its width and height are specified by pnSize. The default size is a 1-by-1-bit square; the width and height can range from (0,0) to (30000,30000). If either the pen width or the pen height is less than 1, the pen will not draw. The pnMode and pnPat fields of a grafPort determine how the bits under the pen are affected when lines or shapes are drawn. The pnPat is a pattern that’s used like the “ink” in the pen. This pattern, like all other patterns drawn in the grafPort, is always aligned with the port’s coordinate system: The top left corner of the pattern is aligned with the top left corner of the portRect, so that adjacent areas of the same pattern will blend into a continuous, coordinated pattern. The pnMode field determines how the pen pattern is to affect what’s already in the bit image when lines or shapes are drawn. When the pen draws, QuickDraw first determines what bits in the bit image will be affected and finds their corresponding bits in the pattern. It then does a bit-by-bit comparison based on the pen mode, which specifies one of eight Boolean operations to perform. The resulting bit is stored into its proper place in the bit image. The pen modes are described under “Transfer Modes” in the section “General Discussion of Drawing”. The pnVis field determines the pen’s visibility, that is, whether it draws on the screen. For more information, see the descriptions of HidePen and ShowPen under “Pen and Line-Drawing Routines” in the “QuickDraw Routines” section. _______________________________________________________________________________ »Text Characteristics The txFont, txFace, txMode, txSize, and spExtra fields of a grafPort determine how text will be drawn—the font, style, and size of characters and how they will be placed in the bit image. QuickDraw can draw characters as quickly and easily as it draws lines and shapes, and in many prepared fonts. Font means the complete set of characters of one typeface. The characters may be drawn in any size and character style (that is, with stylistic variations such as bold, italic, and underline). Figure 12 shows two characters drawn by QuickDraw and some terms associated with drawing text. •••Refer to Figure 12.••• Figure 12–QuickDraw Characters Text is drawn with the base line positioned at the pen location. The txFont field is a font number that identifies the character font to be used in the grafPort. The font number 0 represents the system font. For more information about the system font, the other font numbers recognized by the Font Manager, and the construction, layout, and loading of fonts, see the Font Manager chapter. A character font is defined as a collection of images that make up the individual characters of the font. The characters can be of unequal widths, and they’re not restricted to their “cells”: The lower curl of a lowercase j, for example, can stretch back under the previous character (typographers call this kerning). A font can consist of up to 255 distinct characters, yet not all characters need to be defined in a single font. In addition, each font contains a missing symbol to be drawn in case of a request to draw a character that’s missing from the font. The txFace field controls the character style of the text with values from the set defined by the Style data type: TYPE StyleItem = (bold,italic,underline,outline,shadow,condense,extend); Style = SET OF StyleItem; Assembly-language note: In assembly language, this set is stored as a word whose low-order byte contains bits representing the style. The bit numbers are specified by the following global constants: boldBit .EQU 0 italicBit .EQU 1 ulineBit .EQU 2 outlineBit .EQU 3 shadowBit .EQU 5 extendBit .EQU 6 If all bits are 0, it represents the plain character style. You can apply stylistic variations either alone or in combination; Figure 13 illustrates some as applied to the Geneva font. Most combinations usually look good only for large font sizes. •••Refer to Figure 13.••• Figure 13–Stylistic Variations If you specify bold, each character is repeatedly drawn one bit to the right an appropriate number of times for extra thickness. Italic adds an italic slant to the characters. Character bits above the base line are skewed right; bits below the base line are skewed left. Underline draws a line below the base line of the characters. If part of a character descends below the base line (as “y” in Figure 13), the underline isn’t drawn through the pixel on either side of the descending part. Outline makes a hollow, outlined character rather than a solid one. Shadow also makes an outlined character, but the outline is thickened below and to the right of the character to achieve the effect of a shadow. If you specify bold along with outline or shadow, the hollow part of the character is widened. Condense and extend affect the horizontal distance between all characters, including spaces. Condense decreases the distance between characters and extend increases it, by an amount that the Font Manager determines is appropriate. The txMode field controls the way characters are placed in the bit image. It functions much like a pnMode: When a character is drawn, QuickDraw determines which bits in the bit image will be affected, does a bit-by-bit comparison based on the mode, and stores the resulting bits into the bit image. These modes are described under “Transfer Modes” in the section “General Discussion of Drawing”. Only three of them—srcOr, srcXor, and srcBic—should be used for drawing text. Note: If you use scrCopy, some extra blank space will be appended at the end of the text. The txSize field specifies the font size in points (where “point” is a typographical term meaning approximately 1/72 inch). Any size from 1 to 127 points may be specified. If the Font Manager doesn’t have the font in a specified size, it will scale a size it does have as necessary to produce the size desired. A value of 0 in this field represents the system font size (12 points). Finally, the spExtra field is useful when a line of characters is to be drawn justified such that it’s aligned with both a left and a right margin (sometimes called “full justification”). SpExtra contains a fixed-point number equal to the average number of pixels by which each space character should be widened to fill out the line. The Fixed data type is described in the Macintosh Memory Management: An Introduction chapter. _______________________________________________________________________________ »COORDINATES IN GRAFPORTS _______________________________________________________________________________ Each grafPort has its own local coordinate system. All fields in the grafPort are expressed in these coordinates, and all calculations and actions performed in QuickDraw use the local coordinate system of the currently selected port. Two things are important to remember: • Each grafPort maps a portion of the coordinate plane into a similarly- sized portion of a bit image. • The portBits.bounds rectangle defines the local coordinates for a grafPort. The top left corner of portBits.bounds is always aligned around the first bit in the bit image; the coordinates of that corner “anchor” a point on the grid to that bit in the bit image. This forms a common reference point for multiple grafPorts that use the same bit image (such as the screen); given a portBits.bounds rectangle for each port, you know that their top left corners coincide. The relationship between the portBits.bounds and portRect rectangles is very important: The portBits.bounds rectangle establishes a coordinate system for the port, and the portRect rectangle indicates the section of the coordinate plane (and thus the bit image) that will be used for drawing. The portRect usually falls inside the portBits.bounds rectangle, but it’s not required to do so. When a new grafPort is created, its bit map is set to point to the entire screen, and both the portBits.bounds and the portRect are set to rectangles enclosing the screen. The point (0,0) corresponds to the screen’s top left corner. You can redefine the local coordinates of the top left corner of the grafPort’s portRect, using the SetOrigin procedure. This offsets the coordinates of the grafPort’s portBits.bounds rectangle, recalculating the coordinates of all points in the grafPort to be relative to the new corner coordinates. For example, consider these procedure calls: SetPort(gamePort); SetOrigin(90,80) The call to SetPort sets the current grafPort to gamePort; the call to SetOrigin changes the local coordinates of the top left corner of that port’s portRect to (90,80) (see Figure 14). •••Refer to Figure 14.••• Figure 14–Changing Local Coordinates This offsets the coordinates of the following elements: gamePort^.portBits.bounds gamePort^.portRect gamePort^.visRgn These three elements are always kept “in sync”. Notice that when the local coordinates of a grafPort are offset, the grafPort’s clipRgn and pen location are not offset. A good way to think of it is that the port’s structure “sticks” to the screen, while the document in the grafPort (along with the pen and clipRgn) “sticks” to the coordinate system. For example, in Figure 14, before SetOrigin, the visRgn and clipRgn are the same as the portRect. After the SetOrigin call, the locations of portBits.bounds, portRect, and visRgn do not change on the screen; their coordinates are simply offset. As always, the top left corner of portBits.bounds remains “anchored” around the first bit in the bit image (the first pixel on the screen); the image on the screen doesn’t move as a result of SetOrigin. However, the pen location and clipRgn do move on the screen; the top left corner of the clipRgn is still (100,100), but this location has moved down and to the right, and the pen has similarly moved. If you’re moving, comparing, or otherwise dealing with mathematical items in different grafPorts (for example, finding the intersection of two regions in two different grafPorts), you must adjust to a common coordinate system before you perform the operation. A QuickDraw procedure, LocalToGlobal, lets you convert a point’s local coordinates to a global coordinate system where the top left corner of the bit image is (0,0); by converting the various local coordinates to global coordinates, you can compare and mix them with confidence. For more information, see the description of LocaltoGlobal under “Calculations with Points” in the “QuickDraw Routines” section. æKY DialogTemplate DialogTPtr DialogTHndl æFp Dialogs.p æT RECORD æD DialogTPtr = ^DialogTemplate; DialogTHndl = ^DialogTPtr; DialogTemplate = RECORD boundsRect: Rect; procID: INTEGER; visible: BOOLEAN; filler1: BOOLEAN; goAwayFlag: BOOLEAN; filler2: BOOLEAN; refCon: LONGINT; itemsID: INTEGER; title: Str255; END; æC »Dialog Templates in Memory The data structure of a dialog template is as follows: TYPE DialogTemplate = RECORD boundsRect: Rect; {becomes window's portRect} procID: INTEGER; {window definiton ID} visible: BOOLEAN; {TRUE if visible} filler1: BOOLEAN; {not used} goAwayFlag: BOOLEAN; {TRUE if has go-away region} filler2: BOOLEAN; {not used} refCon: LONGINT; {window's reference value} itemsID: INTEGER; {resource ID of item list} title: Str255 {window's title} END; The filler1 and filler2 fields are there because for historical reasons the goAwayFlag and refCon fields have to begin on a word boundary. The itemsID field contains the resource ID of the dialog’s item list. The other fields are the same as the parameters of the same name in the NewDialog function; they provide information about the dialog window. You access the dialog template by converting the handle returned by the Resource Manager to a template handle: TYPE DialogTHndl = ^DialogTPtr; DialogTPtr = ^DialogTemplate; æKY StageList æFp Dialogs.p æT RECORD æD StageList = PACKED RECORD boldItm4: 0..1; {default button item number - 1} boxDrwn4: BOOLEAN; {true if alert box to be drawn} sound4: 0..3; {sound number} boldItm3: 0..1; boxDrwn3: BOOLEAN; sound3: 0..3; boldItm2: 0..1; boxDrwn2: BOOLEAN; sound2: 0..3; boldItm1: 0..1; boxDrwn1: BOOLEAN; sound1: 0..3; END; æC »Alert Templates in Memory The data structure of an alert template is as follows: TYPE AlertTemplate = RECORD boundsRect: Rect; {becomes window's portRect} itemsID: INTEGER; {resource ID of item list} stages: StageList {alert stage information} END; BoundsRect is the rectangle that becomes the portRect of the window's grafPort. The itemsID field contains the resource ID of the item list for the alert. The information in the stages field determines exactly what should happen at each stage of the alert. It's packed into a word that has the following structure: TYPE StageList = PACKED RECORD boldItm4: 0..1; {default button item number minus 1} boxDrwn4: BOOLEAN; {TRUE if alert box to be drawn} sound4: 0..3 {sound number} boldItm3: 0..1; boxDrwn3: BOOLEAN; sound3: 0..3 boldItm2: 0..1; boxDrwn2: BOOLEAN; sound2: 0..3 boldItm1: 0..1; boxDrwn1: BOOLEAN; sound1: 0..3 END; Notice that the information is stored in reverse order—for the fourth stage first, and for the first stage last. The boldItm field indicates which button should be the default button (and therefore boldly outlined in the alert box). If the first two items in the alert’s item list are the OK button and the Cancel button, respectively, 0 will refer to the OK button and 1 to the Cancel button. The reason for this is that the value of boldItm plus 1 is interpreted as an item number, and normally items 1 and 2 are the OK and Cancel buttons, respectively. Whatever the item having the corresponding item number happens to be, a bold rounded-corner rectangle will be drawn outside its display rectangle. Note: When deciding where to place items in an alert box, be sure to allow room for any bold outlines that may be drawn. The boxDrwn field is TRUE if the alert box is to be drawn. The sound field specifies which sound should be emitted at this stage of the alert, with a number from 0 to 3 that’s passed to the current sound procedure. You can call ErrorSound to specify your own sound procedure; if you don’t, the standard sound procedure will be used (as described earlier in the “Alerts” section). You access the alert template by converting the handle returned by the Resource Manager to a template handle: TYPE AlertTHndl = ^AlertTPtr; AlertTPtr = ^AlertTemplate; Assembly-language note: Rather than offsets into the fields of the StageList data structure, there are masks for accessing the information stored for an alert stage in a stages word; they’re listed in the summary at the end of this chapter. æKY AlertTemplate AlertTPtr AlertTHndl æFp Dialogs.p æT RECORD æD AlertTPtr = ^AlertTemplate; AlertTHndl = ^AlertTPtr; AlertTemplate = RECORD boundsRect: Rect; itemsID: INTEGER; stages: StageList; END; æC »Alert Templates in Memory The data structure of an alert template is as follows: TYPE AlertTemplate = RECORD boundsRect: Rect; {becomes window's portRect} itemsID: INTEGER; {resource ID of item list} stages: StageList {alert stage information} END; BoundsRect is the rectangle that becomes the portRect of the window's grafPort. The itemsID field contains the resource ID of the item list for the alert. The information in the stages field determines exactly what should happen at each stage of the alert. It's packed into a word that has the following structure: TYPE StageList = PACKED RECORD boldItm4: 0..1; {default button item number minus 1} boxDrwn4: BOOLEAN; {TRUE if alert box to be drawn} sound4: 0..3 {sound number} boldItm3: 0..1; boxDrwn3: BOOLEAN; sound3: 0..3 boldItm2: 0..1; boxDrwn2: BOOLEAN; sound2: 0..3 boldItm1: 0..1; boxDrwn1: BOOLEAN; sound1: 0..3 END; Notice that the information is stored in reverse order—for the fourth stage first, and for the first stage last. The boldItm field indicates which button should be the default button (and therefore boldly outlined in the alert box). If the first two items in the alert’s item list are the OK button and the Cancel button, respectively, 0 will refer to the OK button and 1 to the Cancel button. The reason for this is that the value of boldItm plus 1 is interpreted as an item number, and normally items 1 and 2 are the OK and Cancel buttons, respectively. Whatever the item having the corresponding item number happens to be, a bold rounded-corner rectangle will be drawn outside its display rectangle. Note: When deciding where to place items in an alert box, be sure to allow room for any bold outlines that may be drawn. The boxDrwn field is TRUE if the alert box is to be drawn. The sound field specifies which sound should be emitted at this stage of the alert, with a number from 0 to 3 that’s passed to the current sound procedure. You can call ErrorSound to specify your own sound procedure; if you don’t, the standard sound procedure will be used (as described earlier in the “Alerts” section). You access the alert template by converting the handle returned by the Resource Manager to a template handle: TYPE AlertTHndl = ^AlertTPtr; AlertTPtr = ^AlertTemplate; Assembly-language note: Rather than offsets into the fields of the StageList data structure, there are masks for accessing the information stored for an alert stage in a stages word; they’re listed in the summary at the end of this chapter. æKY InitDialogs æFp Dialogs.p æT PROCEDURE æTN A97B æD PROCEDURE InitDialogs(resumeProc: ResumeProcPtr); INLINE $A97B; æDT InitDialogs(resumeProc); æRI I-411, P-107, 112, 174 æC Call InitDialogs once before all other Dialog Manager routines, to initialize the Dialog Manager. InitDialogs does the following initialization: • It saves the pointer passed in resumeProc, if any, for access by the System Error Handler in case a fatal system error occurs. ResumeProc can be a pointer to a resume procedure, as described in the System Error Handler chapter, or NIL if no such procedure is desired. Assembly-language note: InitDialogs stores the address of the resume procedure in a global variable named ResumeProc. • It installs the standard sound procedure. • It passes empty strings to ParamText. æKY ErrorSound æFp Dialogs.p æT PROCEDURE æTN A98C æD PROCEDURE ErrorSound(soundProc: SoundProcPtr); INLINE $A98C; æDT ErrorSound(soundProc); æRI I-411 æC ErrorSound sets the sound procedure for alerts to the procedure pointed to by soundProc; if you don’t call ErrorSound, the Dialog Manager uses the standard sound procedure. (For details, see the “Alerts” section.) If you pass NIL for soundProc, there will be no sound (or menu bar blinking) at all. Assembly-language note: The address of the sound procedure being used is stored in the global variable DABeeper. æKY NewDialog æFp Dialogs.p æT FUNCTION æTN A97D æD FUNCTION NewDialog(wStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN; procID: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT; itmLstHndl: Handle): DialogPtr; INLINE $A97D; æDT myVariable := NewDialog(wStorage,boundsRect,title,visible,procID,behind,goAwayFlag,refCon,itmLstHndl); æMM æRI I-412, P-107, 177 æC NewDialog creates a dialog as specified by its parameters and returns a pointer to the new dialog. The first eight parameters (dStorage through refCon) are passed to the Window Manager function NewWindow, which creates the dialog window; the meanings of these parameters are summarized below. The items parameter is a handle to the dialog’s item list. You can get the items handle by calling the Resource Manager to read the item list from the resource file into memory. Note: Advanced programmers can create their own item lists in memory rather than have them read from a resource file. The exact format is given later under “Formats of Resources for Dialogs and Alerts”. DStorage is analogous to the wStorage parameter of NewWindow; it’s a pointer to the storage to use for the dialog record. If you pass NIL for dStorage, the dialog record will be allocated in the heap (which, in the case of modeless dialogs, may cause the heap to become fragmented). BoundsRect, a rectangle given in global coordinates, determines the dialog window’s size and location. It becomes the portRect of the window’s grafPort. Remember that the top coordinate of this rectangle should be at least 25 points below the top of the screen for a modal dialog, to allow for the menu bar and the border around the portRect, and at least 40 points below the top of the screen for a modeless dialog, to allow for the menu bar and the window’s title bar. Title is the title of a modeless dialog box; pass the empty string for modal dialogs. If the visible parameter is TRUE, the dialog window is drawn on the screen. If it’s FALSE, the window is initially invisible and may later be shown with a call to the Window Manager procedure ShowWindow. Note: NewDialog generates an update event for the entire window contents, so the items aren’t drawn immediately, with the exception of controls. The Dialog Manager calls the Control Manager to draw controls, and the Control Manager draws them immediately rather than via the standard update mechanism. Because of this, the Dialog Manager calls the Window Manager procedure ValidRect for the enclosing rectangle of each control, so the controls won’t be drawn twice. If you find that the other items aren’t being drawn soon enough after the controls, try making the window invisible initially and then calling ShowWindow to show it. ProcID is the window definition ID, which leads to the window definition function for this type of window. The window definition IDs for the standard types of dialog window are dBoxProc for the modal type and documentProc for the modeless type. The behind parameter specifies the window behind which the dialog window is to be placed on the desktop. Pass POINTER(–1) to bring up the dialog window in front of all other windows. GoAwayFlag applies to modeless dialog boxes; if it’s TRUE, the dialog window has a close box in its title bar when the window is active. RefCon is the dialog window’s reference value, which the application may store into and access for any purpose. NewDialog sets the font of the dialog window’s grafPort to the system font or, if you previously called SetDAFont, to the specified font. It also sets the window class in the window record to dialogKind. æKY GetNewDialog æFp Dialogs.p æT FUNCTION æTN A97C æD FUNCTION GetNewDialog(dialogID: INTEGER;dStorage: Ptr;behind: WindowPtr): DialogPtr; INLINE $A97C; æDT myVariable := GetNewDialog(dialogID,dStorage,behind); æMM æRT 4,34 æRI I-413, V-284, N4-1, P-107, 172 æC Like NewDialog (above), GetNewDialog creates a dialog as specified by its parameters and returns a pointer to the new dialog. Instead of having the parameters boundsRect, title, visible, procID, goAwayFlag, and refCon, GetNewDialog has a single dialogID parameter, where dialogID is the resource ID of a dialog template that supplies the same information as those parameters. The dialog template also contains the resource ID of the dialog’s item list. After calling the Resource Manager to read the item list into memory (if it’s not already in memory), GetNewDialog makes a copy of the item list and uses that copy; thus you may have multiple independent dialogs whose items have the same types, locations, and initial contents. The dStorage and behind parameters of GetNewDialog have the same meaning as in NewDialog. Warning: If either the dialog template resource or the item list resource can’t be read, the function result is undefined. Note: GetNewDialog doesn’t release the memory occupied by the resources. The GetNewDialog routine will attempt to load a 'dctb' resource and returns a pointer to a color grafPort if the resource exists. If no 'dctb' resource is present, GetNewDialog returns a pointer to an old grafPort. The dialog color table is copied before it is passed to SetWinSize unless its ctSize field is equal to –1, indicating that the default window colors are to be used instead. The copy is made so that the color table resource can be purged without affecting the dialog. The color dialog item list resource is duplicated as well, so it can be purgeable. æKY CloseDialog æFp Dialogs.p æT PROCEDURE æTN A982 æD PROCEDURE CloseDialog(theDialog: DialogPtr); INLINE $A982; æDT CloseDialog(theDialog); æMM æRI I-413, P-107, 167 æC CloseDialog removes theDialog’s window from the screen and deletes it from the window list, just as when the Window Manager procedure CloseWindow is called. It releases the memory occupied by the following: • The data structures associated with the dialog window (such as the window’s structure, content, and update regions). • All the items in the dialog (except for pictures and icons, which might be shared resources), and any data structures associated with them. For example, it would dispose of the region occupied by the thumb of a scroll bar, or a similar region for some other control in the dialog. CloseDialog does not dispose of the dialog record or the item list. Figure 10 illustrates the effect of CloseDialog (and DisposDialog, described below). •••Refer to Figure 10.••• Figure 10–CloseDialog and DisposDialog Call CloseDialog when you’re done with a dialog if you supplied NewDialog or GetNewDialog with a pointer to the dialog storage (in the dStorage parameter) when you created the dialog. Note: Even if you didn’t supply a pointer to the dialog storage, you may want to call CloseDialog if you created the dialog with NewDialog. You would call CloseDialog if you wanted to keep the item list around (since, unlike GetNewDialog, NewDialog does not use a copy of the item list). æKY DisposDialog æFp Dialogs.p æT PROCEDURE æTN A983 æD PROCEDURE DisposDialog(theDialog: DialogPtr); INLINE $A983; æDT DisposDialog(theDialog); æRI I-415 æC DisposDialog calls CloseDialog (above) and then releases the memory occupied by the dialog’s item list and dialog record. Call DisposDialog when you’re done with a dialog if you let the dialog record be allocated in the heap when you created the dialog (by passing NIL as the dStorage parameter to NewDialog or GetNewDialog). æKY DisposeDialog æFp Dialogs.p æT PROCEDURE æTN A983 æD PROCEDURE DisposeDialog(theDialog: DialogPtr); INLINE $A983; æDT DisposeDialog(theDialog); æRI I-415 æC DisposDialog calls CloseDialog (above) and then releases the memory occupied by the dialog’s item list and dialog record. Call DisposDialog when you’re done with a dialog if you let the dialog record be allocated in the heap when you created the dialog (by passing NIL as the dStorage parameter to NewDialog or GetNewDialog). æKY CouldDialog æFp Dialogs.p æT PROCEDURE æTN A979 æD PROCEDURE CouldDialog(dialogID: INTEGER); INLINE $A979; æDT CouldDialog(dialogID); æMM æRI I-415, V-284 æC CouldDialog makes the dialog template having the given resource ID unpurgeable (reading it into memory if it’s not already there). It does the same for the dialog window’s definition function, the dialog’s item list resource, and any items defined as resources. This is useful if the dialog box may come up when the resource file isn’t accessible, such as during a disk copy. Warning: CouldDialog assumes your dialogs use the system font; if you’ve changed the font with SetDAFont, calling CouldDialog doesn’t make the font unpurgeable. The CouldDialog procedure makes the dialog color table template unpurgeable (reading it into memory if it isn’t already there), if it exists. It does the same for the dialog’s color item list, if it has one. Warning: CouldDialog doesn’t load or make 'FONT' or 'FOND' resources indicated in the color item list unpurgeable. æKY FreeDialog æFp Dialogs.p æT PROCEDURE æTN A97A æD PROCEDURE FreeDialog(dialogID: INTEGER); INLINE $A97A; æDT FreeDialog(dialogID); æMM æRI I-415, V-284 æC Given the resource ID of a dialog template previously specified in a call to CouldDialog, FreeDialog undoes the effect of CouldDialog (by making the resources purgeable). It should be called when there’s no longer a need to keep the resources in memory. Given the resource ID of a dialog template previously specified in a call to CouldDialog, the FreeDialog routine undoes the effect of CouldDialog, by restoring the original purge state of the color table and color item list resources. æKY ParamText æFp Dialogs.p æT PROCEDURE æTN A98B æD PROCEDURE ParamText(param0: Str255;param1: Str255;param2: Str255;param3: Str255); INLINE $A98B; æDT ParamText(param0,param1,param2,param3); æMM æRI I-421 æC ParamText provides a means of substituting text in statText items: param0 through param3 will replace the special strings '^0' through '^3' in all statText items in all subsequent dialog or alert boxes. Pass empty strings for parameters not used. Assembly-language note: Assembly-language programmers may pass NIL for parameters not used or for strings that are not to be changed. For example, if the text is defined as 'Cannot open document ^0' and docName is a string variable containing a document name that the user typed, you can call ParamText(docName,' ',' ',' ') Note: All strings that may need to be translated to other languages should be stored in resource files. Assembly-language note: The Dialog Manager stores handles to the four ParamText parameters in a global array named DAStrings. æKY ModalDialog æFp Dialogs.p æT PROCEDURE æTN A991 æD PROCEDURE ModalDialog(filterProc: ModalFilterProcPtr;VAR itemHit: INTEGER); INLINE $A991; æDT ModalDialog(filterProc,itemHit); æMM æRT 34, 203 æRI I-415, N34-2, 3, P-108, 176 æC Call ModalDialog after creating a modal dialog and bringing up its window in the frontmost plane. ModalDialog repeatedly gets and handles events in the dialog’s window; after handling an event involving an enabled dialog item, it returns with the item number in itemHit. Normally you’ll then do whatever is appropriate as a response to an event in that item. ModalDialog gets each event by calling the Toolbox Event Manager function GetNextEvent. If the event is a mouse-down event outside the content region of the dialog window, ModalDialog emits sound number 1 (which should be a single beep) and gets the next event; otherwise, it filters and handles the event as described below. Note: Once before getting each event, ModalDialog calls SystemTask, a Desk Manager procedure that must be called regularly so that desk accessories will work properly. The filterProc parameter determines how events are filtered. If it’s NIL, the standard filterProc function is executed; this causes ModalDialog to return 1 in itemHit if the Return key or Enter key is pressed. If filterProc isn’t NIL, ModalDialog filters events by executing the function it points to. Your filterProc function should have three parameters and return a Boolean value. For example, this is how it would be declared if it were named MyFilter: FUNCTION MyFilter (theDialog: DialogPtr; VAR theEvent: EventRecord; VAR itemHit: INTEGER) : BOOLEAN; A function result of FALSE tells ModalDialog to go ahead and handle the event, which either can be sent through unchanged or can be changed to simulate a different event. A function result of TRUE tells ModalDialog to return immediately rather than handle the event; in this case, the filterProc function sets itemHit to the item number that ModalDialog should return. Note: If you want it to be consistent with the standard filterProc function, your function should at least check whether the Return key or Enter key was pressed and, if so, return 1 in itemHit and a function result of TRUE. You can use the filterProc function, for example, to treat a typed character in a special way (such as ignore it, or make it have the same effect as another character or as clicking a button); in this case, the function would test for a key-down event with that character. As another example, suppose the dialog box contains a userItem whose procedure draws a clock with the current time displayed. The filterProc function can call that procedure and return FALSE without altering the current event. Note: ModalDialog calls GetNextEvent with a mask that excludes disk-inserted events. To receive disk-inserted events, your filterProc function can call GetNextEvent (or EventAvail) with a mask that accepts only that type of event. ModalDialog handles the events for which the filterProc function returns FALSE as follows: • In response to an activate or update event for the dialog window, ModalDialog activates or updates the window. • If the mouse button is pressed in an editText item, ModalDialog responds to the mouse activity as appropriate (displaying an insertion point or selecting text). If a key-down event occurs and there’s an editText item, text entry and editing are handled in the standard way for such items (except that if the Command key is down, ModalDialog responds as though it’s not). In either case, ModalDialog returns if the editText item is enabled or does nothing if it’s disabled. If a key-down event occurs when there’s no editText item, ModalDialog does nothing. • If the mouse button is pressed in a control, ModalDialog calls the Control Manager function TrackControl. If the mouse button is released inside the control and the control is enabled, ModalDialog returns; otherwise, it does nothing. • If the mouse button is pressed in any other enabled item in the dialog box, ModalDialog returns. If the mouse button is pressed in any other disabled item or in no item, or if any other event occurs, ModalDialog does nothing. æKY IsDialogEvent æFp Dialogs.p æT FUNCTION æTN A97F æD FUNCTION IsDialogEvent(theEvent: EventRecord): BOOLEAN; INLINE $A97F; æDT myVariable := IsDialogEvent(theEvent); æRI I-416, N5-1, P-108, 175 æC If your application includes any modeless dialogs, call IsDialogEvent after calling the Toolbox Event Manager function GetNextEvent. Warning: If your modeless dialog contains any editText items, you must call IsDialogEvent (and then DialogSelect) even if GetNextEvent returns FALSE; otherwise your dialog won’t receive null events and the caret won’t blink. Pass the current event in theEvent. IsDialogEvent determines whether theEvent needs to be handled as part of a dialog. If theEvent is an activate or update event for a dialog window, a mouse-down event in the content region of an active dialog window, or any other type of event when a dialog window is active, IsDialogEvent returns TRUE; otherwise, it returns FALSE. When FALSE is returned, just handle the event yourself like any other event that’s not dialog-related. When TRUE is returned, you’ll generally end up passing the event to DialogSelect for it to handle (as described below), but first you should do some additional checking: • DialogSelect doesn’t handle keyboard equivalents of commands. Check whether the event is a key-down event with the Command key held down and, if so, carry out the command if it’s one that applies when a dialog window is active. (If the command doesn’t so apply, do nothing.) • In special cases, you may want to bypass DialogSelect or do some preprocessing before calling it. If so, check for those events and respond accordingly. You would need to do this, for example, if the dialog is to respond to disk-inserted events. For cases other than these, pass the event to DialogSelect for it to handle. æKY DialogSelect æFp Dialogs.p æT FUNCTION æTN A980 æD FUNCTION DialogSelect(theEvent: EventRecord;VAR theDialog: DialogPtr;VAR itemHit: INTEGER): BOOLEAN; INLINE $A980; æDT myVariable := DialogSelect(theEvent,theDialog,itemHit); æMM æRT 34 æRI I-417, N34-3, P-108, 168 æC You’ll normally call DialogSelect when IsDialogEvent returns TRUE, passing in theEvent an event that needs to be handled as part of a modeless dialog. DialogSelect handles the event as described below. If the event involves an enabled dialog item, DialogSelect returns a function result of TRUE with the dialog pointer in theDialog and the item number in itemHit; otherwise, it returns FALSE with theDialog and itemHit undefined. Normally when DialogSelect returns TRUE, you’ll do whatever is appropriate as a response to the event, and when it returns FALSE you’ll do nothing. If the event is an activate or update event for a dialog window, DialogSelect activates or updates the window and returns FALSE. If the event is a mouse-down event in an editText item, DialogSelect responds as appropriate (displaying a caret at the insertion point or selecting text). If it’s a key-down or auto-key event and there’s an editText item, text entry and editing are handled in the standard way. In either case, DialogSelect returns TRUE if the editText item is enabled or FALSE if it’s disabled. If a key-down or auto-key event is passed when there’s no editText item, DialogSelect returns FALSE. Note: For a keyboard event, DialogSelect doesn’t check to see whether the Command key is held down; to handle keyboard equivalents of commands, you have to check for them before calling DialogSelect. Similarly, to treat a typed character in a special way (such as ignore it, or make it have the same effect as another character or as clicking a button), you need to check for a key-down event with that character before calling DialogSelect. If the event is a mouse-down event in a control, DialogSelect calls the Control Manager function TrackControl. If the mouse button is released inside the control and the control is enabled, DialogSelect returns TRUE; otherwise, it returns FALSE. If the event is a mouse-down event in any other enabled item, DialogSelect returns TRUE. If it’s a mouse-down event in any other disabled item or in no item, or if it’s any other event, DialogSelect returns FALSE. Note: If the event isn’t one that DialogSelect specifically checks for (if it’s a null event, for example), and there’s an editText item in the dialog, DialogSelect calls the TextEdit procedure TEIdle to make the caret blink. æKY DrawDialog æFp Dialogs.p æT PROCEDURE æTN A981 æD PROCEDURE DrawDialog(theDialog: DialogPtr); INLINE $A981; æDT DrawDialog(theDialog); æMM æRI I-418 æC DrawDialog draws the contents of the given dialog box. Since DialogSelect and ModalDialog handle dialog window updating, this procedure is useful only in unusual situations. You would call it, for example, to display a dialog box that doesn’t require any response but merely tells the user what’s going on during a time-consuming process. æKY UpdtDialog æFp Dialogs.p æT PROCEDURE æTN A978 æD PROCEDURE UpdtDialog(theDialog: DialogPtr;updateRgn: RgnHandle); INLINE $A978; æDT UpdtDialog(theDialog,updateRgn); æMM æRI IV-60 æC UpdtDialog is a faster version of the DrawDialog procedure. Instead of drawing the entire contents of the given dialog box, UpdtDialog draws only the items that are in a specified update region. UpdtDialog is called in response to an update event, and is usually bracketed by calls to the Window Manager procedures BeginUpdate and EndUpdate. UpdateRgn should be set to the visRgn of theWindow’s port. (For more details, see the BeginUpdate procedure in the Window Manager chapter.) æKY UpdateDialog æFp Dialogs.p æT PROCEDURE æTN A978 æD PROCEDURE UpdateDialog(theDialog: DialogPtr;updateRgn: RgnHandle); INLINE $A978; æDT UpdateDialog(theDialog,updateRgn); æMM æRI IV-60 æC UpdtDialog is a faster version of the DrawDialog procedure. Instead of drawing the entire contents of the given dialog box, UpdtDialog draws only the items that are in a specified update region. UpdtDialog is called in response to an update event, and is usually bracketed by calls to the Window Manager procedures BeginUpdate and EndUpdate. UpdateRgn should be set to the visRgn of theWindow’s port. (For more details, see the BeginUpdate procedure in the Window Manager chapter.) æKY Alert æFp Dialogs.p æT FUNCTION æTN A985 æD FUNCTION Alert(alertID: INTEGER;filterProc: ModalFilterProcPtr): INTEGER; INLINE $A985; æDT myVariable := Alert(alertID,filterProc); æMM æRI I-418, V-284 æC This function invokes the alert defined by the alert template that has the given resource ID. It calls the current sound procedure, if any, passing it the sound number specified in the alert template for this stage of the alert. If no alert box is to be drawn at this stage, Alert returns a function result of –1; otherwise, it creates and displays the alert window for this alert and draws the alert box. Warning: If the alert template resource can’t be read, the function result is undefined. Note: Alert creates the alert window by calling NewDialog, and does the rest of its processing by calling ModalDialog. Alert repeatedly gets and handles events in the alert window until an enabled item is clicked, at which time it returns the item number. Normally you’ll then do whatever is appropriate in response to a click of that item. Alert gets each event by calling the Toolbox Event Manager function GetNextEvent. If the event is a mouse-down event outside the content region of the alert window, Alert emits sound number 1 (which should be a single beep) and gets the next event; otherwise, it filters and handles the event as described below. The filterProc parameter has the same meaning as in ModalDialog (see above). If it’s NIL, the standard filterProc function is executed, which makes the Return key or the Enter key have the same effect as clicking the default button. If you specify your own filterProc function and want to retain this feature, you must include it in your function. You can find out what the current default button is by looking at the aDefItem field of the dialog record for the alert (via the dialog pointer passed to the function). Alert handles the events for which the filterProc function returns FALSE as follows: • If the mouse button is pressed in a control, Alert calls the Control Manager procedure TrackControl. If the mouse button is released inside the control and the control is enabled, Alert returns; otherwise, it does nothing. • If the mouse button is pressed in any other enabled item, Alert simply returns. If it’s pressed in any other disabled item or in no item, or if any other event occurs, Alert does nothing. Before returning to the application with the item number, Alert removes the alert box from the screen. (It disposes of the alert window and its associated data structures, the item list, and the items.) Note: When an alert is removed, if it was overlapping the default button of a previous alert, that button’s bold outline won’t be redrawn. Note: The Alert function’s removal of the alert box would not be the desired result if the user clicked a check box or radio button; however, normally alerts contain only static text, icons, pictures, and buttons that are supposed to make the alert box go away. If your alert contains other items besides these, consider whether it might be more appropriate as a dialog. The Alert function looks for a resource of type 'actb' with the same ID as the alert. The alert color table is copied before it is passed to SetWinSize unless its ctSize field is equal to –1, indicating that the default window colors are to be used instead. The copy is made so that the color table resource can be purged without affecting the alert. The color dialog item list resource is duplicated as well, so it can be purgeable. æKY StopAlert æFp Dialogs.p æT FUNCTION æTN A986 æD FUNCTION StopAlert(alertID: INTEGER;filterProc: ModalFilterProcPtr): INTEGER; INLINE $A986; æDT myVariable := StopAlert(alertID,filterProc); æMM æRI I-419, V-284, P-109, 182 æC StopAlert is the same as the Alert function (above) except that before drawing the items of the alert in the alert box, it draws the Stop icon in the top left corner of the box (within the rectangle (10,20)(42,52)). The Stop icon has the following resource ID: CONST stopIcon = 0; If the application’s resource file doesn’t include an icon with that ID number, the Dialog Manager uses the standard Stop icon in the system resource file (see Figure 11). The calls CautionAlert, StopAlert, and NoteAlert look for a resource of type 'actb' with the same ID as the alert. •••Refer to Figure 11.••• Figure 11–Standard Alert Icons æKY NoteAlert æFp Dialogs.p æT FUNCTION æTN A987 æD FUNCTION NoteAlert(alertID: INTEGER;filterProc: ModalFilterProcPtr): INTEGER; INLINE $A987; æDT myVariable := NoteAlert(alertID,filterProc); æMM æRI I-420 æC NoteAlert is like StopAlert except that it draws the Note icon, which has the following resource ID: CONST noteIcon = 1; The calls CautionAlert, StopAlert, and NoteAlert look for a resource of type 'actb' with the same ID as the alert. æKY CautionAlert æFp Dialogs.p æT FUNCTION æTN A988 æD FUNCTION CautionAlert(alertID: INTEGER;filterProc: ModalFilterProcPtr): INTEGER; INLINE $A988; æDT myVariable := CautionAlert(alertID,filterProc); æMM æRI I-420 æC CautionAlert is like StopAlert except that it draws the Caution icon, which has the following resource ID: CONST cautionIcon = 2; The calls CautionAlert, StopAlert, and NoteAlert look for a resource of type 'actb' with the same ID as the alert. æKY CouldAlert æFp Dialogs.p æT PROCEDURE æTN A989 æD PROCEDURE CouldAlert(alertID: INTEGER); INLINE $A989; æDT CouldAlert(alertID); æMM æRI I-420, V-285 æC CouldAlert makes the alert template having the given resource ID unpurgeable (reading it into memory if it’s not already there). It does the same for the alert window’s definition function, the alert’s item list resource, and any items defined as resources. This is useful if the alert may occur when the resource file isn’t accessible, such as during a disk copy. Warning: Like CouldDialog, CouldAlert assumes your alerts use the system font; if you’ve changed the font with SetDAFont, calling CouldAlert doesn’t make the font unpurgeable. The CouldAlert routine makes the alert color table template unpurgeable (reading it into memory if it isn’t already there), if it exists. It does the same for the alert’s color item list, if it has one. Warning: Like CouldDialog, CouldAlert doesn’t load or make 'FONT' or 'FOND' resources indicated in the color item list unpurgeable. æKY FreeAlert æFp Dialogs.p æT PROCEDURE æTN A98A æD PROCEDURE FreeAlert(alertID: INTEGER); INLINE $A98A; æDT FreeAlert(alertID); æMM æRI I-420, V-285 æC Given the resource ID of an alert template previously specified in a call to CouldAlert, FreeAlert undoes the effect of CouldAlert (by making the resources purgeable). It should be called when there’s no longer a need to keep the resources in memory. Given the resource ID of an alert template previously specified in a call to CouldAlert, the FreeAlert routine undoes the effect of CouldAlert, by restoring the original purge state of the color table and color item list resources. æKY GetDItem æFp Dialogs.p æT PROCEDURE æTN A98D æD PROCEDURE GetDItem(theDialog: DialogPtr;itemNo: INTEGER;VAR itemType: INTEGER; VAR item: Handle;VAR box: Rect); INLINE $A98D; æDT GetDItem(theDialog,itemNo,itemType,item,box); æMM æRI I-421 æC GetDItem returns in its VAR parameters the following information about the item numbered itemNo in the given dialog’s item list: In the itemType parameter, the item type; in the item parameter, a handle to the item (or, for item type userItem, the procedure pointer); and in the box parameter, the display rectangle for the item. Suppose, for example, that you want to change the title of a control in a dialog box. You can get the item handle with GetDItem, coerce it to type ControlHandle, and call the Control Manager procedure SetCTitle to change the title. Similarly, to move the control or change its size, you would call MoveControl or SizeControl. Note: To access the text of a statText or editText item, you can pass the handle returned by GetDItem to GetIText or SetIText (see below). æKY SetDItem æFp Dialogs.p æT PROCEDURE æTN A98E æD PROCEDURE SetDItem(theDialog: DialogPtr;itemNo: INTEGER;itemType: INTEGER; item: Handle;box: Rect); INLINE $A98E; æDT SetDItem(theDialog,itemNo,itemType,item,box); æMM æRT 34 æRI I-421, N34-1 æC SetDItem sets the item numbered itemNo in the given dialog’s item list, as specified by the parameters (without drawing the item). The itemType parameter is the item type; the item parameter is a handle to the item (or, for item type userItem, the procedure pointer); and the box parameter is the display rectangle for the item. Consider, for example, how to install an item of type userItem in a dialog: In the item list in the resource file, define an item in which the type is set to userItem and the display rectangle to (0,0)(0,0). Specify that the dialog window be invisible (in either the dialog template or the NewDialog call). After creating the dialog, coerce the item’s procedure pointer to type Handle; then call SetDItem, passing that handle and the display rectangle for the item. Finally, call the Window Manager procedure ShowWindow to display the dialog window. Note: Do not use SetDItem to change the text of a statText or editText item or to change or move a control. See the description of GetDItem above for more information. æKY HideDItem æFp Dialogs.p æT PROCEDURE æTN A827 æD PROCEDURE HideDItem(theDialog: DialogPtr;itemNo: INTEGER); INLINE $A827; æDT HideDItem(theDialog,itemNo); æMM æRI IV-59 æC HideDItem hides the item numbered itemNo in the given dialog’s item list by giving the item a display rectangle that’s off the screen. (Specifically, if the left coordinate of the item’s display rectangle is less than 8192, ShowDItem adds 16384 to both the left and right coordinates the rectangle.) If the item is already hidden (that is, if the left coordinate is greater than 8192), HideDItem does nothing. HideDItem calls the EraseRect procedure on the item’s enclosing rectangle and adds the rectangle that contained the item (not necessarily the item’s display rectangle) to the update region. If the specified item is an active editText item, the item is first deactivated (by calling TEDeactivate). Note: If you have items that are close to each other, be aware that the Dialog Manager draws outside of the enclosing rectangle by 3 pixels for editText items and by 4 pixels for a default button. An item that’s been hidden by HideDItem can be redisplayed by the ShowDItem procedure. Note: To create a hidden item in a dialog item list, simply add 16384 to the left and right coordinates of the display rectangle. æKY ShowDItem æFp Dialogs.p æT PROCEDURE æTN A828 æD PROCEDURE ShowDItem(theDialog: DialogPtr;itemNo: INTEGER); INLINE $A828; æDT ShowDItem(theDialog,itemNo); æMM æRI IV-59 æC ShowDItem redisplays the item numbered itemNo, previously hidden by HideDItem, by giving the item the display rectangle it had prior to the HideDItem call. (Specifically, if the left coordinate of the item’s display rectangle is greater than 8192, ShowDItem subtracts 16384 from both the left and right coordinates the rectangle.) If the item is already visible (that is, if the left coordinate is less than 8192), ShowDItem does nothing. ShowDItem adds the rectangle that contained the item (not necessarily the item’s display rectangle) to the update region so that it will be drawn. If the item becomes the only editText item, ShowDItem activates it (by calling TEActivate). æKY SelIText æFp Dialogs.p æT PROCEDURE æTN A97E æD PROCEDURE SelIText(theDialog: DialogPtr;itemNo: INTEGER;strtSel: INTEGER; endSel: INTEGER); INLINE $A97E; æDT SelIText(theDialog,itemNo,strtSel,endSel); æMM æRI I-422, P-110 æC Given a pointer to a dialog and the item number of an editText item in the dialog box, SelIText does the following: • If the item contains text, SelIText sets the selection range to extend from character position strtSel up to but not including character position endSel. The selection range is inverted unless strtSel equals endSel, in which case a blinking vertical bar is displayed to indicate an insertion point at that position. • If the item doesn’t contain text, SelIText simply displays the insertion point. For example, if the user makes an unacceptable entry in the editText item, the application can put up an alert box reporting the problem and then select the entire text of the item so it can be replaced by a new entry. (Without this procedure, the user would have to select the item before making the new entry.) Note: You can select the entire texxt by specifying 0 for strtSel and 32767 for endSel. For details about selection range and character position, see the TextEdit chapter. æKY GetIText æFp Dialogs.p æT PROCEDURE æTN A990 æD PROCEDURE GetIText(item: Handle;VAR text: Str255); INLINE $A990; æDT GetIText(item,text); æRT 18 æRI I-422, N18-2 æC Given a handle to a statText or editText item in a dialog box, as returned by GetDItem, GetIText returns the text of the item in the text parameter. (If the user typed more than 255 characters in an editText item, GetIText returns only the first 255.) æKY SetIText æFp Dialogs.p æT PROCEDURE æTN A98F æD PROCEDURE SetIText(item: Handle;text: Str255); INLINE $A98F; æDT SetIText(item,text); æMM æRI I-422 æC Given a handle to a statText or editText item in a dialog box, as returned by GetDItem, SetIText sets the text of the item to the specified text and draws the item. For example, suppose the exact content of a dialog’s text item cannot be determined until the application is running, but the display rectangle is defined in the resource file: Call GetDItem to get a handle to the item, and call SetIText with the desired text. æKY FindDItem æFp Dialogs.p æT FUNCTION æTN A984 æD FUNCTION FindDItem(theDialog: DialogPtr;thePt: Point): INTEGER; INLINE $A984; æDT myVariable := FindDItem(theDialog,thePt); æMM æRT 112 æRI IV-60, N112 æC FindDItem returns the item number of the item containing the point specified, in local coordinates, by thePt. If the point doesn’t lie within the item’s rectangle, FindDItem returns –1. If there are overlapping items, it returns the item number of the first item in the list containing the point. FindDItem is useful for changing the cursor when it’s over a particular item. Note: FindDItem will return the item number of disabled items as well. æKY NewCDialog æFp Dialogs.p æT FUNCTION æTN AA4B æD FUNCTION NewCDialog(dStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN; procID: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT; items: Handle): DialogPtr; INLINE $AA4B; æDT myVariable := NewCDialog(dStorage,boundsRect,title,visible,procID,behind,goAwayFlag,refCon,items); æMM æRI V-283 æC A new Dialog Manager routine has been added to support color dialogs: NewCDialog. Its parameters are identical to NewDialog, except that a cGrafPort is allocated through a NewCWindow call instead of a call to NewWindow. NewCDialog creates a dialog box as specified by its parameters and returns a cDialogPtr to the new dialog. The first eight parameters (dStorage through refCon) are passed to the Window Manager function NewCWindow, which creates the dialog window. The items parameter is a handle to the dialog’s item list. You can get the items handle by calling the Resource Manager to read the item list from the resource file into memory. After calling NewCDialog, you can use SetWinColor to add a color table to the dialog. This creates an auxiliary window record (auxWinRec) for the dialog window. You can access this record with the GetAuxWin routine. The dialogCItem handle within the auxWinRec points to the dialog item color table. If the dialog’s content color isn’t white, it’s a good idea to call NewCDialog with the visible flag set to FALSE. After the color table and color item list are installed, use ShowWindow to display the dialog if the dialog is the frontmost window. If the dialog is not in front, use ShowHide to display the dialog. æKY GetAlrtStage æFp Dialogs.p æT FUNCTION æD FUNCTION GetAlrtStage: INTEGER; INLINE $3EB8,$0A9A; æDT myVariable := GetAlrtStage; æRI I-422 æC GetAlrtStage returns the stage of the last occurrence of an alert, as a number from 0 to 3. Assembly-language note: Assembly-language programmers can get this number by accessing the global variable ACount. In addition, the global variable ANumber contains the resource ID of the alert template of the last alert that occurred. æKY ResetAlrtStage æFp Dialogs.p æT PROCEDURE æD PROCEDURE ResetAlrtStage; INLINE $4278,$0A9A; æDT ResetAlrtStage; æRI I-423 æC ResetAlrtStage resets the stage of the last occurrence of an alert so that the next occurrence of that same alert will be treated as its first stage. This is useful, for example, when you’ve used ParamText to change the text of an alert such that from the user’s point of view it’s a different alert. Assembly-language note: Assembly-language programmers can set the global variable ACount to –1 for the same effect. æKY DlgCut æFp Dialogs.p æT PROCEDURE æD PROCEDURE DlgCut(theDialog: DialogPtr); æDT DlgCut(theDialog); æRT 215 æRI I-418, P-110 æC [Not in ROM] DlgCut checks whether theDialog has any editText items and, if so, applies the TextEdit procedure TECut to the currently selected editText item. (If the dialog record’s editField is 0 or greater, DlgCut passes the contents of the textH field to TECut.) You can call DlgCut to handle the editing command Cut when a modeless dialog window is active. Assembly-language note: Assembly-language programmers can just read the dialog record’s fields and call TextEdit directly. æKY DlgPaste æFp Dialogs.p æT PROCEDURE æD PROCEDURE DlgPaste(theDialog: DialogPtr); æDT DlgPaste(theDialog); æMM æRT 215 æRI I-418, P-110 æC [Not in ROM] DlgPaste is the same as DlgCut (above) except that it calls TEPaste, for handling the Paste command. æKY DlgCopy æFp Dialogs.p æT PROCEDURE æD PROCEDURE DlgCopy(theDialog: DialogPtr); æDT DlgCopy(theDialog); æMM æRT 215 æRI I-418, P-110 æC [Not in ROM] DlgCopy is the same as DlgCut (above) except that it calls TECopy, for handling the Copy command. æKY DlgDelete æFp Dialogs.p æT PROCEDURE æD PROCEDURE DlgDelete(theDialog: DialogPtr); æDT DlgDelete(theDialog); æMM æRT 215 æRI I-418, P-110 æC [Not in ROM] DlgDelete is the same as DlgCut (above) except that it calls TEDelete, for handling the Clear command. æKY SetDAFont æFp Dialogs.p æT PROCEDURE æD PROCEDURE SetDAFont(fontNum: INTEGER); INLINE $31DF,$0AFA; æDT SetDAFont(fontNum); æRI I-412 æC For subsequently created dialogs and alerts, SetDAFont causes the font of the dialog or alert window’s grafPort to be set to the font having the specified font number. If you don’t call this procedure, the system font is used. SetDAFont affects statText and editText items but not titles of controls, which are always in the system font. Assembly-language note: Assembly-language programmers can simply set the global variable DlgFont to the desired font number. æKY DiskInit.p æKL DIBadMount DIFormat DILoad DIUnload DIVerify DIZero HFSDefaults æKY HFSDefaults æFp DiskInit.p æT RECORD æD HFSDefaults = RECORD sigWord: PACKED ARRAY [0..1] OF Byte; { signature word} abSize: LONGINT; { allocation block size in bytes} clpSize: LONGINT; { clump size in bytes} nxFreeFN: LONGINT; { next free file number} btClpSize: LONGINT; { B-Tree clump size in bytes} rsrv1: INTEGER; { reserved} rsrv2: INTEGER; { reserved} rsrv3: INTEGER; { reserved} END; æC »Formatting Hierarchical Volumes The Disk Initialization Package must set certain volume characteristics when placing a hierarchical file directory on a volume. Default values for these volume characteristics are stored in the 128K ROM; this section is for advanced programmers who want to substitute their own values. The record containing the default values, if defined in Pascal, would look like this: TYPE HFSDefaults = PACKED RECORD sigWord: ARRAY[1..2] OF CHAR; {signature word} abSize: LONGINT; {allocation block size in bytes} clpSize: LONGINT; {clump size in bytes} nxFreeFN: LONGINT; {next free file number} btClpSize: LONGINT; {B*-Tree clump size in bytes} rsrv1: INTEGER; {reserved} rsrv2: INTEGER; {reserved} rsrv3: INTEGER; {reserved} END; The default values for these fields are as follows: Field Default value sigWord 'BD' abSize 0 clpSize 4 * abSize nxFreeFN 16 btClpSize 0 To supply your own values for these fields, create a similar, nonrelocatable record containing the desired values and place a pointer to it in the global variable FmtDefaults. To restore the system defaults, simply clear FmtDefaults. The sigWord must equal 'BD' (meaning “big disk”) for the volume to be recognized as a hierarchical volume. If the specified allocation block size is 0, the allocation block size is calculated according to the size of the volume: abSize = (1 + (volSize in blocks / 64K)) * 512 bytes If the specified B*-tree clump size is 0, the clump size for both the catalog and extent trees is calculated according to the size of the volume: btClpSize = (volSize in blocks)/128 * 512bytes æKY DILoad æFp DiskInit.p æT PROCEDURE æD PROCEDURE DILoad; æDT DILoad; æMM æRI II-396 æC Assembly-language note: The trap macro for the Disk Initialization Package is _Pack2. The routine selectors are as follows: diBadMount .EQU 0 diLoad .EQU 2 diUnload .EQU 4 diFormat .EQU 6 diVerify .EQU 8 diZero .EQU 10 DILoad reads the Disk Initialization Package, and its associated dialog and dialog items, from the system resource file into memory and makes them unpurgeable. Note: DIFormat, DIVerify, and DIZero don’t need the dialog, so if you use only these routines you can call the Resource Manager function GetResource to read just the package resource into memory (and the Memory Manager procedure HNoPurge to make it unpurgeable). æKY DIUnload æFp DiskInit.p æT PROCEDURE æD PROCEDURE DIUnload; æDT DIUnload; æMM æRI II-396 æC Assembly-language note: The trap macro for the Disk Initialization Package is _Pack2. The routine selectors are as follows: diBadMount .EQU 0 diLoad .EQU 2 diUnload .EQU 4 diFormat .EQU 6 diVerify .EQU 8 diZero .EQU 10 DIUnload makes the Disk Initialization Package (and its associated dialog and dialog items) purgeable. æKY DIBadMount æFp DiskInit.p æT FUNCTION æD FUNCTION DIBadMount(where: Point;evtMessage: LONGINT): INTEGER; æDT myVariable := DIBadMount(where,evtMessage); æRI DIBadMount function II-396, N70-1, P-34, 168 æC Assembly-language note: The trap macro for the Disk Initialization Package is _Pack2. The routine selectors are as follows: diBadMount .EQU 0 diLoad .EQU 2 diUnload .EQU 4 diFormat .EQU 6 diVerify .EQU 8 diZero .EQU 10 Call DIBadMount when a disk-inserted event occurs if the result code in the high-order word of the associated event message indicates an error (that is, the result code is other than noErr). Given the event message in evtMessage, DIBadMount evaluates the result code and either ejects the disk or lets the user initialize and name it. The low-order word of the event message contains the drive number. The where parameter specifies the location (in global coordinates) of the top left corner of the dialog box displayed by DIBadMount. If the result code passed is extFSErr, memFullErr, nsDrvErr, paramErr, or volOnLinErr, DIBadMount simply ejects the disk from the drive and returns the result code. If the result code ioErr, badMDBErr, or noMacDskErr is passed, the error can be corrected by initializing the disk; DIBadMount displays a dialog box that describes the problem and asks whether the user wants to initialize the disk. For the result code ioErr, the dialog box shown in Figure 1 is displayed. (This happens if the disk is brand new.) For badMDBErr and noMacDskErr, DIBadMount displays a similar dialog box in which the description of the problem is “This disk is damaged” and “This is not a Macintosh disk”, respectively. •••Refer to Figure 1.••• Figure 1–Disk Initialization Dialog for IOErr Note: Before presenting the disk initialization dialog, DIBadMount checks whether the drive contains an already mounted volume; if so, it ejects the disk and returns 2 as its result. This will happen rarely and may reflect an error in your program (for example, you forgot to call DILoad and the user had to switch to the disk containing the system resource file). If the user responds to the disk initialization dialog by clicking the Eject button, DIBadMount ejects the disk and returns 1 as its result. If the Initialize button is clicked, a box displaying the message “Initializing disk...” appears, and DIBadMount attempts to initialize the disk. If initialization fails, the disk is ejected and the user is informed as shown in Figure 2; after the user clicks OK, DIBadMount returns a negative result code ranging from firstDskErr to lastDskErr, indicating that a low-level disk error occurred. •••Refer to Figure 2.••• Figure 2–Initialization Failure Dialog If the disk is successfully initialized, the dialog box in Figure 3 appears. After the user names the disk and clicks OK, DIBadMount mounts the volume by calling the File Manager function MountVol and returns MountVol’s result code (noErr if no error occurs). •••Refer to Figure 3.••• Figure 3–Dialog for Naming a Disk Result codes noErr No error extFSErr External file system memFullErr Not enough room in heap zone nsDrvErr No such drive paramErr Bad drive number volOnLinErr Volume already on-line firstDskErr Low-level disk error through lastDskErr Other results 1 User clicked Eject 2 Mounted volume in drive æKY DIFormat æFp DiskInit.p æT FUNCTION æD FUNCTION DIFormat(drvNum: INTEGER): OSErr; æDT myVariable := DIFormat(drvNum); æMM æRI II-398 æC Assembly-language note: The trap macro for the Disk Initialization Package is _Pack2. The routine selectors are as follows: diBadMount .EQU 0 diLoad .EQU 2 diUnload .EQU 4 diFormat .EQU 6 diVerify .EQU 8 diZero .EQU 10 DIFormat formats the disk in the drive specified by the given drive number and returns a result code indicating whether the formatting was completed successfully or failed. Formatting a disk consists of writing special information onto it so that the Disk Driver can read from and write to the disk. Result codes noErr No error firstDskErr Low-level disk error through lastDskErr æKY DIVerify æFp DiskInit.p æT FUNCTION æD FUNCTION DIVerify(drvNum: INTEGER): OSErr; æDT myVariable := DIVerify(drvNum); æMM æRI II-398 æC Assembly-language note: The trap macro for the Disk Initialization Package is _Pack2. The routine selectors are as follows: diBadMount .EQU 0 diLoad .EQU 2 diUnload .EQU 4 diFormat .EQU 6 diVerify .EQU 8 diZero .EQU 10 DIVerify verifies the format of the disk in the drive specified by the given drive number; it reads each bit from the disk and returns a result code indicating whether all bits were read successfully or not. DIVerify doesn’t affect the contents of the disk itself. Result codes noErr No error firstDskErr Low-level disk error through lastDskErr æKY DIZero æFp DiskInit.p æT FUNCTION æD FUNCTION DIZero(drvNum: INTEGER;volName: Str255): OSErr; æDT myVariable := DIZero(drvNum,volName); æMM æRT 70 æRI II-399, N70-2 æC Assembly-language note: The trap macro for the Disk Initialization Package is _Pack2. The routine selectors are as follows: diBadMount .EQU 0 diLoad .EQU 2 diUnload .EQU 4 diFormat .EQU 6 diVerify .EQU 8 diZero .EQU 10 On the unmounted volume in the drive specified by the given drive number, DIZero writes the volume information, a block map, and a file directory as for a volume with no files; the volName parameter specifies the volume name to be included in the volume information. This is the last step in initialization (after formatting and verifying) and makes any files that are already on the volume permanently inaccessible. If the operation fails, DIZero returns a result code indicating that a low-level disk error occurred; otherwise, it mounts the volume by calling the File Manager function MountVol and returns MountVol’s result code (noErr if no error occurs). Result codes noErr No error badMDBErr Bad master directory block extFSErr External file system ioErr I/O error memFullErr Not enough room in heap zone noMacDskErr Not a Macintosh disk nsDrvErr No such drive paramErr Bad drive number volOnLinErr Volume already on-line firstDskErr Low-level disk error through lastDskErr æKY Disks.p æKL DiskEject DriveStatus SetTagBuffer DriveKind DrvSts hard20 sony æKY DriveKind sony hard20 æFp Disks.p æT TYPE æD DriveKind = (sony,hard20); æC æKY DrvSts æFp Disks.p æT RECORD æD DrvSts = RECORD track: INTEGER; {current track} writeProt: SignedByte; {bit 7 = 1 if volume is locked} diskInPlace: SignedByte; {disk in drive} installed: SignedByte; {drive installed} sides: SignedByte; {-1 for 2-sided, 0 for 1-sided} driveQLink: QElemPtr; {next queue entry} driveQVers: INTEGER; {1 for HD20} dQDrive: INTEGER; {drive number} dQRefNum: INTEGER; {driver reference number} dQFSID: INTEGER; {file system ID} CASE DriveKind OF sony: (twoSideFmt: SignedByte; {after 1st rd/wrt: 0=1 side, -1=2 side} needsFlush: SignedByte; {-1 for MacPlus drive} diskErrs: INTEGER); {soft error count} hard20: (driveSize: INTEGER; {drive block size low word} driveS1: INTEGER; {drive block size high word} driveType: INTEGER; {1 for HD20} driveManf: INTEGER; {1 for Apple Computer, Inc.} driveChar: SignedByte; {230 ($E6) for HD20} driveMisc: SignedByte); {0 -- reserved} END; æC æKY DiskEject æFp Disks.p æT FUNCTION æD FUNCTION DiskEject(drvNum: INTEGER): OSErr; æDT myVariable := DiskEject(drvNum); æMM æRI II-214 æC [Not in ROM] Assembly-language note: DiskEject is equivalent to a Control call with csCode equal to the global constant ejectCode. DiskEject ejects the disk from the internal drive if drvNum is 1, or from the external drive if drvNum is 2. Result codes noErr No error nsDrvErr No such drive æKY SetTagBuffer æFp Disks.p æT FUNCTION æD FUNCTION SetTagBuffer(buffPtr: Ptr): OSErr; æDT myVariable := SetTagBuffer(buffPtr); æMM æRI II-214 æC [Not in ROM] Assembly-language note: SetTagBuffer is equivalent to a Control call with csCode equal to the global constant tgBuffCode. An application can change the information used in the file tags buffer by calling SetTagBuffer. The buffPtr parameter points to a buffer that contains the information to be used. If buffPtr is NIL, the information in the file tags buffer isn’t changed. If buffPtr isn’t NIL, every time the Disk Driver reads a sector from the disk, it stores the file tags in the file tags buffer and in the buffer pointed to by buffPtr. Every time the Disk Driver writes a sector onto the disk, it reads 12 bytes from the buffer pointed to by buffPtr, places them in the file tags buffer, and then writes them onto the disk. The contents of the buffer pointed to by buffPtr are overwritten at the end of every read request (which can be composed of a number of sectors) instead of at the end of every sector. Each read request places 12 bytes in the buffer for each sector, always beginning at the start of the buffer. This way an application can examine the file tags for a number of sequentially read sectors. If a read request is composed of a number of sectors, the Disk Driver places 12 bytes in the buffer for each sector. For example, for a read request of five sectors, the Disk Driver will place 60 bytes in the buffer. Result codes noErr No error æKY DriveStatus æFp Disks.p æT FUNCTION æD FUNCTION DriveStatus(drvNum: INTEGER;VAR status: DrvSts): OSErr; æDT myVariable := DriveStatus(drvNum,status); æMM æRI II-215 æC [Not in ROM] Assembly-language note: DriveStatus is equivalent to a Status call with csCode equal to the global constant drvStsCode; status is returned in csParam through csParam+21. DriveStatus returns information about the internal drive if drvNum is 1, or about the external drive if drvNum is 2. The information is returned in a record of type DrvSts: TYPE DrvSts = RECORD track: INTEGER; {current track} writeProt: SignedByte; {bit 7=1 if volume is locked} diskInPlace: SignedByte; {disk in place} installed: SignedByte; {drive installed} sides: SignedByte; {bit 7=0 if single-side drive} qLink: QElemPtr; {next queue entry} qType: INTEGER; {reserved for future use} dQDrive: INTEGER; {drive number} dQRefNum: INTEGER; {driver reference number} dQFSID: INTEGER; {file-system identifier} twoSideFmt: SignedByte; {-1 if two-sided disk} needsFlush: SignedByte; {reserved for future use} diskErrs: INTEGER {error count} END; The diskInPlace field is 0 if there’s no disk in the drive, 1 or 2 if there is a disk in the drive, or –4 to –1 if the disk was ejected in the last 1.5 seconds. The installed field is 1 if the drive is connected to the Macintosh, 0 if the drive might be connected to the Macintosh, and –1 if the drive isn’t installed. The value of twoSideFmt is valid only when diskInPlace=2. The value of diskErrs is incremented every time an error occurs internally within the Disk Driver. Result codes noErr No error nsDrvErr No such drive æKY Editions.p æKL AssociateSection CallEditionOpenerProc CallFormatIOProc CloseEdition CreateEditionContainerFile DeleteEditionContainerFile EditionHasFormat GetEditionFormatMark GetEditionInfo GetEditionOpenerProc GetLastEditionContainerUsed GetStandardFormats GoToPublisherSection InitEditionPack IsRegisteredSection NewPublisherDialog NewPublisherExpDialog NewSection NewSubscriberDialog NewSubscriberExpDialog OpenEdition OpenNewEdition ReadEdition RegisterSection SectionOptionsDialog SectionOptionsExpDialog SetEditionFormatMark SetEditionOpenerProc UnRegisterSection WriteEdition EditionContainerSpec EditionContainerSpecPtr EditionInfoRecord EditionOpenerParamBlock EditionOpenerProcPtr EditionOpenerVerb EditionRefNum emCancelSectionDialogRefCon emGoToPubErrDialogRefCon emHookAutoUpdateMode emHookCancelSection emHookGetEditionNow emHookGoToPublisher emHookManualUpdateMode emHookRedrawPreview emHookSendEditionNow emOptionsDialogRefCon eoCanSubscribe eoClose eoCloseNew eoOpen eoOpenNew ExpDlgHookProcPtr ExpModalFilterProcPtr FormatIOParamBlock FormatIOProcPtr FormatIOVerb FormatType ioHasFormat ioNewFormat ioReadFormat ioWriteFormat kFormatLengthUnknown kFormatListFormat kPartNumberUnknown kPartsNotUsed kPICTEditionFileType kPICTformatMask kPreviewFormat kPreviewHeight kPreviewWidth kPublisherDocAliasFormat ksndEditionFileType ksndFormatMask kTEXTEditionFileType kTEXTformatMask kUnknownEditionFileType NewPublisherReply NewSubscriberReply pumManual pumOnSave rSectionType sectionCancelMsgID sectionEventMsgClass SectionHandle SectionOptionsReply SectionPtr sectionReadMsgID SectionRecord sectionScrollMsgID SectionType sectionWriteMsgID stPublisher stSubscriber sumAutomatic sumManual TimeStamp UpdateMode æKY rSectionType æFp Editions.p æT CONST æD rSectionType = 'sect'; { ResType of saved SectionRecords } æC æKY stSubscriber æFp Editions.p æT CONST æD stSubscriber = $01; æC æKY stPublisher æFp Editions.p æT CONST æD stPublisher = $0A; æC æKY sumAutomatic æFp Editions.p æT CONST æD sumAutomatic = 0; { subscriber update mode - Automatically } æC æKY sumManual æFp Editions.p æT CONST æD sumManual = 1; { subscriber update mode - Manually } æC æKY pumOnSave æFp Editions.p æT CONST æD pumOnSave = 0; { publisher update mode - OnSave } æC æKY pumManual æFp Editions.p æT CONST æD pumManual = 1; { publisher update mode - Manually } æC æKY kPartsNotUsed æFp Editions.p æT CONST æD kPartsNotUsed = 0; æC æKY kPartNumberUnknown æFp Editions.p æT CONST æD kPartNumberUnknown = -1; { misc } æC æKY kPreviewWidth æFp Editions.p æT CONST æD kPreviewWidth = 120; æC æKY kPreviewHeight æFp Editions.p æT CONST æD kPreviewHeight = 120; æC æKY kPublisherDocAliasFormat æFp Editions.p æT CONST æD kPublisherDocAliasFormat = 'alis'; æC æKY kPreviewFormat æFp Editions.p æT CONST æD kPreviewFormat = 'prvw'; æC æKY kFormatListFormat æFp Editions.p æT CONST æD kFormatListFormat = 'fmts'; æC æKY kPICTformatMask æFp Editions.p æT CONST æD kPICTformatMask = 1; æC æKY kTEXTformatMask æFp Editions.p æT CONST æD kTEXTformatMask = 2; æC æKY ksndFormatMask æFp Editions.p æT CONST æD ksndFormatMask = 4; æC æKY kPICTEditionFileType æFp Editions.p æT CONST æD kPICTEditionFileType = 'edtp'; æC æKY kTEXTEditionFileType æFp Editions.p æT CONST æD kTEXTEditionFileType = 'edtt'; æC æKY ksndEditionFileType æFp Editions.p æT CONST æD ksndEditionFileType = 'edts'; æC æKY kUnknownEditionFileType æFp Editions.p æT CONST æD kUnknownEditionFileType = 'edtu'; æC æKY emHookRedrawPreview æFp Editions.p æT CONST æD emHookRedrawPreview = 150; æC æKY emHookCancelSection æFp Editions.p æT CONST æD emHookCancelSection = 160; æC æKY emHookGoToPublisher æFp Editions.p æT CONST æD emHookGoToPublisher = 161; æC æKY emHookGetEditionNow æFp Editions.p æT CONST æD emHookGetEditionNow = 162; æC æKY emHookSendEditionNow æFp Editions.p æT CONST æD emHookSendEditionNow = 162; æC æKY emHookManualUpdateMode æFp Editions.p æT CONST æD emHookManualUpdateMode = 163; æC æKY emHookAutoUpdateMode æFp Editions.p æT CONST æD emHookAutoUpdateMode = 164; æC æKY emOptionsDialogRefCon æFp Editions.p æT CONST æD emOptionsDialogRefCon = 'optn'; æC æKY emCancelSectionDialogRefCon æFp Editions.p æT CONST æD emCancelSectionDialogRefCon = 'cncl'; æC æKY emGoToPubErrDialogRefCon æFp Editions.p æT CONST æD emGoToPubErrDialogRefCon = 'gerr'; æC æKY kFormatLengthUnknown æFp Editions.p æT CONST æD kFormatLengthUnknown = -1; æC æKY SectionType æFp Editions.p æT TYPE æD SectionType = SignedByte; { one byte, stSubscriber or stPublisher } æC æKY TimeStamp æFp Editions.p æT TYPE æD TimeStamp = LONGINT; { seconds since 1904 } æC æKY FormatType æFp Editions.p æT TYPE æD FormatType = PACKED ARRAY [1..4] OF CHAR;{ similar to ResType as used by scrap mgr } æC æKY EditionRefNum æFp Editions.p æT TYPE æD EditionRefNum = Handle; { used in Edition I/O } æC æKY UpdateMode æFp Editions.p æT TYPE æD UpdateMode = INTEGER; { sumAutomatic, pumSuspend, etc } æC æKY SectionRecord SectionPtr SectionHandle æFp Editions.p æT RECORD æD SectionPtr = ^SectionRecord; SectionHandle = ^SectionPtr; SectionRecord = RECORD version: SignedByte; { always 0x01 in system 7.0 } kind: SectionType; { stSubscriber or stPublisher } mode: UpdateMode; { auto or manual } mdDate: TimeStamp; { last change in document } sectionID: LONGINT; { app. specific, unique per document } refCon: LONGINT; { application specific } alias: AliasHandle; { handle to Alias Record } subPart: LONGINT; { which part of container file } nextSection: SectionHandle; { for linked list of app's Sections } controlBlock: Handle; { used internally } refNum: EditionRefNum; { used internally } END; æC æKY EditionContainerSpec EditionContainerSpecPtr æFp Editions.p æT RECORD æD EditionContainerSpecPtr = ^EditionContainerSpec; EditionContainerSpec = RECORD theFile: FSSpec; theFileScript: ScriptCode; thePart: LONGINT; thePartName: Str31; thePartScript: ScriptCode; END; æC æKY EditionInfoRecord æFp Editions.p æT RECORD æD EditionInfoRecord = RECORD crDate: TimeStamp; { date EditionContainer was created } mdDate: TimeStamp; { date of last change } fdCreator: OSType; { file creator } fdType: OSType; { file type } container: EditionContainerSpec; { the Edition } END; æC æKY NewPublisherReply æFp Editions.p æT RECORD æD NewPublisherReply = RECORD canceled: BOOLEAN; { O } replacing : BOOLEAN; usePart: BOOLEAN; { I } preview: Handle; { I } previewFormat: FormatType; { I } container: EditionContainerSpec; { I/O } END; æC æKY NewSubscriberReply æFp Editions.p æT RECORD æD NewSubscriberReply = RECORD canceled: BOOLEAN; { O } formatsMask: SignedByte; container: EditionContainerSpec; {I/O} END; æC æKY SectionOptionsReply æFp Editions.p æT RECORD æD SectionOptionsReply = RECORD canceled: BOOLEAN; { O } changed: BOOLEAN; { O } sectionH: SectionHandle; { I } action: ResType; { O } END; æC æKY ExpModalFilterProcPtr æFp Editions.p æT TYPE æD ExpModalFilterProcPtr = ProcPtr; { FUNCTION Filter(theDialog: DialogPtr; VAR theEvent: EventRecord; itemOffset: INTEGER; VAR itemHit: INTEGER; yourDataPtr: Ptr): BOOLEAN; } æC æKY ExpDlgHookProcPtr æFp Editions.p æT TYPE æD ExpDlgHookProcPtr = ProcPtr; { FUNCTION Hook(itemOffset, item: INTEGER; theDialog: DialogPtr; yourDataPtr: Ptr): INTEGER; } æC æKY FormatIOVerb ioHasFormat ioReadFormat ioNewFormat ioWriteFormat æFp Editions.p æT TYPE æD FormatIOVerb = (ioHasFormat,ioReadFormat,ioNewFormat,ioWriteFormat); æC æKY FormatIOParamBlock æFp Editions.p æT RECORD æD FormatIOParamBlock = RECORD ioRefNum: LONGINT; format: FormatType; formatIndex: LONGINT; offset: LONGINT; buffPtr: Ptr; buffLen: LONGINT; END; æC æKY FormatIOProcPtr æFp Editions.p æT TYPE æD FormatIOProcPtr = ProcPtr; { FUNCTION IO(selector: FormatIOVerb; VAR PB: FormatIOParamBlock): OSErr; } æC æKY EditionOpenerVerb eoOpen eoClose eoOpenNew eoCloseNew eoCanSubscribe æFp Editions.p æT TYPE æD EditionOpenerVerb = (eoOpen,eoClose,eoOpenNew,eoCloseNew,eoCanSubscribe); æC æKY EditionOpenerParamBlock æFp Editions.p æT RECORD æD EditionOpenerParamBlock = RECORD info: EditionInfoRecord; sectionH: SectionHandle; document: FSSpecPtr; fdCreator: OSType; ioRefNum: LONGINT; ioProc: FormatIOProcPtr; success: BOOLEAN; formatsMask: SignedByte; END; æC æKY EditionOpenerProcPtr æFp Editions.p æT TYPE æD EditionOpenerProcPtr = ProcPtr; { FUNCTION Opener(selector: EditionOpenerVerb; VAR PB: EditionOpenerParamBlock): OSErr; } æC æKY sectionEventMsgClass æFp Editions.p æT CONST æD sectionEventMsgClass = 'sect'; æC æKY sectionReadMsgID æFp Editions.p æT CONST æD sectionReadMsgID = 'read'; æC æKY sectionWriteMsgID æFp Editions.p æT CONST æD sectionWriteMsgID = 'writ'; æC æKY sectionScrollMsgID æFp Editions.p æT CONST æD sectionScrollMsgID = 'scrl'; æC æKY sectionCancelMsgID æFp Editions.p æT CONST æD sectionCancelMsgID = 'cncl'; æC æKY InitEditionPack æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION InitEditionPack: OSErr; INLINE $3F3C,$0011,$303C,$0100,$A82D; æDT myVariable := InitEditionPack; æC æKY NewSection æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION NewSection(container: EditionContainerSpec; sectionDocument: FSSpecPtr; kind: SectionType; sectionID: LONGINT; initalMode: UpdateMode; VAR sectionH: SectionHandle): OSErr; INLINE $303C,$0A02,$A82D; æDT myVariable := NewSection(container,sectionDocument,kind,sectionID,initalMode,sectionH); æC æKY RegisterSection æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION RegisterSection(sectionDocument: FSSpec; sectionH: SectionHandle; VAR aliasWasUpdated: BOOLEAN): OSErr; INLINE $303C,$0604,$A82D; æDT myVariable := RegisterSection(sectionDocument,sectionH,aliasWasUpdated); æC æKY UnRegisterSection æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION UnRegisterSection(sectionH: SectionHandle): OSErr; INLINE $303C,$0206,$A82D; æDT myVariable := UnRegisterSection(sectionH); æC æKY IsRegisteredSection æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION IsRegisteredSection(sectionH: SectionHandle): OSErr; INLINE $303C,$0208,$A82D; æDT myVariable := IsRegisteredSection(sectionH); æC æKY AssociateSection æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION AssociateSection(sectionH: SectionHandle; newSectionDocument: FSSpecPtr): OSErr; INLINE $303C,$040C,$A82D; æDT myVariable := AssociateSection(sectionH,newSectionDocument); æC æKY CreateEditionContainerFile æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION CreateEditionContainerFile(editionFile: FSSpec; fdCreator: OSType; editionFileNameScript: ScriptCode): OSErr; INLINE $303C,$050E,$A82D; æDT myVariable := CreateEditionContainerFile(editionFile,fdCreator,editionFileNameScript); æC æKY DeleteEditionContainerFile æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION DeleteEditionContainerFile(editionFile: FSSpec): OSErr; INLINE $303C,$0210,$A82D; æDT myVariable := DeleteEditionContainerFile(editionFile); æC æKY OpenEdition æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION OpenEdition(subscriberSectionH: SectionHandle; VAR refNum: EditionRefNum): OSErr; INLINE $303C,$0412,$A82D; æDT myVariable := OpenEdition(subscriberSectionH,refNum); æC æKY OpenNewEdition æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION OpenNewEdition(publisherSectionH: SectionHandle; fdCreator: OSType; publisherSectionDocument: FSSpecPtr; VAR refNum: EditionRefNum): OSErr; INLINE $303C,$0814,$A82D; æDT myVariable := OpenNewEdition(publisherSectionH,fdCreator,publisherSectionDocument,refNum); æC æKY CloseEdition æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION CloseEdition(whichEdition: EditionRefNum; successful: BOOLEAN): OSErr; INLINE $303C,$0316,$A82D; æDT myVariable := CloseEdition(whichEdition,successful); æC æKY EditionHasFormat æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION EditionHasFormat(whichEdition: EditionRefNum; whichFormat: FormatType; VAR formatSize: Size): OSErr; INLINE $303C,$0618,$A82D; æDT myVariable := EditionHasFormat(whichEdition,whichFormat,formatSize); æC æKY ReadEdition æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION ReadEdition(whichEdition: EditionRefNum; whichFormat: FormatType; buffPtr: UNIV Ptr; VAR buffLen: Size): OSErr; INLINE $303C,$081A,$A82D; æDT myVariable := ReadEdition(whichEdition,whichFormat,buffPtr,buffLen); æC æKY WriteEdition æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION WriteEdition(whichEdition: EditionRefNum; whichFormat: FormatType; buffPtr: UNIV Ptr; buffLen: Size): OSErr; INLINE $303C,$081C,$A82D; æDT myVariable := WriteEdition(whichEdition,whichFormat,buffPtr,buffLen); æC æKY GetEditionFormatMark æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION GetEditionFormatMark(whichEdition: EditionRefNum; whichFormat: FormatType; VAR currentMark: LONGINT): OSErr; INLINE $303C,$061E,$A82D; æDT myVariable := GetEditionFormatMark(whichEdition,whichFormat,currentMark); æC æKY SetEditionFormatMark æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION SetEditionFormatMark(whichEdition: EditionRefNum; whichFormat: FormatType; setMarkTo: LONGINT): OSErr; INLINE $303C,$0620,$A82D; æDT myVariable := SetEditionFormatMark(whichEdition,whichFormat,setMarkTo); æC æKY GetEditionInfo æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION GetEditionInfo(sectionH: SectionHandle; VAR editionInfo: EditionInfoRecord): OSErr; INLINE $303C,$0422,$A82D; æDT myVariable := GetEditionInfo(sectionH,editionInfo); æC æKY GoToPublisherSection æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION GoToPublisherSection(container: EditionContainerSpec): OSErr; INLINE $303C,$0224,$A82D; æDT myVariable := GoToPublisherSection(container); æC æKY GetLastEditionContainerUsed æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION GetLastEditionContainerUsed(VAR container: EditionContainerSpec): OSErr; INLINE $303C,$0226,$A82D; æDT myVariable := GetLastEditionContainerUsed(container); æC æKY GetStandardFormats æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION GetStandardFormats(container: EditionContainerSpec; VAR previewFormat: FormatType; preview: Handle; publisherAlias: Handle; formats: Handle): OSErr; INLINE $303C,$0A28,$A82D; æDT myVariable := GetStandardFormats(container,previewFormat,preview,publisherAlias,formats); æC æKY GetEditionOpenerProc æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION GetEditionOpenerProc(VAR opener: EditionOpenerProcPtr): OSErr; INLINE $303C,$022A,$A82D; æDT myVariable := GetEditionOpenerProc(opener); æC æKY SetEditionOpenerProc æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION SetEditionOpenerProc(opener: EditionOpenerProcPtr): OSErr; INLINE $303C,$022C,$A82D; æDT myVariable := SetEditionOpenerProc(opener); æC æKY CallEditionOpenerProc æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION CallEditionOpenerProc(selector: EditionOpenerVerb; VAR PB: EditionOpenerParamBlock; routine: EditionOpenerProcPtr): OSErr; INLINE $303C,$052E,$A82D; æDT myVariable := CallEditionOpenerProc(selector,PB,routine); æC æKY CallFormatIOProc æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION CallFormatIOProc(selector: FormatIOVerb; VAR PB: FormatIOParamBlock; routine: FormatIOProcPtr): OSErr; INLINE $303C,$0530,$A82D; æDT myVariable := CallFormatIOProc(selector,PB,routine); æC æKY NewSubscriberDialog æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION NewSubscriberDialog(VAR reply: NewSubscriberReply): OSErr; INLINE $303C,$0232,$A82D; æDT myVariable := NewSubscriberDialog(reply); æC æKY NewSubscriberExpDialog æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION NewSubscriberExpDialog(VAR reply: NewSubscriberReply; where: Point; expansionDITLresID: INTEGER; dlgHook: ExpDlgHookProcPtr; filterProc: ExpModalFilterProcPtr; yourDataPtr:UNIV Ptr): OSErr; INLINE $303C,$0B34,$A82D; æDT myVariable := NewSubscriberExpDialog(reply,where,expansionDITLresID,dlgHook,filterProc,yourDataPtr); æC æKY NewPublisherDialog æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION NewPublisherDialog(VAR reply: NewPublisherReply): OSErr; INLINE $303C,$0236,$A82D; æDT myVariable := NewPublisherDialog(reply); æC æKY NewPublisherExpDialog æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION NewPublisherExpDialog(VAR reply: NewPublisherReply; where: Point; expansionDITLresID: INTEGER; dlgHook: ExpDlgHookProcPtr; filterProc: ExpModalFilterProcPtr; yourDataPtr: UNIV Ptr): OSErr; INLINE $303C,$0B38,$A82D; æDT myVariable := NewPublisherExpDialog(reply,where,expansionDITLresID,dlgHook,filterProc,yourDataPtr); æC æKY SectionOptionsDialog æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION SectionOptionsDialog(VAR reply: SectionOptionsReply): OSErr; INLINE $303C,$023A,$A82D; æDT myVariable := SectionOptionsDialog(reply); æC æKY SectionOptionsExpDialog æFp Editions.p æT FUNCTION æTN A82D æD FUNCTION SectionOptionsExpDialog(VAR reply: SectionOptionsReply; where: Point; expansionDITLresID: INTEGER; dlgHook: ExpDlgHookProcPtr; filterProc: ExpModalFilterProcPtr; yourDataPtr: UNIV Ptr): OSErr; INLINE $303C,$0B3C,$A82D; æDT myVariable := SectionOptionsExpDialog(reply,where,expansionDITLresID,dlgHook,filterProc,yourDataPtr); æC æKY ENET.p æKL EAddMulti EAttachPH EDelMulti EDetachPH EGetInfo ERdCancel ERead ESetGeneral EWrite EAddrRType eLenErr eMultiErr ENetAddMulti ENetAttachPH ENetDelMulti ENetDetachPH ENetGetInfo ENetRdCancel ENetRead ENetSetGeneral ENetWrite EParamBlkPtr EParamBlock æKY ENetSetGeneral æFp ENET.p æT CONST æD ENetSetGeneral = 253; {Set "general" mode} æC æKY ENetGetInfo æFp ENET.p æT CONST æD ENetGetInfo = 252; {Get info} æC æKY ENetRdCancel æFp ENET.p æT CONST æD ENetRdCancel = 251; {Cancel read} æC æKY ENetRead æFp ENET.p æT CONST æD ENetRead = 250; {Read} æC æKY ENetWrite æFp ENET.p æT CONST æD ENetWrite = 249; {Write} æC æKY ENetDetachPH æFp ENET.p æT CONST æD ENetDetachPH = 248; {Detach protocol handler} æC æKY ENetAttachPH æFp ENET.p æT CONST æD ENetAttachPH = 247; {Attach protocol handler} æC æKY ENetAddMulti æFp ENET.p æT CONST æD ENetAddMulti = 246; {Add a multicast address} æC æKY ENetDelMulti æFp ENET.p æT CONST æD ENetDelMulti = 245; {Delete a multicast address} æC æKY eLenErr æFp ENET.p æT CONST æD eLenErr = -92; {Length error ddpLenErr} æC æKY eMultiErr æFp ENET.p æT CONST æD eMultiErr = -91; {Multicast address error ddpSktErr} æC æKY EAddrRType æFp ENET.p æT CONST æD EAddrRType = 'eadr'; {Alternate address resource type} æC æKY EParamBlock EParamBlkPtr æFp ENET.p æT RECORD æD EParamBlkPtr = ^EParamBlock; EParamBlock = PACKED RECORD qLink: QElemPtr; {next queue entry} qType: INTEGER; {queue type} ioTrap: INTEGER; {routine trap} ioCmdAddr: Ptr; {routine address} ioCompletion: ProcPtr; {completion routine} ioResult: OSErr; {result code} ioNamePtr: StringPtr; {->filename} ioVRefNum: INTEGER; {volume reference or drive number} ioRefNum: INTEGER; {driver reference number} csCode: INTEGER; {call command code AUTOMATICALLY set} CASE INTEGER OF ENetWrite,ENetAttachPH,ENetDetachPH,ENetRead,ENetRdCancel,ENetGetInfo,ENetSetGeneral: (eProtType: INTEGER; {Ethernet protocol type} ePointer: Ptr; eBuffSize: INTEGER; {buffer size} eDataSize: INTEGER); {number of bytes read} ENetAddMulti,ENetDelMulti: (eMultiAddr: ARRAY [0..5] of char); {Multicast Address} END; æC æKY EWrite æFp ENET.p æT FUNCTION æD FUNCTION EWrite(thePBptr: EParamBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := EWrite(thePBptr,async); æC æKY EAttachPH æFp ENET.p æT FUNCTION æD FUNCTION EAttachPH(thePBptr: EParamBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := EAttachPH(thePBptr,async); æC æKY EDetachPH æFp ENET.p æT FUNCTION æD FUNCTION EDetachPH(thePBptr: EParamBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := EDetachPH(thePBptr,async); æC æKY ERead æFp ENET.p æT FUNCTION æD FUNCTION ERead(thePBptr: EParamBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := ERead(thePBptr,async); æC æKY ERdCancel æFp ENET.p æT FUNCTION æD FUNCTION ERdCancel(thePBptr: EParamBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := ERdCancel(thePBptr,async); æC æKY EGetInfo æFp ENET.p æT FUNCTION æD FUNCTION EGetInfo(thePBptr: EParamBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := EGetInfo(thePBptr,async); æC æKY ESetGeneral æFp ENET.p æT FUNCTION æD FUNCTION ESetGeneral(thePBptr: EParamBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := ESetGeneral(thePBptr,async); æC æKY EAddMulti æFp ENET.p æT FUNCTION æD FUNCTION EAddMulti(thePBptr: EParamBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := EAddMulti(thePBptr,async); æC æKY EDelMulti æFp ENET.p æT FUNCTION æD FUNCTION EDelMulti(thePBptr: EParamBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := EDelMulti(thePBptr,async); æC æKY EPPC.p æKL AcceptHighLevelEvent GetPortNameFromProcessSerialNumber GetProcessSerialNumberFromPortName GetSpecificHighLevelEvent PostHighLevelEvent bufferIsSmall connectionInvalid GetSpecificFilterProcPtr HighLevelEventMsg HighLevelEventMsgClass HighLevelEventMsgHdl HighLevelEventMsgPtr kHighLevelEvent msgWasFullyAccepted msgWasNotAccepted msgWasPartiallyAccepted nAttnMsg noOutstandingHLE noUserInteractionAllowed nReturnReceipt priorityMask receiverIDisPSN receiverIDisSessionID receiverIDisSignature receiverIDisTargetID receiverIDMask rtrnReceiptMsgID SenderID SenderIDPtr systemOptionsMask TargetID TargetIDHdl TargetIDPtr æKY kHighLevelEvent æFp EPPC.p æT CONST æD kHighLevelEvent = 23; æC æKY receiverIDMask æFp EPPC.p æT CONST æD receiverIDMask = $0000F000; æC æKY receiverIDisPSN æFp EPPC.p æT CONST æD receiverIDisPSN = $00008000; æC æKY receiverIDisSignature æFp EPPC.p æT CONST æD receiverIDisSignature = $00007000; æC æKY receiverIDisSessionID æFp EPPC.p æT CONST æD receiverIDisSessionID = $00006000; æC æKY receiverIDisTargetID æFp EPPC.p æT CONST æD receiverIDisTargetID = $00005000; æC æKY systemOptionsMask æFp EPPC.p æT CONST æD systemOptionsMask = $00000F00; æC æKY nReturnReceipt æFp EPPC.p æT CONST æD nReturnReceipt = $00000200; æC æKY priorityMask æFp EPPC.p æT CONST æD priorityMask = $000000FF; æC æKY nAttnMsg æFp EPPC.p æT CONST æD nAttnMsg = $00000001; æC æKY bufferIsSmall æFp EPPC.p æT CONST æD bufferIsSmall = -607; æC æKY noOutstandingHLE æFp EPPC.p æT CONST æD noOutstandingHLE = -608; æC æKY connectionInvalid æFp EPPC.p æT CONST æD connectionInvalid = -609; æC æKY noUserInteractionAllowed æFp EPPC.p æT CONST æD noUserInteractionAllowed = -610; { no user interaction allowed } æC æKY HighLevelEventMsgClass æFp EPPC.p æT CONST æD HighLevelEventMsgClass = 'jaym'; æC æKY rtrnReceiptMsgID æFp EPPC.p æT CONST æD rtrnReceiptMsgID = 'rtrn'; æC æKY msgWasPartiallyAccepted æFp EPPC.p æT CONST æD msgWasPartiallyAccepted = 2; æC æKY msgWasFullyAccepted æFp EPPC.p æT CONST æD msgWasFullyAccepted = 1; æC æKY msgWasNotAccepted æFp EPPC.p æT CONST æD msgWasNotAccepted = 0; æC æKY TargetID TargetIDPtr TargetIDHdl æFp EPPC.p æT RECORD æD TargetIDPtr = ^TargetID; TargetIDHdl = ^TargetIDPtr; TargetID = RECORD sessionID: LONGINT; name: PPCPortRec; location: LocationNameRec; recvrName: PPCPortRec; END; æC æKY SenderID æFp EPPC.p æT TYPE æD SenderID = TargetID; æC æKY SenderIDPtr æFp EPPC.p æT TYPE æD SenderIDPtr = ^SenderID; æC æKY HighLevelEventMsg HighLevelEventMsgPtr HighLevelEventMsgHdl æFp EPPC.p æT RECORD æD HighLevelEventMsgPtr = ^HighLevelEventMsg; HighLevelEventMsgHdl = ^HighLevelEventMsgPtr; HighLevelEventMsg = RECORD HighLevelEventMsgHeaderLength: INTEGER; version: INTEGER; reserved1: LONGINT; theMsgEvent: EventRecord; userRefcon: LONGINT; postingOptions: LONGINT; msgLength: LONGINT; END; æC æKY PostHighLevelEvent æFp EPPC.p æT FUNCTION æTN A88F æD FUNCTION PostHighLevelEvent(theEvent: EventRecord; receiverID: Ptr; msgRefcon: LONGINT; msgBuff: Ptr; msgLen: LONGINT; postingOptions: LONGINT): OSErr; INLINE $3F3C,$0034,$A88F; æDT myVariable := PostHighLevelEvent(theEvent,receiverID,msgRefcon,msgBuff,msgLen,postingOptions); æC æKY AcceptHighLevelEvent æFp EPPC.p æT FUNCTION æTN A88F æD FUNCTION AcceptHighLevelEvent(VAR sender: TargetID; VAR msgRefcon: LONGINT; msgBuff: Ptr; VAR msgLen: LONGINT): OSErr; INLINE $3F3C,$0033,$A88F; æDT myVariable := AcceptHighLevelEvent(sender,msgRefcon,msgBuff,msgLen); æC æKY GetProcessSerialNumberFromPortName æFp EPPC.p æT FUNCTION æTN A88F æD FUNCTION GetProcessSerialNumberFromPortName(portName: PPCPortRec;VAR PSN: ProcessSerialNumber): OSErr; INLINE $3F3C,$0035,$A88F; æDT myVariable := GetProcessSerialNumberFromPortName(portName,PSN); æC æKY GetPortNameFromProcessSerialNumber æFp EPPC.p æT FUNCTION æTN A88F æD FUNCTION GetPortNameFromProcessSerialNumber(VAR portName: PPCPortRec;PSN: ProcessSerialNumber): OSErr; INLINE $3F3C,$0046,$A88F; æDT myVariable := GetPortNameFromProcessSerialNumber(portName,PSN); æC æKY GetSpecificFilterProcPtr æFp EPPC.p æT TYPE æD GetSpecificFilterProcPtr = ProcPtr; { FUNCTION MyFilter(yourDataPtr: Ptr; } { msgBuff: HighLevelEventMsgPtr; } { sender: TargetID): Boolean; } æC æKY GetSpecificHighLevelEvent æFp EPPC.p æT FUNCTION æTN A88F æD FUNCTION GetSpecificHighLevelEvent(aFilter: GetSpecificFilterProcPtr;yourDataPtr: UNIV Ptr; VAR err: OSErr): BOOLEAN; INLINE $3F3C,$0045,$A88F; æDT myVariable := GetSpecificHighLevelEvent(aFilter,yourDataPtr,err); æC æKY Errors.p æKL SysError abortErr addRefFailed addResFailed afpAccessDenied afpAuthContinue afpBadIDErr afpBadUAM afpBadVersNum afpBitmapErr afpCallNotSupported afpCantMove afpCantRename afpCatalogChanged afpContainsSharedErr afpDenyConflict afpDiffVolErr afpDirNotEmpty afpDirNotFound afpDiskFull afpEofError afpFileBusy afpFlatVol afpIconTypeError afpIDExists afpIDNotFound afpInsideSharedErr afpInsideTrashErr afpItemNotFound afpLockErr afpMiscErr afpNoMoreLocks afpNoServer afpObjectExists afpObjectLocked afpObjectNotFound afpObjectTypeErr afpParmErr afpPwdExpiredErr afpPwdSameErr afpPwdTooShortErr afpRangeNotLocked afpRangeOverlap afpSameObjectErr afpServerGoingDown afpSessClosed afpTooManyFilesOpen afpUserNotAuth afpVolLocked appIsDaemon appMemFullErr appModeErr aspBadVersNum aspBufTooSmall aspNoAck aspNoMoreSess aspNoServers aspParamErr aspServerBusy aspSessClosed aspSizeErr aspTooMany atpBadRsp atpLenErr authFailErr badATPSkt badBtSlpErr badBuffNum badChannel badCksmErr badDBtSlp badDCksum badEditionFileErr badExtResource badFidErr badFileFormat badFormat badLocNameErr badMDBErr badMovErr badPortNameErr badReqErr badSectionErr badServiceMethodErr badSubPartErr badUnitErr bdNamErr breakRecd buf2SmallErr buffersTooSmall cannotDeferErr cannotMakeContiguousErr CantDecompress cantLoadPickMethodErr cantStepErr catChangedErr cbNotFound CDEFNFnd cDevErr channelBusy channelNotBusy ckSumErr clkRdErr clkWrErr closErr cMatchErr cNoMemErr colorsRequestedErr containerAlreadyOpenWrn containerNotFoundWrn controlErr corErr cProtectErr cRangeErr cResErr cTempMemErr dataVerErr dceExtErr ddpLenErr ddpSktErr desktopDamagedErr destPortErr diffVolErr dInstErr dirFulErr dirNFErr dRemovErr ds32BitMode dsAddressErr dsBadLaunch dsBadPatch dsBadPatchHeader dsBadSANEOpcode dsBadSlotInt dsBadStartupDisk dsBufPtrTooLow dsBusError dsCDEFNotFound dsChkErr dsCoreErr dsDisassemblerInstalled dsExtensionsDisabled dsFinderErr dsForcedQuit dsFPErr dsFSErr dsGreeting dsHD20Installed dsHMenuFindErr dsIllInstErr dsIOCoreErr dsIrqErr dskFulErr dsLineAErr dsLineFErr dsLoadErr dsMacsBugInstalled dsMBarNFnd dsMDEFNotFound dsMemFullErr dsMiscErr dsNeedToWriteBootBlocks dsNoFPU dsNoPackErr dsNoPatch dsNoPk1 dsNoPk2 dsNoPk3 dsNoPk4 dsNoPk5 dsNoPk6 dsNoPk7 dsNotEnoughRAMToBoot dsNotThe1 dsOldSystem dsOvflowErr dsParityErr dsPrivErr dsReinsert dsShutDownOrRestart dsStknHeap dsSwitchOffOrRestart dsSysErr dsSystemFileErr dsTraceErr dsWDEFNotFound dsZeroDivErr dupFNErr editionMgrInitErr envBadVers envNotPresent envVersTooBig eofErr evtNotEnb excessCollsns extFSErr extractErr exUserBreak fBsyErr fidExists fidNotFound firstDskErr fLckdErr fmt1Err fmt2Err fnfErr fnOpnErr fontDecError fontNotDeclared fontNotOutlineErr fontSubErr framingErr fsRnErr gcrOnMFMErr gfpErr guestNotAllowedErr hardwareConfigErr hMenuFindErr hwOverrunErr hwParamErr iIOAbortErr initIWMErr interruptsMaskedErr ioErr lapProtErr lastDskErr localOnlyErr mapReadErr mBarNFnd memAdrErr memAZErr memBCErr memFragErr memFullErr memLockedErr memPCErr memPurErr memROZErr memROZError memROZWarn memSCErr memWZErr menuPrgErr mFulErr multiplePublisherWrn nameTypeErr nbpBuffOvr nbpConfDiff nbpDuplicate nbpNISErr nbpNoConfirm nbpNotFound negZcbFreeErr networkErr nilHandleErr nmTypErr noAdrMkErr noBridgeErr noDataArea noDefaultUserErr noDriveErr noDtaMkErr noGlobalsErr noHardware noHardwareErr noInformErr noMacDskErr noMachineNameErr noMemForPictPlaybackErr noMoreRealTime noMPPErr noNybErr noPortErr noRelErr noResponseErr noScrapErr noSendResp noSessionErr notAFileErr notEnoughBufferSpace notEnoughHardware notEnoughHardwareErr notEnoughMemoryErr notHeldErr notInitErr notLockedErr notLoggedInErr noToolboxNameErr notOpenErr notRegisteredSectionErr notThePublisherWrn noTypeErr noUserNameErr noUserRecErr noUserRefErr nsDrvErr nsStackErr nsvErr offLinErr openErr opWrErr paramErr parityErr permErr pictInfoIDErr pictInfoVerbErr pictInfoVersionErr pictureDataErr pixMapTooDeepErr pmBusyErr pmRecvEndErr pmRecvStartErr pmReplyTOErr pmSendEndErr pmSendStartErr portClosedErr portInUse portNameExistsErr portNotCf posErr prInitErr procNotFound protocolErr prWrErr qErr queueFull rcvrErr readErr readQErr recNotFnd reqAborted reqFailed resAttrErr resFNotFound resNotFound resProblem rfNumErr rgnTooBigErr rgnTooBigError rmvRefFailed rmvResFailed sameFileErr sdmInitErr sdmJTInitErr sdmPRAMInitErr sdmPriInitErr sdmSRTInitErr sectNFErr seekErr selectorErr seNoDB sessClosedErr sessTableErr shutDownAlert siBadDeviceName siBadRefNum siBadSoundInDevice siDeviceBusyErr siHardDriveTooSlow siInitSDTblErr siInitSPTblErr siInitVBLQsErr siInputDeviceErr siInvalidCompression siInvalidSampleRate siInvalidSampleSize siNoBufferSpecified siNoSoundInHardware siUnknownInfoType siUnknownQuality sktClosedErr slotNumErr SlpTypeErr smBadBoardId smBadRefId smBadsList smBadsPtrErr smBLFieldBad smBlkMoveErr smBusErrTO smByteLanesErr smCkStatusErr smCodeRevErr smCPUErr smCRCFail smDisabledSlot smDisDrvrNamErr smDisposePErr smEmptySlot smFHBlkDispErr smFHBlockRdErr smFormatErr smGetDrvrNamErr smGetPRErr smInitStatVErr smInitTblVErr smNewPErr smNilsBlockErr smNoBoardId smNoBoardSRsrc smNoDir smNoGoodOpens smNoJmpTbl smNoMoresRsrcs smNosInfoArray smOffsetErr smPRAMInitErr smPriInitErr smRecNotFnd smReservedErr smResrvErr smRevisionErr smSDMInitErr smSelOOBErr smsGetDrvrErr smSlotOOBErr smsPointerNil smSRTInitErr smSRTOvrFlErr smUnExBusErr spdAdjErr statusErr strUserBreak svDisabled svTempDisable swOverrunErr teScrapSizeErr tk0BadErr tmfoErr tmwdoErr tooManyReqs tooManySkts twoSideErr unimpErr unitEmptyErr unitTblFullErr updPixMemErr userBreak userCanceledErr userRejectErr verErr vLckdErr volGoneErr volOffLinErr volOnLinErr vTypErr WDEFNFnd wPrErr wrgVolTypErr writErr wrPermErr wrUnderrun æKY paramErr æFp Errors.p æT CONST æD paramErr = -50; {error in user parameter list} æC æKY noHardwareErr æFp Errors.p æT CONST æD noHardwareErr = -200; {Sound Manager Error Returns} æC æKY notEnoughHardwareErr æFp Errors.p æT CONST æD notEnoughHardwareErr = -201; {Sound Manager Error Returns} æC æKY userCanceledErr æFp Errors.p æT CONST æD userCanceledErr = -128; æC æKY qErr æFp Errors.p æT CONST æD qErr = -1; {queue element not found during deletion} æC æKY vTypErr æFp Errors.p æT CONST æD vTypErr = -2; {invalid queue element} æC æKY corErr æFp Errors.p æT CONST æD corErr = -3; {core routine number out of range} æC æKY unimpErr æFp Errors.p æT CONST æD unimpErr = -4; {unimplemented core routine} æC æKY SlpTypeErr æFp Errors.p æT CONST æD SlpTypeErr = -5; {invalid queue element} æC æKY seNoDB æFp Errors.p æT CONST æD seNoDB = -8; {no debugger installed to handle debugger command} æC æKY controlErr æFp Errors.p æT CONST æD controlErr = -17; {I/O System Errors} æC æKY statusErr æFp Errors.p æT CONST æD statusErr = -18; {I/O System Errors} æC æKY readErr æFp Errors.p æT CONST æD readErr = -19; {I/O System Errors} æC æKY writErr æFp Errors.p æT CONST æD writErr = -20; {I/O System Errors} æC æKY badUnitErr æFp Errors.p æT CONST æD badUnitErr = -21; {I/O System Errors} æC æKY unitEmptyErr æFp Errors.p æT CONST æD unitEmptyErr = -22; {I/O System Errors} æC æKY openErr æFp Errors.p æT CONST æD openErr = -23; {I/O System Errors} æC æKY closErr æFp Errors.p æT CONST æD closErr = -24; {I/O System Errors} æC æKY dRemovErr æFp Errors.p æT CONST æD dRemovErr = -25; {tried to remove an open driver} æC æKY dInstErr æFp Errors.p æT CONST æD dInstErr = -26; {DrvrInstall couldn't find driver in resources } æC æKY abortErr æFp Errors.p æT CONST æD abortErr = -27; {IO call aborted by KillIO} æC æKY iIOAbortErr æFp Errors.p æT CONST æD iIOAbortErr = -27; {IO abort error (Printing Manager)} æC æKY notOpenErr æFp Errors.p æT CONST æD notOpenErr = -28; {Couldn't rd/wr/ctl/sts cause driver not opened} æC æKY unitTblFullErr æFp Errors.p æT CONST æD unitTblFullErr = -29; {unit table has no more entries} æC æKY dceExtErr æFp Errors.p æT CONST æD dceExtErr = -30; {dce extension error} æC æKY slotNumErr æFp Errors.p æT CONST æD slotNumErr = -360; {invalid slot # error} æC æKY gcrOnMFMErr æFp Errors.p æT CONST æD gcrOnMFMErr = -400; {gcr format on high density media error} æC æKY dirFulErr æFp Errors.p æT CONST æD dirFulErr = -33; {Directory full} æC æKY dskFulErr æFp Errors.p æT CONST æD dskFulErr = -34; {disk full} æC æKY nsvErr æFp Errors.p æT CONST æD nsvErr = -35; {no such volume} æC æKY ioErr æFp Errors.p æT CONST æD ioErr = -36; {I/O error (bummers)} æC æKY bdNamErr æFp Errors.p æT CONST æD bdNamErr = -37; {there may be no bad names in the final system!} æC æKY fnOpnErr æFp Errors.p æT CONST æD fnOpnErr = -38; {File not open} æC æKY eofErr æFp Errors.p æT CONST æD eofErr = -39; {End of file} æC æKY posErr æFp Errors.p æT CONST æD posErr = -40; {tried to position to before start of file (r/w)} æC æKY mFulErr æFp Errors.p æT CONST æD mFulErr = -41; {memory full (open) or file won't fit (load)} æC æKY tmfoErr æFp Errors.p æT CONST æD tmfoErr = -42; {too many files open} æC æKY fnfErr æFp Errors.p æT CONST æD fnfErr = -43; {File not found} æC æKY wPrErr æFp Errors.p æT CONST æD wPrErr = -44; {diskette is write protected.} æC æKY fLckdErr æFp Errors.p æT CONST æD fLckdErr = -45; {file is locked} æC æKY vLckdErr æFp Errors.p æT CONST æD vLckdErr = -46; {volume is locked} æC æKY fBsyErr æFp Errors.p æT CONST æD fBsyErr = -47; {File is busy (delete)} æC æKY dupFNErr æFp Errors.p æT CONST æD dupFNErr = -48; {duplicate filename (rename)} æC æKY opWrErr æFp Errors.p æT CONST æD opWrErr = -49; {file already open with with write permission} æC æKY rfNumErr æFp Errors.p æT CONST æD rfNumErr = -51; {refnum error} æC æKY gfpErr æFp Errors.p æT CONST æD gfpErr = -52; {get file position error} æC æKY volOffLinErr æFp Errors.p æT CONST æD volOffLinErr = -53; {volume not on line error (was Ejected)} æC æKY permErr æFp Errors.p æT CONST æD permErr = -54; {permissions error (on file open)} æC æKY volOnLinErr æFp Errors.p æT CONST æD volOnLinErr = -55; {drive volume already on-line at MountVol} æC æKY nsDrvErr æFp Errors.p æT CONST æD nsDrvErr = -56; {no such drive (tried to mount a bad drive num)} æC æKY noMacDskErr æFp Errors.p æT CONST æD noMacDskErr = -57; {not a mac diskette (sig bytes are wrong)} æC æKY extFSErr æFp Errors.p æT CONST æD extFSErr = -58; {volume in question belongs to an external fs} æC æKY fsRnErr æFp Errors.p æT CONST æD fsRnErr = -59; {file system internal error:during rename the old entry was deleted but could not be restored.} æC æKY badMDBErr æFp Errors.p æT CONST æD badMDBErr = -60; {bad master directory block} æC æKY wrPermErr æFp Errors.p æT CONST æD wrPermErr = -61; {write permissions error} æC æKY dirNFErr æFp Errors.p æT CONST æD dirNFErr = -120; {Directory not found} æC æKY tmwdoErr æFp Errors.p æT CONST æD tmwdoErr = -121; {No free WDCB available} æC æKY badMovErr æFp Errors.p æT CONST æD badMovErr = -122; {Move into offspring error} æC æKY wrgVolTypErr æFp Errors.p æT CONST æD wrgVolTypErr = -123; {Wrong volume type error [operation not supported for MFS]} æC æKY volGoneErr æFp Errors.p æT CONST æD volGoneErr = -124; {Server volume has been disconnected.} æC æKY fidNotFound æFp Errors.p æT CONST æD fidNotFound = -1300; {no file thread exists.} æC æKY fidExists æFp Errors.p æT CONST æD fidExists = -1301; {file id already exists} æC æKY notAFileErr æFp Errors.p æT CONST æD notAFileErr = -1302; {directory specified} æC æKY diffVolErr æFp Errors.p æT CONST æD diffVolErr = -1303; {files on different volumes} æC æKY catChangedErr æFp Errors.p æT CONST æD catChangedErr = -1304; {the catalog has been modified} æC æKY desktopDamagedErr æFp Errors.p æT CONST æD desktopDamagedErr = -1305; {desktop database files are corrupted} æC æKY sameFileErr æFp Errors.p æT CONST æD sameFileErr = -1306; {can't exchange a file with itself} æC æKY badFidErr æFp Errors.p æT CONST æD badFidErr = -1307; {file id is dangling or doesn't match with the file number} æC æKY envNotPresent æFp Errors.p æT CONST æD envNotPresent = -5500; {returned by glue.} æC æKY envBadVers æFp Errors.p æT CONST æD envBadVers = -5501; {Version non-positive} æC æKY envVersTooBig æFp Errors.p æT CONST æD envVersTooBig = -5502; {Version bigger than call can handle} æC æKY fontDecError æFp Errors.p æT CONST æD fontDecError = -64; {error during font declaration} æC æKY fontNotDeclared æFp Errors.p æT CONST æD fontNotDeclared = -65; {font not declared} æC æKY fontSubErr æFp Errors.p æT CONST æD fontSubErr = -66; {font substitution occured} æC æKY fontNotOutlineErr æFp Errors.p æT CONST æD fontNotOutlineErr = -32615; {bitmap font passed to routine that does outlines only} æC æKY firstDskErr æFp Errors.p æT CONST æD firstDskErr = -84; {I/O System Errors} æC æKY lastDskErr æFp Errors.p æT CONST æD lastDskErr = -64; {I/O System Errors} æC æKY noDriveErr æFp Errors.p æT CONST æD noDriveErr = -64; {drive not installed} æC æKY offLinErr æFp Errors.p æT CONST æD offLinErr = -65; {r/w requested for an off-line drive} æC æKY noNybErr æFp Errors.p æT CONST æD noNybErr = -66; {couldn't find 5 nybbles in 200 tries} æC æKY noAdrMkErr æFp Errors.p æT CONST æD noAdrMkErr = -67; {couldn't find valid addr mark} æC æKY dataVerErr æFp Errors.p æT CONST æD dataVerErr = -68; {read verify compare failed} æC æKY badCksmErr æFp Errors.p æT CONST æD badCksmErr = -69; {addr mark checksum didn't check} æC æKY badBtSlpErr æFp Errors.p æT CONST æD badBtSlpErr = -70; {bad addr mark bit slip nibbles} æC æKY noDtaMkErr æFp Errors.p æT CONST æD noDtaMkErr = -71; {couldn't find a data mark header} æC æKY badDCksum æFp Errors.p æT CONST æD badDCksum = -72; {bad data mark checksum} æC æKY badDBtSlp æFp Errors.p æT CONST æD badDBtSlp = -73; {bad data mark bit slip nibbles} æC æKY wrUnderrun æFp Errors.p æT CONST æD wrUnderrun = -74; {write underrun occurred} æC æKY cantStepErr æFp Errors.p æT CONST æD cantStepErr = -75; {step handshake failed} æC æKY tk0BadErr æFp Errors.p æT CONST æD tk0BadErr = -76; {track 0 detect doesn't change} æC æKY initIWMErr æFp Errors.p æT CONST æD initIWMErr = -77; {unable to initialize IWM} æC æKY twoSideErr æFp Errors.p æT CONST æD twoSideErr = -78; {tried to read 2nd side on a 1-sided drive} æC æKY spdAdjErr æFp Errors.p æT CONST æD spdAdjErr = -79; {unable to correctly adjust disk speed} æC æKY seekErr æFp Errors.p æT CONST æD seekErr = -80; {track number wrong on address mark} æC æKY sectNFErr æFp Errors.p æT CONST æD sectNFErr = -81; {sector number never found on a track} æC æKY fmt1Err æFp Errors.p æT CONST æD fmt1Err = -82; {can't find sector 0 after track format} æC æKY fmt2Err æFp Errors.p æT CONST æD fmt2Err = -83; {can't get enough sync} æC æKY verErr æFp Errors.p æT CONST æD verErr = -84; {track failed to verify} æC æKY clkRdErr æFp Errors.p æT CONST æD clkRdErr = -85; {unable to read same clock value twice} æC æKY clkWrErr æFp Errors.p æT CONST æD clkWrErr = -86; {time written did not verify} æC æKY prWrErr æFp Errors.p æT CONST æD prWrErr = -87; {parameter ram written didn't read-verify} æC æKY prInitErr æFp Errors.p æT CONST æD prInitErr = -88; {InitUtil found the parameter ram uninitialized} æC æKY rcvrErr æFp Errors.p æT CONST æD rcvrErr = -89; {SCC receiver error (framing; parity; OR)} æC æKY breakRecd æFp Errors.p æT CONST æD breakRecd = -90; {Break received (SCC)} æC æKY pmBusyErr æFp Errors.p æT CONST æD pmBusyErr = -13000; {Power Mgr never ready to start handshake} æC æKY pmReplyTOErr æFp Errors.p æT CONST æD pmReplyTOErr = -13001; {Timed out waiting for reply} æC æKY pmSendStartErr æFp Errors.p æT CONST æD pmSendStartErr = -13002; {during send, pmgr did not start hs} æC æKY pmSendEndErr æFp Errors.p æT CONST æD pmSendEndErr = -13003; {during send, pmgr did not finish hs} æC æKY pmRecvStartErr æFp Errors.p æT CONST æD pmRecvStartErr = -13004; {during receive, pmgr did not start hs} æC æKY pmRecvEndErr æFp Errors.p æT CONST æD pmRecvEndErr = -13005; {during receive, pmgr did not finish hs configured for this connection} æC æKY noScrapErr æFp Errors.p æT CONST æD noScrapErr = -100; {No scrap exists error} æC æKY noTypeErr æFp Errors.p æT CONST æD noTypeErr = -102; {No object of that type in scrap} æC æKY memROZWarn æFp Errors.p æT CONST æD memROZWarn = -99; {soft error in ROZ} æC æKY memROZError æFp Errors.p æT CONST æD memROZError = -99; {hard error in ROZ} æC æKY memROZErr æFp Errors.p æT CONST æD memROZErr = -99; {hard error in ROZ} æC æKY memFullErr æFp Errors.p æT CONST æD memFullErr = -108; {Not enough room in heap zone} æC æKY nilHandleErr æFp Errors.p æT CONST æD nilHandleErr = -109; {Master Pointer was NIL in HandleZone or other} æC æKY memWZErr æFp Errors.p æT CONST æD memWZErr = -111; {WhichZone failed (applied to free block)} æC æKY memPurErr æFp Errors.p æT CONST æD memPurErr = -112; {trying to purge a locked or non-purgeable block} æC æKY memAdrErr æFp Errors.p æT CONST æD memAdrErr = -110; {address was odd; or out of range} æC æKY memAZErr æFp Errors.p æT CONST æD memAZErr = -113; {Address in zone check failed} æC æKY memPCErr æFp Errors.p æT CONST æD memPCErr = -114; {Pointer Check failed} æC æKY memBCErr æFp Errors.p æT CONST æD memBCErr = -115; {Block Check failed} æC æKY memSCErr æFp Errors.p æT CONST æD memSCErr = -116; {Size Check failed} æC æKY memLockedErr æFp Errors.p æT CONST æD memLockedErr = -117; {trying to move a locked block (MoveHHi)} æC æKY resNotFound æFp Errors.p æT CONST æD resNotFound = -192; {Resource not found} æC æKY resFNotFound æFp Errors.p æT CONST æD resFNotFound = -193; {Resource file not found} æC æKY addResFailed æFp Errors.p æT CONST æD addResFailed = -194; {AddResource failed} æC æKY addRefFailed æFp Errors.p æT CONST æD addRefFailed = -195; {AddReference failed} æC æKY rmvResFailed æFp Errors.p æT CONST æD rmvResFailed = -196; {RmveResource failed} æC æKY rmvRefFailed æFp Errors.p æT CONST æD rmvRefFailed = -197; {RmveReference failed} æC æKY resAttrErr æFp Errors.p æT CONST æD resAttrErr = -198; {attribute inconsistent with operation} æC æKY mapReadErr æFp Errors.p æT CONST æD mapReadErr = -199; {map inconsistent with operation} æC æKY CantDecompress æFp Errors.p æT CONST æD CantDecompress = -186; {resource bent ("the bends") - can't decompress a compressed resource} æC æKY badExtResource æFp Errors.p æT CONST æD badExtResource = -185; {extended resource has a bad format.} æC æKY evtNotEnb æFp Errors.p æT CONST æD evtNotEnb = 1; {event not enabled at PostEvent} æC æKY noMemForPictPlaybackErr æFp Errors.p æT CONST æD noMemForPictPlaybackErr = -145; æC æKY rgnTooBigError æFp Errors.p æT CONST æD rgnTooBigError = -147; æC æKY pixMapTooDeepErr æFp Errors.p æT CONST æD pixMapTooDeepErr = -148; æC æKY nsStackErr æFp Errors.p æT CONST æD nsStackErr = -149; æC æKY cMatchErr æFp Errors.p æT CONST æD cMatchErr = -150; {Color2Index failed to find an index} æC æKY cTempMemErr æFp Errors.p æT CONST æD cTempMemErr = -151; {failed to allocate memory for temporary structures} æC æKY cNoMemErr æFp Errors.p æT CONST æD cNoMemErr = -152; {failed to allocate memory for structure} æC æKY cRangeErr æFp Errors.p æT CONST æD cRangeErr = -153; {range error on colorTable request} æC æKY cProtectErr æFp Errors.p æT CONST æD cProtectErr = -154; {colorTable entry protection violation} æC æKY cDevErr æFp Errors.p æT CONST æD cDevErr = -155; {invalid type of graphics device} æC æKY cResErr æFp Errors.p æT CONST æD cResErr = -156; {invalid resolution for MakeITable} æC æKY rgnTooBigErr æFp Errors.p æT CONST æD rgnTooBigErr = -500; æC æKY updPixMemErr æFp Errors.p æT CONST æD updPixMemErr = -125; {insufficient memory to update a pixmap} æC æKY pictInfoVersionErr æFp Errors.p æT CONST æD pictInfoVersionErr = -11000; { wrong version of the PictInfo structure } æC æKY pictInfoIDErr æFp Errors.p æT CONST æD pictInfoIDErr = -11001; { the internal consistancy check for the PictInfoID is wrong } æC æKY pictInfoVerbErr æFp Errors.p æT CONST æD pictInfoVerbErr = -11002; { the passed verb was invalid } æC æKY cantLoadPickMethodErr æFp Errors.p æT CONST æD cantLoadPickMethodErr = -11003; { unable to load the custom pick proc } æC æKY colorsRequestedErr æFp Errors.p æT CONST æD colorsRequestedErr = -11004; { the number of colors requested was illegal } æC æKY pictureDataErr æFp Errors.p æT CONST æD pictureDataErr = -11005; { the picture data was invalid } æC æKY noHardware æFp Errors.p æT CONST æD noHardware = noHardwareErr; {*** obsolete spelling} æC æKY notEnoughHardware æFp Errors.p æT CONST æD notEnoughHardware = notEnoughHardwareErr; {*** obsolete spelling} æC æKY queueFull æFp Errors.p æT CONST æD queueFull = -203; {Sound Manager Error Returns} æC æKY resProblem æFp Errors.p æT CONST æD resProblem = -204; {Sound Manager Error Returns} æC æKY badChannel æFp Errors.p æT CONST æD badChannel = -205; {Sound Manager Error Returns} æC æKY badFormat æFp Errors.p æT CONST æD badFormat = -206; {Sound Manager Error Returns} æC æKY notEnoughBufferSpace æFp Errors.p æT CONST æD notEnoughBufferSpace = -207; { could not allocate enough memory } æC æKY badFileFormat æFp Errors.p æT CONST æD badFileFormat = -208; { was not type AIFF or was of bad format,corrupt } æC æKY channelBusy æFp Errors.p æT CONST æD channelBusy = -209; { the Channel is being used for a PFD already } æC æKY buffersTooSmall æFp Errors.p æT CONST æD buffersTooSmall = -210; { can not operate in the memory allowed } æC æKY channelNotBusy æFp Errors.p æT CONST æD channelNotBusy = -211; æC æKY noMoreRealTime æFp Errors.p æT CONST æD noMoreRealTime = -212; { not enough CPU cycles left to add another task } æC æKY siNoSoundInHardware æFp Errors.p æT CONST æD siNoSoundInHardware = -220; {no Sound Input hardware} æC æKY siBadSoundInDevice æFp Errors.p æT CONST æD siBadSoundInDevice = -221; {invalid index passed to SoundInGetIndexedDevice} æC æKY siNoBufferSpecified æFp Errors.p æT CONST æD siNoBufferSpecified = -222; {returned by synchronous SPBRecord if nil buffer passed} æC æKY siInvalidCompression æFp Errors.p æT CONST æD siInvalidCompression = -223; {invalid compression type} æC æKY siHardDriveTooSlow æFp Errors.p æT CONST æD siHardDriveTooSlow = -224; {hard drive too slow to record to disk} æC æKY siInvalidSampleRate æFp Errors.p æT CONST æD siInvalidSampleRate = -225; {invalid sample rate} æC æKY siInvalidSampleSize æFp Errors.p æT CONST æD siInvalidSampleSize = -226; {invalid sample size} æC æKY siDeviceBusyErr æFp Errors.p æT CONST æD siDeviceBusyErr = -227; {input device already in use} æC æKY siBadDeviceName æFp Errors.p æT CONST æD siBadDeviceName = -228; {input device could not be opened} æC æKY siBadRefNum æFp Errors.p æT CONST æD siBadRefNum = -229; {invalid input device reference number} æC æKY siInputDeviceErr æFp Errors.p æT CONST æD siInputDeviceErr = -230; {input device hardware failure} æC æKY siUnknownInfoType æFp Errors.p æT CONST æD siUnknownInfoType = -231; {invalid info type selector (returned by driver)} æC æKY siUnknownQuality æFp Errors.p æT CONST æD siUnknownQuality = -232; {invalid quality selector (returned by driver)} æC æKY nmTypErr æFp Errors.p æT CONST æD nmTypErr = -299; {wrong queue type} æC æKY siInitSDTblErr æFp Errors.p æT CONST æD siInitSDTblErr = 1; {slot int dispatch table could not be initialized.} æC æKY siInitVBLQsErr æFp Errors.p æT CONST æD siInitVBLQsErr = 2; {VBLqueues for all slots could not be initialized.} æC æKY siInitSPTblErr æFp Errors.p æT CONST æD siInitSPTblErr = 3; {slot priority table could not be initialized.} æC æKY sdmJTInitErr æFp Errors.p æT CONST æD sdmJTInitErr = 10; {SDM Jump Table could not be initialized.} æC æKY sdmInitErr æFp Errors.p æT CONST æD sdmInitErr = 11; {SDM could not be initialized.} æC æKY sdmSRTInitErr æFp Errors.p æT CONST æD sdmSRTInitErr = 12; {Slot Resource Table could not be initialized.} æC æKY sdmPRAMInitErr æFp Errors.p æT CONST æD sdmPRAMInitErr = 13; {Slot PRAM could not be initialized.} æC æKY sdmPriInitErr æFp Errors.p æT CONST æD sdmPriInitErr = 14; {Cards could not be initialized.} æC æKY smSDMInitErr æFp Errors.p æT CONST æD smSDMInitErr = -290; {Error; SDM could not be initialized.} æC æKY smSRTInitErr æFp Errors.p æT CONST æD smSRTInitErr = -291; {Error; Slot Resource Table could not be initialized.} æC æKY smPRAMInitErr æFp Errors.p æT CONST æD smPRAMInitErr = -292; {Error; Slot Resource Table could not be initialized.} æC æKY smPriInitErr æFp Errors.p æT CONST æD smPriInitErr = -293; {Error; Cards could not be initialized.} æC æKY smEmptySlot æFp Errors.p æT CONST æD smEmptySlot = -300; {No card in slot} æC æKY smCRCFail æFp Errors.p æT CONST æD smCRCFail = -301; {CRC check failed for declaration data} æC æKY smFormatErr æFp Errors.p æT CONST æD smFormatErr = -302; {FHeader Format is not Apple's} æC æKY smRevisionErr æFp Errors.p æT CONST æD smRevisionErr = -303; {Wrong revison level} æC æKY smNoDir æFp Errors.p æT CONST æD smNoDir = -304; {Directory offset is Nil } æC æKY smDisabledSlot æFp Errors.p æT CONST æD smDisabledSlot = -305; {This slot is disabled (-305 use to be smLWTstBad)} æC æKY smNosInfoArray æFp Errors.p æT CONST æD smNosInfoArray = -306; {No sInfoArray. Memory Mgr error.} æC æKY smResrvErr æFp Errors.p æT CONST æD smResrvErr = -307; {Fatal reserved error. Resreved field <> 0.} æC æKY smUnExBusErr æFp Errors.p æT CONST æD smUnExBusErr = -308; {Unexpected BusError} æC æKY smBLFieldBad æFp Errors.p æT CONST æD smBLFieldBad = -309; {ByteLanes field was bad.} æC æKY smFHBlockRdErr æFp Errors.p æT CONST æD smFHBlockRdErr = -310; {Error occured during _sGetFHeader.} æC æKY smFHBlkDispErr æFp Errors.p æT CONST æD smFHBlkDispErr = -311; {Error occured during _sDisposePtr (Dispose of FHeader block).} æC æKY smDisposePErr æFp Errors.p æT CONST æD smDisposePErr = -312; {_DisposePointer error} æC æKY smNoBoardSRsrc æFp Errors.p æT CONST æD smNoBoardSRsrc = -313; {No Board sResource.} æC æKY smGetPRErr æFp Errors.p æT CONST æD smGetPRErr = -314; {Error occured during _sGetPRAMRec (See SIMStatus).} æC æKY smNoBoardId æFp Errors.p æT CONST æD smNoBoardId = -315; {No Board Id.} æC æKY smInitStatVErr æFp Errors.p æT CONST æD smInitStatVErr = -316; {The InitStatusV field was negative after primary or secondary init.} æC æKY smInitTblVErr æFp Errors.p æT CONST æD smInitTblVErr = -317; {An error occured while trying to initialize the Slot Resource Table.} æC æKY smNoJmpTbl æFp Errors.p æT CONST æD smNoJmpTbl = -318; {SDM jump table could not be created.} æC æKY smBadBoardId æFp Errors.p æT CONST æD smBadBoardId = -319; {BoardId was wrong; re-init the PRAM record.} æC æKY smBusErrTO æFp Errors.p æT CONST æD smBusErrTO = -320; {BusError time out.} æC æKY svTempDisable æFp Errors.p æT CONST æD svTempDisable = -32768; {Temporarily disable card but run primary init.} æC æKY svDisabled æFp Errors.p æT CONST æD svDisabled = -32640; {Reserve range -32640 to -32768 for Apple temp disables.} æC æKY smBadRefId æFp Errors.p æT CONST æD smBadRefId = -330; {Reference Id not found in List} æC æKY smBadsList æFp Errors.p æT CONST æD smBadsList = -331; {Bad sList: Id1 < Id2 < Id3 ...format is not followed.} æC æKY smReservedErr æFp Errors.p æT CONST æD smReservedErr = -332; {Reserved field not zero} æC æKY smCodeRevErr æFp Errors.p æT CONST æD smCodeRevErr = -333; {Code revision is wrong} æC æKY smCPUErr æFp Errors.p æT CONST æD smCPUErr = -334; {Code revision is wrong} æC æKY smsPointerNil æFp Errors.p æT CONST æD smsPointerNil = -335; {LPointer is nil From sOffsetData. If this error occurs; check sInfo rec for more information.} æC æKY smNilsBlockErr æFp Errors.p æT CONST æD smNilsBlockErr = -336; {Nil sBlock error (Dont allocate and try to use a nil sBlock)} æC æKY smSlotOOBErr æFp Errors.p æT CONST æD smSlotOOBErr = -337; {Slot out of bounds error} æC æKY smSelOOBErr æFp Errors.p æT CONST æD smSelOOBErr = -338; {Selector out of bounds error} æC æKY smNewPErr æFp Errors.p æT CONST æD smNewPErr = -339; {_NewPtr error} æC æKY smBlkMoveErr æFp Errors.p æT CONST æD smBlkMoveErr = -340; {_BlockMove error} æC æKY smCkStatusErr æFp Errors.p æT CONST æD smCkStatusErr = -341; {Status of slot = fail.} æC æKY smGetDrvrNamErr æFp Errors.p æT CONST æD smGetDrvrNamErr = -342; {Error occured during _sGetDrvrName.} æC æKY smDisDrvrNamErr æFp Errors.p æT CONST æD smDisDrvrNamErr = -343; {Error occured during _sDisDrvrName.} æC æKY smNoMoresRsrcs æFp Errors.p æT CONST æD smNoMoresRsrcs = -344; {No more sResources} æC æKY smsGetDrvrErr æFp Errors.p æT CONST æD smsGetDrvrErr = -345; {Error occurred during _sGetDriver.} æC æKY smBadsPtrErr æFp Errors.p æT CONST æD smBadsPtrErr = -346; {Bad pointer was passed to sCalcsPointer} æC æKY smByteLanesErr æFp Errors.p æT CONST æD smByteLanesErr = -347; {NumByteLanes was determined to be zero.} æC æKY smOffsetErr æFp Errors.p æT CONST æD smOffsetErr = -348; {Offset was too big (temporary error} æC æKY smNoGoodOpens æFp Errors.p æT CONST æD smNoGoodOpens = -349; {No opens were successfull in the loop.} æC æKY smSRTOvrFlErr æFp Errors.p æT CONST æD smSRTOvrFlErr = -350; {SRT over flow.} æC æKY smRecNotFnd æFp Errors.p æT CONST æD smRecNotFnd = -351; {Record not found in the SRT.} æC æKY editionMgrInitErr æFp Errors.p æT CONST æD editionMgrInitErr = -450; {edition manager not inited by this app} æC æKY badSectionErr æFp Errors.p æT CONST æD badSectionErr = -451; {not a valid SectionRecord} æC æKY notRegisteredSectionErr æFp Errors.p æT CONST æD notRegisteredSectionErr = -452; {not a registered SectionRecord} æC æKY badEditionFileErr æFp Errors.p æT CONST æD badEditionFileErr = -453; {edition file is corrupt} æC æKY badSubPartErr æFp Errors.p æT CONST æD badSubPartErr = -454; {can not use sub parts in this release} æC æKY multiplePublisherWrn æFp Errors.p æT CONST æD multiplePublisherWrn = -460; {A Publisher is already registered for that container} æC æKY containerNotFoundWrn æFp Errors.p æT CONST æD containerNotFoundWrn = -461; {could not find editionContainer at this time} æC æKY containerAlreadyOpenWrn æFp Errors.p æT CONST æD containerAlreadyOpenWrn = -462; {container already opened by this section} æC æKY notThePublisherWrn æFp Errors.p æT CONST æD notThePublisherWrn = -463; {not the first registered publisher for that container} æC æKY teScrapSizeErr æFp Errors.p æT CONST æD teScrapSizeErr = -501; {scrap item too big for text edit record} æC æKY hwParamErr æFp Errors.p æT CONST æD hwParamErr = -502; {bad selector for _HWPriv} æC æKY procNotFound æFp Errors.p æT CONST æD procNotFound = -600; { no eligible process with specified descriptor } æC æKY memFragErr æFp Errors.p æT CONST æD memFragErr = -601; { not enough room to launch app w/special requirements } æC æKY appModeErr æFp Errors.p æT CONST æD appModeErr = -602; { memory mode is 32-bit, but app not 32-bit clean } æC æKY protocolErr æFp Errors.p æT CONST æD protocolErr = -603; { app made module calls in improper order } æC æKY hardwareConfigErr æFp Errors.p æT CONST æD hardwareConfigErr = -604; { hardware configuration not correct for call } æC æKY appMemFullErr æFp Errors.p æT CONST æD appMemFullErr = -605; { application SIZE not big enough for launch } æC æKY appIsDaemon æFp Errors.p æT CONST æD appIsDaemon = -606; { app is BG-only, and launch flags disallow this } æC æKY notEnoughMemoryErr æFp Errors.p æT CONST æD notEnoughMemoryErr = -620; {insufficient physical memory} æC æKY notHeldErr æFp Errors.p æT CONST æD notHeldErr = -621; {specified range of memory is not held} æC æKY cannotMakeContiguousErr æFp Errors.p æT CONST æD cannotMakeContiguousErr = -622; {cannot make specified range contiguous} æC æKY notLockedErr æFp Errors.p æT CONST æD notLockedErr = -623; {specified range of memory is not locked} æC æKY interruptsMaskedErr æFp Errors.p æT CONST æD interruptsMaskedErr = -624; {don’t call with interrupts masked} æC æKY cannotDeferErr æFp Errors.p æT CONST æD cannotDeferErr = -625; {unable to defer additional functions} æC æKY ddpSktErr æFp Errors.p æT CONST æD ddpSktErr = -91; {error in soket number} æC æKY ddpLenErr æFp Errors.p æT CONST æD ddpLenErr = -92; {data length too big} æC æKY noBridgeErr æFp Errors.p æT CONST æD noBridgeErr = -93; {no network bridge for non-local send} æC æKY lapProtErr æFp Errors.p æT CONST æD lapProtErr = -94; {error in attaching/detaching protocol} æC æKY excessCollsns æFp Errors.p æT CONST æD excessCollsns = -95; {excessive collisions on write} æC æKY portInUse æFp Errors.p æT CONST æD portInUse = -97; {driver Open error code (port is in use)} æC æKY portNotCf æFp Errors.p æT CONST æD portNotCf = -98; {driver Open error code (parameter RAM not configured for this connection)} æC æKY nbpBuffOvr æFp Errors.p æT CONST æD nbpBuffOvr = -1024; {Buffer overflow in LookupName} æC æKY nbpNoConfirm æFp Errors.p æT CONST æD nbpNoConfirm = -1025; æC æKY nbpConfDiff æFp Errors.p æT CONST æD nbpConfDiff = -1026; {Name confirmed at different socket} æC æKY nbpDuplicate æFp Errors.p æT CONST æD nbpDuplicate = -1027; {Duplicate name exists already} æC æKY nbpNotFound æFp Errors.p æT CONST æD nbpNotFound = -1028; {Name not found on remove} æC æKY nbpNISErr æFp Errors.p æT CONST æD nbpNISErr = -1029; {Error trying to open the NIS} æC æKY aspBadVersNum æFp Errors.p æT CONST æD aspBadVersNum = -1066; {Server cannot support this ASP version} æC æKY aspBufTooSmall æFp Errors.p æT CONST æD aspBufTooSmall = -1067; {Buffer too small} æC æKY aspNoMoreSess æFp Errors.p æT CONST æD aspNoMoreSess = -1068; {No more sessions on server} æC æKY aspNoServers æFp Errors.p æT CONST æD aspNoServers = -1069; {No servers at that address} æC æKY aspParamErr æFp Errors.p æT CONST æD aspParamErr = -1070; {Parameter error} æC æKY aspServerBusy æFp Errors.p æT CONST æD aspServerBusy = -1071; {Server cannot open another session} æC æKY aspSessClosed æFp Errors.p æT CONST æD aspSessClosed = -1072; {Session closed} æC æKY aspSizeErr æFp Errors.p æT CONST æD aspSizeErr = -1073; {Command block too big} æC æKY aspTooMany æFp Errors.p æT CONST æD aspTooMany = -1074; {Too many clients (server error)} æC æKY aspNoAck æFp Errors.p æT CONST æD aspNoAck = -1075; {No ack on attention request (server err)} æC æKY reqFailed æFp Errors.p æT CONST æD reqFailed = -1096; æC æKY tooManyReqs æFp Errors.p æT CONST æD tooManyReqs = -1097; æC æKY tooManySkts æFp Errors.p æT CONST æD tooManySkts = -1098; æC æKY badATPSkt æFp Errors.p æT CONST æD badATPSkt = -1099; æC æKY badBuffNum æFp Errors.p æT CONST æD badBuffNum = -1100; æC æKY noRelErr æFp Errors.p æT CONST æD noRelErr = -1101; æC æKY cbNotFound æFp Errors.p æT CONST æD cbNotFound = -1102; æC æKY noSendResp æFp Errors.p æT CONST æD noSendResp = -1103; æC æKY noDataArea æFp Errors.p æT CONST æD noDataArea = -1104; æC æKY reqAborted æFp Errors.p æT CONST æD reqAborted = -1105; æC æKY buf2SmallErr æFp Errors.p æT CONST æD buf2SmallErr = -3101; æC æKY noMPPErr æFp Errors.p æT CONST æD noMPPErr = -3102; æC æKY ckSumErr æFp Errors.p æT CONST æD ckSumErr = -3103; æC æKY extractErr æFp Errors.p æT CONST æD extractErr = -3104; æC æKY readQErr æFp Errors.p æT CONST æD readQErr = -3105; æC æKY atpLenErr æFp Errors.p æT CONST æD atpLenErr = -3106; æC æKY atpBadRsp æFp Errors.p æT CONST æD atpBadRsp = -3107; æC æKY recNotFnd æFp Errors.p æT CONST æD recNotFnd = -3108; æC æKY sktClosedErr æFp Errors.p æT CONST æD sktClosedErr = -3109; æC æKY afpAccessDenied æFp Errors.p æT CONST æD afpAccessDenied = -5000; æC æKY afpAuthContinue æFp Errors.p æT CONST æD afpAuthContinue = -5001; æC æKY afpBadUAM æFp Errors.p æT CONST æD afpBadUAM = -5002; æC æKY afpBadVersNum æFp Errors.p æT CONST æD afpBadVersNum = -5003; æC æKY afpBitmapErr æFp Errors.p æT CONST æD afpBitmapErr = -5004; æC æKY afpCantMove æFp Errors.p æT CONST æD afpCantMove = -5005; æC æKY afpDenyConflict æFp Errors.p æT CONST æD afpDenyConflict = -5006; æC æKY afpDirNotEmpty æFp Errors.p æT CONST æD afpDirNotEmpty = -5007; æC æKY afpDiskFull æFp Errors.p æT CONST æD afpDiskFull = -5008; æC æKY afpEofError æFp Errors.p æT CONST æD afpEofError = -5009; æC æKY afpFileBusy æFp Errors.p æT CONST æD afpFileBusy = -5010; æC æKY afpFlatVol æFp Errors.p æT CONST æD afpFlatVol = -5011; æC æKY afpItemNotFound æFp Errors.p æT CONST æD afpItemNotFound = -5012; æC æKY afpLockErr æFp Errors.p æT CONST æD afpLockErr = -5013; æC æKY afpMiscErr æFp Errors.p æT CONST æD afpMiscErr = -5014; æC æKY afpNoMoreLocks æFp Errors.p æT CONST æD afpNoMoreLocks = -5015; æC æKY afpNoServer æFp Errors.p æT CONST æD afpNoServer = -5016; æC æKY afpObjectExists æFp Errors.p æT CONST æD afpObjectExists = -5017; æC æKY afpObjectNotFound æFp Errors.p æT CONST æD afpObjectNotFound = -5018; æC æKY afpParmErr æFp Errors.p æT CONST æD afpParmErr = -5019; æC æKY afpRangeNotLocked æFp Errors.p æT CONST æD afpRangeNotLocked = -5020; æC æKY afpRangeOverlap æFp Errors.p æT CONST æD afpRangeOverlap = -5021; æC æKY afpSessClosed æFp Errors.p æT CONST æD afpSessClosed = -5022; æC æKY afpUserNotAuth æFp Errors.p æT CONST æD afpUserNotAuth = -5023; æC æKY afpCallNotSupported æFp Errors.p æT CONST æD afpCallNotSupported = -5024; æC æKY afpObjectTypeErr æFp Errors.p æT CONST æD afpObjectTypeErr = -5025; æC æKY afpTooManyFilesOpen æFp Errors.p æT CONST æD afpTooManyFilesOpen = -5026; æC æKY afpServerGoingDown æFp Errors.p æT CONST æD afpServerGoingDown = -5027; æC æKY afpCantRename æFp Errors.p æT CONST æD afpCantRename = -5028; æC æKY afpDirNotFound æFp Errors.p æT CONST æD afpDirNotFound = -5029; æC æKY afpIconTypeError æFp Errors.p æT CONST æD afpIconTypeError = -5030; æC æKY afpVolLocked æFp Errors.p æT CONST æD afpVolLocked = -5031; {Volume is Read-Only} æC æKY afpObjectLocked æFp Errors.p æT CONST æD afpObjectLocked = -5032; {Object is M/R/D/W inhibited} æC æKY afpContainsSharedErr æFp Errors.p æT CONST æD afpContainsSharedErr = -5033; {$FFFFEC57 the folder being shared contains a shared folder } æC æKY afpIDNotFound æFp Errors.p æT CONST æD afpIDNotFound = -5034; {$FFFFEC56} æC æKY afpIDExists æFp Errors.p æT CONST æD afpIDExists = -5035; {$FFFFEC55} æC æKY afpDiffVolErr æFp Errors.p æT CONST æD afpDiffVolErr = -5036; {$FFFFEC54} æC æKY afpCatalogChanged æFp Errors.p æT CONST æD afpCatalogChanged = -5037; {$FFFFEC53} æC æKY afpSameObjectErr æFp Errors.p æT CONST æD afpSameObjectErr = -5038; {$FFFFEC52} æC æKY afpBadIDErr æFp Errors.p æT CONST æD afpBadIDErr = -5039; {$FFFFEC51} æC æKY afpPwdSameErr æFp Errors.p æT CONST æD afpPwdSameErr = -5040; {$FFFFEC50 someone tried to change their password to the same password on a mantadory password change } æC æKY afpPwdTooShortErr æFp Errors.p æT CONST æD afpPwdTooShortErr = -5041; {$FFFFEC4F the password being set is too short: there is a minimum length that must be met or exceeded } æC æKY afpPwdExpiredErr æFp Errors.p æT CONST æD afpPwdExpiredErr = -5042; {$FFFFEC4E the password being used is too old: this requires the user to change the password before log-in can continue } æC æKY afpInsideSharedErr æFp Errors.p æT CONST æD afpInsideSharedErr = -5043; {$FFFFEC4D the folder being shared is inside a shared folder OR the folder contains a shared folder and is being moved into a shared folder OR the folder contains a shared folder and is being moved into the descendent of a shared folder. } æC æKY afpInsideTrashErr æFp Errors.p æT CONST æD afpInsideTrashErr = -5044; {$FFFFEC4C the folder being shared is inside the trash folder OR the shared folder is being moved into the trash folder OR the folder is being moved to the trash and it contains a shared folder } æC æKY notInitErr æFp Errors.p æT CONST æD notInitErr = -900; { PPCToolBox not initialized } æC æKY nameTypeErr æFp Errors.p æT CONST æD nameTypeErr = -902; { Invalid or inappropriate locationKindSelector in locationName } æC æKY noPortErr æFp Errors.p æT CONST æD noPortErr = -903; { Unable to open port or bad portRefNum } æC æKY noGlobalsErr æFp Errors.p æT CONST æD noGlobalsErr = -904; { The system is hosed, better re-boot } æC æKY localOnlyErr æFp Errors.p æT CONST æD localOnlyErr = -905; { Network activity is currently disabled } æC æKY destPortErr æFp Errors.p æT CONST æD destPortErr = -906; { Port does not exist at destination } æC æKY sessTableErr æFp Errors.p æT CONST æD sessTableErr = -907; { Out of session tables, try again later } æC æKY noSessionErr æFp Errors.p æT CONST æD noSessionErr = -908; { Invalid session reference number } æC æKY badReqErr æFp Errors.p æT CONST æD badReqErr = -909; { bad parameter or invalid state for operation } æC æKY portNameExistsErr æFp Errors.p æT CONST æD portNameExistsErr = -910; { port is already open (perhaps in another app) } æC æKY noUserNameErr æFp Errors.p æT CONST æD noUserNameErr = -911; { user name unknown on destination machine } æC æKY userRejectErr æFp Errors.p æT CONST æD userRejectErr = -912; { Destination rejected the session request } æC æKY noMachineNameErr æFp Errors.p æT CONST æD noMachineNameErr = -913; { user hasn't named his Macintosh in the Network Setup Control Panel } æC æKY noToolboxNameErr æFp Errors.p æT CONST æD noToolboxNameErr = -914; { A system resource is missing, not too likely } æC æKY noResponseErr æFp Errors.p æT CONST æD noResponseErr = -915; { unable to contact destination } æC æKY portClosedErr æFp Errors.p æT CONST æD portClosedErr = -916; { port was closed } æC æKY sessClosedErr æFp Errors.p æT CONST æD sessClosedErr = -917; { session was closed } æC æKY badPortNameErr æFp Errors.p æT CONST æD badPortNameErr = -919; { PPCPortRec malformed } æC æKY noDefaultUserErr æFp Errors.p æT CONST æD noDefaultUserErr = -922; { user hasn't typed in owners name in Network Setup Control Pannel } æC æKY notLoggedInErr æFp Errors.p æT CONST æD notLoggedInErr = -923; { The default userRefNum does not yet exist } æC æKY noUserRefErr æFp Errors.p æT CONST æD noUserRefErr = -924; { unable to create a new userRefNum } æC æKY networkErr æFp Errors.p æT CONST æD networkErr = -925; { An error has occured in the network, not too likely } æC æKY noInformErr æFp Errors.p æT CONST æD noInformErr = -926; { PPCStart failed because destination did not have inform pending } æC æKY authFailErr æFp Errors.p æT CONST æD authFailErr = -927; { unable to authenticate user at destination } æC æKY noUserRecErr æFp Errors.p æT CONST æD noUserRecErr = -928; { Invalid user reference number } æC æKY badServiceMethodErr æFp Errors.p æT CONST æD badServiceMethodErr = -930; { illegal service type, or not supported } æC æKY badLocNameErr æFp Errors.p æT CONST æD badLocNameErr = -931; { location name malformed } æC æKY guestNotAllowedErr æFp Errors.p æT CONST æD guestNotAllowedErr = -932; { destination port requires authentication } æC æKY swOverrunErr æFp Errors.p æT CONST æD swOverrunErr = 1; {serial driver error masks} æC æKY parityErr æFp Errors.p æT CONST æD parityErr = 16; {serial driver error masks} æC æKY hwOverrunErr æFp Errors.p æT CONST æD hwOverrunErr = 32; {serial driver error masks} æC æKY framingErr æFp Errors.p æT CONST æD framingErr = 64; {serial driver error masks} æC æKY dsBusError æFp Errors.p æT CONST æD dsBusError = 1; {bus error } æC æKY dsAddressErr æFp Errors.p æT CONST æD dsAddressErr = 2; {address error} æC æKY dsIllInstErr æFp Errors.p æT CONST æD dsIllInstErr = 3; {illegal instruction error} æC æKY dsZeroDivErr æFp Errors.p æT CONST æD dsZeroDivErr = 4; {zero divide error} æC æKY dsChkErr æFp Errors.p æT CONST æD dsChkErr = 5; {check trap error} æC æKY dsOvflowErr æFp Errors.p æT CONST æD dsOvflowErr = 6; {overflow trap error} æC æKY dsPrivErr æFp Errors.p æT CONST æD dsPrivErr = 7; {privilege violation error} æC æKY dsTraceErr æFp Errors.p æT CONST æD dsTraceErr = 8; {trace mode error} æC æKY dsLineAErr æFp Errors.p æT CONST æD dsLineAErr = 9; {line 1010 trap error} æC æKY dsLineFErr æFp Errors.p æT CONST æD dsLineFErr = 10; {line 1111 trap error} æC æKY dsMiscErr æFp Errors.p æT CONST æD dsMiscErr = 11; {miscellaneous hardware exception error} æC æKY dsCoreErr æFp Errors.p æT CONST æD dsCoreErr = 12; {unimplemented core routine error} æC æKY dsIrqErr æFp Errors.p æT CONST æD dsIrqErr = 13; {uninstalled interrupt error} æC æKY dsIOCoreErr æFp Errors.p æT CONST æD dsIOCoreErr = 14; {IO Core Error} æC æKY dsLoadErr æFp Errors.p æT CONST æD dsLoadErr = 15; {Segment Loader Error} æC æKY dsFPErr æFp Errors.p æT CONST æD dsFPErr = 16; {Floating point error} æC æKY dsNoPackErr æFp Errors.p æT CONST æD dsNoPackErr = 17; {package 0 not present} æC æKY dsNoPk1 æFp Errors.p æT CONST æD dsNoPk1 = 18; {package 1 not present} æC æKY dsNoPk2 æFp Errors.p æT CONST æD dsNoPk2 = 19; {package 2 not present} æC æKY dsNoPk3 æFp Errors.p æT CONST æD dsNoPk3 = 20; {package 3 not present} æC æKY dsNoPk4 æFp Errors.p æT CONST æD dsNoPk4 = 21; {package 4 not present} æC æKY dsNoPk5 æFp Errors.p æT CONST æD dsNoPk5 = 22; {package 5 not present} æC æKY dsNoPk6 æFp Errors.p æT CONST æD dsNoPk6 = 23; {package 6 not present} æC æKY dsNoPk7 æFp Errors.p æT CONST æD dsNoPk7 = 24; {package 7 not present} æC æKY dsMemFullErr æFp Errors.p æT CONST æD dsMemFullErr = 25; {out of memory!} æC æKY dsBadLaunch æFp Errors.p æT CONST æD dsBadLaunch = 26; {can't launch file} æC æKY dsFSErr æFp Errors.p æT CONST æD dsFSErr = 27; {file system map has been trashed} æC æKY dsStknHeap æFp Errors.p æT CONST æD dsStknHeap = 28; {stack has moved into application heap} æC æKY negZcbFreeErr æFp Errors.p æT CONST æD negZcbFreeErr = 33; {ZcbFree has gone negative} æC æKY dsFinderErr æFp Errors.p æT CONST æD dsFinderErr = 41; {can't load the Finder error} æC æKY dsBadSlotInt æFp Errors.p æT CONST æD dsBadSlotInt = 51; {unserviceable slot interrupt} æC æKY dsBadSANEOpcode æFp Errors.p æT CONST æD dsBadSANEOpcode = 81; {bad opcode given to SANE Pack4} æC æKY dsBadPatchHeader æFp Errors.p æT CONST æD dsBadPatchHeader = 83; {SetTrapAddress saw the “come-from” header} æC æKY menuPrgErr æFp Errors.p æT CONST æD menuPrgErr = 84; {happens when a menu is purged} æC æKY dsMBarNFnd æFp Errors.p æT CONST æD dsMBarNFnd = 85; {Menu Manager Errors} æC æKY dsHMenuFindErr æFp Errors.p æT CONST æD dsHMenuFindErr = 86; {Menu Manager Errors} æC æKY dsWDEFNotFound æFp Errors.p æT CONST æD dsWDEFNotFound = 87; {could not load WDEF} æC æKY dsCDEFNotFound æFp Errors.p æT CONST æD dsCDEFNotFound = 88; {could not load CDEF} æC æKY dsMDEFNotFound æFp Errors.p æT CONST æD dsMDEFNotFound = 89; {could not load MDEF} æC æKY dsNoFPU æFp Errors.p æT CONST æD dsNoFPU = 90; {an FPU instruction was executed and the machine doesn’t have one} æC æKY dsNoPatch æFp Errors.p æT CONST æD dsNoPatch = 98; {Can't patch for particular Model Mac} æC æKY dsBadPatch æFp Errors.p æT CONST æD dsBadPatch = 99; {Can't load patch resource} æC æKY dsParityErr æFp Errors.p æT CONST æD dsParityErr = 101; {memory parity error} æC æKY dsOldSystem æFp Errors.p æT CONST æD dsOldSystem = 102; {System is too old for this ROM} æC æKY ds32BitMode æFp Errors.p æT CONST æD ds32BitMode = 103; {booting in 32-bit on a 24-bit sys} æC æKY dsNeedToWriteBootBlocks æFp Errors.p æT CONST æD dsNeedToWriteBootBlocks = 104; {need to write new boot blocks} æC æKY dsNotEnoughRAMToBoot æFp Errors.p æT CONST æD dsNotEnoughRAMToBoot = 105; {must have at least 1.5MB of RAM to boot 7.0} æC æKY dsBufPtrTooLow æFp Errors.p æT CONST æD dsBufPtrTooLow = 106; {bufPtr moved too far during boot} æC æKY dsReinsert æFp Errors.p æT CONST æD dsReinsert = 30; {request user to reinsert off-line volume} æC æKY shutDownAlert æFp Errors.p æT CONST æD shutDownAlert = 42; {handled like a shutdown error} æC æKY dsShutDownOrRestart æFp Errors.p æT CONST æD dsShutDownOrRestart = 20000; {user choice between ShutDown and Restart} æC æKY dsSwitchOffOrRestart æFp Errors.p æT CONST æD dsSwitchOffOrRestart = 20001; {user choice between switching off and Restart} æC æKY dsForcedQuit æFp Errors.p æT CONST æD dsForcedQuit = 20002; {allow the user to ExitToShell, return if Cancel} æC æKY dsMacsBugInstalled æFp Errors.p æT CONST æD dsMacsBugInstalled = -10; {say “MacsBug Installed”} æC æKY dsDisassemblerInstalled æFp Errors.p æT CONST æD dsDisassemblerInstalled = -11; {say “Disassembler Installed”} æC æKY dsExtensionsDisabled æFp Errors.p æT CONST æD dsExtensionsDisabled = -13; {say “Extensions Disabled”} æC æKY dsGreeting æFp Errors.p æT CONST æD dsGreeting = 40; {welcome to Macintosh greeting} æC æKY dsSysErr æFp Errors.p æT CONST æD dsSysErr = 32767; {general system error} æC æKY WDEFNFnd æFp Errors.p æT CONST æD WDEFNFnd = dsWDEFNotFound; æC æKY CDEFNFnd æFp Errors.p æT CONST æD CDEFNFnd = dsCDEFNotFound; æC æKY dsNotThe1 æFp Errors.p æT CONST æD dsNotThe1 = 31; {not the disk I wanted} æC æKY dsBadStartupDisk æFp Errors.p æT CONST æD dsBadStartupDisk = 42; {unable to mount boot volume (sad Mac only)} æC æKY dsSystemFileErr æFp Errors.p æT CONST æD dsSystemFileErr = 43; {can’t find System file to open (sad Mac only)} æC æKY dsHD20Installed æFp Errors.p æT CONST æD dsHD20Installed = -12; {say “HD20 Startup”} æC æKY mBarNFnd æFp Errors.p æT CONST æD mBarNFnd = -126; {system error code for MBDF not found} æC æKY hMenuFindErr æFp Errors.p æT CONST æD hMenuFindErr = -127; {could not find HMenu's parent in MenuKey} æC æKY userBreak æFp Errors.p æT CONST æD userBreak = -490; {user debugger break} æC æKY strUserBreak æFp Errors.p æT CONST æD strUserBreak = -491; {user debugger break; display string on stack} æC æKY exUserBreak æFp Errors.p æT CONST æD exUserBreak = -492; {user debugger break; execute debugger commands on stack} æC æKY selectorErr æFp Errors.p æT CONST æD selectorErr = paramErr; {bad selector, for selector-based traps} æC æKY SysError æFp Errors.p æT PROCEDURE æD PROCEDURE SysError(errorCode: INTEGER); INLINE $301F,$A9C9; æDT SysError(errorCode); æMM æRI II-362, V-572 æC _____________________________________________________________________________________ Trap macro _SysError On entry D0: errorCode (word) On exit All registers changed _____________________________________________________________________________________ SysError generates a system error with the ID specified by the errorCode parameter. It takes the following precise steps: 1. It saves all registers and the stack pointer. 2. It stores the system error ID in a global variable (named DSErrCode). 3. It checks to see whether there's a system error alert table in memory (by testing whether the global variable DSAlertTab is 0); if there isn't, it draws the "sad Macintosh" icon. 4. It allocates memory for QuickDraw globals on the stack, initializes QuickDraw, and initializes a grafPort in which the alert box will be drawn. 5. It checks the system error ID. If the system error ID is negative, the alert box isn't redrawn (this is used for system startup alerts, which can display a sequence of consecutive messages in the same box). If the system error ID doesn't correspond to an entry in the system error alert table, the default alert definition at the start of the table will be used, displaying the message "Sorry, a system error occurred". 6. It draws an alert box (in the rectangle specified by the global variable DSAlertRect). 7. If the text definition IDs in the alert definition for this alert aren't 0, it draws both strings. 8. If the icon definition ID in the alert definition isn't 0, it draws the icon. 9. If the procedure definition ID in the alert definition isn't 0, it invokes the procedure with the specified ID. 10. If the button definition ID in the alert definition is 0, it returns control to the procedure that called it (this is used during the disk-switch alert to return control to the File Manager after the "Please insert the disk:" message has been displayed). 11. If there's a resume procedure, it increments the button definition ID by 1. 12. It draws the buttons. 13. It hit-tests the buttons and calls the corresponding procedure code when a button is pressed. If there's no procedure code, it returns to the procedure that called it. User Alerts _____________ ID Explanation 1 Bus error: Invalid memory reference; happens only on a Macintosh XL 2 Address error: Word or long-word reference made to an odd address 3 Illegal instruction: The MC68000 received an instruction it didn't recognize. 4 Zero divide: Signed Divide (DIVS) or Unsigned Divide (DIVU) instruction with a divisor of 0 was executed. 5 Check exception: Check Register Against Bounds (CHK) instruction was executed and failed. Pascal "value out of range" errors are usually reported in this way. 6 TrapV exception: Trap On Overflow (TRAPV) instruction was executed and failed. 7 Privilege violation: Macintosh always runs in supervisor mode; perhaps an erroneous Return From Execution (RTE) instruction was executed. 8 Trace exception: The trace bit in the status register is set. 9 Line 1010 exception: The 1010 trap dispatcher has failed. 10 Line 1111 exception: Unimplemented instruction 11 Miscellaneous exception: All other MC68000 exceptions 12 Unimplemented core routine: An unimplemented trap number was encountered. 13 Spurious interrupt: The interrupt vector table entry for a particular level of interrupt is NIL; usually occurs with level 4, 5, 6, or 7 interrupts. 14 I/O system error: The File Manager is attempting to dequeue an entry from an I/O request queue that has a bad queue type field; perhaps the queue entry is unlocked. Or, the dCtlQHead field was NIL during a Fetch or Stash call. Or, a needed device control entry has been purged. 15 Segment Loader error: A GetResource call to read a segment into memory failed. 16 Floating point error: The halt bit in the floating-point environment word was set. 17-24 Can't load package: A GetResource call to read a package into memory failed. 25 Can't allocate requested memory block in the heap 26 Segment Loader error: A GetResource call to read 'CODE' resource 0 into memory failed; usually indicates a nonexecutable file. 27 File map destroyed: A logical block number was found that's greater than the number of the last logical block on the volume or less than the logical block number of the first allocation block on the volume. 28 Stack overflow error: The stack has expanded into the heap. 30 "Please insert the disk:" File Manager alert 41 The file named "Finder" can't be found on the disk. 100 Can't mount system startup volume. The system couldn't read the system resource file into memory. 32767 "Sorry, a system error occurred": Default alert message æKY Events.p æKL Button EventAvail GetCaretTime GetDblTime GetKeys GetMouse GetNextEvent StillDown TickCount WaitMouseUp WaitNextEvent activateEvt activeFlag activMask adbAddrMask alphaLock app1Evt app1Mask app2Evt app2Mask app3Evt app3Mask app4Evt app4Mask autoKey autoKeyMask btnState charCodeMask cmdKey controlKey convertClipboardFlag diskEvt diskMask driverEvt driverMask EventRecord everyEvent highLevelEventMask keyCodeMask keyDown keyDownMask KeyMap keyUp keyUpMask mDownMask mouseDown mouseMovedMessage mouseUp mUpMask networkEvt networkMask nullEvent optionKey osEvt osEvtMessageMask osMask resumeFlag shiftKey suspendResumeMessage updateEvt updateMask æKY nullEvent æFp Events.p æT CONST æD nullEvent = 0; æC »Event Code The what field of an event record contains an event code identifying the type of the event. The event codes are available as predefined constants: CONST nullEvent = 0; {null} mouseDown = 1; {mouse-down} mouseUp = 2; {mouse-up} keyDown = 3; {key-down} keyUp = 4; {key-up} autoKey = 5; {auto-key} updateEvt = 6; {update} diskEvt = 7; {disk-inserted} activateEvt = 8; {activate} networkEvt = 10; {network} driverEvt = 11; {device driver} app1Evt = 12; {application-defined} app2Evt = 13; {application-defined} app3Evt = 14; {application-defined} app4Evt = 15; {application-defined} æKY mouseDown æFp Events.p æT CONST æD mouseDown = 1; æC æKY mouseUp æFp Events.p æT CONST æD mouseUp = 2; æC æKY keyDown æFp Events.p æT CONST æD keyDown = 3; æC æKY keyUp æFp Events.p æT CONST æD keyUp = 4; æC æKY autoKey æFp Events.p æT CONST æD autoKey = 5; æC æKY updateEvt æFp Events.p æT CONST æD updateEvt = 6; æC æKY diskEvt æFp Events.p æT CONST æD diskEvt = 7; æC æKY activateEvt æFp Events.p æT CONST æD activateEvt = 8; æC æKY osEvt æFp Events.p æT CONST æD osEvt = 15; æC æKY mDownMask æFp Events.p æT CONST æD mDownMask = 2; æC _______________________________________________________________________________ »EVENT MASKS _______________________________________________________________________________ Some of the Event Manager routines can be restricted to operate on a specific event type or group of types; in other words, the specified event types are enabled while all others are disabled. For instance, instead of just requesting the next available event, you can specifically ask for the next keyboard event. You specify which event types a particular Event Manager call applies to by supplying an event mask as a parameter. This is an integer in which there’s one bit position for each event type, as shown in Figure 8. The bit position representing a given type corresponds to the event code for that type—for example, update events (event code 6) are specified by bit 6 of the mask. A 1 in bit 6 means that this Event Manager call applies to update events; a 0 means that it doesn’t. •••Refer to Figure 8.••• Figure 8–Event Mask Masks for each individual event type are available as predefined constants: CONST mDownMask = 2; {mouse-down} mUpMask = 4; {mouse-up} keyDownMask = 8; {key-down} keyUpMask = 16; {key-up} autoKeyMask = 32; {auto-key} updateMask = 64; {update} diskMask = 128; {disk-inserted} activMask = 256; {activate} networkMask = 1024; {network} driverMask = 2048; {device driver} app1Mask = 4096; {application-defined} app2Mask = 8192; {application-defined} app3Mask = 16384; {application-defined} app4Mask = -32768; {application-defined} Note: Null events can’t be disabled; a null event will always be reported when none of the enabled types of events are available. The following predefined mask designates all event types: CONST everyEvent = -1; {all event types} You can form any mask you need by adding or subtracting these mask constants. For example, to specify every keyboard event, use keyDownMask + keyUpMask + autoKeyMask For every event except an update, use everyEvent - updateMask Note: It’s recommended that you always use the event mask everyEvent unless there’s a specific reason not to. There’s also a global system event mask that controls which event types get posted into the event queue. Only event types corresponding to bits set in the system event mask are posted; all others are ignored. When the system starts up, the system event mask is set to post all except key-up event—that is, it’s initialized to everyEvent - keyUpMask Note: Key-up events are meaningless for most applications. Your application will usually want to ignore them; if not, it can set the system event mask with the Operating System Event Manager procedure SetEventMask. æKY mUpMask æFp Events.p æT CONST æD mUpMask = 4; æC æKY keyDownMask æFp Events.p æT CONST æD keyDownMask = 8; æC æKY keyUpMask æFp Events.p æT CONST æD keyUpMask = 16; æC æKY autoKeyMask æFp Events.p æT CONST æD autoKeyMask = 32; æC æKY updateMask æFp Events.p æT CONST æD updateMask = 64; æC æKY diskMask æFp Events.p æT CONST æD diskMask = 128; æC æKY activMask æFp Events.p æT CONST æD activMask = 256; æC æKY highLevelEventMask æFp Events.p æT CONST æD highLevelEventMask = 1024; æC æKY osMask æFp Events.p æT CONST æD osMask = -32768; æC æKY everyEvent æFp Events.p æT CONST æD everyEvent = -1; æC æKY charCodeMask æFp Events.p æT CONST æD charCodeMask = $000000FF; æC æKY keyCodeMask æFp Events.p æT CONST æD keyCodeMask = $0000FF00; æC æKY adbAddrMask æFp Events.p æT CONST æD adbAddrMask = $00FF0000; æC æKY osEvtMessageMask æFp Events.p æT CONST æD osEvtMessageMask = $FF000000; æC æKY mouseMovedMessage æFp Events.p æT CONST æD mouseMovedMessage = $FA; æC æKY suspendResumeMessage æFp Events.p æT CONST æD suspendResumeMessage = $01; æC æKY resumeFlag æFp Events.p æT CONST æD resumeFlag = 1; { bit 0 of message indicates resume vs suspend } æC æKY convertClipboardFlag æFp Events.p æT CONST æD convertClipboardFlag = 2; { bit 1 in resume message indicates clipboard change } æC æKY activeFlag æFp Events.p æT CONST æD activeFlag = 1; {bit 0 of modifiers for activate event} æC »Modifier Flags As mentioned above, the modifiers field of an event record contains further information about activate events and the state of the modifier keys and mouse button at the time the event was posted (see Figure 7). You might look at this field to find out, for instance, whether the Command key was down when a mouse-down event was posted (which in many applications affects the way objects are selected) or when a key-down event was posted (which could mean the user is choosing a menu item by typing its keyboard equivalent). •••Refer to Figure 7.••• Figure 7–Modifier Flags The following predefined constants are useful as masks for reading the flags in the modifiers field: CONST activeFlag = 1; {set if window being activated} btnState = 128; {set if mouse button up} cmdKey = 256; {set if Command key down} shiftKey = 512; {set if Shift key down} alphaLock = 1024; {set if Caps Lock key down} optionKey = 2048; {set if Option key down} controlKey = 4096; {set if Control key down} The activeFlag bit gives further information about activate events; it’s set if the window pointed to by the event message is being activated, or 0 if the window is being deactivated. The remaining bits indicate the state of the mouse button and modifier keys. Notice that the btnState bit is set if the mouse button is up, whereas the bits for the four modifier keys are set if their corresponding keys are down. æKY btnState æFp Events.p æT CONST æD btnState = 128; {Bit 7 of low byte is mouse button state} æC æKY cmdKey æFp Events.p æT CONST æD cmdKey = 256; {Bit 0} æC æKY shiftKey æFp Events.p æT CONST æD shiftKey = 512; {Bit 1} æC æKY alphaLock æFp Events.p æT CONST æD alphaLock = 1024; {Bit 2 } æC æKY optionKey æFp Events.p æT CONST æD optionKey = 2048; {Bit 3 of high byte} æC æKY controlKey æFp Events.p æT CONST æD controlKey = 4096; æC æKY networkEvt æFp Events.p æT CONST æD networkEvt = 10; æC æKY driverEvt æFp Events.p æT CONST æD driverEvt = 11; æC æKY app1Evt æFp Events.p æT CONST æD app1Evt = 12; æC æKY app2Evt æFp Events.p æT CONST æD app2Evt = 13; æC æKY app3Evt æFp Events.p æT CONST æD app3Evt = 14; æC æKY app4Evt æFp Events.p æT CONST æD app4Evt = 15; æC æKY networkMask æFp Events.p æT CONST æD networkMask = 1024; æC æKY driverMask æFp Events.p æT CONST æD driverMask = 2048; æC æKY app1Mask æFp Events.p æT CONST æD app1Mask = 4096; æC æKY app2Mask æFp Events.p æT CONST æD app2Mask = 8192; æC æKY app3Mask æFp Events.p æT CONST æD app3Mask = 16384; æC æKY app4Mask æFp Events.p æT CONST æD app4Mask = -32768; æC æKY EventRecord æFp Events.p æT RECORD æD EventRecord = RECORD what: INTEGER; message: LONGINT; when: LONGINT; where: Point; modifiers: INTEGER; END; æC _______________________________________________________________________________ »EVENT RECORDS _______________________________________________________________________________ Every event is represented internally by an event record containing all pertinent information about that event. The event record includes the following information: • the type of event • the time the event was posted (in ticks since system startup) • the location of the mouse at the time the event was posted (in global coordinates) • the state of the mouse button and modifier keys at the time the event was posted • any additional information required for a particular type of event, such as which key the user pressed or which window is being activated Every event has an event record containing this information—even null events. Event records are defined as follows: TYPE EventRecord = RECORD what: INTEGER; {event code} message: LONGINT; {event message} when: LONGINT; {ticks since startup} where: Point; {mouse location} modifiers: INTEGER {modifier flags} END; The when field contains the number of ticks since the system last started up, and the where field gives the location of the mouse, in global coordinates, at the time the event was posted. The other three fields are described below. _______________________________________________________________________________ »Event Code The what field of an event record contains an event code identifying the type of the event. The event codes are available as predefined constants: CONST nullEvent = 0; {null} mouseDown = 1; {mouse-down} mouseUp = 2; {mouse-up} keyDown = 3; {key-down} keyUp = 4; {key-up} autoKey = 5; {auto-key} updateEvt = 6; {update} diskEvt = 7; {disk-inserted} activateEvt = 8; {activate} networkEvt = 10; {network} driverEvt = 11; {device driver} app1Evt = 12; {application-defined} app2Evt = 13; {application-defined} app3Evt = 14; {application-defined} app4Evt = 15; {application-defined} _______________________________________________________________________________ »Event Message The message field of an event record contains the event message, which conveys additional important information about the event. The nature of this information depends on the event type, as summarized in the following table and described below. Event type Event message Keyboard Character code, key code, and ADB address field Activate, update Pointer to window Disk-inserted Drive number in low-order word, File Manager result code in high-order word Mouse-down, Undefined mouse-up, null Network Handle to parameter block Device driver See chapter describing driver Application-defined Whatever you wish For keyboard events, the low-order byte of the low-order word of the event message contains the ASCII character code generated by the key or combination of keys that was pressed or released; usually this is all you’ll need. However, as described in the Apple Desktop Bus chapter, the Macintosh II and SE can be connected to multiple keyboards. To identify the origin of keyboard events, the keyboard event message contains a new ADB address field. It now has the structure shown in Figure 2. Warning: The high byte of the event message for keyboard events is reserved for future use, and is not presently guaranteed to be zero. The event message for non-keyboard events remains the same as described above. •••Refer to Figure 2.••• Figure 2–Event Message for Keyboard Events The key code in the event message for a keyboard event represents the character key that was pressed or released; this value is always the same for any given character key, regardless of the modifier keys pressed along with it. Key codes are useful in special cases—in a music generator, for example—where you want to treat the keyboard as a set of keys unrelated to characters. Figure 3 gives the key codes for all the keys on the keyboard and keypad. (Key codes are shown for modifier keys here because they’re meaningful in other contexts, as explained later.) Both the U.S. and international keyboards are shown; in some cases the codes are quite different (for example, space and Enter are reversed). Three keyboards are now available as standard equipment with Macintosh computers sold in the U.S. They are • The Macintosh Plus Keyboard, which includes cursor control keys and an integral keypad. Its layout and key coding is shown in Figure 4. • The Macintosh II Keyboard, also shipped with the Macintosh SE, which adds Esc (Escape) and Control keys and is connected to the Apple Desktop Bus. Its layout and key coding is shown in Figure 5. • The Apple Extended Keyboard, which the user may connect to the Apple Desktop Bus of any Macintosh II or Macintosh SE computer. Its layout and key coding is shown in Figure 6. These figures show the virtual key codes for each key; they are the key codes that actually appear in keyboard events. In the case of the Macintosh II and Apple Extended Keyboards, however, the hardware produces raw key codes, which may be different. Raw key codes are translated to virtual key codes by the 'KMAP' resource in the System Folder. By modifying the 'KMAP' resource you can change the key codes for any keys. Similarly, you can change the ASCII codes corresponding to specific key codes by modifying the 'KCHR' resource in the System Folder. The 'KMAP' and 'KCHR' resources are described in the Resource Manager chapter. With both the Macintosh II and the Apple Extended keyboards, the standard 'KMAP' resource supplied in the system folder reassigns the following raw key codes to different virtual key codes: Key Raw key code Virtual key code Control 36 3B Left cursor 3B 7B Right cursor 3C 7C Down cursor 3D 7D Up cursor 3E 7E The standard 'KMAP' resource leaves all other raw key codes and virtual key codes the same. With the Apple Extended Keyboard, the virtual key codes for three more keys may be easily reassigned, as described above under “Reassigning Right Key Codes”. The following predefined constants are available to help you access the character code and key code: CONST charCodeMask = $000000FF; {character code} keyCodeMask = $0000FF00; {key code} •••Refer to Figure 3.••• Figure 3–Key Codes •••Refer to Figure 4.••• Figure 4–Macintosh Plus Keyboard •••Refer to Figure 5.••• Figure 5–Macintosh II Keyboard •••Refer to Figure 6.••• Figure 6–Apple Extended Keyboard Note: You can use the Toolbox Utility function BitAnd with these constants; for instance, to access the character code, use charCode := BitAnd(my Event.message,charCodeMask) _______________________________________________________________________________ THE TOOLBOX EVENT MANAGER _______________________________________________________________________________ For activate and update events, the event message is a pointer to the window affected. (If the event is an activate event, additional important information about the event can be found in the modifiers field of the event record, as described below.) For disk-inserted events, the low-order word of the event message contains the drive number of the disk drive into which the disk was inserted: 1 for the Macintosh’s built-in drive, and 2 for the external drive, if any. Numbers greater than 2 denote additional disk drives connected to the Macintosh. By the time your application receives a disk-inserted event, the system will already have attempted to mount the volume on the disk by calling the File Manager function MountVol; the high-order word of the event message will contain the result code returned by MountVol. For mouse-down, mouse-up, and null events, the event message is undefined and should be ignored. The event message for a network event contains a handle to a parameter block, as described in the AppleTalk Manager chapter. For device driver events, the contents of the event message depend on the situation under which the event was generated; the chapters describing those situations will give the details. Finally, you can use the event message however you wish for application-defined event types. _______________________________________________________________________________ »Modifier Flags As mentioned above, the modifiers field of an event record contains further information about activate events and the state of the modifier keys and mouse button at the time the event was posted (see Figure 7). You might look at this field to find out, for instance, whether the Command key was down when a mouse-down event was posted (which in many applications affects the way objects are selected) or when a key-down event was posted (which could mean the user is choosing a menu item by typing its keyboard equivalent). •••Refer to Figure 7.••• Figure 7–Modifier Flags The following predefined constants are useful as masks for reading the flags in the modifiers field: CONST activeFlag = 1; {set if window being activated} btnState = 128; {set if mouse button up} cmdKey = 256; {set if Command key down} shiftKey = 512; {set if Shift key down} alphaLock = 1024; {set if Caps Lock key down} optionKey = 2048; {set if Option key down} controlKey = 4096; {set if Control key down} The activeFlag bit gives further information about activate events; it’s set if the window pointed to by the event message is being activated, or 0 if the window is being deactivated. The remaining bits indicate the state of the mouse button and modifier keys. Notice that the btnState bit is set if the mouse button is up, whereas the bits for the four modifier keys are set if their corresponding keys are down. æKY KeyMap æFp Events.p æT TYPE æD KeyMap = PACKED ARRAY [0..127] OF BOOLEAN; æC æKY GetNextEvent æFp Events.p æT FUNCTION æTN A970 æD FUNCTION GetNextEvent(eventMask: INTEGER;VAR theEvent: EventRecord): BOOLEAN; INLINE $A970; æDT myVariable := GetNextEvent(eventMask,theEvent); æMM æRT 3, 5, 85, 194, 205 æRI I-257, N3-1, N5-1, N85, P-30, 32, 34, 39, 40, 97, 108, 173 æC GetNextEvent returns the next available event of a specified type or types and, if the event is in the event queue, removes it from the queue. The event is returned in the parameter theEvent. The eventMask parameter specifies which event types are of interest. GetNextEvent returns the next available event of any type designated by the mask, subject to the priority rules discussed above under “Priority of Events”. If no event of any of the designated types is available, GetNextEvent returns a null event. Note: Events in the queue that aren’t designated in the mask are kept in the queue; if you want to remove them, you can do so by calling the Operating System Event Manager procedure FlushEvents. Before reporting an event to your application, GetNextEvent first calls the Desk Manager function SystemEvent to see whether the system wants to intercept and respond to the event. If so, or if the event being reported is a null event, GetNextEvent returns a function result of FALSE; a function result of TRUE means that your application should handle the event itself. The Desk Manager intercepts the following events: • activate and update events directed to a desk accessory • mouse-up and keyboard events, if the currently active window belongs to a desk accessory Note: In each case, the event is intercepted by the Desk Manager only if the desk accessory can handle that type of event; however, as a rule all desk accessories should be set up to handle activate, update, and keyboard events and should not handle mouse-up events. The Desk Manager also intercepts disk-inserted events: It attempts to mount the volume on the disk by calling the File Manager function MountVol. GetNextEvent will always return TRUE in this case, though, so that your application can take any further appropriate action after examining the result code returned by MountVol in the event message. (See the Desk Manager and File Manager chapters.) GetNextEvent returns TRUE for all other non-null events (including all mouse-down events, regardless of which window is active), leaving them for your application to handle. GetNextEvent also makes the following processing happen, invisible to your program: • If the “alarm” is set and the current time is the alarm time, the alarm goes off (a beep followed by blinking the apple symbol in the menu bar). The user can set the alarm with the Alarm Clock desk accessory. • If the user holds down the Command and Shift keys while pressing a numeric key that has a special effect, that effect occurs. The standard such keys are 1 and 2 for ejecting the disk in the internal or external drive, and 3 and 4 for writing a snapshot of the screen to a MacPaint document or to the printer. Note: Advanced programmers can implement their own code to be executed in response to Command-Shift-number combinations (except for Command- Shift-1 and 2, which can’t be changed). The code corresponding to a particular number must be a routine having no parameters, stored in a resource whose type is 'FKEY' and whose ID is the number. The system resource file contains code for the numbers 3 and 4. Assembly-language note: You can disable GetNextEvent’s processing of Command- Shift-number combinations by setting the global variable ScrDmpEnb (a byte) to 0. æKY WaitNextEvent æFp Events.p æT FUNCTION æTN A860 æD FUNCTION WaitNextEvent(eventMask: INTEGER;VAR theEvent: EventRecord;sleep: LONGINT; mouseRgn: RgnHandle): BOOLEAN; INLINE $A860; æDT myVariable := WaitNextEvent(eventMask,theEvent,sleep,mouseRgn); æRT 158, 177, 180, 194, 205 æRI N158-1 æC æKY EventAvail æFp Events.p æT FUNCTION æTN A971 æD FUNCTION EventAvail(eventMask: INTEGER;VAR theEvent: EventRecord): BOOLEAN; INLINE $A971; æDT myVariable := EventAvail(eventMask,theEvent); æMM æRT 194 æRI I-259 æC EventAvail works exactly the same as GetNextEvent except that if the event is in the event queue, it’s left there. Note: An event returned by EventAvail will not be accessible later if in the meantime the queue becomes full and the event is discarded from it; since the events discarded are always the oldest ones in the queue, however, this will happen only in an unusually busy environment. æKY GetMouse æFp Events.p æT PROCEDURE æTN A972 æD PROCEDURE GetMouse(VAR mouseLoc: Point); INLINE $A972; æDT GetMouse(mouseLoc); æMM æRI I-259 æC GetMouse returns the current mouse location in the mouseLoc parameter. The location is given in the local coordinate system of the current grafPort (which might be, for example, the currently active window). Notice that this differs from the mouse location stored in the where field of an event record; that location is always in global coordinates. æKY Button æFp Events.p æT FUNCTION æTN A974 æD FUNCTION Button: BOOLEAN; INLINE $A974; æDT myVariable := Button; æMM æRI I-259 æC The Button function returns TRUE if the mouse button is currently down, and FALSE if it isn’t. æKY StillDown æFp Events.p æT FUNCTION æTN A973 æD FUNCTION StillDown: BOOLEAN; INLINE $A973; æDT myVariable := StillDown; æMM æRT 194 æRI I-259 æC Usually called after a mouse-down event, StillDown tests whether the mouse button is still down. It returns TRUE if the button is currently down and there are no more mouse events pending in the event queue. This is a true test of whether the button is still down from the original press—unlike Button (above), which returns TRUE whenever the button is currently down, even if it has been released and pressed again since the original mouse-down event. æKY WaitMouseUp æFp Events.p æT FUNCTION æTN A977 æD FUNCTION WaitMouseUp: BOOLEAN; INLINE $A977; æDT myVariable := WaitMouseUp; æMM æRT 194 æRI I-259 æC WaitMouseUp works exactly the same as StillDown (above), except that if the button is not still down from the original press, WaitMouseUp removes the preceding mouse-up event before returning FALSE. If, for instance, your application attaches some special significance both to mouse double-clicks and to mouse-up events, this function would allow your application to recognize a double-click without being confused by the intervening mouse-up. æKY GetKeys æFp Events.p æT PROCEDURE æTN A976 æD PROCEDURE GetKeys(VAR theKeys: KeyMap); INLINE $A976; æDT GetKeys(theKeys); æMM æRI I-259 æC GetKeys reads the current state of the keyboard (and keypad, if any) and returns it in the form of a keyMap: TYPE KeyMap = PACKED ARRAY[0..127] OF BOOLEAN; Each key on the keyboard or keypad corresponds to an element in the keyMap. The index into the keyMap for a particular key is the same as the key code for that key. (The key codes are shown in Figure 3 above.) The keyMap element is TRUE if the corresponding key is down and FALSE if it isn’t. The maximum number of keys that can be down simultaneously is two character keys plus any combination of the four modifier keys. æKY TickCount æFp Events.p æT FUNCTION æTN A975 æD FUNCTION TickCount: LONGINT; INLINE $A975; æDT myVariable := TickCount; æMM æRI I-260 æC TickCount returns the current number of ticks (sixtieths of a second) since the system last started up. Warning: Don’t rely on the tick count being exact; it will usually be accurate to within one tick, but may be off by more than that. The tick count is incremented during the vertical retrace interrupt, but it’s possible for this interrupt to be disabled. Furthermore, don’t rely on the tick count being incremented to a certain value, such as testing whether it has become equal to its old value plus 1; check instead for “greater than or equal to” (since an interrupt task may keep control for more than one tick). Assembly-language note: The value returned by this function is also contained in the global variable Ticks. æKY GetDblTime æFp Events.p æT FUNCTION æD FUNCTION GetDblTime: LONGINT; INLINE $2EB8,$02F0; æDT myVariable := GetDblTime; æRI I-260 æC [Not in ROM] GetDblTime returns the suggested maximum difference (in ticks) that should exist between the times of a mouse-up event and a mouse-down event for those two mouse clicks to be considered a double-click. The user can adjust this value by means of the Control Panel desk accessory. Assembly-language note: This value is available to assembly-language programmers in the global variable DoubleTime. æKY GetCaretTime æFp Events.p æT FUNCTION æD FUNCTION GetCaretTime: LONGINT; INLINE $2EB8,$02F4; æDT myVariable := GetCaretTime; æRI I-260 æC [Not in ROM] GetCaretTime returns the time (in ticks) between blinks of the “caret” (usually a vertical bar) marking the insertion point in editable text. If you aren’t using TextEdit, you’ll need to cause the caret to blink yourself; on every pass through your program’s main event loop, you should check this value against the elapsed time since the last blink of the caret. The user can adjust this value by means of the Control Panel desk accessory. Assembly-language note: This value is available to assembly-language programmers in the global variable CaretTime. æKY Files.p æKL AddDrive Allocate AllocContig CatMove CloseWD Create DirCreate Eject FInitQueue FlushVol FSClose FSDelete FSMakeFSSpec FSOpen FSpCatMove FSpCreate FSpDelete FSpDirCreate FSpExchangeFiles FSpGetFInfo FSpOpenDF FSpOpenRF FSpRename FSpRstFLock FSpSetFInfo FSpSetFLock FSRead FSWrite GetDrvQHdr GetEOF GetFInfo GetFPos GetFSQHdr GetVCBQHdr GetVInfo GetVol GetVRefNum GetWDInfo HCreate HDelete HGetFInfo HGetVol HOpen HOpenDF HOpenRF HRename HRstFLock HSetFInfo HSetFLock HSetVol OpenDF OpenRF OpenWD PBAllocate PBAllocateAsync PBAllocateSync PBAllocContig PBAllocContigAsync PBAllocContigSync PBCatMove PBCatMoveAsync PBCatMoveSync PBCatSearch PBCatSearchAsync PBCatSearchSync PBClose PBCloseAsync PBCloseSync PBCloseWD PBCloseWDAsync PBCloseWDSync PBCreate PBCreateAsync PBCreateFileIDRef PBCreateFileIDRefAsync PBCreateFileIDRefSync PBCreateSync PBDelete PBDeleteAsync PBDeleteFileIDRef PBDeleteFileIDRefAsync PBDeleteFileIDRefSync PBDeleteSync PBDirCreate PBDirCreateAsync PBDirCreateSync PBDTAddAPPL PBDTAddAPPLAsync PBDTAddAPPLSync PBDTAddIcon PBDTAddIconAsync PBDTAddIconSync PBDTCloseDown PBDTDelete PBDTDeleteAsync PBDTDeleteSync PBDTFlush PBDTFlushAsync PBDTFlushSync PBDTGetAPPL PBDTGetAPPLAsync PBDTGetAPPLSync PBDTGetComment PBDTGetCommentAsync PBDTGetCommentSync PBDTGetIcon PBDTGetIconAsync PBDTGetIconInfo PBDTGetIconInfoAsync PBDTGetIconInfoSync PBDTGetIconSync PBDTGetInfo PBDTGetInfoAsync PBDTGetInfoSync PBDTGetPath PBDTOpenInform PBDTRemoveAPPL PBDTRemoveAPPLAsync PBDTRemoveAPPLSync PBDTRemoveComment PBDTRemoveCommentAsync PBDTRemoveCommentSync PBDTReset PBDTResetAsync PBDTResetSync PBDTSetComment PBDTSetCommentAsync PBDTSetCommentSync PBEject PBExchangeFiles PBExchangeFilesAsync PBExchangeFilesSync PBFlushFile PBFlushFileAsync PBFlushFileSync PBFlushVol PBFlushVolAsync PBFlushVolSync PBGetCatInfo PBGetCatInfoAsync PBGetCatInfoSync PBGetEOF PBGetEOFAsync PBGetEOFSync PBGetFCBInfo PBGetFCBInfoAsync PBGetFCBInfoSync PBGetFInfo PBGetFInfoAsync PBGetFInfoSync PBGetForeignPrivs PBGetForeignPrivsAsync PBGetForeignPrivsSync PBGetFPos PBGetFPosAsync PBGetFPosSync PBGetVInfo PBGetVInfoAsync PBGetVInfoSync PBGetVol PBGetVolAsync PBGetVolMountInfo PBGetVolMountInfoSize PBGetVolSync PBGetWDInfo PBGetWDInfoAsync PBGetWDInfoSync PBHCopyFile PBHCopyFileAsync PBHCopyFileSync PBHCreate PBHCreateAsync PBHCreateSync PBHDelete PBHDeleteAsync PBHDeleteSync PBHGetDirAccess PBHGetDirAccessAsync PBHGetDirAccessSync PBHGetFInfo PBHGetFInfoAsync PBHGetFInfoSync PBHGetLogInInfo PBHGetLogInInfoAsync PBHGetLogInInfoSync PBHGetVInfo PBHGetVInfoAsync PBHGetVInfoSync PBHGetVol PBHGetVolAsync PBHGetVolParms PBHGetVolParmsAsync PBHGetVolParmsSync PBHGetVolSync PBHMapID PBHMapIDAsync PBHMapIDSync PBHMapName PBHMapNameAsync PBHMapNameSync PBHMoveRename PBHMoveRenameAsync PBHMoveRenameSync PBHOpen PBHOpenAsync PBHOpenDeny PBHOpenDenyAsync PBHOpenDenySync PBHOpenDF PBHOpenDFAsync PBHOpenDFSync PBHOpenRF PBHOpenRFAsync PBHOpenRFDeny PBHOpenRFDenyAsync PBHOpenRFDenySync PBHOpenRFSync PBHOpenSync PBHRename PBHRenameAsync PBHRenameSync PBHRstFLock PBHRstFLockAsync PBHRstFLockSync PBHSetDirAccess PBHSetDirAccessAsync PBHSetDirAccessSync PBHSetFInfo PBHSetFInfoAsync PBHSetFInfoSync PBHSetFLock PBHSetFLockAsync PBHSetFLockSync PBHSetVol PBHSetVolAsync PBHSetVolSync PBLockRange PBLockRangeAsync PBLockRangeSync PBMakeFSSpec PBMakeFSSpecAsync PBMakeFSSpecSync PBMountVol PBOffLine PBOpen PBOpenAsync PBOpenDF PBOpenDFAsync PBOpenDFSync PBOpenRF PBOpenRFAsync PBOpenRFSync PBOpenSync PBOpenWD PBOpenWDAsync PBOpenWDSync PBRead PBReadAsync PBReadSync PBRename PBRenameAsync PBRenameSync PBResolveFileIDRef PBResolveFileIDRefAsync PBResolveFileIDRefSync PBRstFLock PBRstFLockAsync PBRstFLockSync PBSetCatInfo PBSetCatInfoAsync PBSetCatInfoSync PBSetEOF PBSetEOFAsync PBSetEOFSync PBSetFInfo PBSetFInfoAsync PBSetFInfoSync PBSetFLock PBSetFLockAsync PBSetFLockSync PBSetForeignPrivs PBSetForeignPrivsAsync PBSetForeignPrivsSync PBSetFPos PBSetFPosAsync PBSetFPosSync PBSetFVers PBSetFVersAsync PBSetFVersSync PBSetVInfo PBSetVInfoAsync PBSetVInfoSync PBSetVol PBSetVolAsync PBSetVolSync PBUnlockRange PBUnlockRangeAsync PBUnlockRangeSync PBUnmountVol PBVolumeMount PBWrite PBWriteAsync PBWriteSync Rename RstFLock SetEOF SetFInfo SetFLock SetFPos SetVol UnmountVol AFPVolMountInfo AFPVolMountInfoPtr alphaStage AppleShareMediaType bAccessCntl betaStage bHasBlankAccessPrivileges bHasBTreeMgr bHasCatSearch bHasCopyFile bHasDesktopMgr bHasExtFSVol bHasFileIDs bHasFolderLock bHasMoveRename bHasOpenDeny bHasPersonalAccessPrivileges bHasShortName bHasUserGroupList bLimitFCBs bLocalWList bNoBootBlks bNoDeskItems bNoLclSync bNoMiniFndr bNoSwitchTo bNoSysDir bNoVNEdit bTrshOffLine CatPositionRec CInfoPBPtr CInfoPBRec CInfoType CMovePBPtr CMovePBRec developStage DInfo dirInfo DTPBPtr DTPBRec DXInfo FCBPBPtr FCBPBRec fDesktop fDisk fHasBundle finalStage fInvisible fOnDesk fsAtMark fsCurPerm fsFromLEOF fsFromMark fsFromStart fsRdPerm fsRdWrPerm fsRdWrShPerm fsRtDirID fsRtParID fsSBDrBkDat fsSBDrCrDat fsSBDrFndrInfo fsSBDrMdDat fsSBDrNmFls fsSBDrParID fsSBDrUsrWds fsSBFlAttrib fsSBFlBkDat fsSBFlCrDat fsSBFlFndrInfo fsSBFlLgLen fsSBFlMdDat fsSBFlParID fsSBFlPyLen fsSBFlRLgLen fsSBFlRPyLen fsSBFlXFndrInfo fsSBFullName fsSBNegate fsSBPartialName FSSpec FSSpecArray FSSpecArrayHandle FSSpecArrayPtr FSSpecHandle FSSpecPtr fsUnixPriv fsWrPerm fTrash FXInfo GetVolParmsInfoBuffer hFileInfo HParamBlockRec HParmBlkPtr ioDirFlg ioDirMask kEncryptPassword kLarge4BitIcon kLarge4BitIconSize kLarge8BitIcon kLarge8BitIconSize kLargeIcon kLargeIconSize kNoUserAuthentication kPassword kSmall4BitIcon kSmall4BitIconSize kSmall8BitIcon kSmall8BitIconSize kSmallIcon kSmallIconSize kTwoWayEncryptPassword NumVersion rdVerify VersRec VersRecHndl VersRecPtr VolMountInfoHeader VolMountInfoPtr VolumeType WDPBPtr WDPBRec æKY fsAtMark æFp Files.p æT CONST æD fsAtMark = 0; æC If you specify fsAtMark, ioPosOffset is ignored and the operation begins wherever the mark is currently positioned. If you choose to set the mark (relative to either the beginning of the file, the logical end-of-file, or the current mark), ioPosOffset must specify the byte offset from the chosen point (either positive or negative) where the operation should begin. Note: Advanced programmers: Bit 7 of ioPosMode is the newline flag; it’s set if read operations should terminate at a newline character. The ASCII code of the newline character is specified in the high-order byte of ioPosMode. If the newline flag is set, the data will be read one byte at a time until the newline character is encountered, ioReqCount bytes have been read, or the end-of-file is reached. If the newline flag is clear, the data will be read one byte at a time until ioReqCount bytes have been read or the end-of-file is reached. æKY fOnDesk æFp Files.p æT CONST æD fOnDesk = 1; æC æKY fsCurPerm æFp Files.p æT CONST æD fsCurPerm = 0; æC This request is compared with the open permission of the file. If the open permission doesn’t allow I/O as requested, a result code indicating the error is returned. Warning: To ensure data integrity be sure to lock the portion of the file you’ll be using if you specify shared write permission. æKY fHasBundle æFp Files.p æT CONST æD fHasBundle = 8192; æC æKY fsRdPerm æFp Files.p æT CONST æD fsRdPerm = 1; æC æKY fInvisible æFp Files.p æT CONST æD fInvisible = 16384; æC æKY fTrash æFp Files.p æT CONST æD fTrash = -3; æC æKY fsWrPerm æFp Files.p æT CONST æD fsWrPerm = 2; æC æKY fDesktop æFp Files.p æT CONST æD fDesktop = -2; æC æKY fsRdWrPerm æFp Files.p æT CONST æD fsRdWrPerm = 3; æC æKY fDisk æFp Files.p æT CONST æD fDisk = 0; æC æKY fsRdWrShPerm æFp Files.p æT CONST æD fsRdWrShPerm = 4; æC æKY fsFromStart æFp Files.p æT CONST æD fsFromStart = 1; æC æKY fsFromLEOF æFp Files.p æT CONST æD fsFromLEOF = 2; æC æKY fsFromMark æFp Files.p æT CONST æD fsFromMark = 3; æC æKY rdVerify æFp Files.p æT CONST æD rdVerify = 64; æC To have the File Manager verify that all data written to a volume exactly matches the data in memory, make a Read call right after the Write call. The parameters for a read-verify operation are the same as for a standard Read call, except that the following constant must be added to the positioning mode: CONST rdVerify = 64; {read-verify mode} The result code ioErr is returned if any of the data doesn’t match. æKY ioDirFlg æFp Files.p æT CONST æD ioDirFlg = 3; {see IM IV-125} æC æKY ioDirMask æFp Files.p æT CONST æD ioDirMask = $10; æC æKY fsRtParID æFp Files.p æT CONST æD fsRtParID = 1; æC æKY fsRtDirID æFp Files.p æT CONST æD fsRtDirID = 2; æC æKY fsSBPartialName æFp Files.p æT CONST æD fsSBPartialName = 1; æC æKY fsSBFullName æFp Files.p æT CONST æD fsSBFullName = 2; æC æKY fsSBFlAttrib æFp Files.p æT CONST æD fsSBFlAttrib = 4; æC æKY fsSBFlFndrInfo æFp Files.p æT CONST æD fsSBFlFndrInfo = 8; æC æKY fsSBFlLgLen æFp Files.p æT CONST æD fsSBFlLgLen = 32; æC æKY fsSBFlPyLen æFp Files.p æT CONST æD fsSBFlPyLen = 64; æC æKY fsSBFlRLgLen æFp Files.p æT CONST æD fsSBFlRLgLen = 128; æC æKY fsSBFlRPyLen æFp Files.p æT CONST æD fsSBFlRPyLen = 256; æC æKY fsSBFlCrDat æFp Files.p æT CONST æD fsSBFlCrDat = 512; æC æKY fsSBFlMdDat æFp Files.p æT CONST æD fsSBFlMdDat = 1024; æC æKY fsSBFlBkDat æFp Files.p æT CONST æD fsSBFlBkDat = 2048; æC æKY fsSBFlXFndrInfo æFp Files.p æT CONST æD fsSBFlXFndrInfo = 4096; æC æKY fsSBFlParID æFp Files.p æT CONST æD fsSBFlParID = 8192; æC æKY fsSBNegate æFp Files.p æT CONST æD fsSBNegate = 16384; æC æKY fsSBDrUsrWds æFp Files.p æT CONST æD fsSBDrUsrWds = 8; æC æKY fsSBDrNmFls æFp Files.p æT CONST æD fsSBDrNmFls = 16; æC æKY fsSBDrCrDat æFp Files.p æT CONST æD fsSBDrCrDat = 512; æC æKY fsSBDrMdDat æFp Files.p æT CONST æD fsSBDrMdDat = 1024; æC æKY fsSBDrBkDat æFp Files.p æT CONST æD fsSBDrBkDat = 2048; æC æKY fsSBDrFndrInfo æFp Files.p æT CONST æD fsSBDrFndrInfo = 4096; æC æKY fsSBDrParID æFp Files.p æT CONST æD fsSBDrParID = 8192; æC æKY bLimitFCBs æFp Files.p æT CONST æD bLimitFCBs = 31; æC æKY bLocalWList æFp Files.p æT CONST æD bLocalWList = 30; æC æKY bNoMiniFndr æFp Files.p æT CONST æD bNoMiniFndr = 29; æC æKY bNoVNEdit æFp Files.p æT CONST æD bNoVNEdit = 28; æC æKY bNoLclSync æFp Files.p æT CONST æD bNoLclSync = 27; æC æKY bTrshOffLine æFp Files.p æT CONST æD bTrshOffLine = 26; æC æKY bNoSwitchTo æFp Files.p æT CONST æD bNoSwitchTo = 25; æC æKY bNoDeskItems æFp Files.p æT CONST æD bNoDeskItems = 20; æC æKY bNoBootBlks æFp Files.p æT CONST æD bNoBootBlks = 19; æC æKY bAccessCntl æFp Files.p æT CONST æD bAccessCntl = 18; æC æKY bNoSysDir æFp Files.p æT CONST æD bNoSysDir = 17; æC æKY bHasExtFSVol æFp Files.p æT CONST æD bHasExtFSVol = 16; æC æKY bHasOpenDeny æFp Files.p æT CONST æD bHasOpenDeny = 15; æC æKY bHasCopyFile æFp Files.p æT CONST æD bHasCopyFile = 14; æC æKY bHasMoveRename æFp Files.p æT CONST æD bHasMoveRename = 13; æC æKY bHasDesktopMgr æFp Files.p æT CONST æD bHasDesktopMgr = 12; æC æKY bHasShortName æFp Files.p æT CONST æD bHasShortName = 11; æC æKY bHasFolderLock æFp Files.p æT CONST æD bHasFolderLock = 10; æC æKY bHasPersonalAccessPrivileges æFp Files.p æT CONST æD bHasPersonalAccessPrivileges = 9; æC æKY bHasUserGroupList æFp Files.p æT CONST æD bHasUserGroupList = 8; æC æKY bHasCatSearch æFp Files.p æT CONST æD bHasCatSearch = 7; æC æKY bHasFileIDs æFp Files.p æT CONST æD bHasFileIDs = 6; æC æKY bHasBTreeMgr æFp Files.p æT CONST æD bHasBTreeMgr = 5; æC æKY bHasBlankAccessPrivileges æFp Files.p æT CONST æD bHasBlankAccessPrivileges = 4; æC æKY kLargeIcon æFp Files.p æT CONST æD kLargeIcon = 1; æC æKY kLarge4BitIcon æFp Files.p æT CONST æD kLarge4BitIcon = 2; æC æKY kLarge8BitIcon æFp Files.p æT CONST æD kLarge8BitIcon = 3; æC æKY kSmallIcon æFp Files.p æT CONST æD kSmallIcon = 4; æC æKY kSmall4BitIcon æFp Files.p æT CONST æD kSmall4BitIcon = 5; æC æKY kSmall8BitIcon æFp Files.p æT CONST æD kSmall8BitIcon = 6; æC æKY kLargeIconSize æFp Files.p æT CONST æD kLargeIconSize = 256; æC æKY kLarge4BitIconSize æFp Files.p æT CONST æD kLarge4BitIconSize = 512; æC æKY kLarge8BitIconSize æFp Files.p æT CONST æD kLarge8BitIconSize = 1024; æC æKY kSmallIconSize æFp Files.p æT CONST æD kSmallIconSize = 64; æC æKY kSmall4BitIconSize æFp Files.p æT CONST æD kSmall4BitIconSize = 128; æC æKY kSmall8BitIconSize æFp Files.p æT CONST æD kSmall8BitIconSize = 256; æC æKY fsUnixPriv æFp Files.p æT CONST æD fsUnixPriv = 1; æC æKY developStage æFp Files.p æT CONST æD developStage = $20; æC æKY alphaStage æFp Files.p æT CONST æD alphaStage = $40; æC æKY betaStage æFp Files.p æT CONST æD betaStage = $60; æC æKY finalStage æFp Files.p æT CONST æD finalStage = $80; æC æKY kNoUserAuthentication æFp Files.p æT CONST æD kNoUserAuthentication = 1; æC æKY kPassword æFp Files.p æT CONST æD kPassword = 2; æC æKY kEncryptPassword æFp Files.p æT CONST æD kEncryptPassword = 3; æC æKY kTwoWayEncryptPassword æFp Files.p æT CONST æD kTwoWayEncryptPassword = 6; æC æKY CInfoType hFileInfo dirInfo æFp Files.p æT TYPE æD CInfoType = (hFileInfo,dirInfo); æC æKY FXInfo æFp Files.p æT RECORD æD FXInfo = RECORD fdIconID: INTEGER; { Icon ID} fdUnused: ARRAY [1..3] OF INTEGER; {unused but reserved 6 bytes} fdScript: SignedByte; { Script flag and number } fdXFlags: SignedByte; fdComment: INTEGER; { Comment ID} fdPutAway: LONGINT; { Home Dir ID} END; æC On hierarchical volumes, in addition to the FInfo record, the following information about files is maintained for the Finder: æKY DInfo æFp Files.p æT RECORD æD DInfo = RECORD frRect: Rect; {folder rect} frFlags: INTEGER; {Flags} frLocation: Point; {folder location} frView: INTEGER; {folder view} END; æC On hierarchical volumes, the following information about directories is maintained for the Finder: DInfo = RECORD frRect: Rect; {folder's rectangle} frFlags: INTEGER; {flags} frLocation: Point; {folder's location} frView: INTEGER; {folder's view} END; DXInfo = RECORD frScroll: Point; {scroll position} frOpenChain: LONGINT; {directory ID chain of open folders} frUnused: INTEGER; {reserved} frComment: INTEGER; {comment ID} frPutAway: LONGINT; {directory ID} END; When a file (or folder) is moved to the desktop on a hierarchical volume, it’s actually moved to the root level of the file directory. (This permits all the desktop icons to be enumerated by one simple scan of the root.) The fOnDesk bit of fdFlags is set. FDPutAway (or frPutAway for directories) contains the directory ID of the folder that originally contained the file (or folder); this allows the file (or folder) to be returned there from the desktop. æKY DXInfo æFp Files.p æT RECORD æD DXInfo = RECORD frScroll: Point; {scroll position} frOpenChain: LONGINT; {DirID chain of open folders} frScript: SignedByte; { Script flag and number } frXFlags: SignedByte; frComment: INTEGER; {comment} frPutAway: LONGINT; {DirID} END; æC æKY GetVolParmsInfoBuffer æFp Files.p æT RECORD æD GetVolParmsInfoBuffer = RECORD vMVersion: INTEGER; {version number} vMAttrib: LONGINT; {bit vector of attributes (see vMAttrib constants)} vMLocalHand: Handle; {handle to private data} vMServerAdr: LONGINT; {AppleTalk server address or zero} vMVolumeGrade: LONGINT; {approx. speed rating or zero if unrated} vMForeignPrivID: INTEGER; {foreign privilege model supported or zero if none} END; æC æKY CInfoPBRec CInfoPBPtr æFp Files.p æT RECORD æD CInfoPBPtr = ^CInfoPBRec; CInfoPBRec = RECORD qLink: QElemPtr; qType: INTEGER; ioTrap: INTEGER; ioCmdAddr: Ptr; ioCompletion: ProcPtr; ioResult: OSErr; ioNamePtr: StringPtr; ioVRefNum: INTEGER; ioFRefNum: INTEGER; ioFVersNum: SignedByte; filler1: SignedByte; ioFDirIndex: INTEGER; ioFlAttrib: SignedByte; filler2: SignedByte; CASE CInfoType OF hFileInfo: (ioFlFndrInfo: FInfo; ioDirID: LONGINT; ioFlStBlk: INTEGER; ioFlLgLen: LONGINT; ioFlPyLen: LONGINT; ioFlRStBlk: INTEGER; ioFlRLgLen: LONGINT; ioFlRPyLen: LONGINT; ioFlCrDat: LONGINT; ioFlMdDat: LONGINT; ioFlBkDat: LONGINT; ioFlXFndrInfo: FXInfo; ioFlParID: LONGINT; ioFlClpSiz: LONGINT); dirInfo: (ioDrUsrWds: DInfo; ioDrDirID: LONGINT; ioDrNmFls: INTEGER; filler3: ARRAY [1..9] OF INTEGER; ioDrCrDat: LONGINT; ioDrMdDat: LONGINT; ioDrBkDat: LONGINT; ioDrFndrInfo: DXInfo; ioDrParID: LONGINT); END; æC »CInfoPBRec The routines GetCatInfo and SetCatInfo are used for getting and setting information about the files and directories within a directory. With files, you’ll use the following 19 additional fields after the standard eight fields in the parameter block record CInfoPBRec: ioFRefNum: INTEGER; {path reference number} ioFVersNum: SignedByte; {version number} filler1: SignedByte; {not used} ioFDirIndex: INTEGER; {index} ioFlAttrib: SignedByte; {file attributes} filler2: SignedByte; {not used} hFileInfo: (ioFlFndrInfo: FInfo; {information used by the Finder} ioDirID: LONGINT; {directory ID or file number} ioFlStBlk: INTEGER; {first allocation block of data fork} ioFlLgLen: LONGINT; {logical end-of-file of data fork} ioFlPyLen: LONGINT; {physical end-of-file of data fork} ioFlRStBlk: INTEGER; {first allocation block of resource fork} ioFlRLgLen: LONGINT; {logical end-of-file of resource fork} ioFlRPyLen: LONGINT; {physical end-of-file of resource fork} ioFlCrDat: LONGINT; {date and time of creation} ioFlMdDat: LONGINT; {date and time of last modification} ioFlBkDat: LONGINT; {date and time of last backup} ioFlXFndrInfo: FXInfo; {additional information used by the Finder} ioFlParID: LONGINT; {file's parent directory ID (integer)} ioFlClpSiz: LONGINT); {file's clump size} •••Refer to Technical Note #69:••• IOFDirIndex can be used with the function PBGetCatInfo to index through the files and directories in a given directory. For each iteration of the function, you can determine whether it’s a file or a directory by testing bit 4 (the fifth least significant bit) of ioFlAttrib. You can test for a directory by using the Toolbox Utilities BitTst function in the following manner (remember, the Toolbox Utilities routines reverse the standard 68000 notation): BitTst(@myCInfoRec.ioFlAttrib,3) IOFlAttrib contains the following attributes: Bit Meaning 0 Set if file is locked 2 Set if resource fork is open 3 Set if data fork is open 4 Set if a directory 7 Set if file (either fork) is open When passed to a routine, ioDirID contains a directory ID; it can be used to refer to a directory or, in conjuction with a partial pathname from that directory, to other files and directories. If both a directory ID and a working directory reference number are provided, the directory ID is used to identify the directory on the volume indicated by the working directory reference number. In other words, a directory ID specified by the caller will override the working directory referred to by the working directory reference number. If you don’t want this to happen, you can set ioDirID to 0. (If no directory is specified through a working directory reference number, the root directory ID will be used.) Warning: With files, ioDirID returns the file number of the file; when indexing with GetCatInfo, you’ll need to reset this field for each iteration. IOFlStBlk and ioFlRStBlk contain 0 if the file’s data or resource fork is empty, respectively; they’re used only with flat volumes. The date and time in the ioFlCrDat, ioFlMdDat, and ioFlBkDat fields are specified in seconds since midnight, January 1, 1904. IOFlParID contains the directory ID of the file’s parent. IOFlClpSiz is the clump size to be used when writing the file; if it’s 0, the volume’s clump size is used when the file is opened. With directories, you’ll use the following 14 additional fields after the standard eight fields in the parameter block record CInfoPBRec: ioFRefNum: INTEGER; {file reference number} ioFVersNum SignedByte; {version number} filler1: SignedByte; {not used} ioFDirIndex: INTEGER; {index} ioFlAttrib: SignedByte; {file attributes} filler2: SignedByte; {not used} dirInfo: (ioDrUsrWds: DInfo; {information used by the Finder} ioDrDirID: LONGINT; {directory ID} ioDrNmFls: INTEGER; {number of files in directory} filler3: ARRAY[1..9] OF INTEGER; {not used} ioDrCrDat: LONGINT; {date and time of creation} ioDrMdDat: LONGINT; {date and time of last modification} ioDrBkDat: LONGINT; {date and time of last backup} ioDrFndrInfo: DXInfo; {additional information used by the Finder} ioDrParID: LONGINT); {directory's parent directory ID (integer)} IOFDirIndex can be used with the function PBGetCatInfo to index through the files and directories in a given directory. For each iteration of the function, you can determine whether it’s a file or a directory by testing bit 4 of ioFlAttrib. When passed to a routine, ioDrDirID contains a directory ID; it can be used to refer to a directory or, in conjuction with a partial pathname from that directory, to other files and directories. If both a directory ID and a working directory reference number are provided, the directory ID is used to identify the directory on the volume indicated by the working directory reference number. In other words, a directory ID specified by the caller will override the working directory referred to by the working directory reference number. If you don’t want this to happen, you can set ioDirID to 0. (If no directory is specified through a working directory reference number, the root directory ID will be used.) With directories, ioDrDirID returns the directory ID of the directory. IODrNmFls is the number of files and directories contained in this directory (the valence of the directory). The date and time in the ioDrCrDat, ioDrMdDat, and ioDrBkDat fields are specified in seconds since midnight, January 1, 1904. IODrParID contains the directory ID of the directory’s parent. æKY CatPositionRec æFp Files.p æT RECORD æD CatPositionRec = RECORD initialize: LONGINT; priv: ARRAY [1..6] OF INTEGER; END; æC æKY FSSpec FSSpecPtr FSSpecHandle æFp Files.p æT RECORD æD FSSpecPtr = ^FSSpec; FSSpecHandle = ^FSSpecPtr; FSSpec = RECORD vRefNum: INTEGER; parID: LONGINT; name: Str63; END; æC æKY FSSpecArray FSSpecArrayPtr FSSpecArrayHandle æFp Files.p æT RECORD æD FSSpecArrayPtr = ^FSSpecArray; FSSpecArrayHandle = ^FSSpecArrayPtr; FSSpecArray = ARRAY [0..0] of FSSpec; æC æKY VolumeType æFp Files.p æT TYPE æD VolumeType = OSType; æC æKY AppleShareMediaType æFp Files.p æT CONST æD AppleShareMediaType = 'afpm'; { the signature for AppleShare } æC æKY VolMountInfoHeader VolMountInfoPtr æFp Files.p æT RECORD æD VolMountInfoPtr = ^VolMountInfoHeader; VolMountInfoHeader = RECORD length: INTEGER; { length of location data (including self) } media: VolumeType; { type of media . Variable length data follows } END; æC æKY AFPVolMountInfo AFPVolMountInfoPtr æFp Files.p æT RECORD æD AFPVolMountInfoPtr = ^AFPVolMountInfo; AFPVolMountInfo = RECORD length: INTEGER; { length of location data (including self) } media: VolumeType; { type of media } flags: INTEGER; { bits for no messages, no reconnect } nbpInterval: SignedByte; { NBP Interval parameter (IM2, p.322) } nbpCount: SignedByte; { NBP Interval parameter (IM2, p.322) } uamType: INTEGER; { User Authentication Method } zoneNameOffset: INTEGER; { short positive offset from start of struct to Zone Name } serverNameOffset: INTEGER; { offset to pascal Server Name string } volNameOffset: INTEGER; { offset to pascal Volume Name string } userNameOffset: INTEGER; { offset to pascal User Name string } userPasswordOffset: INTEGER; { offset to pascal User Password string } volPasswordOffset: INTEGER; { offset to pascal Volume Password string } AFPData: PACKED ARRAY [1..144] OF CHAR; {variable length data may follow} END; æC æKY DTPBRec DTPBPtr æFp Files.p æT RECORD æD DTPBPtr = ^DTPBRec; DTPBRec = RECORD qLink: QElemPtr; qType: INTEGER; ioTrap: INTEGER; ioCmdAddr: Ptr; ioCompletion: ProcPtr; ioResult: OSErr; ioNamePtr: StringPtr; ioVRefNum: INTEGER; ioDTRefNum: INTEGER; ioIndex: INTEGER; ioTagInfo: LONGINT; ioDTBuffer: Ptr; ioDTReqCount: LONGINT; ioDTActCount: LONGINT; filler1: SignedByte; ioIconType: SignedByte; filler2: INTEGER; ioDirID: LONGINT; ioFileCreator: OSType; ioFileType: OSType; ioFiller3: LONGINT; ioDTLgLen: LONGINT; ioDTPyLen: LONGINT; ioFiller4: ARRAY [1..14] OF INTEGER; ioAPPLParID: LONGINT; END; æC æKY HParamBlockRec HParmBlkPtr æFp Files.p æT RECORD æD HParmBlkPtr = ^HParamBlockRec; HParamBlockRec = RECORD qLink: QElemPtr; qType: INTEGER; ioTrap: INTEGER; ioCmdAddr: Ptr; ioCompletion: ProcPtr; ioResult: OSErr; ioNamePtr: StringPtr; ioVRefNum: INTEGER; CASE ParamBlkType OF IOParam: (ioRefNum: INTEGER; ioVersNum: SignedByte; ioPermssn: SignedByte; ioMisc: Ptr; ioBuffer: Ptr; ioReqCount: LONGINT; {size of buffer area} ioActCount: LONGINT; {length of vol parms data} ioPosMode: INTEGER; ioPosOffset: LONGINT); FileParam: (ioFRefNum: INTEGER; ioFVersNum: SignedByte; filler1: SignedByte; ioFDirIndex: INTEGER; ioFlAttrib: SignedByte; ioFlVersNum: SignedByte; ioFlFndrInfo: FInfo; ioDirID: LONGINT; ioFlStBlk: INTEGER; ioFlLgLen: LONGINT; ioFlPyLen: LONGINT; ioFlRStBlk: INTEGER; ioFlRLgLen: LONGINT; ioFlRPyLen: LONGINT; ioFlCrDat: LONGINT; ioFlMdDat: LONGINT); VolumeParam: (filler2: LONGINT; ioVolIndex: INTEGER; ioVCrDate: LONGINT; ioVLsMod: LONGINT; ioVAtrb: INTEGER; ioVNmFls: INTEGER; ioVBitMap: INTEGER; ioAllocPtr: INTEGER; ioVNmAlBlks: INTEGER; ioVAlBlkSiz: LONGINT; ioVClpSiz: LONGINT; ioAlBlSt: INTEGER; ioVNxtCNID: LONGINT; ioVFrBlk: INTEGER; ioVSigWord: INTEGER; ioVDrvInfo: INTEGER; ioVDRefNum: INTEGER; ioVFSID: INTEGER; ioVBkUp: LONGINT; ioVSeqNum: INTEGER; ioVWrCnt: LONGINT; ioVFilCnt: LONGINT; ioVDirCnt: LONGINT; ioVFndrInfo: ARRAY [1..8] OF LONGINT); AccessParam: (filler3: INTEGER; ioDenyModes: INTEGER; {access rights data} filler4: INTEGER; filler5: SignedByte; ioACUser: SignedByte; {access rights for directory only} filler6: LONGINT; ioACOwnerID: LONGINT; {owner ID} ioACGroupID: LONGINT; {group ID} ioACAccess: LONGINT); {access rights} ObjParam: (filler7: INTEGER; ioObjType: INTEGER; {function code} ioObjNamePtr: Ptr; {ptr to returned creator/group name} ioObjID: LONGINT); {creator/group ID} CopyParam: (ioDstVRefNum: INTEGER; {destination vol identifier} filler8: INTEGER; ioNewName: Ptr; {ptr to destination pathname} ioCopyName: Ptr; {ptr to optional name} ioNewDirID: LONGINT); {destination directory ID} WDParam: (filler9: INTEGER; ioWDIndex: INTEGER; ioWDProcID: LONGINT; ioWDVRefNum: INTEGER; filler10: INTEGER; filler11: LONGINT; filler12: LONGINT; filler13: LONGINT; ioWDDirID: LONGINT); FIDParam: (filler14: LONGINT; ioDestNamePtr: StringPtr; filler15: LONGINT; ioDestDirID: LONGINT; filler16: LONGINT; filler17: LONGINT; ioSrcDirID: LONGINT; filler18: INTEGER; ioFileID: LONGINT); CSParam: (ioMatchPtr: FSSpecArrayPtr; {match array} ioReqMatchCount: LONGINT; {maximum allowable matches} ioActMatchCount: LONGINT; {actual match count} ioSearchBits: LONGINT; {search criteria selector} ioSearchInfo1: CInfoPBPtr; {search values and range lower bounds} ioSearchInfo2: CInfoPBPtr; {search values and range upper bounds} ioSearchTime: LONGINT; {length of time to run the search} ioCatPosition: CatPositionRec; {current position in the catalog} ioOptBuffer: Ptr; {optional performance enhancement buffer} ioOptBufSize: LONGINT); {length of buffer pointed to by ioOptBuffer} ForeignPrivParam: (filler21: LONGINT; filler22: LONGINT; ioForeignPrivBuffer: Ptr; ioForeignPrivReqCount: LONGINT; ioForeignPrivActCount: LONGINT; filler23: LONGINT; ioForeignPrivDirID: LONGINT; ioForeignPrivInfo1: LONGINT; ioForeignPrivInfo2: LONGINT; ioForeignPrivInfo3: LONGINT; ioForeignPrivInfo4: LONGINT); END; æC »FileParam Variant ( ParamBlockRec and HParamBlockRec) The fileParam variants of ParamBlockRec and HParamBlockRec are identical, with one exception: The field ioDirID in HParamBlockRec is called ioFlNum in ParamBlockRec. The fields of the fileParam variant of HParamBlockRec are as follows: •••Refer to Technical Note #204:••• fileParam: (ioFRefNum: INTEGER; {path reference number} ioFVersNum: SignedByte; {version number} filler1: SignedByte; {not used} ioFDirIndex: INTEGER; {index} ioFlAttrib: SignedByte; {file attributes} ioFlVersNum: SignedByte; {version number} ioFlFndrInfo: FInfo; {information used by the Finder} ioDirID: LONGINT; {directory ID or file number} ioFlStBlk: INTEGER; {first allocation block of data fork} ioFlLgLen: LONGINT; {logical end-of-file of data fork} ioFlPyLen: LONGINT; {physical end-of-file of data fork} ioFlRStBlk: INTEGER; {first allocation block of resource fork} ioFlRLgLen: LONGINT; {logical end-of-file of resource fork} ioFlRPyLen: LONGINT; {physical end-of-file of resource fork} ioFlCrDat: LONGINT; {date and time of creation} ioFlMdDat: LONGINT); {date and time of last modification} IOFDirIndex can be used with the PBGetFInfo and PBHGetFInfo to index through the files in a given directory. Warning: When used with GetFileInfo, ioFDirIndex will index only the files in a directory. To index both files and directories, you can use ioFDirIndex with PBGetCatInfo. IOFlAttrib contains the following file attributes: Bit Meaning 0 Set if file is locked 2 Set if resource fork is open 3 Set if data fork is open 4 Set if a directory 7 Set if file (either fork) is open When passed to a routine, ioDirID contains a directory ID; it can be used to refer to a directory or, in conjuction with a partial pathname from that directory, to other files and directories. If both a directory ID and a working directory reference number are provided, the directory ID is used to identify the directory on the volume indicated by the working directory reference number. In other words, a directory ID specified by the caller will override the working directory referred to by the working directory reference number. If you don’t want this to happen, you can set ioDirID to 0. (If no directory is specified through a working directory reference number, the root directory ID will be used.) When returned from a routine, ioDirID contains the file number of a file; most programmers needn’t be concerned with file numbers, but those interested can read the section “Data Organization on Volumes”. IOFlStBlk and ioFlRStBlk contain 0 if the file’s data or resource fork is empty, respectively; they’re used only with flat volumes. The date and time in the ioFlCrDat and ioFlMdDat fields are specified in seconds since midnight, January 1, 1904. »VolumeParam Variant (ParamBlockRec) When you call GetVolInfo, you’ll use the volumeParam variant of ParamBlockRec: volumeParam: (filler2: LONGINT; {not used} ioVolIndex: INTEGER; {index} ioVCrDate: LONGINT; {date and time of initialization} ioVLsBkUp: LONGINT; {date and time of last modification} ioVAtrb: INTEGER; {volume attributes} ioVNmFls: INTEGER; {number of files in root directory} ioVDirSt: INTEGER; {first block of directory} ioVBlLn: INTEGER; {length of directory in blocks} ioVNmAlBlks: INTEGER; {number of allocation blocks} ioVAlBlkSiz: LONGINT; {size of allocation blocks} ioVClpSiz: LONGINT; {number of bytes to allocate} ioAlBlSt: INTEGER; {first block in volume block map} ioVNxtFNum: LONGINT; {next unused file number} ioVFrBlk: INTEGER); {number of unused allocation blocks} IOVolIndex can be used to index through all the mounted volumes; using an index of 1 accesses the first volume mounted, and so on. (For more information on indexing, see the section “Indexing” above.) IOVLsBkUp contains the date and time the volume information was last modified (this is not necessarily when it was flushed). (This field is not modified when information is written to a file.) Note: The name ioVLsBkUp is actually a misnomer; this field has always contained the date and time of the last modification to the volume, not the last backup. Most programmers needn’t be concerned with the remaining parameters, but interested programmers can read the section “Data Organization on Volumes”. »VolumeParam Variant (HParamBlockRec) When you call HGetVInfo and SetVolInfo, you’ll use the volumeParam variant of HParamBlockRec. This is a superset of the volumeParam variant of ParamBlockRec; the names and functions of certain fields have been changed, and new fields have been added: volumeParam: (filler2: LONGINT; {not used} ioVolIndex: INTEGER; {index} ioVCrDate: LONGINT; {date and time of initialization} ioVLsMod: LONGINT; {date and time of last modification} ioVAtrb: INTEGER; {volume attributes} ioVNmFls: INTEGER; {number of files in root directory} ioVBitMap: INTEGER; {first block of volume bit map} ioAllocPtr: INTEGER; {block at which next new file starts} ioVNmAlBlks: INTEGER; {number of allocation blocks} ioVAlBlkSiz: LONGINT; {size of allocation blocks} ioVClpSiz: LONGINT; {number of bytes to allocate} ioAlBlSt: INTEGER; {first block in volume block map} ioVNxtCNID: LONGINT; {next unused file number} ioVFrBlk: INTEGER; {number of unused allocation blocks} ioVSigWord: INTEGER; {volume signature} ioVDrvInfo: INTEGER; {drive number} ioVDRefNum: INTEGER; {driver reference number} ioVFSID: INTEGER; {file system handling this volume} ioVBkUp: LONGINT; {date and time of last backup} ioVSeqNum: INTEGER; {used internally} ioVWrCnt LONGINT; {volume write count} ioVFilCnt: LONGINT; {number of files on volume} ioVDirCnt: LONGINT; {number of directories on volume} ioVFndrInfo: ARRAY[1..8] OF LONGINT); {information used by the Finder} IOVolIndex can be used to index through all the mounted volumes; using an index of 1 accesses the first volume mounted, and so on. (For more information on indexing, see the section “Indexing” above.) IOVLsMod contains the date and time the volume information was last modified (this is not necessarily when it was flushed). (This field is not modified when information is written to a file.) Note: IOVLsMod replaces the field ioVLsBkUp in ParamBlockRec. The name ioVLsBkUp was actually a misnomer; this field has always contained the date and time of the last modification, not the last backup. Another field, ioVBkUp, contains the date and time of the last backup. IOVClpSiz can be used to set the volume clump size in bytes; it’s used for files that don’t have a clump size defined as part of their file information in the catalog. To promote file contiguity and avoid fragmentation, space is allocated to a file not in allocation blocks but in clumps. A clump is a group of contiguous allocation blocks. The clump size is always a multiple of the allocation block size; it’s the minimum number of bytes to allocate each time the Allocate function is called or the end-of-file is reached during the Write routine. IOVSigWord contains a signature word identifying the type of volume; it’s $D2D7 for flat directory volumes and $4244 for hierarchical directory volumes. The drive number of the drive containing the volume is returned in ioDrvInfo. For on-line volumes, ioVDRefNum returns the reference number of the I/O driver for the drive identified by ioDrvInfo. IOVFSID is the file-system identifier. It indicates which file system is servicing the volume; it’s 0 for File Manager volumes and nonzero for volumes handled by an external file system. IOVBkUp specifies the date and time the volume was last backed up (it’s 0 if never backed up). IOVNmFls contains the number of files in the root directory. IOVFilCnt contains the total number of files on the volume, while ioVDirCnt contains the total number of directories (not including the root directory). Most programmers needn’t be concerned with the other parameters, but interested programmers can read the section “Data Organization on Volumes”. HParamBlockRec, described above, has been extended to support a shared environment with the addition of AccessParam, ObjParam, CopyParam, and WDParam, as shown below. (The complete HParamBlockRec data type is shown in the summary.) AccessParam: (filler3: INTEGER; ioDenyModes: INTEGER; {access rights data} filler4: INTEGER; filler5: Signed Byte; ioACUser: Signed Byte; {access rights for directory only} filler6: LONGINT; ioACOwnerID: LONGINT; {owner ID} ioACGroupID: LONGINT; {group ID} ioACAccess: LONGINT); {access rights} ObjParam: (filler7: INTEGER; ioObjType: INTEGER; {function code} ioObjNamePtr: Ptr; {ptr to returned creator/group name} ioObjID: LONGINT; {creator/group ID} ioReqCount: LONGINT; {size of buffer area} ioActCount: LONGINT); {length of vol parms data} CopyParam: (ioDstVRefNum: INTEGER; {destination vol identifier} filler8: INTEGER; ioNewName: Ptr; {ptr to destination pathname} ioCopyName: Ptr; {ptr to optional name} ioNewDirID: LONGINT); {destination directory ID} WDParam: (filler9: INTEGER; ioWDIndex: INTEGER; ioWDProcID: LONGINT; ioWDVRefNum: INTEGER; filler10: INTEGER; filler11: LONGINT; filler12: LONGINT; filler13: LONGINT; ioWDDirID: LONGINT); æKY CMovePBRec CMovePBPtr æFp Files.p æT RECORD æD CMovePBPtr = ^CMovePBRec; CMovePBRec = RECORD qLink: QElemPtr; qType: INTEGER; ioTrap: INTEGER; ioCmdAddr: Ptr; ioCompletion: ProcPtr; ioResult: OSErr; ioNamePtr: StringPtr; ioVRefNum: INTEGER; filler1: LONGINT; ioNewName: StringPtr; filler2: LONGINT; ioNewDirID: LONGINT; filler3: ARRAY [1..2] OF LONGINT; ioDirID: LONGINT; END; æC »CMovePBRec When you call CatMove to move files or directories into a different directory, you’ll use the following six additional fields after the standard eight fields in the parameter block record CMovePBRec: filler1: LONGINT; {not used} ioNewName: StringPtr; {name of new directory} filler2: LONGINT; {not used} ioNewDirID: LONGINT; {directory ID of new directory} filler3: ARRAY[1..2] OF LONGINT; {not used} ioDirID: LONGINT); {directory ID of current directory} IONewName and ioNewDirID specify the name and directory ID of the directory to which the file or directory is to be moved. IODirID (used in conjuntion with the ioVRefNum and ioNamePtr) specifies the current directory ID of the file or directory to be moved. æKY WDPBRec WDPBPtr æFp Files.p æT RECORD æD WDPBPtr = ^WDPBRec; WDPBRec = RECORD qLink: QElemPtr; qType: INTEGER; ioTrap: INTEGER; ioCmdAddr: Ptr; ioCompletion: ProcPtr; ioResult: OSErr; ioNamePtr: StringPtr; ioVRefNum: INTEGER; filler1: INTEGER; ioWDIndex: INTEGER; ioWDProcID: LONGINT; ioWDVRefNum: INTEGER; filler2: ARRAY [1..7] OF INTEGER; ioWDDirID: LONGINT; END; æC »WDPBRec When you call the routines that open, close, and get information about working directories, you’ll use the following six additional fields after the standard eight fields in the parameter block record WDPBRec: filler1: INTEGER; {not used} ioWDIndex: INTEGER; {index} ioWDProcID: LONGINT; {working directory user identifier} ioWDVRefNum: INTEGER; {working directory's volume reference number} filler2: ARRAY[1..7] OF INTEGER; {not used} ioWDDirID: LONGINT); {working directory's directory ID} IOWDIndex can be used with the function PBGetWDInfo to index through the current working directories. IOWDProcID is an identifier that’s used to distinguish between working directories set up by different users; you should use the application’s signature (discussed in the Finder Interface chapter) as the ioWDProcID. æKY FCBPBRec FCBPBPtr æFp Files.p æT RECORD æD FCBPBPtr = ^FCBPBRec; FCBPBRec = RECORD qLink: QElemPtr; qType: INTEGER; ioTrap: INTEGER; ioCmdAddr: Ptr; ioCompletion: ProcPtr; ioResult: OSErr; ioNamePtr: StringPtr; ioVRefNum: INTEGER; ioRefNum: INTEGER; filler: INTEGER; ioFCBIndx: INTEGER; filler1: INTEGER; ioFCBFlNm: LONGINT; ioFCBFlags: INTEGER; ioFCBStBlk: INTEGER; ioFCBEOF: LONGINT; ioFCBPLen: LONGINT; ioFCBCrPs: LONGINT; ioFCBVRefNum: INTEGER; ioFCBClpSiz: LONGINT; ioFCBParID: LONGINT; END; æC æKY NumVersion æFp Files.p æT RECORD æD NumVersion = PACKED RECORD CASE INTEGER OF 0: (majorRev: SignedByte; {1st part of version number in BCD} minorRev: 0..9; {2nd part is 1 nibble in BCD} bugFixRev: 0..9; {3rd part is 1 nibble in BCD} stage: SignedByte; {stage code: dev, alpha, beta, final} nonRelRev: SignedByte); {revision level of non-released version} 1: (version: LONGINT); {to use all 4 fields at one time} END; æC æKY VersRec VersRecPtr VersRecHndl æFp Files.p æT RECORD æD VersRecPtr = ^VersRec; VersRecHndl = ^VersRecPtr; VersRec = RECORD numericVersion: NumVersion; {encoded version number} countryCode: INTEGER; {country code from intl utilities} shortVersion: Str255; {version number string - worst case} reserved: Str255; {longMessage string packed after shortVersion} END; æC æKY PBOpen æFp Files.p æT FUNCTION æD FUNCTION PBOpen(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBOpen(paramBlock,async); æRI II-108 æC Trap macro _Open Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioRefNum word --> 26 ioVersNum byte --> 27 ioPermssn byte --> 28 ioMisc pointer PBOpen creates an access path to the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioVersNum) on the volume specified by ioVRefNum. A path reference number is returned in ioRefNum. IOMisc either points to a portion of memory (522 bytes) to be used as the access path’s buffer, or is NIL if you want the volume buffer to be used instead. Warning: All access paths to a single file that’s opened multiple times should share the same buffer so that they will read and write the same data. IOPermssn specifies the path’s read/write permission. A path can be opened for writing even if it accesses a file on a locked volume, and an error won’t be returned until a PBWrite, PBSetEOF, or PBAllocate call is made. If you attempt to open a locked file for writing, PBOpen will return permErr as its function result. If you request exclusive read/write permission but another access path already has write permission (whether write only, exclusive read/write, or shared read/write), PBOpen will return the reference number of the existing access path in ioRefNum and opWrErr as its function result. Similarly, if you request shared read/write permission but another access path already has exclusive read/write permission, PBOpen will return the reference number of the access path in ioRefNum and opWrErr as its function result. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBOpenSync æFp Files.p æT FUNCTION æTN A000 æD FUNCTION PBOpenSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A000,$3E80; æDT myVariable := PBOpenSync(paramBlock,A0); æRI II-108 æC Trap macro _Open Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioRefNum word --> 26 ioVersNum byte --> 27 ioPermssn byte --> 28 ioMisc pointer PBOpen creates an access path to the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioVersNum) on the volume specified by ioVRefNum. A path reference number is returned in ioRefNum. IOMisc either points to a portion of memory (522 bytes) to be used as the access path’s buffer, or is NIL if you want the volume buffer to be used instead. Warning: All access paths to a single file that’s opened multiple times should share the same buffer so that they will read and write the same data. IOPermssn specifies the path’s read/write permission. A path can be opened for writing even if it accesses a file on a locked volume, and an error won’t be returned until a PBWrite, PBSetEOF, or PBAllocate call is made. If you attempt to open a locked file for writing, PBOpen will return permErr as its function result. If you request exclusive read/write permission but another access path already has write permission (whether write only, exclusive read/write, or shared read/write), PBOpen will return the reference number of the existing access path in ioRefNum and opWrErr as its function result. Similarly, if you request shared read/write permission but another access path already has exclusive read/write permission, PBOpen will return the reference number of the access path in ioRefNum and opWrErr as its function result. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBOpenAsync æFp Files.p æT FUNCTION æTN A400 æD FUNCTION PBOpenAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A400,$3E80; æDT myVariable := PBOpenAsync(paramBlock,A0); æRI II-108 æC Trap macro _Open Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioRefNum word --> 26 ioVersNum byte --> 27 ioPermssn byte --> 28 ioMisc pointer PBOpen creates an access path to the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioVersNum) on the volume specified by ioVRefNum. A path reference number is returned in ioRefNum. IOMisc either points to a portion of memory (522 bytes) to be used as the access path’s buffer, or is NIL if you want the volume buffer to be used instead. Warning: All access paths to a single file that’s opened multiple times should share the same buffer so that they will read and write the same data. IOPermssn specifies the path’s read/write permission. A path can be opened for writing even if it accesses a file on a locked volume, and an error won’t be returned until a PBWrite, PBSetEOF, or PBAllocate call is made. If you attempt to open a locked file for writing, PBOpen will return permErr as its function result. If you request exclusive read/write permission but another access path already has write permission (whether write only, exclusive read/write, or shared read/write), PBOpen will return the reference number of the existing access path in ioRefNum and opWrErr as its function result. Similarly, if you request shared read/write permission but another access path already has exclusive read/write permission, PBOpen will return the reference number of the access path in ioRefNum and opWrErr as its function result. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBClose æFp Files.p æT FUNCTION æD FUNCTION PBClose(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBClose(paramBlock,async); æRI II-114 æC Trap macro _Close Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word PBClose writes the contents of the access path buffer specified by ioRefNum to the volume and removes the access path. Warning: Some information stored on the volume won’t be correct until PBFlushVol is called. Result codes noErr No error extFSErr External file system fnfErr File not found fnOpnErr File not open ioErr I/O error nsvErr No such volume rfNumErr Bad reference number æKY PBCloseSync æFp Files.p æT FUNCTION æTN A001 æD FUNCTION PBCloseSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A001,$3E80; æDT myVariable := PBCloseSync(paramBlock,A0); æRI II-114 æC Trap macro _Close Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word PBClose writes the contents of the access path buffer specified by ioRefNum to the volume and removes the access path. Warning: Some information stored on the volume won’t be correct until PBFlushVol is called. Result codes noErr No error extFSErr External file system fnfErr File not found fnOpnErr File not open ioErr I/O error nsvErr No such volume rfNumErr Bad reference number æKY PBCloseAsync æFp Files.p æT FUNCTION æTN A401 æD FUNCTION PBCloseAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A401,$3E80; æDT myVariable := PBCloseAsync(paramBlock,A0); æRI II-114 æC Trap macro _Close Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word PBClose writes the contents of the access path buffer specified by ioRefNum to the volume and removes the access path. Warning: Some information stored on the volume won’t be correct until PBFlushVol is called. Result codes noErr No error extFSErr External file system fnfErr File not found fnOpnErr File not open ioErr I/O error nsvErr No such volume rfNumErr Bad reference number æKY PBRead æFp Files.p æT FUNCTION æD FUNCTION PBRead(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBRead(paramBlock,async); æRT 187 æRI II-110 æC Trap macro _Read Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 32 ioBuffer pointer --> 36 ioReqCount long word <-- 40 ioActCount long word --> 44 ioPosMode word <-> 46 ioPosOffset long word PBRead attempts to read ioReqCount bytes from the open file whose access path is specified by ioRefNum, and transfer them to the data buffer pointed to by ioBuffer. The position of the mark is specified by ioPosMode and ioPosOffset. If you try to read past the logical end-of-file, PBRead moves the mark to the end-of-file and returns eofErr as its function result. After the read is completed, the mark is returned in ioPosOffset and the number of bytes actually read is returned in ioActCount. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error paramErr Negative ioReqCount rfNumErr Bad reference number æKY PBReadSync æFp Files.p æT FUNCTION æTN A002 æD FUNCTION PBReadSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A002,$3E80; æDT myVariable := PBReadSync(paramBlock,A0); æRT 187 æRI II-110 æC Trap macro _Read Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 32 ioBuffer pointer --> 36 ioReqCount long word <-- 40 ioActCount long word --> 44 ioPosMode word <-> 46 ioPosOffset long word PBRead attempts to read ioReqCount bytes from the open file whose access path is specified by ioRefNum, and transfer them to the data buffer pointed to by ioBuffer. The position of the mark is specified by ioPosMode and ioPosOffset. If you try to read past the logical end-of-file, PBRead moves the mark to the end-of-file and returns eofErr as its function result. After the read is completed, the mark is returned in ioPosOffset and the number of bytes actually read is returned in ioActCount. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error paramErr Negative ioReqCount rfNumErr Bad reference number æKY PBReadAsync æFp Files.p æT FUNCTION æTN A402 æD FUNCTION PBReadAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A402,$3E80; æDT myVariable := PBReadAsync(paramBlock,A0); æRT 187 æRI II-110 æC Trap macro _Read Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 32 ioBuffer pointer --> 36 ioReqCount long word <-- 40 ioActCount long word --> 44 ioPosMode word <-> 46 ioPosOffset long word PBRead attempts to read ioReqCount bytes from the open file whose access path is specified by ioRefNum, and transfer them to the data buffer pointed to by ioBuffer. The position of the mark is specified by ioPosMode and ioPosOffset. If you try to read past the logical end-of-file, PBRead moves the mark to the end-of-file and returns eofErr as its function result. After the read is completed, the mark is returned in ioPosOffset and the number of bytes actually read is returned in ioActCount. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error paramErr Negative ioReqCount rfNumErr Bad reference number æKY PBWrite æFp Files.p æT FUNCTION æD FUNCTION PBWrite(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBWrite(paramBlock,async); æRT 187 æRI II-110 æC •••Refer to Technical Note #187:••• Trap macro _Write Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 32 ioBuffer pointer --> 36 ioReqCount long word <-- 40 ioActCount long word --> 44 ioPosMode word <-> 46 ioPosOffset long word PBWrite takes ioReqCount bytes from the buffer pointed to by ioBuffer and attempts to write them to the open file whose access path is specified by ioRefNum. The position of the mark is specified by ioPosMode and ioPosOffset. After the write is completed, the mark is returned in ioPosOffset and the number of bytes actually written is returned in ioActCount. Result codes noErr No error dskFulErr Disk full fLckdErr File locked fnOpnErr File not open ioErr I/O error paramErr Negative ioReqCount posErr Attempt to position before start of file rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY PBWriteSync æFp Files.p æT FUNCTION æTN A003 æD FUNCTION PBWriteSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A003,$3E80; æDT myVariable := PBWriteSync(paramBlock,A0); æRT 187 æRI II-110 æC •••Refer to Technical Note #187:••• Trap macro _Write Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 32 ioBuffer pointer --> 36 ioReqCount long word <-- 40 ioActCount long word --> 44 ioPosMode word <-> 46 ioPosOffset long word PBWrite takes ioReqCount bytes from the buffer pointed to by ioBuffer and attempts to write them to the open file whose access path is specified by ioRefNum. The position of the mark is specified by ioPosMode and ioPosOffset. After the write is completed, the mark is returned in ioPosOffset and the number of bytes actually written is returned in ioActCount. Result codes noErr No error dskFulErr Disk full fLckdErr File locked fnOpnErr File not open ioErr I/O error paramErr Negative ioReqCount posErr Attempt to position before start of file rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY PBWriteAsync æFp Files.p æT FUNCTION æTN A403 æD FUNCTION PBWriteAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A403,$3E80; æDT myVariable := PBWriteAsync(paramBlock,A0); æRT 187 æRI II-110 æC •••Refer to Technical Note #187:••• Trap macro _Write Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 32 ioBuffer pointer --> 36 ioReqCount long word <-- 40 ioActCount long word --> 44 ioPosMode word <-> 46 ioPosOffset long word PBWrite takes ioReqCount bytes from the buffer pointed to by ioBuffer and attempts to write them to the open file whose access path is specified by ioRefNum. The position of the mark is specified by ioPosMode and ioPosOffset. After the write is completed, the mark is returned in ioPosOffset and the number of bytes actually written is returned in ioActCount. Result codes noErr No error dskFulErr Disk full fLckdErr File locked fnOpnErr File not open ioErr I/O error paramErr Negative ioReqCount posErr Attempt to position before start of file rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY PBGetVInfo æFp Files.p æT FUNCTION æD FUNCTION PBGetVInfo(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBGetVInfo(paramBlock,async); æRT 24, 44, 157 æRI II-104, IV-129, N24-1, N44-2, N157 æC Trap macro _GetVolInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer <-> 22 ioVRefNum word --> 28 ioVolIndex word <-- 30 ioVCrDate long word <-- 34 ioVLsBkUp long word <-- 38 ioVAtrb word <-- 40 ioVNmFls word <-- 42 ioVDirSt word <-- 44 ioVBlLn word <-- 46 ioVNmAlBlks word <-- 48 ioVAlBlkSiz long word <-- 52 ioVClpSiz long word <-- 56 ioAlBlSt word <-- 58 ioVNxtFNum long word <-- 62 ioVFrBlk word PBGetVInfo returns information about the specified volume. If ioVolIndex is positive, the File Manager attempts to use it to find the volume; for instance, if ioVolIndex is 2, the File Manager will attempt to access the second mounted volume. If ioVolIndex is negative, the File Manager uses ioNamePtr and ioVRefNum in the standard way (described in the section “Specifying Volumes, Directories, and Files”) to determine which volume. If ioVolIndex is 0, the File Manager attempts to access the volume by using ioVRefNum only. The volume reference number is returned in ioVRefNum, and a pointer to the volume name is returned in ioNamePtr (unless ioNamePtr is NIL). If a working directory reference number is passed in ioVRefNum (or if the default directory is a subdirectory), the number of files and directories in the specified directory (the directory’s valence) will be returned in ioVNmFls. Also, the volume reference number won’t be returned; ioVRefNum will still contain the working directory reference number. Warning: IOVNmAlBlks and ioVFrBlks, which are actually unsigned integers, are clipped to 31744 ($7C00) regardless of the size of the volume. Result codes noErr No error nsvErr No such volume paramErr No default volume æKY PBGetVInfoSync æFp Files.p æT FUNCTION æTN A007 æD FUNCTION PBGetVInfoSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A007,$3E80; æDT myVariable := PBGetVInfoSync(paramBlock,A0); æRT 24, 44, 157 æRI II-104, IV-129, N24-1, N44-2, N157 æC Trap macro _GetVolInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer <-> 22 ioVRefNum word --> 28 ioVolIndex word <-- 30 ioVCrDate long word <-- 34 ioVLsBkUp long word <-- 38 ioVAtrb word <-- 40 ioVNmFls word <-- 42 ioVDirSt word <-- 44 ioVBlLn word <-- 46 ioVNmAlBlks word <-- 48 ioVAlBlkSiz long word <-- 52 ioVClpSiz long word <-- 56 ioAlBlSt word <-- 58 ioVNxtFNum long word <-- 62 ioVFrBlk word PBGetVInfo returns information about the specified volume. If ioVolIndex is positive, the File Manager attempts to use it to find the volume; for instance, if ioVolIndex is 2, the File Manager will attempt to access the second mounted volume. If ioVolIndex is negative, the File Manager uses ioNamePtr and ioVRefNum in the standard way (described in the section “Specifying Volumes, Directories, and Files”) to determine which volume. If ioVolIndex is 0, the File Manager attempts to access the volume by using ioVRefNum only. The volume reference number is returned in ioVRefNum, and a pointer to the volume name is returned in ioNamePtr (unless ioNamePtr is NIL). If a working directory reference number is passed in ioVRefNum (or if the default directory is a subdirectory), the number of files and directories in the specified directory (the directory’s valence) will be returned in ioVNmFls. Also, the volume reference number won’t be returned; ioVRefNum will still contain the working directory reference number. Warning: IOVNmAlBlks and ioVFrBlks, which are actually unsigned integers, are clipped to 31744 ($7C00) regardless of the size of the volume. Result codes noErr No error nsvErr No such volume paramErr No default volume æKY PBGetVInfoAsync æFp Files.p æT FUNCTION æTN A407 æD FUNCTION PBGetVInfoAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A407,$3E80; æDT myVariable := PBGetVInfoAsync(paramBlock,A0); æRT 24, 44, 157 æRI II-104, IV-129, N24-1, N44-2, N157 æC Trap macro _GetVolInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer <-> 22 ioVRefNum word --> 28 ioVolIndex word <-- 30 ioVCrDate long word <-- 34 ioVLsBkUp long word <-- 38 ioVAtrb word <-- 40 ioVNmFls word <-- 42 ioVDirSt word <-- 44 ioVBlLn word <-- 46 ioVNmAlBlks word <-- 48 ioVAlBlkSiz long word <-- 52 ioVClpSiz long word <-- 56 ioAlBlSt word <-- 58 ioVNxtFNum long word <-- 62 ioVFrBlk word PBGetVInfo returns information about the specified volume. If ioVolIndex is positive, the File Manager attempts to use it to find the volume; for instance, if ioVolIndex is 2, the File Manager will attempt to access the second mounted volume. If ioVolIndex is negative, the File Manager uses ioNamePtr and ioVRefNum in the standard way (described in the section “Specifying Volumes, Directories, and Files”) to determine which volume. If ioVolIndex is 0, the File Manager attempts to access the volume by using ioVRefNum only. The volume reference number is returned in ioVRefNum, and a pointer to the volume name is returned in ioNamePtr (unless ioNamePtr is NIL). If a working directory reference number is passed in ioVRefNum (or if the default directory is a subdirectory), the number of files and directories in the specified directory (the directory’s valence) will be returned in ioVNmFls. Also, the volume reference number won’t be returned; ioVRefNum will still contain the working directory reference number. Warning: IOVNmAlBlks and ioVFrBlks, which are actually unsigned integers, are clipped to 31744 ($7C00) regardless of the size of the volume. Result codes noErr No error nsvErr No such volume paramErr No default volume æKY PBGetVol æFp Files.p æT FUNCTION æD FUNCTION PBGetVol(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBGetVol(paramBlock,async); æRI II-104, IV-131 æC Trap macro _GetVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-- 18 ioNamePtr pointer <-- 22 ioVRefNum word PBGetVol returns a pointer to the name of the default volume in ioNamePtr (unless ioNamePtr is NIL) and its volume reference number in ioVRefNum. If a default directory was set with a previous PBSetVol call, a pointer to its name will be returned in ioNamePtr and its working directory reference number in ioVRefNum. Result codes noErr No error nsvErr No default volume æKY PBGetVolSync æFp Files.p æT FUNCTION æTN A014 æD FUNCTION PBGetVolSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A014,$3E80; æDT myVariable := PBGetVolSync(paramBlock,A0); æRI II-104, IV-131 æC Trap macro _GetVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-- 18 ioNamePtr pointer <-- 22 ioVRefNum word PBGetVol returns a pointer to the name of the default volume in ioNamePtr (unless ioNamePtr is NIL) and its volume reference number in ioVRefNum. If a default directory was set with a previous PBSetVol call, a pointer to its name will be returned in ioNamePtr and its working directory reference number in ioVRefNum. Result codes noErr No error nsvErr No default volume æKY PBGetVolAsync æFp Files.p æT FUNCTION æTN A414 æD FUNCTION PBGetVolAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A414,$3E80; æDT myVariable := PBGetVolAsync(paramBlock,A0); æRI II-104, IV-131 æC Trap macro _GetVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-- 18 ioNamePtr pointer <-- 22 ioVRefNum word PBGetVol returns a pointer to the name of the default volume in ioNamePtr (unless ioNamePtr is NIL) and its volume reference number in ioVRefNum. If a default directory was set with a previous PBSetVol call, a pointer to its name will be returned in ioNamePtr and its working directory reference number in ioVRefNum. Result codes noErr No error nsvErr No default volume æKY PBSetVol æFp Files.p æT FUNCTION æD FUNCTION PBSetVol(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBSetVol(paramBlock,async); æRI II-105, IV-132 æC Trap macro _SetVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word PBSetVol sets the default volume to the mounted volume specified by ioNamePtr or ioVRefNum. On hierarchical volumes, PBSetVol also sets the root directory as the default directory. Result codes noErr No error bdNamErr Bad volume name nsvErr No such volume paramErr No default volume æKY PBSetVolSync æFp Files.p æT FUNCTION æTN A015 æD FUNCTION PBSetVolSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A015,$3E80; æDT myVariable := PBSetVolSync(paramBlock,A0); æRI II-105, IV-132 æC Trap macro _SetVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word PBSetVol sets the default volume to the mounted volume specified by ioNamePtr or ioVRefNum. On hierarchical volumes, PBSetVol also sets the root directory as the default directory. Result codes noErr No error bdNamErr Bad volume name nsvErr No such volume paramErr No default volume æKY PBSetVolAsync æFp Files.p æT FUNCTION æTN A415 æD FUNCTION PBSetVolAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A415,$3E80; æDT myVariable := PBSetVolAsync(paramBlock,A0); æRI II-105, IV-132 æC Trap macro _SetVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word PBSetVol sets the default volume to the mounted volume specified by ioNamePtr or ioVRefNum. On hierarchical volumes, PBSetVol also sets the root directory as the default directory. Result codes noErr No error bdNamErr Bad volume name nsvErr No such volume paramErr No default volume æKY PBFlushVol æFp Files.p æT FUNCTION æD FUNCTION PBFlushVol(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBFlushVol(paramBlock,async); æMM æRI II-105, IV-133 æC Trap macro _FlushVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word On the volume specified by ioNamePtr or ioVRefNum, PBFlushVol writes descriptive information about the volume, the contents of the associated volume buffer, and all access path buffers for the volume (if they’ve changed since the last time PBFlushVol was called). Note: The date and time of the last modification to the volume are set when the modification is made, not when the volume is flushed. Result codes noErr No error bdNamErr Bad volume name extFSErr External file system ioErr I/O error nsDrvErr No such drive nsvErr No such volume paramErr No default volume æKY PBFlushVolSync æFp Files.p æT FUNCTION æTN A013 æD FUNCTION PBFlushVolSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A013,$3E80; æDT myVariable := PBFlushVolSync(paramBlock,A0); æMM æRI II-105, IV-133 æC Trap macro _FlushVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word On the volume specified by ioNamePtr or ioVRefNum, PBFlushVol writes descriptive information about the volume, the contents of the associated volume buffer, and all access path buffers for the volume (if they’ve changed since the last time PBFlushVol was called). Note: The date and time of the last modification to the volume are set when the modification is made, not when the volume is flushed. Result codes noErr No error bdNamErr Bad volume name extFSErr External file system ioErr I/O error nsDrvErr No such drive nsvErr No such volume paramErr No default volume æKY PBFlushVolAsync æFp Files.p æT FUNCTION æTN A413 æD FUNCTION PBFlushVolAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A413,$3E80; æDT myVariable := PBFlushVolAsync(paramBlock,A0); æMM æRI II-105, IV-133 æC Trap macro _FlushVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word On the volume specified by ioNamePtr or ioVRefNum, PBFlushVol writes descriptive information about the volume, the contents of the associated volume buffer, and all access path buffers for the volume (if they’ve changed since the last time PBFlushVol was called). Note: The date and time of the last modification to the volume are set when the modification is made, not when the volume is flushed. Result codes noErr No error bdNamErr Bad volume name extFSErr External file system ioErr I/O error nsDrvErr No such drive nsvErr No such volume paramErr No default volume æKY PBCreate æFp Files.p æT FUNCTION æD FUNCTION PBCreate(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBCreate(paramBlock,async); æRI II-107, IV-145 æC Trap macro _Create Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte PBCreate creates a new file (both forks) having the name pointed to by ioNamePtr (and on flat volumes, the version number ioVersNum) on the volume specified by ioVRefNum. The new file is unlocked and empty. The date and time of its creation and last modification are set to the current date and time. If the file created isn’t temporary (that is, if it will exist after the application terminates), the application should call PBSetFInfo (after PBCreate) to fill in the information needed by the Finder. Assembly-language note: If a desk accessory creates a file, it should always create it in the directory containing the system folder. The working directory reference number for this directory is stored in the global variable BootDrive; you can pass it in ioVRefNum. Result codes noErr No error bdNamErr Bad file name dupFNErr Duplicate file name and version dirFulErr File directory full extFSErr External file system ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBCreateSync æFp Files.p æT FUNCTION æTN A008 æD FUNCTION PBCreateSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A008,$3E80; æDT myVariable := PBCreateSync(paramBlock,A0); æRI II-107, IV-145 æC Trap macro _Create Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte PBCreate creates a new file (both forks) having the name pointed to by ioNamePtr (and on flat volumes, the version number ioVersNum) on the volume specified by ioVRefNum. The new file is unlocked and empty. The date and time of its creation and last modification are set to the current date and time. If the file created isn’t temporary (that is, if it will exist after the application terminates), the application should call PBSetFInfo (after PBCreate) to fill in the information needed by the Finder. Assembly-language note: If a desk accessory creates a file, it should always create it in the directory containing the system folder. The working directory reference number for this directory is stored in the global variable BootDrive; you can pass it in ioVRefNum. Result codes noErr No error bdNamErr Bad file name dupFNErr Duplicate file name and version dirFulErr File directory full extFSErr External file system ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBCreateAsync æFp Files.p æT FUNCTION æTN A408 æD FUNCTION PBCreateAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A408,$3E80; æDT myVariable := PBCreateAsync(paramBlock,A0); æRI II-107, IV-145 æC Trap macro _Create Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte PBCreate creates a new file (both forks) having the name pointed to by ioNamePtr (and on flat volumes, the version number ioVersNum) on the volume specified by ioVRefNum. The new file is unlocked and empty. The date and time of its creation and last modification are set to the current date and time. If the file created isn’t temporary (that is, if it will exist after the application terminates), the application should call PBSetFInfo (after PBCreate) to fill in the information needed by the Finder. Assembly-language note: If a desk accessory creates a file, it should always create it in the directory containing the system folder. The working directory reference number for this directory is stored in the global variable BootDrive; you can pass it in ioVRefNum. Result codes noErr No error bdNamErr Bad file name dupFNErr Duplicate file name and version dirFulErr File directory full extFSErr External file system ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBDelete æFp Files.p æT FUNCTION æD FUNCTION PBDelete(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDelete(paramBlock,async); æRI II-119, IV-147 æC Trap macro _Delete Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte PBDelete removes the closed file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioVersNum) from the volume pointed to by ioVRefNum. PBHDelete can be used to delete an empty directory as well. Note: This function will delete both forks of the file. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fBsyErr File busy, directory not empty, or working directory control block open fLckdErr File locked fnfErr File not found nsvErr No such volume ioErr I/O error vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBDeleteSync æFp Files.p æT FUNCTION æTN A009 æD FUNCTION PBDeleteSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A009,$3E80; æDT myVariable := PBDeleteSync(paramBlock,A0); æRI II-119, IV-147 æC Trap macro _Delete Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte PBDelete removes the closed file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioVersNum) from the volume pointed to by ioVRefNum. PBHDelete can be used to delete an empty directory as well. Note: This function will delete both forks of the file. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fBsyErr File busy, directory not empty, or working directory control block open fLckdErr File locked fnfErr File not found nsvErr No such volume ioErr I/O error vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBDeleteAsync æFp Files.p æT FUNCTION æTN A409 æD FUNCTION PBDeleteAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A409,$3E80; æDT myVariable := PBDeleteAsync(paramBlock,A0); æRI II-119, IV-147 æC Trap macro _Delete Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte PBDelete removes the closed file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioVersNum) from the volume pointed to by ioVRefNum. PBHDelete can be used to delete an empty directory as well. Note: This function will delete both forks of the file. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fBsyErr File busy, directory not empty, or working directory control block open fLckdErr File locked fnfErr File not found nsvErr No such volume ioErr I/O error vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBOpenDF æFp Files.p æT FUNCTION æD FUNCTION PBOpenDF(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBOpenDF(paramBlock,async); æRI PBOpenWD function IV-158, N77-1 æC FUNCTION PBOpenWD (paramBlock: WDPBPtr; async: BOOLEAN) : OSErr; Trap macro _OpenWD Parameter block —> 12 ioCompletion pointer <— 16 ioResult word —> 18 ioNamePtr pointer <–> 22 ioVRefNum word —> 28 ioWDProcID long word —> 48 ioWDDirID long word PBOpenWD takes the directory specified by ioVRefNum, ioWDDirID, and ioWDProcID and makes it a working directory. (You can also specify the directory using a combination of partial pathname and directory ID.) It returns a working directory reference number in ioVRefNum that can be used in subsequent calls. If a given directory has already been made a working directory using the same ioWDProcID, no new working directory will be opened; instead, the existing working directory reference number will be returned. If a given directory was already made a working directory using a different ioWDProcID, a new working directory reference number is returned. Result codes noErr No error tmwdoErr Too many working directories open æKY PBOpenDFSync æFp Files.p æT FUNCTION æTN 701A,A060 æD FUNCTION PBOpenDFSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$701A,$A060,$3E80; æDT myVariable := PBOpenDFSync(paramBlock,A0); æRI PBOpenWD function IV-158, N77-1 æC FUNCTION PBOpenWD (paramBlock: WDPBPtr; async: BOOLEAN) : OSErr; Trap macro _OpenWD Parameter block —> 12 ioCompletion pointer <— 16 ioResult word —> 18 ioNamePtr pointer <–> 22 ioVRefNum word —> 28 ioWDProcID long word —> 48 ioWDDirID long word PBOpenWD takes the directory specified by ioVRefNum, ioWDDirID, and ioWDProcID and makes it a working directory. (You can also specify the directory using a combination of partial pathname and directory ID.) It returns a working directory reference number in ioVRefNum that can be used in subsequent calls. If a given directory has already been made a working directory using the same ioWDProcID, no new working directory will be opened; instead, the existing working directory reference number will be returned. If a given directory was already made a working directory using a different ioWDProcID, a new working directory reference number is returned. Result codes noErr No error tmwdoErr Too many working directories open æKY PBOpenDFAsync æFp Files.p æT FUNCTION æTN 701A,A460 æD FUNCTION PBOpenDFAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$701A,$A460,$3E80; æDT myVariable := PBOpenDFAsync(paramBlock,A0); æRI PBOpenWD function IV-158, N77-1 æC FUNCTION PBOpenWD (paramBlock: WDPBPtr; async: BOOLEAN) : OSErr; Trap macro _OpenWD Parameter block —> 12 ioCompletion pointer <— 16 ioResult word —> 18 ioNamePtr pointer <–> 22 ioVRefNum word —> 28 ioWDProcID long word —> 48 ioWDDirID long word PBOpenWD takes the directory specified by ioVRefNum, ioWDDirID, and ioWDProcID and makes it a working directory. (You can also specify the directory using a combination of partial pathname and directory ID.) It returns a working directory reference number in ioVRefNum that can be used in subsequent calls. If a given directory has already been made a working directory using the same ioWDProcID, no new working directory will be opened; instead, the existing working directory reference number will be returned. If a given directory was already made a working directory using a different ioWDProcID, a new working directory reference number is returned. Result codes noErr No error tmwdoErr Too many working directories open æKY PBOpenRF æFp Files.p æT FUNCTION æD FUNCTION PBOpenRF(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBOpenRF(paramBlock,async); æMM æRT 74 æRI II-109, IV-137 æC Trap macro _OpenRF Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioRefNum word --> 26 ioVersNum byte --> 27 ioPermssn byte --> 28 ioMisc pointer PBOpenRF is identical to PBOpen, except that it opens the file’s resource fork instead of its data fork. Note: Normally you should access a file’s resource fork through the routines of the Resource Manager rather than the File Manager. PBOpenRF doesn’t read the resource map into memory; it’s really only useful for block-level operations such as copying files. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBOpenRFSync æFp Files.p æT FUNCTION æTN A00A æD FUNCTION PBOpenRFSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A00A,$3E80; æDT myVariable := PBOpenRFSync(paramBlock,A0); æMM æRT 74 æRI II-109, IV-137 æC Trap macro _OpenRF Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioRefNum word --> 26 ioVersNum byte --> 27 ioPermssn byte --> 28 ioMisc pointer PBOpenRF is identical to PBOpen, except that it opens the file’s resource fork instead of its data fork. Note: Normally you should access a file’s resource fork through the routines of the Resource Manager rather than the File Manager. PBOpenRF doesn’t read the resource map into memory; it’s really only useful for block-level operations such as copying files. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBOpenRFAsync æFp Files.p æT FUNCTION æTN A40A æD FUNCTION PBOpenRFAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A40A,$3E80; æDT myVariable := PBOpenRFAsync(paramBlock,A0); æMM æRT 74 æRI II-109, IV-137 æC Trap macro _OpenRF Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioRefNum word --> 26 ioVersNum byte --> 27 ioPermssn byte --> 28 ioMisc pointer PBOpenRF is identical to PBOpen, except that it opens the file’s resource fork instead of its data fork. Note: Normally you should access a file’s resource fork through the routines of the Resource Manager rather than the File Manager. PBOpenRF doesn’t read the resource map into memory; it’s really only useful for block-level operations such as copying files. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBRename æFp Files.p æT FUNCTION æD FUNCTION PBRename(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBRename(paramBlock,async); æRI II-118, IV-153 æC Trap macro _Rename Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioVersNum byte --> 28 ioMisc pointer Given a pointer to a file name in ioNamePtr (and on flat volumes, a version number in ioVersNum), PBRename changes the name of the file to the name pointed to by ioMisc. (If the name pointed to by ioNamePtr contains one or more colons, so must the name pointed to by ioMisc.) Access paths currently in use aren’t affected. Given a pointer to a volume name in ioNamePtr or a volume reference number in ioVRefNum, it changes the name of the volume to the name pointed to by ioMisc. If a volume to be renamed is specified by its volume reference number, ioNamePtr can be NIL. Warning: If a volume to be renamed is specified by its volume name, be sure that it ends with a colon, or Rename will consider it a file name. Result codes noErr No error bdNamErr Bad file name dirFulErr File directory full dupFNErr Duplicate file name and version extFSErr External file system fLckdErr File locked fnfErr File not found fsRnErr Problem during rename ioErr I/O error nsvErr No such volume paramErr No default volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBRenameSync æFp Files.p æT FUNCTION æTN A00B æD FUNCTION PBRenameSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A00B,$3E80; æDT myVariable := PBRenameSync(paramBlock,A0); æRI II-118, IV-153 æC Trap macro _Rename Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioVersNum byte --> 28 ioMisc pointer Given a pointer to a file name in ioNamePtr (and on flat volumes, a version number in ioVersNum), PBRename changes the name of the file to the name pointed to by ioMisc. (If the name pointed to by ioNamePtr contains one or more colons, so must the name pointed to by ioMisc.) Access paths currently in use aren’t affected. Given a pointer to a volume name in ioNamePtr or a volume reference number in ioVRefNum, it changes the name of the volume to the name pointed to by ioMisc. If a volume to be renamed is specified by its volume reference number, ioNamePtr can be NIL. Warning: If a volume to be renamed is specified by its volume name, be sure that it ends with a colon, or Rename will consider it a file name. Result codes noErr No error bdNamErr Bad file name dirFulErr File directory full dupFNErr Duplicate file name and version extFSErr External file system fLckdErr File locked fnfErr File not found fsRnErr Problem during rename ioErr I/O error nsvErr No such volume paramErr No default volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBRenameAsync æFp Files.p æT FUNCTION æTN A40B æD FUNCTION PBRenameAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A40B,$3E80; æDT myVariable := PBRenameAsync(paramBlock,A0); æRI II-118, IV-153 æC Trap macro _Rename Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioVersNum byte --> 28 ioMisc pointer Given a pointer to a file name in ioNamePtr (and on flat volumes, a version number in ioVersNum), PBRename changes the name of the file to the name pointed to by ioMisc. (If the name pointed to by ioNamePtr contains one or more colons, so must the name pointed to by ioMisc.) Access paths currently in use aren’t affected. Given a pointer to a volume name in ioNamePtr or a volume reference number in ioVRefNum, it changes the name of the volume to the name pointed to by ioMisc. If a volume to be renamed is specified by its volume reference number, ioNamePtr can be NIL. Warning: If a volume to be renamed is specified by its volume name, be sure that it ends with a colon, or Rename will consider it a file name. Result codes noErr No error bdNamErr Bad file name dirFulErr File directory full dupFNErr Duplicate file name and version extFSErr External file system fLckdErr File locked fnfErr File not found fsRnErr Problem during rename ioErr I/O error nsvErr No such volume paramErr No default volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBGetFInfo æFp Files.p æT FUNCTION æD FUNCTION PBGetFInfo(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBGetFInfo(paramBlock,async); æRT 24 æRI II-115, IV-148, N24-1, N68-1 æC Trap macro _GetFileInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioFRefNum word --> 26 ioFVersNum byte --> 28 ioFDirIndex word <-- 30 ioFlAttrib byte <-- 31 ioFlVersNum byte <-- 32 ioFlFndrInfo 16 bytes <-- 48 ioFlNum long word <-- 52 ioFlStBlk word <-- 54 ioFlLgLen long word <-- 58 ioFlPyLen long word <-- 62 ioFlRStBlk word <-- 64 ioFlRLgLen long word <-- 68 ioFlRPyLen long word <-- 72 ioFlCrDat long word <-- 76 ioFlMdDat long word PBGetFInfo returns information about the specified file. If ioFDirIndex is positive, the File Manager returns information about the file whose directory index is ioFDirIndex on the volume specified by ioVRefNum. (See the section “Data Organization on Volumes” if you’re interested in using this method.) Note: If a working directory reference number is specified in ioVRefNum, the File Manager returns information about the file whose directory index is ioFDirIndex in the specified directory. If ioFDirIndex is negative or 0, the File Manager returns information about the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioFVersNum) on the volume specified by ioVRefNum. If the file is open, the reference number of the first access path found is returned in ioFRefNum, and the name of the file is returned in ioNamePtr (unless ioNamePtr is NIL). Result codes noErr No error bdNamErr Bad file name extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume æKY PBGetFInfoSync æFp Files.p æT FUNCTION æTN A00C æD FUNCTION PBGetFInfoSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A00C,$3E80; æDT myVariable := PBGetFInfoSync(paramBlock,A0); æRT 24 æRI II-115, IV-148, N24-1, N68-1 æC Trap macro _GetFileInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioFRefNum word --> 26 ioFVersNum byte --> 28 ioFDirIndex word <-- 30 ioFlAttrib byte <-- 31 ioFlVersNum byte <-- 32 ioFlFndrInfo 16 bytes <-- 48 ioFlNum long word <-- 52 ioFlStBlk word <-- 54 ioFlLgLen long word <-- 58 ioFlPyLen long word <-- 62 ioFlRStBlk word <-- 64 ioFlRLgLen long word <-- 68 ioFlRPyLen long word <-- 72 ioFlCrDat long word <-- 76 ioFlMdDat long word PBGetFInfo returns information about the specified file. If ioFDirIndex is positive, the File Manager returns information about the file whose directory index is ioFDirIndex on the volume specified by ioVRefNum. (See the section “Data Organization on Volumes” if you’re interested in using this method.) Note: If a working directory reference number is specified in ioVRefNum, the File Manager returns information about the file whose directory index is ioFDirIndex in the specified directory. If ioFDirIndex is negative or 0, the File Manager returns information about the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioFVersNum) on the volume specified by ioVRefNum. If the file is open, the reference number of the first access path found is returned in ioFRefNum, and the name of the file is returned in ioNamePtr (unless ioNamePtr is NIL). Result codes noErr No error bdNamErr Bad file name extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume æKY PBGetFInfoAsync æFp Files.p æT FUNCTION æTN A40C æD FUNCTION PBGetFInfoAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A40C,$3E80; æDT myVariable := PBGetFInfoAsync(paramBlock,A0); æRT 24 æRI II-115, IV-148, N24-1, N68-1 æC Trap macro _GetFileInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioFRefNum word --> 26 ioFVersNum byte --> 28 ioFDirIndex word <-- 30 ioFlAttrib byte <-- 31 ioFlVersNum byte <-- 32 ioFlFndrInfo 16 bytes <-- 48 ioFlNum long word <-- 52 ioFlStBlk word <-- 54 ioFlLgLen long word <-- 58 ioFlPyLen long word <-- 62 ioFlRStBlk word <-- 64 ioFlRLgLen long word <-- 68 ioFlRPyLen long word <-- 72 ioFlCrDat long word <-- 76 ioFlMdDat long word PBGetFInfo returns information about the specified file. If ioFDirIndex is positive, the File Manager returns information about the file whose directory index is ioFDirIndex on the volume specified by ioVRefNum. (See the section “Data Organization on Volumes” if you’re interested in using this method.) Note: If a working directory reference number is specified in ioVRefNum, the File Manager returns information about the file whose directory index is ioFDirIndex in the specified directory. If ioFDirIndex is negative or 0, the File Manager returns information about the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioFVersNum) on the volume specified by ioVRefNum. If the file is open, the reference number of the first access path found is returned in ioFRefNum, and the name of the file is returned in ioNamePtr (unless ioNamePtr is NIL). Result codes noErr No error bdNamErr Bad file name extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume æKY PBSetFInfo æFp Files.p æT FUNCTION æD FUNCTION PBSetFInfo(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBSetFInfo(paramBlock,async); æRI II-116, IV-150 æC Trap macro _SetFileInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte --> 32 ioFlFndrInfo 16 bytes --> 72 ioFlCrDat long word --> 76 ioFlMdDat long word PBSetFInfo sets information (including the date and time of creation and modification, and information needed by the Finder) about the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioFVersNum) on the volume specified by ioVRefNum. You should call PBGetFInfo just before PBSetFInfo, so the current information is present in the parameter block. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fLckdErr File locked fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBSetFInfoSync æFp Files.p æT FUNCTION æTN A00D æD FUNCTION PBSetFInfoSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A00D,$3E80; æDT myVariable := PBSetFInfoSync(paramBlock,A0); æRI II-116, IV-150 æC Trap macro _SetFileInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte --> 32 ioFlFndrInfo 16 bytes --> 72 ioFlCrDat long word --> 76 ioFlMdDat long word PBSetFInfo sets information (including the date and time of creation and modification, and information needed by the Finder) about the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioFVersNum) on the volume specified by ioVRefNum. You should call PBGetFInfo just before PBSetFInfo, so the current information is present in the parameter block. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fLckdErr File locked fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBSetFInfoAsync æFp Files.p æT FUNCTION æTN A40D æD FUNCTION PBSetFInfoAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A40D,$3E80; æDT myVariable := PBSetFInfoAsync(paramBlock,A0); æRI II-116, IV-150 æC Trap macro _SetFileInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte --> 32 ioFlFndrInfo 16 bytes --> 72 ioFlCrDat long word --> 76 ioFlMdDat long word PBSetFInfo sets information (including the date and time of creation and modification, and information needed by the Finder) about the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioFVersNum) on the volume specified by ioVRefNum. You should call PBGetFInfo just before PBSetFInfo, so the current information is present in the parameter block. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fLckdErr File locked fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBSetFLock æFp Files.p æT FUNCTION æD FUNCTION PBSetFLock(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBSetFLock(paramBlock,async); æRI II-116, IV-151 æC Trap macro _SetFilLock Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte PBSetFLock locks the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioFVersNum) on the volume specified by ioVRefNum. Access paths currently in use aren’t affected. Result codes noErr No error extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBSetFLockSync æFp Files.p æT FUNCTION æTN A041 æD FUNCTION PBSetFLockSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A041,$3E80; æDT myVariable := PBSetFLockSync(paramBlock,A0); æRI II-116, IV-151 æC Trap macro _SetFilLock Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte PBSetFLock locks the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioFVersNum) on the volume specified by ioVRefNum. Access paths currently in use aren’t affected. Result codes noErr No error extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBSetFLockAsync æFp Files.p æT FUNCTION æTN A441 æD FUNCTION PBSetFLockAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A441,$3E80; æDT myVariable := PBSetFLockAsync(paramBlock,A0); æRI II-116, IV-151 æC Trap macro _SetFilLock Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte PBSetFLock locks the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioFVersNum) on the volume specified by ioVRefNum. Access paths currently in use aren’t affected. Result codes noErr No error extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBRstFLock æFp Files.p æT FUNCTION æD FUNCTION PBRstFLock(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBRstFLock(paramBlock,async); æRI II-117, IV-152 æC Trap macro _RstFilLock Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte PBRstFLock unlocks the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioFVersNum) on the volume specified by ioVRefNum. Access paths currently in use aren’t affected. Result codes noErr No error extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBRstFLockSync æFp Files.p æT FUNCTION æTN A042 æD FUNCTION PBRstFLockSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A042,$3E80; æDT myVariable := PBRstFLockSync(paramBlock,A0); æRI II-117, IV-152 æC Trap macro _RstFilLock Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte PBRstFLock unlocks the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioFVersNum) on the volume specified by ioVRefNum. Access paths currently in use aren’t affected. Result codes noErr No error extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBRstFLockAsync æFp Files.p æT FUNCTION æTN A442 æD FUNCTION PBRstFLockAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A442,$3E80; æDT myVariable := PBRstFLockAsync(paramBlock,A0); æRI II-117, IV-152 æC Trap macro _RstFilLock Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioFVersNum byte PBRstFLock unlocks the file having the name pointed to by ioNamePtr (and on flat volumes, the version number ioFVersNum) on the volume specified by ioVRefNum. Access paths currently in use aren’t affected. Result codes noErr No error extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBSetFVers æFp Files.p æT FUNCTION æD FUNCTION PBSetFVers(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBSetFVers(paramBlock,async); æRI II-117, IV-153 æC Trap macro _SetFilType Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioVersNum byte --> 28 ioMisc byte PBSetFVers has no effect on hierarchical volumes. On flat volumes, PBSetFVers changes the version number of the file having the name pointed to by ioNamePtr and version number ioVersNum, on the volume specified by ioVRefNum, to the version number stored in the high-order byte of ioMisc. Access paths currently in use aren’t affected. Result codes noErr No error bdNamErr Bad file name dupFNErr Duplicate file name and version extFSErr External file system fLckdErr File locked fnfErr File not found nsvErr No such volume ioErr I/O error paramErr No default volume vLckdErr Software volume lock wPrErr Hardware volume lock wrgVolTypErr Attempt to perform hierarchical operation on a flat volume æKY PBSetFVersSync æFp Files.p æT FUNCTION æTN A043 æD FUNCTION PBSetFVersSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A043,$3E80; æDT myVariable := PBSetFVersSync(paramBlock,A0); æRI II-117, IV-153 æC Trap macro _SetFilType Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioVersNum byte --> 28 ioMisc byte PBSetFVers has no effect on hierarchical volumes. On flat volumes, PBSetFVers changes the version number of the file having the name pointed to by ioNamePtr and version number ioVersNum, on the volume specified by ioVRefNum, to the version number stored in the high-order byte of ioMisc. Access paths currently in use aren’t affected. Result codes noErr No error bdNamErr Bad file name dupFNErr Duplicate file name and version extFSErr External file system fLckdErr File locked fnfErr File not found nsvErr No such volume ioErr I/O error paramErr No default volume vLckdErr Software volume lock wPrErr Hardware volume lock wrgVolTypErr Attempt to perform hierarchical operation on a flat volume æKY PBSetFVersAsync æFp Files.p æT FUNCTION æTN A443 æD FUNCTION PBSetFVersAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A443,$3E80; æDT myVariable := PBSetFVersAsync(paramBlock,A0); æRI II-117, IV-153 æC Trap macro _SetFilType Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 26 ioVersNum byte --> 28 ioMisc byte PBSetFVers has no effect on hierarchical volumes. On flat volumes, PBSetFVers changes the version number of the file having the name pointed to by ioNamePtr and version number ioVersNum, on the volume specified by ioVRefNum, to the version number stored in the high-order byte of ioMisc. Access paths currently in use aren’t affected. Result codes noErr No error bdNamErr Bad file name dupFNErr Duplicate file name and version extFSErr External file system fLckdErr File locked fnfErr File not found nsvErr No such volume ioErr I/O error paramErr No default volume vLckdErr Software volume lock wPrErr Hardware volume lock wrgVolTypErr Attempt to perform hierarchical operation on a flat volume æKY PBAllocate æFp Files.p æT FUNCTION æD FUNCTION PBAllocate(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBAllocate(paramBlock,async); æRI II-113, IV-143 æC Trap macro _Allocate Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 36 ioReqCount long word <-- 40 ioActCount long word PBAllocate adds ioReqCount bytes to the open file whose access path is specified by ioRefNum, and sets the physical end-of-file to one byte beyond the last block allocated. The number of bytes actually allocated is rounded up to the nearest multiple of the allocation block size, and returned in ioActCount. If there isn’t enough empty space on the volume to satisfy the allocation request, PBAllocate allocates the rest of the space on the volume and returns dskFulErr as its function result. Note: Even if the total number of requested bytes is unavailable, PBAllocate will allocate whatever space, contiguous or not, is available. To force the allocation of the entire requested space as a contiguous piece, call PBAllocContig instead. Result codes noErr No error dskFulErr Disk full fLckdErr File locked fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY PBAllocateSync æFp Files.p æT FUNCTION æTN A010 æD FUNCTION PBAllocateSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A010,$3E80; æDT myVariable := PBAllocateSync(paramBlock,A0); æRI II-113, IV-143 æC Trap macro _Allocate Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 36 ioReqCount long word <-- 40 ioActCount long word PBAllocate adds ioReqCount bytes to the open file whose access path is specified by ioRefNum, and sets the physical end-of-file to one byte beyond the last block allocated. The number of bytes actually allocated is rounded up to the nearest multiple of the allocation block size, and returned in ioActCount. If there isn’t enough empty space on the volume to satisfy the allocation request, PBAllocate allocates the rest of the space on the volume and returns dskFulErr as its function result. Note: Even if the total number of requested bytes is unavailable, PBAllocate will allocate whatever space, contiguous or not, is available. To force the allocation of the entire requested space as a contiguous piece, call PBAllocContig instead. Result codes noErr No error dskFulErr Disk full fLckdErr File locked fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY PBAllocateAsync æFp Files.p æT FUNCTION æTN A410 æD FUNCTION PBAllocateAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A410,$3E80; æDT myVariable := PBAllocateAsync(paramBlock,A0); æRI II-113, IV-143 æC Trap macro _Allocate Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 36 ioReqCount long word <-- 40 ioActCount long word PBAllocate adds ioReqCount bytes to the open file whose access path is specified by ioRefNum, and sets the physical end-of-file to one byte beyond the last block allocated. The number of bytes actually allocated is rounded up to the nearest multiple of the allocation block size, and returned in ioActCount. If there isn’t enough empty space on the volume to satisfy the allocation request, PBAllocate allocates the rest of the space on the volume and returns dskFulErr as its function result. Note: Even if the total number of requested bytes is unavailable, PBAllocate will allocate whatever space, contiguous or not, is available. To force the allocation of the entire requested space as a contiguous piece, call PBAllocContig instead. Result codes noErr No error dskFulErr Disk full fLckdErr File locked fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY PBGetEOF æFp Files.p æT FUNCTION æD FUNCTION PBGetEOF(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBGetEOF(paramBlock,async); æRI II-112, IV-142 æC Trap macro _GetEOF Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word <-- 28 ioMisc long word PBGetEOF returns, in ioMisc, the logical end-of-file of the open file whose access path is specified by ioRefNum. Result codes noErr No error extFSErr External file system fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number æKY PBGetEOFSync æFp Files.p æT FUNCTION æTN A011 æD FUNCTION PBGetEOFSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A011,$3E80; æDT myVariable := PBGetEOFSync(paramBlock,A0); æRI II-112, IV-142 æC Trap macro _GetEOF Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word <-- 28 ioMisc long word PBGetEOF returns, in ioMisc, the logical end-of-file of the open file whose access path is specified by ioRefNum. Result codes noErr No error extFSErr External file system fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number æKY PBGetEOFAsync æFp Files.p æT FUNCTION æTN A411 æD FUNCTION PBGetEOFAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A411,$3E80; æDT myVariable := PBGetEOFAsync(paramBlock,A0); æRI II-112, IV-142 æC Trap macro _GetEOF Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word <-- 28 ioMisc long word PBGetEOF returns, in ioMisc, the logical end-of-file of the open file whose access path is specified by ioRefNum. Result codes noErr No error extFSErr External file system fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number æKY PBSetEOF æFp Files.p æT FUNCTION æD FUNCTION PBSetEOF(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBSetEOF(paramBlock,async); æRI II-112, IV-142 æC Trap macro _SetEOF Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 28 ioMisc long word PBSetEOF sets the logical end-of-file of the open file, whose access path is specified by ioRefNum, to ioMisc. If you attempt to set the logical end-of-file beyond the physical end-of-file, another allocation block is added to the file; if there isn’t enough space on the volume, no change is made, and PBSetEOF returns dskFulErr as its function result. If ioMisc is 0, all space occupied by the file on the volume is released. Result codes noErr No error dskFulErr Disk full extFSErr External file system fLckdErr File locked fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY PBSetEOFSync æFp Files.p æT FUNCTION æTN A012 æD FUNCTION PBSetEOFSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A012,$3E80; æDT myVariable := PBSetEOFSync(paramBlock,A0); æRI II-112, IV-142 æC Trap macro _SetEOF Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 28 ioMisc long word PBSetEOF sets the logical end-of-file of the open file, whose access path is specified by ioRefNum, to ioMisc. If you attempt to set the logical end-of-file beyond the physical end-of-file, another allocation block is added to the file; if there isn’t enough space on the volume, no change is made, and PBSetEOF returns dskFulErr as its function result. If ioMisc is 0, all space occupied by the file on the volume is released. Result codes noErr No error dskFulErr Disk full extFSErr External file system fLckdErr File locked fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY PBSetEOFAsync æFp Files.p æT FUNCTION æTN A412 æD FUNCTION PBSetEOFAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A412,$3E80; æDT myVariable := PBSetEOFAsync(paramBlock,A0); æRI II-112, IV-142 æC Trap macro _SetEOF Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 28 ioMisc long word PBSetEOF sets the logical end-of-file of the open file, whose access path is specified by ioRefNum, to ioMisc. If you attempt to set the logical end-of-file beyond the physical end-of-file, another allocation block is added to the file; if there isn’t enough space on the volume, no change is made, and PBSetEOF returns dskFulErr as its function result. If ioMisc is 0, all space occupied by the file on the volume is released. Result codes noErr No error dskFulErr Disk full extFSErr External file system fLckdErr File locked fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY PBGetFPos æFp Files.p æT FUNCTION æD FUNCTION PBGetFPos(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBGetFPos(paramBlock,async); æRI II-111, IV-141 æC Trap macro _GetFPos Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word <-- 36 ioReqCount long word <-- 40 ioActCount long word <-- 44 ioPosMode word <-- 46 ioPosOffset long word PBGetFPos returns, in ioPosOffset, the mark of the open file whose access path is specified by ioRefNum. It sets ioReqCount, ioActCount, and ioPosMode to 0. Result codes noErr No error extFSErr External file system fnOpnErr File not open gfpErr Error during GetFPos ioErr I/O error rfNumErr Bad reference number æKY PBGetFPosSync æFp Files.p æT FUNCTION æTN A018 æD FUNCTION PBGetFPosSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A018,$3E80; æDT myVariable := PBGetFPosSync(paramBlock,A0); æRI II-111, IV-141 æC Trap macro _GetFPos Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word <-- 36 ioReqCount long word <-- 40 ioActCount long word <-- 44 ioPosMode word <-- 46 ioPosOffset long word PBGetFPos returns, in ioPosOffset, the mark of the open file whose access path is specified by ioRefNum. It sets ioReqCount, ioActCount, and ioPosMode to 0. Result codes noErr No error extFSErr External file system fnOpnErr File not open gfpErr Error during GetFPos ioErr I/O error rfNumErr Bad reference number æKY PBGetFPosAsync æFp Files.p æT FUNCTION æTN A418 æD FUNCTION PBGetFPosAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A418,$3E80; æDT myVariable := PBGetFPosAsync(paramBlock,A0); æRI II-111, IV-141 æC Trap macro _GetFPos Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word <-- 36 ioReqCount long word <-- 40 ioActCount long word <-- 44 ioPosMode word <-- 46 ioPosOffset long word PBGetFPos returns, in ioPosOffset, the mark of the open file whose access path is specified by ioRefNum. It sets ioReqCount, ioActCount, and ioPosMode to 0. Result codes noErr No error extFSErr External file system fnOpnErr File not open gfpErr Error during GetFPos ioErr I/O error rfNumErr Bad reference number æKY PBSetFPos æFp Files.p æT FUNCTION æD FUNCTION PBSetFPos(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBSetFPos(paramBlock,async); æRI II-111, IV-141 æC Trap macro _SetFPos Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 44 ioPosMode word <-> 46 ioPosOffset long word PBSetFPos sets the mark of the open file whose access path is specified by ioRefNum to the position specified by ioPosMode and ioPosOffset. The position at which the mark is actually set is returned in ioPosOffset. If you try to set the mark past the logical end-of-file, PBSetFPos moves the mark to the end-of-file and returns eofErr as its function result. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error posErr Attempt to position before start of file rfNumErr Bad reference number æKY PBSetFPosSync æFp Files.p æT FUNCTION æTN A044 æD FUNCTION PBSetFPosSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A044,$3E80; æDT myVariable := PBSetFPosSync(paramBlock,A0); æRI II-111, IV-141 æC Trap macro _SetFPos Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 44 ioPosMode word <-> 46 ioPosOffset long word PBSetFPos sets the mark of the open file whose access path is specified by ioRefNum to the position specified by ioPosMode and ioPosOffset. The position at which the mark is actually set is returned in ioPosOffset. If you try to set the mark past the logical end-of-file, PBSetFPos moves the mark to the end-of-file and returns eofErr as its function result. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error posErr Attempt to position before start of file rfNumErr Bad reference number æKY PBSetFPosAsync æFp Files.p æT FUNCTION æTN A444 æD FUNCTION PBSetFPosAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A444,$3E80; æDT myVariable := PBSetFPosAsync(paramBlock,A0); æRI II-111, IV-141 æC Trap macro _SetFPos Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 44 ioPosMode word <-> 46 ioPosOffset long word PBSetFPos sets the mark of the open file whose access path is specified by ioRefNum to the position specified by ioPosMode and ioPosOffset. The position at which the mark is actually set is returned in ioPosOffset. If you try to set the mark past the logical end-of-file, PBSetFPos moves the mark to the end-of-file and returns eofErr as its function result. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error posErr Attempt to position before start of file rfNumErr Bad reference number æKY PBFlushFile æFp Files.p æT FUNCTION æD FUNCTION PBFlushFile(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBFlushFile(paramBlock,async); æRI II-114, IV-144 æC Trap macro _FlushFile Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word PBFlushFile writes the contents of the access path buffer indicated by ioRefNum to the volume, and updates the file’s entry in the file directory (or in the file catalog, in the case of hierarchical volumes). Warning: Some information stored on the volume won’t be correct until PBFlushVol is called. Result codes noErr No error extFSErr External file system fnfErr File not found fnOpnErr File not open ioErr I/O error nsvErr No such volume rfNumErr Bad reference number æKY PBFlushFileSync æFp Files.p æT FUNCTION æTN A045 æD FUNCTION PBFlushFileSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A045,$3E80; æDT myVariable := PBFlushFileSync(paramBlock,A0); æRI II-114, IV-144 æC Trap macro _FlushFile Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word PBFlushFile writes the contents of the access path buffer indicated by ioRefNum to the volume, and updates the file’s entry in the file directory (or in the file catalog, in the case of hierarchical volumes). Warning: Some information stored on the volume won’t be correct until PBFlushVol is called. Result codes noErr No error extFSErr External file system fnfErr File not found fnOpnErr File not open ioErr I/O error nsvErr No such volume rfNumErr Bad reference number æKY PBFlushFileAsync æFp Files.p æT FUNCTION æTN A445 æD FUNCTION PBFlushFileAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A445,$3E80; æDT myVariable := PBFlushFileAsync(paramBlock,A0); æRI II-114, IV-144 æC Trap macro _FlushFile Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word PBFlushFile writes the contents of the access path buffer indicated by ioRefNum to the volume, and updates the file’s entry in the file directory (or in the file catalog, in the case of hierarchical volumes). Warning: Some information stored on the volume won’t be correct until PBFlushVol is called. Result codes noErr No error extFSErr External file system fnfErr File not found fnOpnErr File not open ioErr I/O error nsvErr No such volume rfNumErr Bad reference number æKY PBMountVol æFp Files.p æT FUNCTION æTN A00F æD FUNCTION PBMountVol(paramBlock: ParmBlkPtr): OSErr; æDT myVariable := PBMountVol(paramBlock,A0); æMM æRT 134 æRI II-103, IV-128 æC »Accessing Volumes To get the volume reference number of a volume, given the path reference number of a file on that volume, both Pascal and assembly-language programmers can call the high-level File Manager function GetVRefNum. Assembly-language programmers may prefer calling the function GetFCBInfo (described below in the section “Data Structures in Memory”). FUNCTION PBMountVol (paramBlock: ParmBlkPtr) : OSErr; Trap macro _MountVol Parameter block <-- 16 ioResult word <-> 22 ioVRefNum word PBMountVol mounts the volume in the drive specified by ioVRefNum, and returns a volume reference number in ioVRefNum. If there are no volumes already mounted, this volume becomes the default volume. PBMountVol is always executed synchronously. Note: When mounting hierarchical volumes, PBMountVol opens two files needed for maintaining file directory and file mapping information. PBMountVol can fail if there are no access paths available for these two files; it will return tmfoErr as its function result. Result codes noErr No error badMDBErr Bad master directory block extFSErr External file system ioErr I/O error memFullErr Not enough room in heap zone noMacDskErr Not a Macintosh disk nsDrvErr No such drive paramErr Bad drive number tmfoErr Too many files open volOnLinErr Volume already on-line æKY PBUnmountVol æFp Files.p æT FUNCTION æTN A00E æD FUNCTION PBUnmountVol(paramBlock: ParmBlkPtr): OSErr; æDT myVariable := PBUnmountVol(paramBlock,A0); æRI II-106, IV-134 æC Trap macro _UnmountVol Parameter block <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word PBUnmountVol unmounts the volume specified by ioNamePtr or ioVRefNum, by calling PBFlushVol to flush the volume, closing all open files on the volume, and releasing the memory used for the volume. PBUnmountVol is always executed synchronously. Warning: Don’t unmount the startup volume. Note: Unmounting a volume does not close working directories; to release the memory allocated to a working directory, call PBCloseWD. Result codes noErr No error bdNamErr Bad volume name extFSErr External file system ioErr I/O error nsDrvErr No such drive nsvErr No such volume paramErr No default volume æKY PBEject æFp Files.p æT FUNCTION æTN A017 æD FUNCTION PBEject(paramBlock: ParmBlkPtr): OSErr; æDT myVariable := PBEject(paramBlock,A0); æMM æRI II-107, IV-135 æC Trap macro _Eject Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word PBEject flushes the volume specified by ioNamePtr or ioVRefNum, places it off-line, and then ejects the volume. Assembly-language note: You may invoke the macro _Eject asynchronously; the first part of the call is executed synchronously, and the actual ejection is executed asynchronously. Result codes noErr No error bdNamErr Bad volume name extFSErr External file system ioErr I/O error nsDrvErr No such drive nsvErr No such volume paramErr No default volume æKY PBOffLine æFp Files.p æT FUNCTION æTN A035 æD FUNCTION PBOffLine(paramBlock: ParmBlkPtr): OSErr; æDT myVariable := PBOffLine(paramBlock,A0); æMM æRI II-106, IV-134 æC Trap macro _OffLine Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word PBOffLine places off-line the volume specified by ioNamePtr or ioVRefNum, by calling PBFlushVol to flush the volume and releasing all the memory used for the volume except for the volume control block. PBOffLine is always executed synchronously. Result codes noErr No error bdNamErr Bad volume name extFSErr External file system ioErr I/O error nsDrvErr No such drive nsvErr No such volume paramErr No default volume æKY PBCatSearch æFp Files.p æT FUNCTION æD FUNCTION PBCatSearch(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBCatSearch(paramBlock,async); æMM æRI PBOffLine function II-106, IV-134 æC FUNCTION PBOffLine (paramBlock: ParmBlkPtr) : OSErr; Trap macro _OffLine Parameter block —> 12 ioCompletion pointer <— 16 ioResult word —> 18 ioNamePtr pointer —> 22 ioVRefNum word PBOffLine places off-line the volume specified by ioNamePtr or ioVRefNum, by calling PBFlushVol to flush the volume and releasing all the memory used for the volume except for the volume control block. PBOffLine is always executed synchronously. Result codes noErr No error bdNamErr Bad volume name extFSErr External file system ioErr I/O error nsDrvErr No such drive nsvErr No such volume paramErr No default volume æKY PBCatSearchSync æFp Files.p æT FUNCTION æTN 7018,A260 æD FUNCTION PBCatSearchSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7018,$A260,$3E80; æDT myVariable := PBCatSearchSync(paramBlock,A0); æMM æRI PBOffLine function II-106, IV-134 æC FUNCTION PBOffLine (paramBlock: ParmBlkPtr) : OSErr; Trap macro _OffLine Parameter block —> 12 ioCompletion pointer <— 16 ioResult word —> 18 ioNamePtr pointer —> 22 ioVRefNum word PBOffLine places off-line the volume specified by ioNamePtr or ioVRefNum, by calling PBFlushVol to flush the volume and releasing all the memory used for the volume except for the volume control block. PBOffLine is always executed synchronously. Result codes noErr No error bdNamErr Bad volume name extFSErr External file system ioErr I/O error nsDrvErr No such drive nsvErr No such volume paramErr No default volume æKY PBCatSearchAsync æFp Files.p æT FUNCTION æTN 7018,A660 æD FUNCTION PBCatSearchAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7018,$A660,$3E80; æDT myVariable := PBCatSearchAsync(paramBlock,A0); æMM æRI PBOffLine function II-106, IV-134 æC FUNCTION PBOffLine (paramBlock: ParmBlkPtr) : OSErr; Trap macro _OffLine Parameter block —> 12 ioCompletion pointer <— 16 ioResult word —> 18 ioNamePtr pointer —> 22 ioVRefNum word PBOffLine places off-line the volume specified by ioNamePtr or ioVRefNum, by calling PBFlushVol to flush the volume and releasing all the memory used for the volume except for the volume control block. PBOffLine is always executed synchronously. Result codes noErr No error bdNamErr Bad volume name extFSErr External file system ioErr I/O error nsDrvErr No such drive nsvErr No such volume paramErr No default volume æKY AddDrive æFp Files.p æT PROCEDURE æD PROCEDURE AddDrive(drvrRefNum: INTEGER;drvNum: INTEGER;qEl: DrvQElPtr); æDT AddDrive(drvrRefNum,drvNum,qEl); æRT 36, 108 æRI N36, N108-1 æC æKY FSOpen æFp Files.p æT FUNCTION æD FUNCTION FSOpen(fileName: Str255;vRefNum: INTEGER;VAR refNum: INTEGER): OSErr; æDT myVariable := FSOpen(fileName,vRefNum,refNum); æRT 102 æRI II-91, IV-109, P-131, 171 æC [Not in ROM] FSOpen creates an access path to the file having the name fileName on the volume specified by vRefNum. A path reference number is returned in refNum. The access path’s read/write permission is set to whatever the file’s open permission allows. Note: There’s no guarantee that any bytes have been written until FlushVol is called. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing tmfoErr Too many files open æKY OpenDF æFp Files.p æT FUNCTION æD FUNCTION OpenDF(fileName: Str255;vRefNum: INTEGER;VAR refNum: INTEGER): OSErr; æDT myVariable := OpenDF(fileName,vRefNum,refNum); æRT 102 æRI II-91, IV-109, P-131, 171 æC [Not in ROM] FSOpen creates an access path to the file having the name fileName on the volume specified by vRefNum. A path reference number is returned in refNum. The access path’s read/write permission is set to whatever the file’s open permission allows. Note: There’s no guarantee that any bytes have been written until FlushVol is called. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing tmfoErr Too many files open æKY FSClose æFp Files.p æT FUNCTION æD FUNCTION FSClose(refNum: INTEGER): OSErr; æDT myVariable := FSClose(refNum); æRT 102 æRI II-94, IV-112, P-132, 133, 171 æC [Not in ROM] FSClose removes the access path specified by refNum, writes the contents of the volume buffer to the volume, and updates the file’s entry in the file directory. Note: There’s no guarantee that any bytes have been written until FlushVol is called. Result codes noErr No error extFSErr External file system fnfErr File not found fnOpnErr File not open ioErr I/O error nsvErr No such volume rfNumErr Bad reference number æKY FSRead æFp Files.p æT FUNCTION æD FUNCTION FSRead(refNum: INTEGER;VAR count: LONGINT;buffPtr: Ptr): OSErr; æDT myVariable := FSRead(refNum,count,buffPtr); æRI IV-109, P-131, 171 æC [Not in ROM] FSRead attempts to read the number of bytes specified by the count parameter from the open file whose access path is specified by refNum, and transfer them to the data buffer pointed to by buffPtr. The read operation begins at the current mark, so you might want to precede this with a call to SetFPos. If you try to read past the logical end-of-file, FSRead moves the mark to the end-of-file and returns eofErr as its function result. After the read is completed, the number of bytes actually read is returned in the count parameter. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error paramErr Negative count rfNumErr Bad reference number æKY FSWrite æFp Files.p æT FUNCTION æD FUNCTION FSWrite(refNum: INTEGER;VAR count: LONGINT;buffPtr: Ptr): OSErr; æDT myVariable := FSWrite(refNum,count,buffPtr); æRI IV-110, P-132, 171 æC [Not in ROM] FSWrite takes the number of bytes specified by the count parameter from the buffer pointed to by buffPtr and attempts to write them to the open file whose access path is specified by refNum. The write operation begins at the current mark, so you might want to precede this with a call to SetFPos. After the write is completed, the number of bytes actually written is returned in the count parameter. Result codes noErr No error dskFulErr Disk full fLckdErr File locked fnOpnErr File not open ioErr I/O error paramErr Negative count rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY GetVInfo æFp Files.p æT FUNCTION æD FUNCTION GetVInfo(drvNum: INTEGER;volName: StringPtr;VAR vRefNum: INTEGER; VAR freeBytes: LONGINT): OSErr; æDT myVariable := GetVInfo(drvNum,volName,vRefNum,freeBytes); æRT 157 æRI II-89, IV-107, N157, low-level II-104, IV-129 æC »Accessing Volumes •••Refer to Technical Note #24:••• FUNCTION GetVInfo (drvNum: INTEGER; volName: StringPtr; VAR vRefNum: INTEGER; VAR freeBytes: LONGINT) : OSErr; [Not in ROM] •••Refer to Technical Note #157:••• GetVInfo returns the name, reference number, and available space (in bytes), in volName, vRefNum, and freeBytes, for the volume in the drive specified by drvNum. Result codes noErr No error nsvErr No default volume paramErr Bad drive number æKY GetFInfo æFp Files.p æT FUNCTION æD FUNCTION GetFInfo(fileName: Str255;vRefNum: INTEGER;VAR fndrInfo: FInfo): OSErr; æDT myVariable := GetFInfo(fileName,vRefNum,fndrInfo); æRI II-95, IV-113 æC [Not in ROM] For the file having the name fileName on the specified volume, GetFInfo returns information used by the Finder in fndrInfo (see the section “Information Used by the Finder”). Result codes noErr No error bdNamErr Bad file name extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume æKY GetVol æFp Files.p æT FUNCTION æD FUNCTION GetVol(volName: StringPtr;VAR vRefNum: INTEGER): OSErr; æDT myVariable := GetVol(volName,vRefNum); æRT 77,140 æRI N77-2, N140 high-level II-89, IV-107 low-level II-104, IV-131 æC [Not in ROM] GetVol returns the name of the default volume in volName and its volume reference number in vRefNum. Result codes noErr No error nsvErr No such volume æKY SetVol æFp Files.p æT FUNCTION æD FUNCTION SetVol(volName: StringPtr;vRefNum: INTEGER): OSErr; æDT myVariable := SetVol(volName,vRefNum); æRI II-89, IV-107 low-level II-105, IV-132 æC [Not in ROM] SetVol sets the default volume to the mounted volume specified by volName or vRefNum. Result codes noErr No error bdNamErr Bad volume name nsvErr No such volume paramErr No default volume æKY UnmountVol æFp Files.p æT FUNCTION æD FUNCTION UnmountVol(volName: StringPtr;vRefNum: INTEGER): OSErr; æDT myVariable := UnmountVol(volName,vRefNum); æRT 180 æRI II-90, IV-108 low-level II-106, IV-134 æC [Not in ROM] UnmountVol unmounts the volume specified by volName or vRefNum, by calling FlushVol to flush the volume buffer, closing all open files on the volume, and releasing the memory used for the volume. Warning: Don’t unmount the startup volume. Result codes noErr No error bdNamErr Bad volume name extFSErr External file system ioErr I/O error nsDrvErr No such drive nsvErr No such volume paramErr No default volume æKY Eject æFp Files.p æT FUNCTION æD FUNCTION Eject(volName: StringPtr;vRefNum: INTEGER): OSErr; æDT myVariable := Eject(volName,vRefNum); æMM æRI II-90, IV-108 low-level II-107, IV-135 æC [Not in ROM] Eject flushes the volume specified by volName or vRefNum, places it off-line, and then ejects the volume. Result codes noErr No error bdNamErr Bad volume name extFSErr External file system ioErr I/O error nsDrvErr No such drive nsvErr No such volume paramErr No default volume paramErr No default volume æKY FlushVol æFp Files.p æT FUNCTION æD FUNCTION FlushVol(volName: StringPtr;vRefNum: INTEGER): OSErr; æDT myVariable := FlushVol(volName,vRefNum); æMM æRI P-132, 133 high-level II-89, IV-108 low-level II-105, IV-133 æC [Not in ROM] On the volume specified by volName or vRefNum, FlushVol writes the contents of the associated volume buffer and descriptive information about the volume (if they’ve changed since the last time FlushVol was called). Result codes noErr No error bdNamErr Bad volume name extFSErr External file system ioErr I/O error nsDrvErr No such drive nsvErr No such volume paramErr No default volume æKY Create æFp Files.p æT FUNCTION æD FUNCTION Create(fileName: Str255;vRefNum: INTEGER;creator: OSType;fileType: OSType): OSErr; æDT myVariable := Create(fileName,vRefNum,creator,fileType); æRI II-90, IV-112 low-level II-107, IV-145 æC [Not in ROM] Create creates a new file (both forks) with the specified name, file type, and creator on the specified volume. (File type and creator are discussed in the Finder Interface chapter.) The new file is unlocked and empty. The date and time of its creation and last modification are set to the current date and time. Result codes noErr No error bdNamErr Bad file name dupFNErr Duplicate file name and version dirFulErr File directory full extFSErr External file system ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY FSDelete æFp Files.p æT FUNCTION æD FUNCTION FSDelete(fileName: Str255;vRefNum: INTEGER): OSErr; æDT myVariable := FSDelete(fileName,vRefNum); æRI II-97, IV-113 æC [Not in ROM] FSDelete removes the closed file having the name fileName from the specified volume. Note: This function will delete both forks of a file. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fBsyErr File busy fLckdErr File locked fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY OpenRF æFp Files.p æT FUNCTION æD FUNCTION OpenRF(fileName: Str255;vRefNum: INTEGER;VAR refNum: INTEGER): OSErr; æDT myVariable := OpenRF(fileName,vRefNum,refNum); æRT 74 æRI II-91, IV-109 low-level II-109, IV-137 æC [Not in ROM] OpenRF is similar to FSOpen; the only difference is that OpenRF opens the resource fork of the specified file rather than the data fork. A path reference number is returned in refNum. The access path’s read/write permission is set to whatever the file’s open permission allows. Note: Normally you should access a file’s resource fork through the routines of the Resource Manager rather than the File Manager. OpenRF doesn’t read the resource map into memory; it’s really only useful for block-level operations such as copying files. Result codes noErr No error bdNamErr Bad file name extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing tmfoErr Too many files open æKY Rename æFp Files.p æT FUNCTION æD FUNCTION Rename(oldName: Str255;vRefNum: INTEGER;newName: Str255): OSErr; æDT myVariable := Rename(oldName,vRefNum,newName); æRI II-96, IV-114 low-level II-118, IV-153 æC [Not in ROM] Given a file name in oldName, Rename changes the name of the file to newName. Access paths currently in use aren’t affected. Given a volume name in oldName or a volume reference number in vRefNum, Rename changes the name of the specified volume to newName. Warning: If you’re renaming a volume, be sure that both names end with a colon. Result codes noErr No error bdNamErr Bad file name dirFulErr Directory full dupFNErr Duplicate file name extFSErr External file system fLckdErr File locked fnfErr File not found fsRnErr Problem during rename ioErr I/O error nsvErr No such volume paramErr No default volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY SetFInfo æFp Files.p æT FUNCTION æD FUNCTION SetFInfo(fileName: Str255;vRefNum: INTEGER;fndrInfo: FInfo): OSErr; æDT myVariable := SetFInfo(fileName,vRefNum,fndrInfo); æRI II-95, IV-114 æC [Not in ROM] For the file having the name fileName on the specified volume, SetFInfo sets information used by the Finder to fndrInfo (see the section “Information Used by the Finder”). Result codes noErr No error extFSErr External file system fLckdErr File locked fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY SetFLock æFp Files.p æT FUNCTION æD FUNCTION SetFLock(fileName: Str255;vRefNum: INTEGER): OSErr; æDT myVariable := SetFLock(fileName,vRefNum); æRI II-95, IV-114 æC [Not in ROM] SetFLock locks the file having the name fileName on the specified volume. Access paths currently in use aren’t affected. Result codes noErr No error extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY RstFLock æFp Files.p æT FUNCTION æD FUNCTION RstFLock(fileName: Str255;vRefNum: INTEGER): OSErr; æDT myVariable := RstFLock(fileName,vRefNum); æRI II-96, IV-114 æC [Not in ROM] RstFLock unlocks the file having the name fileName on the specified volume. Access paths currently in use aren’t affected. Result codes noErr No error extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY Allocate æFp Files.p æT FUNCTION æD FUNCTION Allocate(refNum: INTEGER;VAR count: LONGINT): OSErr; æDT myVariable := Allocate(refNum,count); æRI IV-143 æC [Not in ROM] Allocate adds the number of bytes specified by the count parameter to the open file whose access path is specified by refNum, and sets the physical end-of-file to one byte beyond the last block allocated. The number of bytes actually allocated is rounded up to the nearest multiple of the allocation block size, and returned in the count parameter. If there isn’t enough empty space on the volume to satisfy the allocation request, Allocate allocates the rest of the space on the volume and returns dskFulErr as its function result. Result codes noErr No error dskFulErr Disk full fLckdErr File locked fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY GetEOF æFp Files.p æT FUNCTION æD FUNCTION GetEOF(refNum: INTEGER;VAR logEOF: LONGINT): OSErr; æDT myVariable := GetEOF(refNum,logEOF); æRI P-132, 172 high-level II-93, IV-111 low-level II-112, IV-142 æC [Not in ROM] GetEOF returns, in logEOF, the logical end-of-file of the open file whose access path is specified by refNum. Result codes noErr No error extFSErr External file system fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number æKY SetEOF æFp Files.p æT FUNCTION æD FUNCTION SetEOF(refNum: INTEGER;logEOF: LONGINT): OSErr; æDT myVariable := SetEOF(refNum,logEOF); æRI P-132, 180 high-level II-93, IV-111 low-level II-112, IV-142 æC [Not in ROM] SetEOF sets the logical end-of-file of the open file whose access path is specified by refNum to the position specified by logEOF. If you attempt to set the logical end-of-file beyond the physical end-of-file, the physical end-of-file is set to one byte beyond the end of the next free allocation block; if there isn’t enough space on the volume, no change is made, and SetEOF returns dskFulErr as its function result. If logEOF is 0, all space occupied by the file on the volume is released. Result codes noErr No error dskFulErr Disk full extFSErr External file system fLckdErr File locked fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY GetFPos æFp Files.p æT FUNCTION æD FUNCTION GetFPos(refNum: INTEGER;VAR filePos: LONGINT): OSErr; æDT myVariable := GetFPos(refNum,filePos); æRI II-92, IV-110 low-level II-111, IV-141 æC [Not in ROM] GetFPos returns, in filePos, the mark of the open file whose access path is specified by refNum. Result codes noErr No error extFSErr External file system fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number æKY SetFPos æFp Files.p æT FUNCTION æD FUNCTION SetFPos(refNum: INTEGER;posMode: INTEGER;posOff: LONGINT): OSErr; æDT myVariable := SetFPos(refNum,posMode,posOff); æRI P-131, 132, 180 high-level II-93, IV-110 low-level II-111, IV-141 æC [Not in ROM] SetFPos sets the mark of the open file whose access path is specified by refNum to the position specified by posMode and posOff (except when posMode is equal to fsAtMark, in which case posOff is ignored). PosMode indicates how to position the mark; it must contain one of the following values: CONST fsAtMark = 0; {at current mark} fsFromStart = 1; {set mark relative to beginning of file} fsFromLEOF = 2; {set mark relative to logical end-of-file} fsFromMark = 3; {set mark relative to current mark} If you specify fsAtMark, posOffset is ignored and the mark is left wherever it’s currently positioned. If you choose to set the mark (relative to either the beginning of the file, the logical end-of-file, or the current mark), posOffset specifies the byte offset from the chosen point (either positive or negative) where the mark should be set. If you try to set the mark past the logical end-of-file, SetFPos moves the mark to the end-of-file and returns eofErr as its function result. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error posErr Attempt to position before start of file rfNumErr Bad reference number æKY GetVRefNum æFp Files.p æT FUNCTION æD FUNCTION GetVRefNum(fileRefNum: INTEGER;VAR vRefNum: INTEGER): OSErr; æDT myVariable := GetVRefNum(fileRefNum,vRefNum); æRI II-89, IV-107 æC [Not in ROM] Given a path reference number in pathRefNum, GetVRefNum returns the volume reference number in vRefNum. Result codes noErr No error rfNumErr Bad reference number æKY PBOpenWD æFp Files.p æT FUNCTION æD FUNCTION PBOpenWD(paramBlock: WDPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBOpenWD(paramBlock,async); æRT 77, 190 æRI IV-158, N77-1 æC Trap macro _OpenWD Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer <-> 22 ioVRefNum word --> 28 ioWDProcID long word --> 48 ioWDDirID long word PBOpenWD takes the directory specified by ioVRefNum, ioWDDirID, and ioWDProcID and makes it a working directory. (You can also specify the directory using a combination of partial pathname and directory ID.) It returns a working directory reference number in ioVRefNum that can be used in subsequent calls. If a given directory has already been made a working directory using the same ioWDProcID, no new working directory will be opened; instead, the existing working directory reference number will be returned. If a given directory was already made a working directory using a different ioWDProcID, a new working directory reference number is returned. Result codes noErr No error tmwdoErr Too many working directories open æKY PBOpenWDSync æFp Files.p æT FUNCTION æTN 7001,A260 æD FUNCTION PBOpenWDSync(paramBlock: WDPBPtr): OSErr; INLINE $205F,$7001,$A260,$3E80; æDT myVariable := PBOpenWDSync(paramBlock,A0); æRT 77, 190 æRI IV-158, N77-1 æC Trap macro _OpenWD Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer <-> 22 ioVRefNum word --> 28 ioWDProcID long word --> 48 ioWDDirID long word PBOpenWD takes the directory specified by ioVRefNum, ioWDDirID, and ioWDProcID and makes it a working directory. (You can also specify the directory using a combination of partial pathname and directory ID.) It returns a working directory reference number in ioVRefNum that can be used in subsequent calls. If a given directory has already been made a working directory using the same ioWDProcID, no new working directory will be opened; instead, the existing working directory reference number will be returned. If a given directory was already made a working directory using a different ioWDProcID, a new working directory reference number is returned. Result codes noErr No error tmwdoErr Too many working directories open æKY PBOpenWDAsync æFp Files.p æT FUNCTION æTN 7001,A660 æD FUNCTION PBOpenWDAsync(paramBlock: WDPBPtr): OSErr; INLINE $205F,$7001,$A660,$3E80; æDT myVariable := PBOpenWDAsync(paramBlock,A0); æRT 77, 190 æRI IV-158, N77-1 æC Trap macro _OpenWD Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer <-> 22 ioVRefNum word --> 28 ioWDProcID long word --> 48 ioWDDirID long word PBOpenWD takes the directory specified by ioVRefNum, ioWDDirID, and ioWDProcID and makes it a working directory. (You can also specify the directory using a combination of partial pathname and directory ID.) It returns a working directory reference number in ioVRefNum that can be used in subsequent calls. If a given directory has already been made a working directory using the same ioWDProcID, no new working directory will be opened; instead, the existing working directory reference number will be returned. If a given directory was already made a working directory using a different ioWDProcID, a new working directory reference number is returned. Result codes noErr No error tmwdoErr Too many working directories open æKY PBCloseWD æFp Files.p æT FUNCTION æD FUNCTION PBCloseWD(paramBlock: WDPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBCloseWD(paramBlock,async); æRI IV-158 æC Trap macro _CloseWD Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 22 ioVRefNum word PBCloseWD releases the working directory whose working directory reference number is specified in ioVRefNum. Note: If a volume reference number is specified in ioVRefNum, PBCloseWD does nothing. Result codes noErr No error nsvErr No such volume æKY PBCloseWDSync æFp Files.p æT FUNCTION æTN 7002,A260 æD FUNCTION PBCloseWDSync(paramBlock: WDPBPtr): OSErr; INLINE $205F,$7002,$A260,$3E80; æDT myVariable := PBCloseWDSync(paramBlock,A0); æRI IV-158 æC Trap macro _CloseWD Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 22 ioVRefNum word PBCloseWD releases the working directory whose working directory reference number is specified in ioVRefNum. Note: If a volume reference number is specified in ioVRefNum, PBCloseWD does nothing. Result codes noErr No error nsvErr No such volume æKY PBCloseWDAsync æFp Files.p æT FUNCTION æTN 7002,A660 æD FUNCTION PBCloseWDAsync(paramBlock: WDPBPtr): OSErr; INLINE $205F,$7002,$A660,$3E80; æDT myVariable := PBCloseWDAsync(paramBlock,A0); æRI IV-158 æC Trap macro _CloseWD Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 22 ioVRefNum word PBCloseWD releases the working directory whose working directory reference number is specified in ioVRefNum. Note: If a volume reference number is specified in ioVRefNum, PBCloseWD does nothing. Result codes noErr No error nsvErr No such volume æKY PBHSetVol æFp Files.p æT FUNCTION æD FUNCTION PBHSetVol(paramBlock: WDPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHSetVol(paramBlock,async); æRT 140 æRI IV-133, N140 æC •••Refer to Technical Note #140:••• Trap macro _HSetVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioWDDirID long word PBHSetVol sets both the default volume and the default directory. The default directory to be used can be specified by either a volume reference number or a working directory reference number in ioVRefNum, a directory ID in ioWDDirID, or a pointer to a pathname (possibly NIL) in ioNamePtr. Note: Both the default volume and the default directory are used in calls made with no volume name and a volume reference number of zero. Result codes noErr No error nsvErr No default volume æKY PBHSetVolSync æFp Files.p æT FUNCTION æTN A215 æD FUNCTION PBHSetVolSync(paramBlock: WDPBPtr): OSErr; INLINE $205F,$A215,$3E80; æDT myVariable := PBHSetVolSync(paramBlock,A0); æRT 140 æRI IV-133, N140 æC •••Refer to Technical Note #140:••• Trap macro _HSetVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioWDDirID long word PBHSetVol sets both the default volume and the default directory. The default directory to be used can be specified by either a volume reference number or a working directory reference number in ioVRefNum, a directory ID in ioWDDirID, or a pointer to a pathname (possibly NIL) in ioNamePtr. Note: Both the default volume and the default directory are used in calls made with no volume name and a volume reference number of zero. Result codes noErr No error nsvErr No default volume æKY PBHSetVolAsync æFp Files.p æT FUNCTION æTN A615 æD FUNCTION PBHSetVolAsync(paramBlock: WDPBPtr): OSErr; INLINE $205F,$A615,$3E80; æDT myVariable := PBHSetVolAsync(paramBlock,A0); æRT 140 æRI IV-133, N140 æC •••Refer to Technical Note #140:••• Trap macro _HSetVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioWDDirID long word PBHSetVol sets both the default volume and the default directory. The default directory to be used can be specified by either a volume reference number or a working directory reference number in ioVRefNum, a directory ID in ioWDDirID, or a pointer to a pathname (possibly NIL) in ioNamePtr. Note: Both the default volume and the default directory are used in calls made with no volume name and a volume reference number of zero. Result codes noErr No error nsvErr No default volume æKY PBHGetVol æFp Files.p æT FUNCTION æD FUNCTION PBHGetVol(paramBlock: WDPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHGetVol(paramBlock,async); æRI IV-132 æC Trap macro _HGetVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-- 18 ioNamePtr pointer <-- 22 ioVRefNum word <-- 28 ioWDProcID long word <-- 32 ioWDVRefNum word <-- 48 ioWDDirID long word PBHGetVol returns the default volume and directory last set by either a PBSetVol or a PBHSetVol call. The reference number of the default volume is returned in ioVRefNum. Warning: IOVRefNum will return a working directory reference number (instead of the volume reference number) if, in the last call to PBSetVol or PBHSetVol, a working directory reference number was passed in this field. The volume reference number of the volume on which the default directory exists is returned in ioWDVRefNum. The directory ID of the default directory is returned in ioWDDirID. Result codes noErr No error nsvErr No default volume æKY PBHGetVolSync æFp Files.p æT FUNCTION æTN A214 æD FUNCTION PBHGetVolSync(paramBlock: WDPBPtr): OSErr; INLINE $205F,$A214,$3E80; æDT myVariable := PBHGetVolSync(paramBlock,A0); æRI IV-132 æC Trap macro _HGetVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-- 18 ioNamePtr pointer <-- 22 ioVRefNum word <-- 28 ioWDProcID long word <-- 32 ioWDVRefNum word <-- 48 ioWDDirID long word PBHGetVol returns the default volume and directory last set by either a PBSetVol or a PBHSetVol call. The reference number of the default volume is returned in ioVRefNum. Warning: IOVRefNum will return a working directory reference number (instead of the volume reference number) if, in the last call to PBSetVol or PBHSetVol, a working directory reference number was passed in this field. The volume reference number of the volume on which the default directory exists is returned in ioWDVRefNum. The directory ID of the default directory is returned in ioWDDirID. Result codes noErr No error nsvErr No default volume æKY PBHGetVolAsync æFp Files.p æT FUNCTION æTN A614 æD FUNCTION PBHGetVolAsync(paramBlock: WDPBPtr): OSErr; INLINE $205F,$A614,$3E80; æDT myVariable := PBHGetVolAsync(paramBlock,A0); æRI IV-132 æC Trap macro _HGetVol Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-- 18 ioNamePtr pointer <-- 22 ioVRefNum word <-- 28 ioWDProcID long word <-- 32 ioWDVRefNum word <-- 48 ioWDDirID long word PBHGetVol returns the default volume and directory last set by either a PBSetVol or a PBHSetVol call. The reference number of the default volume is returned in ioVRefNum. Warning: IOVRefNum will return a working directory reference number (instead of the volume reference number) if, in the last call to PBSetVol or PBHSetVol, a working directory reference number was passed in this field. The volume reference number of the volume on which the default directory exists is returned in ioWDVRefNum. The directory ID of the default directory is returned in ioWDDirID. Result codes noErr No error nsvErr No default volume æKY PBCatMove æFp Files.p æT FUNCTION æD FUNCTION PBCatMove(paramBlock: CMovePBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBCatMove(paramBlock,async); æRI IV-157 æC •••Refer to Technical Note #226:••• Trap macro _CatMove Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 28 ioNewName pointer --> 36 ioNewDirID long word --> 48 ioDirID long word PBCatMove moves files or directories from one directory to another. The name of the file or directory to be moved is pointed to by ioNamePtr; ioVRefNum contains either the volume reference number or working directory reference number. A directory ID can be specified in ioDirID. The name and directory ID of the directory to which the file or directory is to be moved are specified by ioNewName and ioNewDirID. PBCatMove is strictly a file catalog operation; it does not actually change the location of the file or directory on the disk. PBCatMove cannot move a file or directory to another volume (that is, ioVRefNum is used in specifying both the source and the destination). It also cannot be used to rename files or directories; for that, use PBHRename. Result codes noErr No error badMovErr Attempt to move into offspring bdNamErr Bad file name or attempt to move into a file dupFNErr Duplicate file name and version fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBCatMoveSync æFp Files.p æT FUNCTION æTN 7005,A260 æD FUNCTION PBCatMoveSync(paramBlock: CMovePBPtr): OSErr; INLINE $205F,$7005,$A260,$3E80; æDT myVariable := PBCatMoveSync(paramBlock,A0); æRI IV-157 æC •••Refer to Technical Note #226:••• Trap macro _CatMove Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 28 ioNewName pointer --> 36 ioNewDirID long word --> 48 ioDirID long word PBCatMove moves files or directories from one directory to another. The name of the file or directory to be moved is pointed to by ioNamePtr; ioVRefNum contains either the volume reference number or working directory reference number. A directory ID can be specified in ioDirID. The name and directory ID of the directory to which the file or directory is to be moved are specified by ioNewName and ioNewDirID. PBCatMove is strictly a file catalog operation; it does not actually change the location of the file or directory on the disk. PBCatMove cannot move a file or directory to another volume (that is, ioVRefNum is used in specifying both the source and the destination). It also cannot be used to rename files or directories; for that, use PBHRename. Result codes noErr No error badMovErr Attempt to move into offspring bdNamErr Bad file name or attempt to move into a file dupFNErr Duplicate file name and version fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBCatMoveAsync æFp Files.p æT FUNCTION æTN 7005,A660 æD FUNCTION PBCatMoveAsync(paramBlock: CMovePBPtr): OSErr; INLINE $205F,$7005,$A660,$3E80; æDT myVariable := PBCatMoveAsync(paramBlock,A0); æRI IV-157 æC •••Refer to Technical Note #226:••• Trap macro _CatMove Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 28 ioNewName pointer --> 36 ioNewDirID long word --> 48 ioDirID long word PBCatMove moves files or directories from one directory to another. The name of the file or directory to be moved is pointed to by ioNamePtr; ioVRefNum contains either the volume reference number or working directory reference number. A directory ID can be specified in ioDirID. The name and directory ID of the directory to which the file or directory is to be moved are specified by ioNewName and ioNewDirID. PBCatMove is strictly a file catalog operation; it does not actually change the location of the file or directory on the disk. PBCatMove cannot move a file or directory to another volume (that is, ioVRefNum is used in specifying both the source and the destination). It also cannot be used to rename files or directories; for that, use PBHRename. Result codes noErr No error badMovErr Attempt to move into offspring bdNamErr Bad file name or attempt to move into a file dupFNErr Duplicate file name and version fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBDirCreate æFp Files.p æT FUNCTION æD FUNCTION PBDirCreate(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDirCreate(paramBlock,async); æRI IV-146 æC Trap macro _DirCreate Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer --> 22 ioVRefNum word <-> 48 ioDirID long word PBDirCreate is identical to PBHCreate except that it creates a new directory instead of a file. You can specify the parent of the directory to be created in ioDirID; if it’s 0, the new directory will be placed in the root directory. The directory ID of the new directory is returned in ioDirID. Warning: PBDirCreate operates only with the hierarchical version of the File Manager; if used on a Macintosh equipped only with the 64K ROM version of the File Manager, it will generate a system error. Result codes noErr No error bdNamErr Bad file name dupFNErr Duplicate file name and version dirFulErr File directory full dirNFErr Directory not found or incomplete pathname extFSErr External file system ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBDirCreateSync æFp Files.p æT FUNCTION æTN 7006,A260 æD FUNCTION PBDirCreateSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7006,$A260,$3E80; æDT myVariable := PBDirCreateSync(paramBlock,A0); æRI IV-146 æC Trap macro _DirCreate Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer --> 22 ioVRefNum word <-> 48 ioDirID long word PBDirCreate is identical to PBHCreate except that it creates a new directory instead of a file. You can specify the parent of the directory to be created in ioDirID; if it’s 0, the new directory will be placed in the root directory. The directory ID of the new directory is returned in ioDirID. Warning: PBDirCreate operates only with the hierarchical version of the File Manager; if used on a Macintosh equipped only with the 64K ROM version of the File Manager, it will generate a system error. Result codes noErr No error bdNamErr Bad file name dupFNErr Duplicate file name and version dirFulErr File directory full dirNFErr Directory not found or incomplete pathname extFSErr External file system ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBDirCreateAsync æFp Files.p æT FUNCTION æTN 7006,A660 æD FUNCTION PBDirCreateAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7006,$A660,$3E80; æDT myVariable := PBDirCreateAsync(paramBlock,A0); æRI IV-146 æC Trap macro _DirCreate Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer --> 22 ioVRefNum word <-> 48 ioDirID long word PBDirCreate is identical to PBHCreate except that it creates a new directory instead of a file. You can specify the parent of the directory to be created in ioDirID; if it’s 0, the new directory will be placed in the root directory. The directory ID of the new directory is returned in ioDirID. Warning: PBDirCreate operates only with the hierarchical version of the File Manager; if used on a Macintosh equipped only with the 64K ROM version of the File Manager, it will generate a system error. Result codes noErr No error bdNamErr Bad file name dupFNErr Duplicate file name and version dirFulErr File directory full dirNFErr Directory not found or incomplete pathname extFSErr External file system ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBGetWDInfo æFp Files.p æT FUNCTION æD FUNCTION PBGetWDInfo(paramBlock: WDPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBGetWDInfo(paramBlock,async); æRT 77, 190 æRI IV-159, N77-5 æC Trap macro _GetWDInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-- 18 ioNamePtr pointer <-> 22 ioVRefNum word --> 26 ioWDIndex word <-> 28 ioWDProcID long word <-> 32 ioWDVRefNum word <-- 48 ioWDDirID long word PBGetWDInfo returns information about the specified working directory. The working directory can be specified either by its working directory reference number in ioVRefNum (in which case ioWDIndex should be 0), or by its index number in ioWDIndex. In the latter case, if ioVRefNum is nonzero, it’s interpreted as a volume specification (volume reference number or drive number), and only working directories on that volume are indexed. IOWDVRefNum always returns the volume reference number. IOVRefNum returns a working directory reference number when a working directory reference number is passed in that field; otherwise, it returns a volume reference number. The volume name is returned in ioNamePtr. If IOWDProcID is nonzero, only working directories with that identifier are indexed; otherwise all working directories are indexed. Result codes noErr No error nsvErr No such volume æKY PBGetWDInfoSync æFp Files.p æT FUNCTION æTN 7007,A260 æD FUNCTION PBGetWDInfoSync(paramBlock: WDPBPtr): OSErr; INLINE $205F,$7007,$A260,$3E80; æDT myVariable := PBGetWDInfoSync(paramBlock,A0); æRT 77, 190 æRI IV-159, N77-5 æC Trap macro _GetWDInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-- 18 ioNamePtr pointer <-> 22 ioVRefNum word --> 26 ioWDIndex word <-> 28 ioWDProcID long word <-> 32 ioWDVRefNum word <-- 48 ioWDDirID long word PBGetWDInfo returns information about the specified working directory. The working directory can be specified either by its working directory reference number in ioVRefNum (in which case ioWDIndex should be 0), or by its index number in ioWDIndex. In the latter case, if ioVRefNum is nonzero, it’s interpreted as a volume specification (volume reference number or drive number), and only working directories on that volume are indexed. IOWDVRefNum always returns the volume reference number. IOVRefNum returns a working directory reference number when a working directory reference number is passed in that field; otherwise, it returns a volume reference number. The volume name is returned in ioNamePtr. If IOWDProcID is nonzero, only working directories with that identifier are indexed; otherwise all working directories are indexed. Result codes noErr No error nsvErr No such volume æKY PBGetWDInfoAsync æFp Files.p æT FUNCTION æTN 7007,A660 æD FUNCTION PBGetWDInfoAsync(paramBlock: WDPBPtr): OSErr; INLINE $205F,$7007,$A660,$3E80; æDT myVariable := PBGetWDInfoAsync(paramBlock,A0); æRT 77, 190 æRI IV-159, N77-5 æC Trap macro _GetWDInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-- 18 ioNamePtr pointer <-> 22 ioVRefNum word --> 26 ioWDIndex word <-> 28 ioWDProcID long word <-> 32 ioWDVRefNum word <-- 48 ioWDDirID long word PBGetWDInfo returns information about the specified working directory. The working directory can be specified either by its working directory reference number in ioVRefNum (in which case ioWDIndex should be 0), or by its index number in ioWDIndex. In the latter case, if ioVRefNum is nonzero, it’s interpreted as a volume specification (volume reference number or drive number), and only working directories on that volume are indexed. IOWDVRefNum always returns the volume reference number. IOVRefNum returns a working directory reference number when a working directory reference number is passed in that field; otherwise, it returns a volume reference number. The volume name is returned in ioNamePtr. If IOWDProcID is nonzero, only working directories with that identifier are indexed; otherwise all working directories are indexed. Result codes noErr No error nsvErr No such volume æKY PBGetFCBInfo æFp Files.p æT FUNCTION æD FUNCTION PBGetFCBInfo(paramBlock: FCBPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBGetFCBInfo(paramBlock,async); æRT 87 æRI IV-179, N87-1 æC Trap macro _GetFCBInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-- 18 ioNamePtr pointer <-> 22 ioVRefNum word <-> 24 ioRefNum word --> 28 ioFCBIndx long word <-- 32 ioFCBFlNm long word <-- 36 ioFCBFlags word <-- 38 ioFCBStBlk word <-- 40 ioFCBEOF long word <-- 44 ioFCBPLen long word <-- 48 ioFCBCrPs long word <-- 52 ioFCBVRefNum word <-- 54 ioFCBClpSiz long word <-- 58 ioFCBParID long word PBGetFCBInfo returns information about the specified open file. If ioFCBIndx is positive, the File Manager returns information about the file whose file number is ioFCBIndx on the volume specified by ioVRefNum (which may contain a drive number, volume reference number, or working directory reference number). If ioVRefNum is 0, all open files are indexed; otherwise, only open files on the specified volume are indexed. If ioFCBIndx is 0, the File Manager returns information about the file whose access path is specified by ioRefNum. Assembly-language note: The global variable FCBSPtr points to the length word of the file-control-block buffer. Each file control block contains 94 bytes of information about an access path; Figure 28 shows its structure (using the assembly-language offsets). •••Refer to Figure 28:••• Figure 28–A File Control Block 64K ROM note: The structure of a file control block in the 64K ROM version of the File Manager is a subset of the above structure. The old file control block contained only the fields up to and including fcbFlPos. FCBMdRByt (which corresponds to ioFCBFlags in the parameter block for PBGetFCBInfo) contains flags that describe the status of the file, as follows: Bit Meaning 0 Set if data can be written to the file 1 Set if the entry describes a resource fork 7 Set if the file has been changed since it was last flushed Warning: The size and structure of a file control block may be different in future versions of Macintosh system software. æKY PBGetFCBInfoSync æFp Files.p æT FUNCTION æTN 7008,A260 æD FUNCTION PBGetFCBInfoSync(paramBlock: FCBPBPtr): OSErr; INLINE $205F,$7008,$A260,$3E80; æDT myVariable := PBGetFCBInfoSync(paramBlock,A0); æRT 87 æRI IV-179, N87-1 æC Trap macro _GetFCBInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-- 18 ioNamePtr pointer <-> 22 ioVRefNum word <-> 24 ioRefNum word --> 28 ioFCBIndx long word <-- 32 ioFCBFlNm long word <-- 36 ioFCBFlags word <-- 38 ioFCBStBlk word <-- 40 ioFCBEOF long word <-- 44 ioFCBPLen long word <-- 48 ioFCBCrPs long word <-- 52 ioFCBVRefNum word <-- 54 ioFCBClpSiz long word <-- 58 ioFCBParID long word PBGetFCBInfo returns information about the specified open file. If ioFCBIndx is positive, the File Manager returns information about the file whose file number is ioFCBIndx on the volume specified by ioVRefNum (which may contain a drive number, volume reference number, or working directory reference number). If ioVRefNum is 0, all open files are indexed; otherwise, only open files on the specified volume are indexed. If ioFCBIndx is 0, the File Manager returns information about the file whose access path is specified by ioRefNum. Assembly-language note: The global variable FCBSPtr points to the length word of the file-control-block buffer. Each file control block contains 94 bytes of information about an access path; Figure 28 shows its structure (using the assembly-language offsets). •••Refer to Figure 28:••• Figure 28–A File Control Block 64K ROM note: The structure of a file control block in the 64K ROM version of the File Manager is a subset of the above structure. The old file control block contained only the fields up to and including fcbFlPos. FCBMdRByt (which corresponds to ioFCBFlags in the parameter block for PBGetFCBInfo) contains flags that describe the status of the file, as follows: Bit Meaning 0 Set if data can be written to the file 1 Set if the entry describes a resource fork 7 Set if the file has been changed since it was last flushed Warning: The size and structure of a file control block may be different in future versions of Macintosh system software. æKY PBGetFCBInfoAsync æFp Files.p æT FUNCTION æTN 7008,A660 æD FUNCTION PBGetFCBInfoAsync(paramBlock: FCBPBPtr): OSErr; INLINE $205F,$7008,$A660,$3E80; æDT myVariable := PBGetFCBInfoAsync(paramBlock,A0); æRT 87 æRI IV-179, N87-1 æC Trap macro _GetFCBInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-- 18 ioNamePtr pointer <-> 22 ioVRefNum word <-> 24 ioRefNum word --> 28 ioFCBIndx long word <-- 32 ioFCBFlNm long word <-- 36 ioFCBFlags word <-- 38 ioFCBStBlk word <-- 40 ioFCBEOF long word <-- 44 ioFCBPLen long word <-- 48 ioFCBCrPs long word <-- 52 ioFCBVRefNum word <-- 54 ioFCBClpSiz long word <-- 58 ioFCBParID long word PBGetFCBInfo returns information about the specified open file. If ioFCBIndx is positive, the File Manager returns information about the file whose file number is ioFCBIndx on the volume specified by ioVRefNum (which may contain a drive number, volume reference number, or working directory reference number). If ioVRefNum is 0, all open files are indexed; otherwise, only open files on the specified volume are indexed. If ioFCBIndx is 0, the File Manager returns information about the file whose access path is specified by ioRefNum. Assembly-language note: The global variable FCBSPtr points to the length word of the file-control-block buffer. Each file control block contains 94 bytes of information about an access path; Figure 28 shows its structure (using the assembly-language offsets). •••Refer to Figure 28:••• Figure 28–A File Control Block 64K ROM note: The structure of a file control block in the 64K ROM version of the File Manager is a subset of the above structure. The old file control block contained only the fields up to and including fcbFlPos. FCBMdRByt (which corresponds to ioFCBFlags in the parameter block for PBGetFCBInfo) contains flags that describe the status of the file, as follows: Bit Meaning 0 Set if data can be written to the file 1 Set if the entry describes a resource fork 7 Set if the file has been changed since it was last flushed Warning: The size and structure of a file control block may be different in future versions of Macintosh system software. æKY PBGetCatInfo æFp Files.p æT FUNCTION æD FUNCTION PBGetCatInfo(paramBlock: CInfoPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBGetCatInfo(paramBlock,async); æRT 68,69 æRI IV-155, V-391, N68-1, N69 æC •••Rrefer to Technical Note #69:••• Trap macro _GetCatInfo Parameter block Files: Directories: --> 12 ioCompletion pointer --> 12 ioCompletion pointer <-- 16 ioResult word <-- 16 ioResult word <-> 18 ioNamePtr pointer <-> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 22 ioVRefNum word <-- 24 ioFRefNum word <-- 24 ioFRefNum word --> 28 ioFDirIndex word --> 28 ioFDirIndex word <-- 30 ioFlAttrib byte <-- 30 ioFlAttrib byte <-- 31 ioACUser byte access rights for directory only <-- 32 ioFlFndrInfo 16 bytes <-- 32 ioDrUsrWds 16 bytes <-> 48 ioDirID long word <-> 48 ioDrDirID long word <-- 52 ioFlStBlk word <-- 52 ioDrNmFls word <-- 54 ioFlLgLen long word <-- 58 ioFlPyLen long word <-- 62 ioFlRStBlk word <-- 64 ioFlRLgLen long word <-- 68 ioFlRPyLen long word <-- 72 ioFlCrDat long word <-- 72 ioDrCrDat long word <-- 76 ioFlMdDat long word <-- 76 ioDrMdDat long word <-- 80 ioFlBkDat long word <-- 80 ioDrBkDat long word <-- 84 ioFlXFndrInfo 16 bytes <-- 84 ioDrFndrInfo 16 bytes <-- 100 ioFlParID long word <-- 100 ioDrParID long word <-- 104 ioFlClpSiz long word PBGetCatInfo gets information about the files and directories in a file catalog. To determine whether the information is for a file or a directory, test bit 4 of ioFlAttrib, as described in the section “CInfoPBRec”. The information that’s returned for files is shown in the left column, and the corresponding information for directories is shown in the right column. If ioFDirIndex is positive, the File Manager returns information about the file or directory whose directory index is ioFDirIndex in the directory specified by ioVRefNum (this will be the root directory if a volume reference number is provided). If ioFDirIndex is 0, the File Manager returns information about the file or directory specified by ioNamePtr, in the directory specified by ioVRefNum (again, this will be the root directory if a volume reference number is provided). If ioFDirIndex is negative, the File Manager ignores ioNamePtr and returns information about the directory specified by ioDirID. With files, PBGetCatInfo is similar to PBHGetFileInfo but returns some additional information. If the file is open, the reference number of the first access path found is returned in ioFRefNum, and the name of the file is returned in ioNamePtr (unless ioNamePtr is NIL). For server volume directories, in addition to the normal return parameters the ioACUser field returns the user’s access rights in the following format: Bit 7 if set, user is not the owner of the directory. if clear, user is the owner of the directory. 6–3 Reserved; this is returned set to zero. 2 If set, user does not have Make Changes privileges to the directory. If clear, user has Make Changes privileges to the directory. 1 If set, user does not have See Files privileges to the directory. If clear, user has See Files privileges to the directory. 0 If set, user does not have See Folders privileges to the directory. If clear, user has See Folders privileges to the directory. For example, if ioACUser returns zero for a given server volume directory, you know that the user is the owner of the directory and has complete privileges to it. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume æKY PBGetCatInfoSync æFp Files.p æT FUNCTION æTN 7009,A260 æD FUNCTION PBGetCatInfoSync(paramBlock: CInfoPBPtr): OSErr; INLINE $205F,$7009,$A260,$3E80; æDT myVariable := PBGetCatInfoSync(paramBlock,A0); æRT 68,69 æRI IV-155, V-391, N68-1, N69 æC •••Rrefer to Technical Note #69:••• Trap macro _GetCatInfo Parameter block Files: Directories: --> 12 ioCompletion pointer --> 12 ioCompletion pointer <-- 16 ioResult word <-- 16 ioResult word <-> 18 ioNamePtr pointer <-> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 22 ioVRefNum word <-- 24 ioFRefNum word <-- 24 ioFRefNum word --> 28 ioFDirIndex word --> 28 ioFDirIndex word <-- 30 ioFlAttrib byte <-- 30 ioFlAttrib byte <-- 31 ioACUser byte access rights for directory only <-- 32 ioFlFndrInfo 16 bytes <-- 32 ioDrUsrWds 16 bytes <-> 48 ioDirID long word <-> 48 ioDrDirID long word <-- 52 ioFlStBlk word <-- 52 ioDrNmFls word <-- 54 ioFlLgLen long word <-- 58 ioFlPyLen long word <-- 62 ioFlRStBlk word <-- 64 ioFlRLgLen long word <-- 68 ioFlRPyLen long word <-- 72 ioFlCrDat long word <-- 72 ioDrCrDat long word <-- 76 ioFlMdDat long word <-- 76 ioDrMdDat long word <-- 80 ioFlBkDat long word <-- 80 ioDrBkDat long word <-- 84 ioFlXFndrInfo 16 bytes <-- 84 ioDrFndrInfo 16 bytes <-- 100 ioFlParID long word <-- 100 ioDrParID long word <-- 104 ioFlClpSiz long word PBGetCatInfo gets information about the files and directories in a file catalog. To determine whether the information is for a file or a directory, test bit 4 of ioFlAttrib, as described in the section “CInfoPBRec”. The information that’s returned for files is shown in the left column, and the corresponding information for directories is shown in the right column. If ioFDirIndex is positive, the File Manager returns information about the file or directory whose directory index is ioFDirIndex in the directory specified by ioVRefNum (this will be the root directory if a volume reference number is provided). If ioFDirIndex is 0, the File Manager returns information about the file or directory specified by ioNamePtr, in the directory specified by ioVRefNum (again, this will be the root directory if a volume reference number is provided). If ioFDirIndex is negative, the File Manager ignores ioNamePtr and returns information about the directory specified by ioDirID. With files, PBGetCatInfo is similar to PBHGetFileInfo but returns some additional information. If the file is open, the reference number of the first access path found is returned in ioFRefNum, and the name of the file is returned in ioNamePtr (unless ioNamePtr is NIL). For server volume directories, in addition to the normal return parameters the ioACUser field returns the user’s access rights in the following format: Bit 7 if set, user is not the owner of the directory. if clear, user is the owner of the directory. 6–3 Reserved; this is returned set to zero. 2 If set, user does not have Make Changes privileges to the directory. If clear, user has Make Changes privileges to the directory. 1 If set, user does not have See Files privileges to the directory. If clear, user has See Files privileges to the directory. 0 If set, user does not have See Folders privileges to the directory. If clear, user has See Folders privileges to the directory. For example, if ioACUser returns zero for a given server volume directory, you know that the user is the owner of the directory and has complete privileges to it. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume æKY PBGetCatInfoAsync æFp Files.p æT FUNCTION æTN 7009,A660 æD FUNCTION PBGetCatInfoAsync(paramBlock: CInfoPBPtr): OSErr; INLINE $205F,$7009,$A660,$3E80; æDT myVariable := PBGetCatInfoAsync(paramBlock,A0); æRT 68,69 æRI IV-155, V-391, N68-1, N69 æC •••Rrefer to Technical Note #69:••• Trap macro _GetCatInfo Parameter block Files: Directories: --> 12 ioCompletion pointer --> 12 ioCompletion pointer <-- 16 ioResult word <-- 16 ioResult word <-> 18 ioNamePtr pointer <-> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 22 ioVRefNum word <-- 24 ioFRefNum word <-- 24 ioFRefNum word --> 28 ioFDirIndex word --> 28 ioFDirIndex word <-- 30 ioFlAttrib byte <-- 30 ioFlAttrib byte <-- 31 ioACUser byte access rights for directory only <-- 32 ioFlFndrInfo 16 bytes <-- 32 ioDrUsrWds 16 bytes <-> 48 ioDirID long word <-> 48 ioDrDirID long word <-- 52 ioFlStBlk word <-- 52 ioDrNmFls word <-- 54 ioFlLgLen long word <-- 58 ioFlPyLen long word <-- 62 ioFlRStBlk word <-- 64 ioFlRLgLen long word <-- 68 ioFlRPyLen long word <-- 72 ioFlCrDat long word <-- 72 ioDrCrDat long word <-- 76 ioFlMdDat long word <-- 76 ioDrMdDat long word <-- 80 ioFlBkDat long word <-- 80 ioDrBkDat long word <-- 84 ioFlXFndrInfo 16 bytes <-- 84 ioDrFndrInfo 16 bytes <-- 100 ioFlParID long word <-- 100 ioDrParID long word <-- 104 ioFlClpSiz long word PBGetCatInfo gets information about the files and directories in a file catalog. To determine whether the information is for a file or a directory, test bit 4 of ioFlAttrib, as described in the section “CInfoPBRec”. The information that’s returned for files is shown in the left column, and the corresponding information for directories is shown in the right column. If ioFDirIndex is positive, the File Manager returns information about the file or directory whose directory index is ioFDirIndex in the directory specified by ioVRefNum (this will be the root directory if a volume reference number is provided). If ioFDirIndex is 0, the File Manager returns information about the file or directory specified by ioNamePtr, in the directory specified by ioVRefNum (again, this will be the root directory if a volume reference number is provided). If ioFDirIndex is negative, the File Manager ignores ioNamePtr and returns information about the directory specified by ioDirID. With files, PBGetCatInfo is similar to PBHGetFileInfo but returns some additional information. If the file is open, the reference number of the first access path found is returned in ioFRefNum, and the name of the file is returned in ioNamePtr (unless ioNamePtr is NIL). For server volume directories, in addition to the normal return parameters the ioACUser field returns the user’s access rights in the following format: Bit 7 if set, user is not the owner of the directory. if clear, user is the owner of the directory. 6–3 Reserved; this is returned set to zero. 2 If set, user does not have Make Changes privileges to the directory. If clear, user has Make Changes privileges to the directory. 1 If set, user does not have See Files privileges to the directory. If clear, user has See Files privileges to the directory. 0 If set, user does not have See Folders privileges to the directory. If clear, user has See Folders privileges to the directory. For example, if ioACUser returns zero for a given server volume directory, you know that the user is the owner of the directory and has complete privileges to it. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume æKY PBSetCatInfo æFp Files.p æT FUNCTION æD FUNCTION PBSetCatInfo(paramBlock: CInfoPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBSetCatInfo(paramBlock,async); æRI IV-156 æC Trap macro _SetCatInfo Parameter block Files: Directories: --> 12 ioCompletion pointer --> 12 ioCompletion pointer <-- 16 ioResult word <-- 16 ioResult word <-> 18 ioNamePtr pointer <-> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 22 ioVRefNum word --> 30 ioFlAttrib byte --> 30 ioFlAttrib byte --> 32 ioFlFndrInfo 16 bytes --> 32 ioDrUsrWds 16 bytes --> 48 ioDirID long word --> 48 ioDrDirID long word --> 72 ioFlCrDat long word --> 72 ioDrCrDat long word --> 76 ioFlMdDat long word --> 76 ioDrMdDat long word --> 80 ioFlBkDat long word --> 80 ioDrBkDat long word --> 84 ioFlXFndrInfo 16 bytes --> 84 ioDrFndrInfo 16 bytes --> 104 ioFlClpSiz long word PBSetCatInfo sets information about the files and directories in a catalog. With files, it’s similar to PBHSetFileInfo but lets you set some additional information. The information that can be set for files is shown in the left column, and the corresponding information for directories is shown in the right column. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume æKY PBSetCatInfoSync æFp Files.p æT FUNCTION æTN 700A,A260 æD FUNCTION PBSetCatInfoSync(paramBlock: CInfoPBPtr): OSErr; INLINE $205F,$700A,$A260,$3E80; æDT myVariable := PBSetCatInfoSync(paramBlock,A0); æRI IV-156 æC Trap macro _SetCatInfo Parameter block Files: Directories: --> 12 ioCompletion pointer --> 12 ioCompletion pointer <-- 16 ioResult word <-- 16 ioResult word <-> 18 ioNamePtr pointer <-> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 22 ioVRefNum word --> 30 ioFlAttrib byte --> 30 ioFlAttrib byte --> 32 ioFlFndrInfo 16 bytes --> 32 ioDrUsrWds 16 bytes --> 48 ioDirID long word --> 48 ioDrDirID long word --> 72 ioFlCrDat long word --> 72 ioDrCrDat long word --> 76 ioFlMdDat long word --> 76 ioDrMdDat long word --> 80 ioFlBkDat long word --> 80 ioDrBkDat long word --> 84 ioFlXFndrInfo 16 bytes --> 84 ioDrFndrInfo 16 bytes --> 104 ioFlClpSiz long word PBSetCatInfo sets information about the files and directories in a catalog. With files, it’s similar to PBHSetFileInfo but lets you set some additional information. The information that can be set for files is shown in the left column, and the corresponding information for directories is shown in the right column. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume æKY PBSetCatInfoAsync æFp Files.p æT FUNCTION æTN 700A,A660 æD FUNCTION PBSetCatInfoAsync(paramBlock: CInfoPBPtr): OSErr; INLINE $205F,$700A,$A660,$3E80; æDT myVariable := PBSetCatInfoAsync(paramBlock,A0); æRI IV-156 æC Trap macro _SetCatInfo Parameter block Files: Directories: --> 12 ioCompletion pointer --> 12 ioCompletion pointer <-- 16 ioResult word <-- 16 ioResult word <-> 18 ioNamePtr pointer <-> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 22 ioVRefNum word --> 30 ioFlAttrib byte --> 30 ioFlAttrib byte --> 32 ioFlFndrInfo 16 bytes --> 32 ioDrUsrWds 16 bytes --> 48 ioDirID long word --> 48 ioDrDirID long word --> 72 ioFlCrDat long word --> 72 ioDrCrDat long word --> 76 ioFlMdDat long word --> 76 ioDrMdDat long word --> 80 ioFlBkDat long word --> 80 ioDrBkDat long word --> 84 ioFlXFndrInfo 16 bytes --> 84 ioDrFndrInfo 16 bytes --> 104 ioFlClpSiz long word PBSetCatInfo sets information about the files and directories in a catalog. With files, it’s similar to PBHSetFileInfo but lets you set some additional information. The information that can be set for files is shown in the left column, and the corresponding information for directories is shown in the right column. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume æKY PBAllocContig æFp Files.p æT FUNCTION æD FUNCTION PBAllocContig(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBAllocContig(paramBlock,async); æRI IV-143 æC Trap macro _AllocContig Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 36 ioReqCount long word <-- 40 ioActCount long word PBAllocContig is identical to PBAllocate except that if there isn’t enough contiguous empty space on the volume to satisfy the allocation request, PBAllocContig will do nothing and will return dskFulErr as its function result. If you want to allocate whatever space is available, even when the entire request cannot be filled as a contiguous piece, call PBAllocate instead. Result codes noErr No error dskFulErr Disk full fLckdErr File locked fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY PBAllocContigSync æFp Files.p æT FUNCTION æTN A210 æD FUNCTION PBAllocContigSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A210,$3E80; æDT myVariable := PBAllocContigSync(paramBlock,A0); æRI IV-143 æC Trap macro _AllocContig Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 36 ioReqCount long word <-- 40 ioActCount long word PBAllocContig is identical to PBAllocate except that if there isn’t enough contiguous empty space on the volume to satisfy the allocation request, PBAllocContig will do nothing and will return dskFulErr as its function result. If you want to allocate whatever space is available, even when the entire request cannot be filled as a contiguous piece, call PBAllocate instead. Result codes noErr No error dskFulErr Disk full fLckdErr File locked fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY PBAllocContigAsync æFp Files.p æT FUNCTION æTN A610 æD FUNCTION PBAllocContigAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$A610,$3E80; æDT myVariable := PBAllocContigAsync(paramBlock,A0); æRI IV-143 æC Trap macro _AllocContig Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 36 ioReqCount long word <-- 40 ioActCount long word PBAllocContig is identical to PBAllocate except that if there isn’t enough contiguous empty space on the volume to satisfy the allocation request, PBAllocContig will do nothing and will return dskFulErr as its function result. If you want to allocate whatever space is available, even when the entire request cannot be filled as a contiguous piece, call PBAllocate instead. Result codes noErr No error dskFulErr Disk full fLckdErr File locked fnOpnErr File not open ioErr I/O error rfNumErr Bad reference number vLckdErr Software volume lock wPrErr Hardware volume lock wrPermErr Read/write permission doesn’t allow writing æKY PBLockRange æFp Files.p æT FUNCTION æD FUNCTION PBLockRange(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBLockRange(paramBlock,async); æRT 186 æRI IV-138 æC •••Refer to Technical Note #186:••• Trap macro _LockRng Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 36 ioReqCount long word --> 44 ioPosMode word --> 46 ioPosOffset long word On a file opened with a shared read/write permission, PBLockRange is used in conjunction with PBRead and PBWrite to lock a certain portion of the file. PBLockRange uses the same parameters as both PBRead and PBWrite; by calling it immediately before PBRead, you can use the information present in the parameter block for the PBRead call. When you’re finished with the data (typically after a call to PBWrite), be sure to call PBUnlockRange to free up that portion of the file for subsequent PBRead calls. Warning: PBLockRange operates only with the hierarchical version of the File Manager; if used on a Macintosh equipped only with the 64K ROM version of the File Manager, it will generate a system error. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error paramErr Negative ioReqCount rfNumErr Bad reference number æKY PBLockRangeSync æFp Files.p æT FUNCTION æTN 7010,A260 æD FUNCTION PBLockRangeSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$7010,$A260,$3E80; æDT myVariable := PBLockRangeSync(paramBlock,A0); æRT 186 æRI IV-138 æC •••Refer to Technical Note #186:••• Trap macro _LockRng Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 36 ioReqCount long word --> 44 ioPosMode word --> 46 ioPosOffset long word On a file opened with a shared read/write permission, PBLockRange is used in conjunction with PBRead and PBWrite to lock a certain portion of the file. PBLockRange uses the same parameters as both PBRead and PBWrite; by calling it immediately before PBRead, you can use the information present in the parameter block for the PBRead call. When you’re finished with the data (typically after a call to PBWrite), be sure to call PBUnlockRange to free up that portion of the file for subsequent PBRead calls. Warning: PBLockRange operates only with the hierarchical version of the File Manager; if used on a Macintosh equipped only with the 64K ROM version of the File Manager, it will generate a system error. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error paramErr Negative ioReqCount rfNumErr Bad reference number æKY PBLockRangeAsync æFp Files.p æT FUNCTION æTN 7010,A660 æD FUNCTION PBLockRangeAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$7010,$A660,$3E80; æDT myVariable := PBLockRangeAsync(paramBlock,A0); æRT 186 æRI IV-138 æC •••Refer to Technical Note #186:••• Trap macro _LockRng Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 36 ioReqCount long word --> 44 ioPosMode word --> 46 ioPosOffset long word On a file opened with a shared read/write permission, PBLockRange is used in conjunction with PBRead and PBWrite to lock a certain portion of the file. PBLockRange uses the same parameters as both PBRead and PBWrite; by calling it immediately before PBRead, you can use the information present in the parameter block for the PBRead call. When you’re finished with the data (typically after a call to PBWrite), be sure to call PBUnlockRange to free up that portion of the file for subsequent PBRead calls. Warning: PBLockRange operates only with the hierarchical version of the File Manager; if used on a Macintosh equipped only with the 64K ROM version of the File Manager, it will generate a system error. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error paramErr Negative ioReqCount rfNumErr Bad reference number æKY PBUnlockRange æFp Files.p æT FUNCTION æD FUNCTION PBUnlockRange(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBUnlockRange(paramBlock,async); æRT 186 æRI IV-139 æC Trap macro _UnlockRng Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 36 ioReqCount long word --> 44 ioPosMode word --> 46 ioPosOffset long word PBUnlockRange is used in conjunction with PBRead and PBWrite to unlock a certain portion of a file that you locked with PBLockRange. Warning: PBUnlockRange operates only with the hierarchical version of the File Manager; if used on a Macintosh equipped only with the 64K ROM version of the File Manager, it will generate a system error. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error paramErr Negative ioReqCount rfNumErr Bad reference number æKY PBUnlockRangeSync æFp Files.p æT FUNCTION æTN 7011,A260 æD FUNCTION PBUnlockRangeSync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$7011,$A260,$3E80; æDT myVariable := PBUnlockRangeSync(paramBlock,A0); æRT 186 æRI IV-139 æC Trap macro _UnlockRng Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 36 ioReqCount long word --> 44 ioPosMode word --> 46 ioPosOffset long word PBUnlockRange is used in conjunction with PBRead and PBWrite to unlock a certain portion of a file that you locked with PBLockRange. Warning: PBUnlockRange operates only with the hierarchical version of the File Manager; if used on a Macintosh equipped only with the 64K ROM version of the File Manager, it will generate a system error. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error paramErr Negative ioReqCount rfNumErr Bad reference number æKY PBUnlockRangeAsync æFp Files.p æT FUNCTION æTN 7011,A660 æD FUNCTION PBUnlockRangeAsync(paramBlock: ParmBlkPtr): OSErr; INLINE $205F,$7011,$A660,$3E80; æDT myVariable := PBUnlockRangeAsync(paramBlock,A0); æRT 186 æRI IV-139 æC Trap macro _UnlockRng Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 24 ioRefNum word --> 36 ioReqCount long word --> 44 ioPosMode word --> 46 ioPosOffset long word PBUnlockRange is used in conjunction with PBRead and PBWrite to unlock a certain portion of a file that you locked with PBLockRange. Warning: PBUnlockRange operates only with the hierarchical version of the File Manager; if used on a Macintosh equipped only with the 64K ROM version of the File Manager, it will generate a system error. Result codes noErr No error eofErr End-of-file extFSErr External file system fnOpnErr File not open ioErr I/O error paramErr Negative ioReqCount rfNumErr Bad reference number æKY PBSetVInfo æFp Files.p æT FUNCTION æD FUNCTION PBSetVInfo(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBSetVInfo(paramBlock,async); æRT 204 æRI IV-131 æC •••Refer to Technical Note #204:••• Trap macro _SetVolInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 30 ioVCrDate long word --> 34 ioVLsMod long word --> 38 ioVAtrb word --> 52 ioVClpSiz long word --> 72 ioVBkUp long word --> 76 ioVSeqNum word --> 90 ioVFndrInfo 32 bytes PBSetVInfo lets you modify information about volumes. A pointer to a new name for the volume can be specified in ioNamePtr. The date and time of the volume’s creation and modification can be set with ioVCrDate and ioVLsMod respectively. Only bit 15 of ioVAtrb can be changed; setting it locks the volume. Note: The volume cannot be specified by name; you must use either the volume reference number or the drive number. Warning: PBSetVInfo operates only with the hierarchical version of the File Manager; if used on a Macintosh equipped only with the 64K ROM version of the File Manager, it will generate a system error. Result codes noErr No error nsvErr No such volume paramErr No default volume æKY PBSetVInfoSync æFp Files.p æT FUNCTION æTN 700B,A260 æD FUNCTION PBSetVInfoSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$700B,$A260,$3E80; æDT myVariable := PBSetVInfoSync(paramBlock,A0); æRT 204 æRI IV-131 æC •••Refer to Technical Note #204:••• Trap macro _SetVolInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 30 ioVCrDate long word --> 34 ioVLsMod long word --> 38 ioVAtrb word --> 52 ioVClpSiz long word --> 72 ioVBkUp long word --> 76 ioVSeqNum word --> 90 ioVFndrInfo 32 bytes PBSetVInfo lets you modify information about volumes. A pointer to a new name for the volume can be specified in ioNamePtr. The date and time of the volume’s creation and modification can be set with ioVCrDate and ioVLsMod respectively. Only bit 15 of ioVAtrb can be changed; setting it locks the volume. Note: The volume cannot be specified by name; you must use either the volume reference number or the drive number. Warning: PBSetVInfo operates only with the hierarchical version of the File Manager; if used on a Macintosh equipped only with the 64K ROM version of the File Manager, it will generate a system error. Result codes noErr No error nsvErr No such volume paramErr No default volume æKY PBSetVInfoAsync æFp Files.p æT FUNCTION æTN 700B,A660 æD FUNCTION PBSetVInfoAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$700B,$A660,$3E80; æDT myVariable := PBSetVInfoAsync(paramBlock,A0); æRT 204 æRI IV-131 æC •••Refer to Technical Note #204:••• Trap macro _SetVolInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 30 ioVCrDate long word --> 34 ioVLsMod long word --> 38 ioVAtrb word --> 52 ioVClpSiz long word --> 72 ioVBkUp long word --> 76 ioVSeqNum word --> 90 ioVFndrInfo 32 bytes PBSetVInfo lets you modify information about volumes. A pointer to a new name for the volume can be specified in ioNamePtr. The date and time of the volume’s creation and modification can be set with ioVCrDate and ioVLsMod respectively. Only bit 15 of ioVAtrb can be changed; setting it locks the volume. Note: The volume cannot be specified by name; you must use either the volume reference number or the drive number. Warning: PBSetVInfo operates only with the hierarchical version of the File Manager; if used on a Macintosh equipped only with the 64K ROM version of the File Manager, it will generate a system error. Result codes noErr No error nsvErr No such volume paramErr No default volume æKY PBHGetVInfo æFp Files.p æT FUNCTION æD FUNCTION PBHGetVInfo(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHGetVInfo(paramBlock,async); æRT 24, 66, 67, 77, 106, 157 æRI IV-130, N66-1, N67-1, N77-5 æC Trap macro _HGetVInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer <-> 22 ioVRefNum word --> 28 ioVolIndex word <-- 30 ioVCrDate long word <-- 34 ioVLsMod long word <-- 38 ioVAtrb word <-- 40 ioVNmFls word <-- 42 ioVBitMap word <-- 44 ioVAllocPtr word <-- 46 ioVNmAlBlks word <-- 48 ioVAlBlkSiz long word <-- 52 ioVClpSiz long word <-- 56 ioAlBlSt word <-- 58 ioVNxtFNum long word <-- 62 ioVFrBlk word <-- 64 ioVSigWord word <-- 66 ioVDrvInfo word <-- 68 ioVDRefNum word <-- 70 ioVFSID word <-- 72 ioVBkUp long word <-- 76 ioVSeqNum word <-- 78 ioVWrCnt long word <-- 82 ioVFilCnt long word <-- 86 ioVDirCnt long word <-- 90 ioVFndrInfo 32 bytes PBHGetVInfo is similar in function to PBGetVInfo but returns a larger parameter block. In addition, PBHGetVInfo always returns the volume reference number in ioVRefNum (regardless of what was passed in). Also, ioVNmAlBlks and ioVFrBlks are not clipped as they are by PBGetVInfo. Result codes noErr No error nsvErr No such volume paramErr No default volume æKY PBHGetVInfoSync æFp Files.p æT FUNCTION æTN A207 æD FUNCTION PBHGetVInfoSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A207,$3E80; æDT myVariable := PBHGetVInfoSync(paramBlock,A0); æRT 24, 66, 67, 77, 106, 157 æRI IV-130, N66-1, N67-1, N77-5 æC Trap macro _HGetVInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer <-> 22 ioVRefNum word --> 28 ioVolIndex word <-- 30 ioVCrDate long word <-- 34 ioVLsMod long word <-- 38 ioVAtrb word <-- 40 ioVNmFls word <-- 42 ioVBitMap word <-- 44 ioVAllocPtr word <-- 46 ioVNmAlBlks word <-- 48 ioVAlBlkSiz long word <-- 52 ioVClpSiz long word <-- 56 ioAlBlSt word <-- 58 ioVNxtFNum long word <-- 62 ioVFrBlk word <-- 64 ioVSigWord word <-- 66 ioVDrvInfo word <-- 68 ioVDRefNum word <-- 70 ioVFSID word <-- 72 ioVBkUp long word <-- 76 ioVSeqNum word <-- 78 ioVWrCnt long word <-- 82 ioVFilCnt long word <-- 86 ioVDirCnt long word <-- 90 ioVFndrInfo 32 bytes PBHGetVInfo is similar in function to PBGetVInfo but returns a larger parameter block. In addition, PBHGetVInfo always returns the volume reference number in ioVRefNum (regardless of what was passed in). Also, ioVNmAlBlks and ioVFrBlks are not clipped as they are by PBGetVInfo. Result codes noErr No error nsvErr No such volume paramErr No default volume æKY PBHGetVInfoAsync æFp Files.p æT FUNCTION æTN A607 æD FUNCTION PBHGetVInfoAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A607,$3E80; æDT myVariable := PBHGetVInfoAsync(paramBlock,A0); æRT 24, 66, 67, 77, 106, 157 æRI IV-130, N66-1, N67-1, N77-5 æC Trap macro _HGetVInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer <-> 22 ioVRefNum word --> 28 ioVolIndex word <-- 30 ioVCrDate long word <-- 34 ioVLsMod long word <-- 38 ioVAtrb word <-- 40 ioVNmFls word <-- 42 ioVBitMap word <-- 44 ioVAllocPtr word <-- 46 ioVNmAlBlks word <-- 48 ioVAlBlkSiz long word <-- 52 ioVClpSiz long word <-- 56 ioAlBlSt word <-- 58 ioVNxtFNum long word <-- 62 ioVFrBlk word <-- 64 ioVSigWord word <-- 66 ioVDrvInfo word <-- 68 ioVDRefNum word <-- 70 ioVFSID word <-- 72 ioVBkUp long word <-- 76 ioVSeqNum word <-- 78 ioVWrCnt long word <-- 82 ioVFilCnt long word <-- 86 ioVDirCnt long word <-- 90 ioVFndrInfo 32 bytes PBHGetVInfo is similar in function to PBGetVInfo but returns a larger parameter block. In addition, PBHGetVInfo always returns the volume reference number in ioVRefNum (regardless of what was passed in). Also, ioVNmAlBlks and ioVFrBlks are not clipped as they are by PBGetVInfo. Result codes noErr No error nsvErr No such volume paramErr No default volume æKY PBHOpen æFp Files.p æT FUNCTION æD FUNCTION PBHOpen(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHOpen(paramBlock,async); æRT 204 æRI IV-136 æC Trap macro _HOpen Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioRefNum word --> 27 ioPermssn byte --> 28 ioMisc pointer --> 48 ioDirID long word PBHOpen is identical to PBOpen except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBHOpenSync æFp Files.p æT FUNCTION æTN A200 æD FUNCTION PBHOpenSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A200,$3E80; æDT myVariable := PBHOpenSync(paramBlock,A0); æRT 204 æRI IV-136 æC Trap macro _HOpen Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioRefNum word --> 27 ioPermssn byte --> 28 ioMisc pointer --> 48 ioDirID long word PBHOpen is identical to PBOpen except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBHOpenAsync æFp Files.p æT FUNCTION æTN A600 æD FUNCTION PBHOpenAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A600,$3E80; æDT myVariable := PBHOpenAsync(paramBlock,A0); æRT 204 æRI IV-136 æC Trap macro _HOpen Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioRefNum word --> 27 ioPermssn byte --> 28 ioMisc pointer --> 48 ioDirID long word PBHOpen is identical to PBOpen except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBHOpenRF æFp Files.p æT FUNCTION æD FUNCTION PBHOpenRF(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHOpenRF(paramBlock,async); æRI IV-137 æC Trap macro _HOpenRF Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioRefNum word --> 27 ioPermssn byte --> 28 ioMisc pointer --> 48 ioDirID long word PBHOpenRF is identical to PBOpenRF except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBHOpenRFSync æFp Files.p æT FUNCTION æTN A20A æD FUNCTION PBHOpenRFSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A20A,$3E80; æDT myVariable := PBHOpenRFSync(paramBlock,A0); æRI IV-137 æC Trap macro _HOpenRF Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioRefNum word --> 27 ioPermssn byte --> 28 ioMisc pointer --> 48 ioDirID long word PBHOpenRF is identical to PBOpenRF except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBHOpenRFAsync æFp Files.p æT FUNCTION æTN A60A æD FUNCTION PBHOpenRFAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A60A,$3E80; æDT myVariable := PBHOpenRFAsync(paramBlock,A0); æRI IV-137 æC Trap macro _HOpenRF Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioRefNum word --> 27 ioPermssn byte --> 28 ioMisc pointer --> 48 ioDirID long word PBHOpenRF is identical to PBOpenRF except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBHOpenDF æFp Files.p æT FUNCTION æD FUNCTION PBHOpenDF(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHOpenDF(paramBlock,async); æRI PBHOpenRF function IV-137 æC FUNCTION PBHOpenRF (paramBlock: HParmBlkPtr; async: BOOLEAN) : OSErr; Trap macro _HOpenRF Parameter block —> 12 ioCompletion pointer <— 16 ioResult word —> 18 ioNamePtr pointer —> 22 ioVRefNum word <— 24 ioRefNum word —> 27 ioPermssn byte —> 28 ioMisc pointer —> 48 ioDirID long word PBHOpenRF is identical to PBOpenRF except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBHOpenDFSync æFp Files.p æT FUNCTION æTN 701A,A260 æD FUNCTION PBHOpenDFSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$701A,$A260,$3E80; æDT myVariable := PBHOpenDFSync(paramBlock,A0); æRI PBHOpenRF function IV-137 æC FUNCTION PBHOpenRF (paramBlock: HParmBlkPtr; async: BOOLEAN) : OSErr; Trap macro _HOpenRF Parameter block —> 12 ioCompletion pointer <— 16 ioResult word —> 18 ioNamePtr pointer —> 22 ioVRefNum word <— 24 ioRefNum word —> 27 ioPermssn byte —> 28 ioMisc pointer —> 48 ioDirID long word PBHOpenRF is identical to PBOpenRF except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBHOpenDFAsync æFp Files.p æT FUNCTION æTN 701A,A660 æD FUNCTION PBHOpenDFAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$701A,$A660,$3E80; æDT myVariable := PBHOpenDFAsync(paramBlock,A0); æRI PBHOpenRF function IV-137 æC FUNCTION PBHOpenRF (paramBlock: HParmBlkPtr; async: BOOLEAN) : OSErr; Trap macro _HOpenRF Parameter block —> 12 ioCompletion pointer <— 16 ioResult word —> 18 ioNamePtr pointer —> 22 ioVRefNum word <— 24 ioRefNum word —> 27 ioPermssn byte —> 28 ioMisc pointer —> 48 ioDirID long word PBHOpenRF is identical to PBOpenRF except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume opWrErr File already open for writing permErr Attempt to open locked file for writing tmfoErr Too many files open æKY PBHCreate æFp Files.p æT FUNCTION æD FUNCTION PBHCreate(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHCreate(paramBlock,async); æRI IV-146 æC Trap macro _HCreate Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioDirID long word PBHCreate is identical to PBCreate except that it accepts a directory ID in ioDirID. Note: To create a directory instead of a file, call PBDirCreate. Result codes noErr No error bdNamErr Bad file name dupFNErr Duplicate file name and version dirFulErr File directory full dirNFErr Directory not found or incomplete pathname extFSErr External file system ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHCreateSync æFp Files.p æT FUNCTION æTN A208 æD FUNCTION PBHCreateSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A208,$3E80; æDT myVariable := PBHCreateSync(paramBlock,A0); æRI IV-146 æC Trap macro _HCreate Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioDirID long word PBHCreate is identical to PBCreate except that it accepts a directory ID in ioDirID. Note: To create a directory instead of a file, call PBDirCreate. Result codes noErr No error bdNamErr Bad file name dupFNErr Duplicate file name and version dirFulErr File directory full dirNFErr Directory not found or incomplete pathname extFSErr External file system ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHCreateAsync æFp Files.p æT FUNCTION æTN A608 æD FUNCTION PBHCreateAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A608,$3E80; æDT myVariable := PBHCreateAsync(paramBlock,A0); æRI IV-146 æC Trap macro _HCreate Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioDirID long word PBHCreate is identical to PBCreate except that it accepts a directory ID in ioDirID. Note: To create a directory instead of a file, call PBDirCreate. Result codes noErr No error bdNamErr Bad file name dupFNErr Duplicate file name and version dirFulErr File directory full dirNFErr Directory not found or incomplete pathname extFSErr External file system ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHDelete æFp Files.p æT FUNCTION æD FUNCTION PBHDelete(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHDelete(paramBlock,async); æRI IV-147 æC Trap macro _HDelete Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioDirID long word PBHDelete is identical to PBDelete except that it accepts a directory ID in ioDirID. PBHDelete can be used to delete an empty directory as well. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fBsyErr File busy, directory not empty, or working directory control block open fLckdErr File locked fnfErr File not found nsvErr No such volume ioErr I/O error vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHDeleteSync æFp Files.p æT FUNCTION æTN A209 æD FUNCTION PBHDeleteSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A209,$3E80; æDT myVariable := PBHDeleteSync(paramBlock,A0); æRI IV-147 æC Trap macro _HDelete Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioDirID long word PBHDelete is identical to PBDelete except that it accepts a directory ID in ioDirID. PBHDelete can be used to delete an empty directory as well. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fBsyErr File busy, directory not empty, or working directory control block open fLckdErr File locked fnfErr File not found nsvErr No such volume ioErr I/O error vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHDeleteAsync æFp Files.p æT FUNCTION æTN A609 æD FUNCTION PBHDeleteAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A609,$3E80; æDT myVariable := PBHDeleteAsync(paramBlock,A0); æRI IV-147 æC Trap macro _HDelete Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioDirID long word PBHDelete is identical to PBDelete except that it accepts a directory ID in ioDirID. PBHDelete can be used to delete an empty directory as well. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fBsyErr File busy, directory not empty, or working directory control block open fLckdErr File locked fnfErr File not found nsvErr No such volume ioErr I/O error vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHRename æFp Files.p æT FUNCTION æD FUNCTION PBHRename(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHRename(paramBlock,async); æRI IV-154 æC Trap macro _HRename Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 28 ioMisc pointer --> 48 ioDirID long word PBHRename is identical to PBRename except that it accepts a directory ID in ioDirID and can be used to rename directories as well as files and volumes. Given a pointer to the name of a file or directory in ioNamePtr, PBHRename changes it to the name pointed to by ioMisc. Given a pointer to a volume name in ioNamePtr or a volume reference number in ioVRefNum, it changes the name of the volume to the name pointed to by ioMisc. Warning: PBHRename cannot be used to change the directory a file is in. Result codes noErr No error bdNamErr Bad file name dirFulErr File directory full dirNFErr Directory not found or incomplete pathname dupFNErr Duplicate file name and version extFSErr External file system fLckdErr File locked fnfErr File not found fsRnErr Problem during rename ioErr I/O error nsvErr No such volume paramErr No default volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHRenameSync æFp Files.p æT FUNCTION æTN A20B æD FUNCTION PBHRenameSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A20B,$3E80; æDT myVariable := PBHRenameSync(paramBlock,A0); æRI IV-154 æC Trap macro _HRename Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 28 ioMisc pointer --> 48 ioDirID long word PBHRename is identical to PBRename except that it accepts a directory ID in ioDirID and can be used to rename directories as well as files and volumes. Given a pointer to the name of a file or directory in ioNamePtr, PBHRename changes it to the name pointed to by ioMisc. Given a pointer to a volume name in ioNamePtr or a volume reference number in ioVRefNum, it changes the name of the volume to the name pointed to by ioMisc. Warning: PBHRename cannot be used to change the directory a file is in. Result codes noErr No error bdNamErr Bad file name dirFulErr File directory full dirNFErr Directory not found or incomplete pathname dupFNErr Duplicate file name and version extFSErr External file system fLckdErr File locked fnfErr File not found fsRnErr Problem during rename ioErr I/O error nsvErr No such volume paramErr No default volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHRenameAsync æFp Files.p æT FUNCTION æTN A60B æD FUNCTION PBHRenameAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A60B,$3E80; æDT myVariable := PBHRenameAsync(paramBlock,A0); æRI IV-154 æC Trap macro _HRename Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 28 ioMisc pointer --> 48 ioDirID long word PBHRename is identical to PBRename except that it accepts a directory ID in ioDirID and can be used to rename directories as well as files and volumes. Given a pointer to the name of a file or directory in ioNamePtr, PBHRename changes it to the name pointed to by ioMisc. Given a pointer to a volume name in ioNamePtr or a volume reference number in ioVRefNum, it changes the name of the volume to the name pointed to by ioMisc. Warning: PBHRename cannot be used to change the directory a file is in. Result codes noErr No error bdNamErr Bad file name dirFulErr File directory full dirNFErr Directory not found or incomplete pathname dupFNErr Duplicate file name and version extFSErr External file system fLckdErr File locked fnfErr File not found fsRnErr Problem during rename ioErr I/O error nsvErr No such volume paramErr No default volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHRstFLock æFp Files.p æT FUNCTION æD FUNCTION PBHRstFLock(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHRstFLock(paramBlock,async); æRI IV-152 æC Trap macro _HRstFLock Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioDirID long word PBHRstFLock is identical to PBRstFLock except that it accepts a directory ID in ioDirID. Result codes noErr No error dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHRstFLockSync æFp Files.p æT FUNCTION æTN A242 æD FUNCTION PBHRstFLockSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A242,$3E80; æDT myVariable := PBHRstFLockSync(paramBlock,A0); æRI IV-152 æC Trap macro _HRstFLock Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioDirID long word PBHRstFLock is identical to PBRstFLock except that it accepts a directory ID in ioDirID. Result codes noErr No error dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHRstFLockAsync æFp Files.p æT FUNCTION æTN A642 æD FUNCTION PBHRstFLockAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A642,$3E80; æDT myVariable := PBHRstFLockAsync(paramBlock,A0); æRI IV-152 æC Trap macro _HRstFLock Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioDirID long word PBHRstFLock is identical to PBRstFLock except that it accepts a directory ID in ioDirID. Result codes noErr No error dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHSetFLock æFp Files.p æT FUNCTION æD FUNCTION PBHSetFLock(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHSetFLock(paramBlock,async); æRI IV-151 æC Trap macro _HSetFLock Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioDirID long word PBHSetFLock is identical to PBSetFLock except that it accepts a directory ID in ioDirID. Result codes noErr No error dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHSetFLockSync æFp Files.p æT FUNCTION æTN A241 æD FUNCTION PBHSetFLockSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A241,$3E80; æDT myVariable := PBHSetFLockSync(paramBlock,A0); æRI IV-151 æC Trap macro _HSetFLock Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioDirID long word PBHSetFLock is identical to PBSetFLock except that it accepts a directory ID in ioDirID. Result codes noErr No error dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHSetFLockAsync æFp Files.p æT FUNCTION æTN A641 æD FUNCTION PBHSetFLockAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A641,$3E80; æDT myVariable := PBHSetFLockAsync(paramBlock,A0); æRI IV-151 æC Trap macro _HSetFLock Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 48 ioDirID long word PBHSetFLock is identical to PBSetFLock except that it accepts a directory ID in ioDirID. Result codes noErr No error dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHGetFInfo æFp Files.p æT FUNCTION æD FUNCTION PBHGetFInfo(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHGetFInfo(paramBlock,async); æRI IV-149 æC Trap macro _HGetFileInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioFRefNum word --> 28 ioFDirIndex word <-- 30 ioFlAttrib byte <-- 32 ioFlFndrInfo 16 bytes <-> 48 ioDirID long word <-- 52 ioFlStBlk word <-- 54 ioFlLgLen long word <-- 58 ioFlPyLen long word <-- 62 ioFlRStBlk word <-- 64 ioFlRLgLen long word <-- 68 ioFlRPyLen long word <-- 72 ioFlCrDat long word <-- 76 ioFlMdDat long word PBHGetFInfo is identical to PBGetFInfo except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume æKY PBHGetFInfoSync æFp Files.p æT FUNCTION æTN A20C æD FUNCTION PBHGetFInfoSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A20C,$3E80; æDT myVariable := PBHGetFInfoSync(paramBlock,A0); æRI IV-149 æC Trap macro _HGetFileInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioFRefNum word --> 28 ioFDirIndex word <-- 30 ioFlAttrib byte <-- 32 ioFlFndrInfo 16 bytes <-> 48 ioDirID long word <-- 52 ioFlStBlk word <-- 54 ioFlLgLen long word <-- 58 ioFlPyLen long word <-- 62 ioFlRStBlk word <-- 64 ioFlRLgLen long word <-- 68 ioFlRPyLen long word <-- 72 ioFlCrDat long word <-- 76 ioFlMdDat long word PBHGetFInfo is identical to PBGetFInfo except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume æKY PBHGetFInfoAsync æFp Files.p æT FUNCTION æTN A60C æD FUNCTION PBHGetFInfoAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A60C,$3E80; æDT myVariable := PBHGetFInfoAsync(paramBlock,A0); æRI IV-149 æC Trap macro _HGetFileInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word <-> 18 ioNamePtr pointer --> 22 ioVRefNum word <-- 24 ioFRefNum word --> 28 ioFDirIndex word <-- 30 ioFlAttrib byte <-- 32 ioFlFndrInfo 16 bytes <-> 48 ioDirID long word <-- 52 ioFlStBlk word <-- 54 ioFlLgLen long word <-- 58 ioFlPyLen long word <-- 62 ioFlRStBlk word <-- 64 ioFlRLgLen long word <-- 68 ioFlRPyLen long word <-- 72 ioFlCrDat long word <-- 76 ioFlMdDat long word PBHGetFInfo is identical to PBGetFInfo except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fnfErr File not found ioErr I/O error nsvErr No such volume paramErr No default volume æKY PBHSetFInfo æFp Files.p æT FUNCTION æD FUNCTION PBHSetFInfo(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHSetFInfo(paramBlock,async); æRI IV-150 æC Trap macro _HSetFileInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 32 ioFlFndrInfo 16 bytes --> 48 ioDirID long word --> 72 ioFlCrDat long word --> 76 ioFlMdDat long word PBHSetFInfo is identical to PBSetFInfo except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fLckdErr File locked fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHSetFInfoSync æFp Files.p æT FUNCTION æTN A20D æD FUNCTION PBHSetFInfoSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A20D,$3E80; æDT myVariable := PBHSetFInfoSync(paramBlock,A0); æRI IV-150 æC Trap macro _HSetFileInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 32 ioFlFndrInfo 16 bytes --> 48 ioDirID long word --> 72 ioFlCrDat long word --> 76 ioFlMdDat long word PBHSetFInfo is identical to PBSetFInfo except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fLckdErr File locked fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBHSetFInfoAsync æFp Files.p æT FUNCTION æTN A60D æD FUNCTION PBHSetFInfoAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$A60D,$3E80; æDT myVariable := PBHSetFInfoAsync(paramBlock,A0); æRI IV-150 æC Trap macro _HSetFileInfo Parameter block --> 12 ioCompletion pointer <-- 16 ioResult word --> 18 ioNamePtr pointer --> 22 ioVRefNum word --> 32 ioFlFndrInfo 16 bytes --> 48 ioDirID long word --> 72 ioFlCrDat long word --> 76 ioFlMdDat long word PBHSetFInfo is identical to PBSetFInfo except that it accepts a directory ID in ioDirID. Result codes noErr No error bdNamErr Bad file name dirNFErr Directory not found or incomplete pathname extFSErr External file system fLckdErr File locked fnfErr File not found ioErr I/O error nsvErr No such volume vLckdErr Software volume lock wPrErr Hardware volume lock æKY PBMakeFSSpec æFp Files.p æT FUNCTION æD FUNCTION PBMakeFSSpec(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBMakeFSSpec(paramBlock,async); æC æKY PBMakeFSSpecSync æFp Files.p æT FUNCTION æTN 701B,A260 æD FUNCTION PBMakeFSSpecSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$701B,$A260,$3E80; æDT myVariable := PBMakeFSSpecSync(paramBlock,A0); æC æKY PBMakeFSSpecAsync æFp Files.p æT FUNCTION æTN 701B,A660 æD FUNCTION PBMakeFSSpecAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$701B,$A660,$3E80; æDT myVariable := PBMakeFSSpecAsync(paramBlock,A0); æC æKY FInitQueue æFp Files.p æT PROCEDURE æTN A016 æD PROCEDURE FInitQueue; INLINE $A016; æDT FInitQueue; æRI II-103, IV-128 æC Trap macro _InitQueue FInitQueue clears all queued File Manager calls except the current one. æKY GetFSQHdr æFp Files.p æT FUNCTION æD FUNCTION GetFSQHdr: QHdrPtr; INLINE $2EBC,$0000,$0360; æDT myVariable := GetFSQHdr; æRI II-125, IV-175 æC You can get a pointer to the header of the file I/O queue by calling the File Manager function GetFSQHdr. FUNCTION GetFSQHdr : QHdrPtr; [Not in ROM] GetFSQHdr returns a pointer to the header of the file I/O queue. Assembly-language note: The global variable FSQHdr contains the header of the file I/O queue. æKY GetDrvQHdr æFp Files.p æT FUNCTION æD FUNCTION GetDrvQHdr: QHdrPtr; INLINE $2EBC,$0000,$0308; æDT myVariable := GetDrvQHdr; æRI II-128, IV-181 æC You can get a pointer to the header of the drive queue by calling the File Manager function GetDrvQHdr. FUNCTION GetDrvQHdr : QHdrPtr; [Not in ROM] GetDrvQHdr returns a pointer to the header of the drive queue. Assembly-language note: The global variable DrvQHdr contains the header of the drive queue. The drive queue can support any number of drives, limited only by memory space. æKY GetVCBQHdr æFp Files.p æT FUNCTION æD FUNCTION GetVCBQHdr: QHdrPtr; INLINE $2EBC,$0000,$0356; æDT myVariable := GetVCBQHdr; æRI II-126, IV-178 æC You can get a pointer to the header of the volume-control-block queue by calling the File Manager function GetVCBQHdr. FUNCTION GetVCBQHdr : QHdrPtr; [Not in ROM] GetVCBQHdr returns a pointer to the header of the volume-control-block queue. Assembly-language note: The global variable VCBQHdr contains the header of the volume-control-block-queue. The default volume’s volume control block is pointed to by the global variable DefVCBPtr. æKY HGetVol æFp Files.p æT FUNCTION æD FUNCTION HGetVol(volName: StringPtr;VAR vRefNum: INTEGER;VAR dirID: LONGINT): OSErr; æDT myVariable := HGetVol(volName,vRefNum,dirID); æRI IV-132 æC æKY HSetVol æFp Files.p æT FUNCTION æD FUNCTION HSetVol(volName: StringPtr;vRefNum: INTEGER;dirID: LONGINT): OSErr; æDT myVariable := HSetVol(volName,vRefNum,dirID); æRI IV-133 æC æKY HOpen æFp Files.p æT FUNCTION æD FUNCTION HOpen(vRefNum: INTEGER;dirID: LONGINT;fileName: Str255;permission: SignedByte; VAR refNum: INTEGER): OSErr; æDT myVariable := HOpen(vRefNum,dirID,fileName,permission,refNum); æRI IV-136 æC æKY HOpenDF æFp Files.p æT FUNCTION æD FUNCTION HOpenDF(vRefNum: INTEGER;dirID: LONGINT;fileName: Str255;permission: SignedByte; VAR refNum: INTEGER): OSErr; æDT myVariable := HOpenDF(vRefNum,dirID,fileName,permission,refNum); æRI IV-136 æC æKY HOpenRF æFp Files.p æT FUNCTION æD FUNCTION HOpenRF(vRefNum: INTEGER;dirID: LONGINT;fileName: Str255;permission: SignedByte; VAR refNum: INTEGER): OSErr; æDT myVariable := HOpenRF(vRefNum,dirID,fileName,permission,refNum); æRI IV-137 æC æKY AllocContig æFp Files.p æT FUNCTION æD FUNCTION AllocContig(refNum: INTEGER;VAR count: LONGINT): OSErr; æDT myVariable := AllocContig(refNum,count); æRT 218 æRI IV-143 æC æKY HCreate æFp Files.p æT FUNCTION æD FUNCTION HCreate(vRefNum: INTEGER;dirID: LONGINT;fileName: Str255;creator: OSType; fileType: OSType): OSErr; æDT myVariable := HCreate(vRefNum,dirID,fileName,creator,fileType); æRT 218 æRI IV-146 æC æKY DirCreate æFp Files.p æT FUNCTION æD FUNCTION DirCreate(vRefNum: INTEGER;parentDirID: LONGINT;directoryName: Str255; VAR createdDirID: LONGINT): OSErr; æDT myVariable := DirCreate(vRefNum,parentDirID,directoryName,createdDirID); æRT 218 æRI IV-146 æC æKY HDelete æFp Files.p æT FUNCTION æD FUNCTION HDelete(vRefNum: INTEGER;dirID: LONGINT;fileName: Str255): OSErr; æDT myVariable := HDelete(vRefNum,dirID,fileName); æRI IV-147 æC æKY HGetFInfo æFp Files.p æT FUNCTION æD FUNCTION HGetFInfo(vRefNum: INTEGER;dirID: LONGINT;fileName: Str255;VAR fndrInfo: FInfo): OSErr; æDT myVariable := HGetFInfo(vRefNum,dirID,fileName,fndrInfo); æRI IV-149 æC æKY HSetFInfo æFp Files.p æT FUNCTION æD FUNCTION HSetFInfo(vRefNum: INTEGER;dirID: LONGINT;fileName: Str255;fndrInfo: FInfo): OSErr; æDT myVariable := HSetFInfo(vRefNum,dirID,fileName,fndrInfo); æRI IV-150 æC æKY HSetFLock æFp Files.p æT FUNCTION æD FUNCTION HSetFLock(vRefNum: INTEGER;dirID: LONGINT;fileName: Str255): OSErr; æDT myVariable := HSetFLock(vRefNum,dirID,fileName); æRI IV-151 æC æKY HRstFLock æFp Files.p æT FUNCTION æD FUNCTION HRstFLock(vRefNum: INTEGER;dirID: LONGINT;fileName: Str255): OSErr; æDT myVariable := HRstFLock(vRefNum,dirID,fileName); æRI IV-152 æC æKY HRename æFp Files.p æT FUNCTION æD FUNCTION HRename(vRefNum: INTEGER;dirID: LONGINT;oldName: Str255;newName: Str255): OSErr; æDT myVariable := HRename(vRefNum,dirID,oldName,newName); æRI IV-154 æC æKY CatMove æFp Files.p æT FUNCTION æD FUNCTION CatMove(vRefNum: INTEGER;dirID: LONGINT;oldName: Str255;newDirID: LONGINT; newName: Str255): OSErr; æDT myVariable := CatMove(vRefNum,dirID,oldName,newDirID,newName); æRT 218 æRI IV-157 æC æKY OpenWD æFp Files.p æT FUNCTION æD FUNCTION OpenWD(vRefNum: INTEGER;dirID: LONGINT;procID: LONGINT;VAR wdRefNum: INTEGER): OSErr; æDT myVariable := OpenWD(vRefNum,dirID,procID,wdRefNum); æRT 218 æRI IV-158 æC æKY CloseWD æFp Files.p æT FUNCTION æD FUNCTION CloseWD(wdRefNum: INTEGER): OSErr; æDT myVariable := CloseWD(wdRefNum); æRT 218 æRI IV-158 æC æKY GetWDInfo æFp Files.p æT FUNCTION æD FUNCTION GetWDInfo(wdRefNum: INTEGER;VAR vRefNum: INTEGER;VAR dirID: LONGINT; VAR procID: LONGINT): OSErr; æDT myVariable := GetWDInfo(wdRefNum,vRefNum,dirID,procID); æRT 218 æRI IV-159 æC æKY PBHGetVolParms æFp Files.p æT FUNCTION æD FUNCTION PBHGetVolParms(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHGetVolParms(paramBlock,async); æRI V-392 æC Trap macro _GetVolParms Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long volume name specifier --> 22 ioVRefNum word volume refNum <-- 32 ioBuffer long ptr to vol parms data --> 36 ioReqCount long size of buffer area <-- 40 ioActCount long length of vol parms data The PBHGetVolParms call is used to return volume level information. ioVRefNum or ioFileName contain the volume identifier information. ioReqCount and ioBuffer contain the size and location of the buffer in which to place the volume parameters. The actual size of the information is returned in ioActCount. The format of the buffer is described below. Version 01 of the buffer is shown below along with offsets into the buffer and their equates: offset 0 vMVersion word version number (currently 01) 2 vMAttrib long attributes (detailed below) 6 vMLocalHand long handle used to keep information necessary for shared volumes 10 vMServerAdr long AppleTalk server address (zero if not supported) On creation of the VCB (right after mounting), vMLocalHand will be a handle to a 2 byte block of memory. The Finder uses this for its local window list storage, allocating and deallocating memory as needed. It is disposed of when the volume is unmounted. For AppleTalk server volumes, vMServerAdr contains the AppleTalk internet address of the server. This can be used to tell which volumes are for which server. vMAttrib contains attributes information (32 flag bits) about the volume. These bits and their equates are defined as follows: bit 31 bLimitFCBs If set, Finder limits the number of FCBs used during copies to 8 (instead of 16). 30 bLocalWList If set, Finder uses the returned shared volume handle for its local window list. 29 bNoMiniFndr If set, Mini Finder menu item is disabled. 28 bNoVNEdit If set, volume name cannot be edited. 27 bNoLclSync If set, volume’s modification date is not set by any Finder action. 26 bTrshOffLine If set, anytime volume goes offline, it is zoomed to the Trash and unmounted. 25 bNoSwitchTo If set, Finder will not switch launch to any application on the volume. 24–21 Reserved—server volumes should return these bits set, all other disks should return these bits cleared. 20 bNoDeskItems If set, no items may be placed on the Finder desktop. 19 bNoBootBlks If set, no boot blocks on this volume—not a startup volume. SetStartup menu item will be disabled; bootblocks will not be copied during copy operations. 18 bAccessCntl If set, volume supports AppleTalk AFP access control interfaces. The calls GetLoginInfo, GetDirAccess, SetDirAccess, MapID, and MapName are supported. Special folder icons are used. Access Privileges menu item is enabled for disk and folder items. The privileges field of GetCatInfo calls are assumed to be valid. 17 bNoSysDir If set, volume doesn’t support a system directory; no switch launch to this volume. 16 bExtFSVol If set, this volume is an external file system volume. Disk init package will not be called. Erase Disk menu item is disabled. 15 bHasOpenDeny If set, supports _OpenDeny and _OpenRFDeny calls. For copy operations, source files are opened with enable read/deny write and destination files are opened enable write/deny read and write. 14 bHasCopyFile If set, _CopyFile call supported. _CopyFile is used in copy and duplicate operations if both source and destination volumes have same server address. 13 bHasMoveRename If set, _MoveRename call supported. 12 bHasNewDesk If set, all of the new desktop calls are supported (for example, OpenDB, AddIcon, AddComment). 11–0 Reserved—these bits should be returned cleared. æKY PBHGetVolParmsSync æFp Files.p æT FUNCTION æTN 7030,A260 æD FUNCTION PBHGetVolParmsSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7030,$A260,$3E80; æDT myVariable := PBHGetVolParmsSync(paramBlock,A0); æRI V-392 æC Trap macro _GetVolParms Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long volume name specifier --> 22 ioVRefNum word volume refNum <-- 32 ioBuffer long ptr to vol parms data --> 36 ioReqCount long size of buffer area <-- 40 ioActCount long length of vol parms data The PBHGetVolParms call is used to return volume level information. ioVRefNum or ioFileName contain the volume identifier information. ioReqCount and ioBuffer contain the size and location of the buffer in which to place the volume parameters. The actual size of the information is returned in ioActCount. The format of the buffer is described below. Version 01 of the buffer is shown below along with offsets into the buffer and their equates: offset 0 vMVersion word version number (currently 01) 2 vMAttrib long attributes (detailed below) 6 vMLocalHand long handle used to keep information necessary for shared volumes 10 vMServerAdr long AppleTalk server address (zero if not supported) On creation of the VCB (right after mounting), vMLocalHand will be a handle to a 2 byte block of memory. The Finder uses this for its local window list storage, allocating and deallocating memory as needed. It is disposed of when the volume is unmounted. For AppleTalk server volumes, vMServerAdr contains the AppleTalk internet address of the server. This can be used to tell which volumes are for which server. vMAttrib contains attributes information (32 flag bits) about the volume. These bits and their equates are defined as follows: bit 31 bLimitFCBs If set, Finder limits the number of FCBs used during copies to 8 (instead of 16). 30 bLocalWList If set, Finder uses the returned shared volume handle for its local window list. 29 bNoMiniFndr If set, Mini Finder menu item is disabled. 28 bNoVNEdit If set, volume name cannot be edited. 27 bNoLclSync If set, volume’s modification date is not set by any Finder action. 26 bTrshOffLine If set, anytime volume goes offline, it is zoomed to the Trash and unmounted. 25 bNoSwitchTo If set, Finder will not switch launch to any application on the volume. 24–21 Reserved—server volumes should return these bits set, all other disks should return these bits cleared. 20 bNoDeskItems If set, no items may be placed on the Finder desktop. 19 bNoBootBlks If set, no boot blocks on this volume—not a startup volume. SetStartup menu item will be disabled; bootblocks will not be copied during copy operations. 18 bAccessCntl If set, volume supports AppleTalk AFP access control interfaces. The calls GetLoginInfo, GetDirAccess, SetDirAccess, MapID, and MapName are supported. Special folder icons are used. Access Privileges menu item is enabled for disk and folder items. The privileges field of GetCatInfo calls are assumed to be valid. 17 bNoSysDir If set, volume doesn’t support a system directory; no switch launch to this volume. 16 bExtFSVol If set, this volume is an external file system volume. Disk init package will not be called. Erase Disk menu item is disabled. 15 bHasOpenDeny If set, supports _OpenDeny and _OpenRFDeny calls. For copy operations, source files are opened with enable read/deny write and destination files are opened enable write/deny read and write. 14 bHasCopyFile If set, _CopyFile call supported. _CopyFile is used in copy and duplicate operations if both source and destination volumes have same server address. 13 bHasMoveRename If set, _MoveRename call supported. 12 bHasNewDesk If set, all of the new desktop calls are supported (for example, OpenDB, AddIcon, AddComment). 11–0 Reserved—these bits should be returned cleared. æKY PBHGetVolParmsAsync æFp Files.p æT FUNCTION æTN 7030,A660 æD FUNCTION PBHGetVolParmsAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7030,$A660,$3E80; æDT myVariable := PBHGetVolParmsAsync(paramBlock,A0); æRI V-392 æC Trap macro _GetVolParms Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long volume name specifier --> 22 ioVRefNum word volume refNum <-- 32 ioBuffer long ptr to vol parms data --> 36 ioReqCount long size of buffer area <-- 40 ioActCount long length of vol parms data The PBHGetVolParms call is used to return volume level information. ioVRefNum or ioFileName contain the volume identifier information. ioReqCount and ioBuffer contain the size and location of the buffer in which to place the volume parameters. The actual size of the information is returned in ioActCount. The format of the buffer is described below. Version 01 of the buffer is shown below along with offsets into the buffer and their equates: offset 0 vMVersion word version number (currently 01) 2 vMAttrib long attributes (detailed below) 6 vMLocalHand long handle used to keep information necessary for shared volumes 10 vMServerAdr long AppleTalk server address (zero if not supported) On creation of the VCB (right after mounting), vMLocalHand will be a handle to a 2 byte block of memory. The Finder uses this for its local window list storage, allocating and deallocating memory as needed. It is disposed of when the volume is unmounted. For AppleTalk server volumes, vMServerAdr contains the AppleTalk internet address of the server. This can be used to tell which volumes are for which server. vMAttrib contains attributes information (32 flag bits) about the volume. These bits and their equates are defined as follows: bit 31 bLimitFCBs If set, Finder limits the number of FCBs used during copies to 8 (instead of 16). 30 bLocalWList If set, Finder uses the returned shared volume handle for its local window list. 29 bNoMiniFndr If set, Mini Finder menu item is disabled. 28 bNoVNEdit If set, volume name cannot be edited. 27 bNoLclSync If set, volume’s modification date is not set by any Finder action. 26 bTrshOffLine If set, anytime volume goes offline, it is zoomed to the Trash and unmounted. 25 bNoSwitchTo If set, Finder will not switch launch to any application on the volume. 24–21 Reserved—server volumes should return these bits set, all other disks should return these bits cleared. 20 bNoDeskItems If set, no items may be placed on the Finder desktop. 19 bNoBootBlks If set, no boot blocks on this volume—not a startup volume. SetStartup menu item will be disabled; bootblocks will not be copied during copy operations. 18 bAccessCntl If set, volume supports AppleTalk AFP access control interfaces. The calls GetLoginInfo, GetDirAccess, SetDirAccess, MapID, and MapName are supported. Special folder icons are used. Access Privileges menu item is enabled for disk and folder items. The privileges field of GetCatInfo calls are assumed to be valid. 17 bNoSysDir If set, volume doesn’t support a system directory; no switch launch to this volume. 16 bExtFSVol If set, this volume is an external file system volume. Disk init package will not be called. Erase Disk menu item is disabled. 15 bHasOpenDeny If set, supports _OpenDeny and _OpenRFDeny calls. For copy operations, source files are opened with enable read/deny write and destination files are opened enable write/deny read and write. 14 bHasCopyFile If set, _CopyFile call supported. _CopyFile is used in copy and duplicate operations if both source and destination volumes have same server address. 13 bHasMoveRename If set, _MoveRename call supported. 12 bHasNewDesk If set, all of the new desktop calls are supported (for example, OpenDB, AddIcon, AddComment). 11–0 Reserved—these bits should be returned cleared. æKY PBHGetLogInInfo æFp Files.p æT FUNCTION æD FUNCTION PBHGetLogInInfo(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHGetLogInInfo(paramBlock,async); æRI V-393 æC Trap macro _GetLogInInfo Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 22 ioVRefNum word volume refNum <-- 26 ioObjType word log in method <-- 28 ioObjNamePtr long ptr to log in name buffer PBHGetLogInInfo returns the method used for log-in and the user name specified at log-in time for the volume. The log-in user name is returned as a Pascal string in ioObjNamePtr. The maximum size of the user name is 31 characters. The log-in method type is returned in ioObjType. æKY PBHGetLogInInfoSync æFp Files.p æT FUNCTION æTN 7031,A260 æD FUNCTION PBHGetLogInInfoSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7031,$A260,$3E80; æDT myVariable := PBHGetLogInInfoSync(paramBlock,A0); æRI V-393 æC Trap macro _GetLogInInfo Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 22 ioVRefNum word volume refNum <-- 26 ioObjType word log in method <-- 28 ioObjNamePtr long ptr to log in name buffer PBHGetLogInInfo returns the method used for log-in and the user name specified at log-in time for the volume. The log-in user name is returned as a Pascal string in ioObjNamePtr. The maximum size of the user name is 31 characters. The log-in method type is returned in ioObjType. æKY PBHGetLogInInfoAsync æFp Files.p æT FUNCTION æTN 7031,A660 æD FUNCTION PBHGetLogInInfoAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7031,$A660,$3E80; æDT myVariable := PBHGetLogInInfoAsync(paramBlock,A0); æRI V-393 æC Trap macro _GetLogInInfo Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 22 ioVRefNum word volume refNum <-- 26 ioObjType word log in method <-- 28 ioObjNamePtr long ptr to log in name buffer PBHGetLogInInfo returns the method used for log-in and the user name specified at log-in time for the volume. The log-in user name is returned as a Pascal string in ioObjNamePtr. The maximum size of the user name is 31 characters. The log-in method type is returned in ioObjType. æKY PBHGetDirAccess æFp Files.p æT FUNCTION æD FUNCTION PBHGetDirAccess(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHGetDirAccess(paramBlock,async); æRI V-394 æC Trap macro _GetDirAccess Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long directory name --> 22 ioVRefNum word volume refNum <-- 36 ioACOwnerID long owner ID <-- 40 ioACGroupID long group ID <-- 44 ioACAccess long access rights --> 48 ioDirID long directory ID PBHGetDirAccess returns access control information for the folder pointed to by the ioDirID/ioFIleName pair. ioACOwnerID will return the ID for the folder’s owner. ioACGroupID will return the ID for the folder’s primary group. The access rights are returned in ioACAccess. A fnfErr is returned if the pathname does not point to a valid directory. An AccessDenied error is returned if the user does not have the correct access rights to examine this directory. æKY PBHGetDirAccessSync æFp Files.p æT FUNCTION æTN 7032,A260 æD FUNCTION PBHGetDirAccessSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7032,$A260,$3E80; æDT myVariable := PBHGetDirAccessSync(paramBlock,A0); æRI V-394 æC Trap macro _GetDirAccess Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long directory name --> 22 ioVRefNum word volume refNum <-- 36 ioACOwnerID long owner ID <-- 40 ioACGroupID long group ID <-- 44 ioACAccess long access rights --> 48 ioDirID long directory ID PBHGetDirAccess returns access control information for the folder pointed to by the ioDirID/ioFIleName pair. ioACOwnerID will return the ID for the folder’s owner. ioACGroupID will return the ID for the folder’s primary group. The access rights are returned in ioACAccess. A fnfErr is returned if the pathname does not point to a valid directory. An AccessDenied error is returned if the user does not have the correct access rights to examine this directory. æKY PBHGetDirAccessAsync æFp Files.p æT FUNCTION æTN 7032,A660 æD FUNCTION PBHGetDirAccessAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7032,$A660,$3E80; æDT myVariable := PBHGetDirAccessAsync(paramBlock,A0); æRI V-394 æC Trap macro _GetDirAccess Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long directory name --> 22 ioVRefNum word volume refNum <-- 36 ioACOwnerID long owner ID <-- 40 ioACGroupID long group ID <-- 44 ioACAccess long access rights --> 48 ioDirID long directory ID PBHGetDirAccess returns access control information for the folder pointed to by the ioDirID/ioFIleName pair. ioACOwnerID will return the ID for the folder’s owner. ioACGroupID will return the ID for the folder’s primary group. The access rights are returned in ioACAccess. A fnfErr is returned if the pathname does not point to a valid directory. An AccessDenied error is returned if the user does not have the correct access rights to examine this directory. æKY PBHSetDirAccess æFp Files.p æT FUNCTION æD FUNCTION PBHSetDirAccess(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHSetDirAccess(paramBlock,async); æRI V-394 æC Trap macro _SetDirAccess Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long pathname identifier --> 22 ioVRefNum word volume refNum --> 36 ioACOwnerID long owner ID --> 40 ioACGroupID long group ID --> 44 ioACAccess long access rights --> 48 ioDirID long directory ID PBHSetDirAccess allows you to change the access rights to a folder pointed to by the ioFileName/ioDirID pair. IOACOwnerID contains the new owner ID. IOACGroupID contains the group ID. IOACAccess contains the folder’s access rights. You cannot set the owner bit or the user’s rights of the directory. To change the owner or group, you should set the ioACOwnerID or ioACGroupID field with the appropriate ID of the new owner/group. You must be the owner of the directory to change the owner or group ID. A fnfErr is returned if the pathname does not point to a valid directory. An AccessDenied error is returned if you do not have the correct access rights to modify the parameters for this directory. A paramErr is returned if you try to set the owner bit or user’s rights bits. æKY PBHSetDirAccessSync æFp Files.p æT FUNCTION æTN 7033,A260 æD FUNCTION PBHSetDirAccessSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7033,$A260,$3E80; æDT myVariable := PBHSetDirAccessSync(paramBlock,A0); æRI V-394 æC Trap macro _SetDirAccess Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long pathname identifier --> 22 ioVRefNum word volume refNum --> 36 ioACOwnerID long owner ID --> 40 ioACGroupID long group ID --> 44 ioACAccess long access rights --> 48 ioDirID long directory ID PBHSetDirAccess allows you to change the access rights to a folder pointed to by the ioFileName/ioDirID pair. IOACOwnerID contains the new owner ID. IOACGroupID contains the group ID. IOACAccess contains the folder’s access rights. You cannot set the owner bit or the user’s rights of the directory. To change the owner or group, you should set the ioACOwnerID or ioACGroupID field with the appropriate ID of the new owner/group. You must be the owner of the directory to change the owner or group ID. A fnfErr is returned if the pathname does not point to a valid directory. An AccessDenied error is returned if you do not have the correct access rights to modify the parameters for this directory. A paramErr is returned if you try to set the owner bit or user’s rights bits. æKY PBHSetDirAccessAsync æFp Files.p æT FUNCTION æTN 7033,A660 æD FUNCTION PBHSetDirAccessAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7033,$A660,$3E80; æDT myVariable := PBHSetDirAccessAsync(paramBlock,A0); æRI V-394 æC Trap macro _SetDirAccess Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long pathname identifier --> 22 ioVRefNum word volume refNum --> 36 ioACOwnerID long owner ID --> 40 ioACGroupID long group ID --> 44 ioACAccess long access rights --> 48 ioDirID long directory ID PBHSetDirAccess allows you to change the access rights to a folder pointed to by the ioFileName/ioDirID pair. IOACOwnerID contains the new owner ID. IOACGroupID contains the group ID. IOACAccess contains the folder’s access rights. You cannot set the owner bit or the user’s rights of the directory. To change the owner or group, you should set the ioACOwnerID or ioACGroupID field with the appropriate ID of the new owner/group. You must be the owner of the directory to change the owner or group ID. A fnfErr is returned if the pathname does not point to a valid directory. An AccessDenied error is returned if you do not have the correct access rights to modify the parameters for this directory. A paramErr is returned if you try to set the owner bit or user’s rights bits. æKY PBHMapID æFp Files.p æT FUNCTION æD FUNCTION PBHMapID(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHMapID(paramBlock,async); æRI V-395 æC Trap macro _MapID Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long pathname identifier --> 22 ioVRefNum word volume refNum --> 26 ioObjType word function code <-- 28 ioObjNamePtr long ptr to retrnd creator/group name --> 32 ioObjID long creator/group ID PBHMapID returns the name of a user or group given its unique ID. IOObjID contains the ID to be mapped. The value zero for ioObjID is special cased and will always return a NIL name. AppleShare uses this to signify <Any User>. IOObjType is the mapping function code; it’s 1 if you’re mapping an owner ID to owner name or 2 if you’re mapping a group ID to a group name. The name is returned as a Pascal string in ioObjNamePtr. The maximum size of the name is 31 characters. A fnfErr is returned if an unrecognizable owner or group ID is passed. æKY PBHMapIDSync æFp Files.p æT FUNCTION æTN 7034,A260 æD FUNCTION PBHMapIDSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7034,$A260,$3E80; æDT myVariable := PBHMapIDSync(paramBlock,A0); æRI V-395 æC Trap macro _MapID Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long pathname identifier --> 22 ioVRefNum word volume refNum --> 26 ioObjType word function code <-- 28 ioObjNamePtr long ptr to retrnd creator/group name --> 32 ioObjID long creator/group ID PBHMapID returns the name of a user or group given its unique ID. IOObjID contains the ID to be mapped. The value zero for ioObjID is special cased and will always return a NIL name. AppleShare uses this to signify <Any User>. IOObjType is the mapping function code; it’s 1 if you’re mapping an owner ID to owner name or 2 if you’re mapping a group ID to a group name. The name is returned as a Pascal string in ioObjNamePtr. The maximum size of the name is 31 characters. A fnfErr is returned if an unrecognizable owner or group ID is passed. æKY PBHMapIDAsync æFp Files.p æT FUNCTION æTN 7034,A660 æD FUNCTION PBHMapIDAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7034,$A660,$3E80; æDT myVariable := PBHMapIDAsync(paramBlock,A0); æRI V-395 æC Trap macro _MapID Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long pathname identifier --> 22 ioVRefNum word volume refNum --> 26 ioObjType word function code <-- 28 ioObjNamePtr long ptr to retrnd creator/group name --> 32 ioObjID long creator/group ID PBHMapID returns the name of a user or group given its unique ID. IOObjID contains the ID to be mapped. The value zero for ioObjID is special cased and will always return a NIL name. AppleShare uses this to signify <Any User>. IOObjType is the mapping function code; it’s 1 if you’re mapping an owner ID to owner name or 2 if you’re mapping a group ID to a group name. The name is returned as a Pascal string in ioObjNamePtr. The maximum size of the name is 31 characters. A fnfErr is returned if an unrecognizable owner or group ID is passed. æKY PBHMapName æFp Files.p æT FUNCTION æD FUNCTION PBHMapName(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHMapName(paramBlock,async); æRI V-395 æC Trap macro _MapName Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long volume identifier (may be NIL) --> 22 ioVRefNum word volume refNum --> 28 ioObjNamePtr long owner or group name --> 26 ioObjType word function code <-- 32 ioObjID long creator/group ID PBHMapName returns the unique user ID or group ID given its name. The name is passed as a string in ioObjNamePtr. If a NIL name is passed, the ID returned will always be zero. The maximum size of the name is 31 characters. IOObjType is the mapping function code; it’s 3 if you’re mapping an owner name to owner ID or 4 if you’re mapping a group name to a group ID. IOObjID will contain the mapped ID. A fnfErr is returned if an unrecognizable owner or group name is passed. æKY PBHMapNameSync æFp Files.p æT FUNCTION æTN 7035,A260 æD FUNCTION PBHMapNameSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7035,$A260,$3E80; æDT myVariable := PBHMapNameSync(paramBlock,A0); æRI V-395 æC Trap macro _MapName Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long volume identifier (may be NIL) --> 22 ioVRefNum word volume refNum --> 28 ioObjNamePtr long owner or group name --> 26 ioObjType word function code <-- 32 ioObjID long creator/group ID PBHMapName returns the unique user ID or group ID given its name. The name is passed as a string in ioObjNamePtr. If a NIL name is passed, the ID returned will always be zero. The maximum size of the name is 31 characters. IOObjType is the mapping function code; it’s 3 if you’re mapping an owner name to owner ID or 4 if you’re mapping a group name to a group ID. IOObjID will contain the mapped ID. A fnfErr is returned if an unrecognizable owner or group name is passed. æKY PBHMapNameAsync æFp Files.p æT FUNCTION æTN 7035,A660 æD FUNCTION PBHMapNameAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7035,$A660,$3E80; æDT myVariable := PBHMapNameAsync(paramBlock,A0); æRI V-395 æC Trap macro _MapName Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long volume identifier (may be NIL) --> 22 ioVRefNum word volume refNum --> 28 ioObjNamePtr long owner or group name --> 26 ioObjType word function code <-- 32 ioObjID long creator/group ID PBHMapName returns the unique user ID or group ID given its name. The name is passed as a string in ioObjNamePtr. If a NIL name is passed, the ID returned will always be zero. The maximum size of the name is 31 characters. IOObjType is the mapping function code; it’s 3 if you’re mapping an owner name to owner ID or 4 if you’re mapping a group name to a group ID. IOObjID will contain the mapped ID. A fnfErr is returned if an unrecognizable owner or group name is passed. æKY PBHCopyFile æFp Files.p æT FUNCTION æD FUNCTION PBHCopyFile(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHCopyFile(paramBlock,async); æRI V-396 æC Trap macro _CopyFile Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long ptr to source pathname --> 22 ioVRefNum word source vol identifier --> 24 ioDstVRefNum word destination vol identifier --> 28 ioNewName long ptr to destination pathname --> 32 ioCopyName long ptr to optional name (may be NIL) --> 36 ioNewDirID long destination directory ID --> 48 ioDirID long source directory ID PBHCopyFile duplicates a file on the volume and optionally renames it. It is an optional call for AppleShare file servers. You should examine the returned flag information in the PBHGetVolParms call to see if this volume supports CopyFile. For AppleShare file servers, the source and destination pathnames must indicate the same file server; however, it may point to a different volume for that file server. A useful way to tell if two file server volumes are on the same file server is to make the GetVolParms call and compare the server addresses returned. The server will open source files with read/deny write enabled and destination files with write/deny read and write enabled. IOVRefNum contains a source volume identifier. The source pathname is determined by the ioFileName/ioDirID pair. IODstVRefNum contains a destination volume identifier. AppleShare 1.0 required that it be an actual volume reference number; however, on future versions it can be a WDRefNum. The destination pathname is determined by the ioNewName/ioNewDirID pair. IOCopyName may contain an optional string used in renaming the file. If it is non-NIL then the file copy will be renamed to the specified name in ioCopyName. A fnfErr is returned if the source pathname does not point to an existing file or the destination pathname does not point to an existing directory. An AccessDenied error is returned if the user does not have the right to read the source or write to the destination. A dupFnErr is returned if the destination already exists. A DenyConflict error is returned if either the source or destination file could not be opened under the access modes described above. æKY PBHCopyFileSync æFp Files.p æT FUNCTION æTN 7036,A260 æD FUNCTION PBHCopyFileSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7036,$A260,$3E80; æDT myVariable := PBHCopyFileSync(paramBlock,A0); æRI V-396 æC Trap macro _CopyFile Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long ptr to source pathname --> 22 ioVRefNum word source vol identifier --> 24 ioDstVRefNum word destination vol identifier --> 28 ioNewName long ptr to destination pathname --> 32 ioCopyName long ptr to optional name (may be NIL) --> 36 ioNewDirID long destination directory ID --> 48 ioDirID long source directory ID PBHCopyFile duplicates a file on the volume and optionally renames it. It is an optional call for AppleShare file servers. You should examine the returned flag information in the PBHGetVolParms call to see if this volume supports CopyFile. For AppleShare file servers, the source and destination pathnames must indicate the same file server; however, it may point to a different volume for that file server. A useful way to tell if two file server volumes are on the same file server is to make the GetVolParms call and compare the server addresses returned. The server will open source files with read/deny write enabled and destination files with write/deny read and write enabled. IOVRefNum contains a source volume identifier. The source pathname is determined by the ioFileName/ioDirID pair. IODstVRefNum contains a destination volume identifier. AppleShare 1.0 required that it be an actual volume reference number; however, on future versions it can be a WDRefNum. The destination pathname is determined by the ioNewName/ioNewDirID pair. IOCopyName may contain an optional string used in renaming the file. If it is non-NIL then the file copy will be renamed to the specified name in ioCopyName. A fnfErr is returned if the source pathname does not point to an existing file or the destination pathname does not point to an existing directory. An AccessDenied error is returned if the user does not have the right to read the source or write to the destination. A dupFnErr is returned if the destination already exists. A DenyConflict error is returned if either the source or destination file could not be opened under the access modes described above. æKY PBHCopyFileAsync æFp Files.p æT FUNCTION æTN 7036,A660 æD FUNCTION PBHCopyFileAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7036,$A660,$3E80; æDT myVariable := PBHCopyFileAsync(paramBlock,A0); æRI V-396 æC Trap macro _CopyFile Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long ptr to source pathname --> 22 ioVRefNum word source vol identifier --> 24 ioDstVRefNum word destination vol identifier --> 28 ioNewName long ptr to destination pathname --> 32 ioCopyName long ptr to optional name (may be NIL) --> 36 ioNewDirID long destination directory ID --> 48 ioDirID long source directory ID PBHCopyFile duplicates a file on the volume and optionally renames it. It is an optional call for AppleShare file servers. You should examine the returned flag information in the PBHGetVolParms call to see if this volume supports CopyFile. For AppleShare file servers, the source and destination pathnames must indicate the same file server; however, it may point to a different volume for that file server. A useful way to tell if two file server volumes are on the same file server is to make the GetVolParms call and compare the server addresses returned. The server will open source files with read/deny write enabled and destination files with write/deny read and write enabled. IOVRefNum contains a source volume identifier. The source pathname is determined by the ioFileName/ioDirID pair. IODstVRefNum contains a destination volume identifier. AppleShare 1.0 required that it be an actual volume reference number; however, on future versions it can be a WDRefNum. The destination pathname is determined by the ioNewName/ioNewDirID pair. IOCopyName may contain an optional string used in renaming the file. If it is non-NIL then the file copy will be renamed to the specified name in ioCopyName. A fnfErr is returned if the source pathname does not point to an existing file or the destination pathname does not point to an existing directory. An AccessDenied error is returned if the user does not have the right to read the source or write to the destination. A dupFnErr is returned if the destination already exists. A DenyConflict error is returned if either the source or destination file could not be opened under the access modes described above. æKY PBHMoveRename æFp Files.p æT FUNCTION æD FUNCTION PBHMoveRename(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHMoveRename(paramBlock,async); æRI V-397 æC Trap macro _MoveRename Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long ptr to source pathname --> 22 ioVRefNum word source vol identifier --> 28 ioNewName long ptr to destination pathname --> 32 ioBuffer long ptr to optional name (may be NIL) --> 36 ioNewDirID long destination directory ID --> 48 ioDirID long source directory ID PBHMoveRename allows you to move (not copy) an item and optionally to rename it. The source and destination pathnames must point to the same file server volume. IOVRefNum contains a source volume identifier. The source pathname is specified by the ioFileName/ioDirID pair. The destination pathname is specified by the ioNewName/ioNewDirID pair. IOBuffer may contain an optional string used in renaming the item. If it is non-NIL then the moved object will be renamed to the specified name in ioBuffer. A fnfErr is returned if the source pathname does not point to an existing object. An AccessDenied error is returned if the user does not have the right to move the object. A dupFnErr is returned if the destination already exists. A badMovErr is returned if an attempt is made to move a directory into one of its descendent directories. æKY PBHMoveRenameSync æFp Files.p æT FUNCTION æTN 7037,A260 æD FUNCTION PBHMoveRenameSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7037,$A260,$3E80; æDT myVariable := PBHMoveRenameSync(paramBlock,A0); æRI V-397 æC Trap macro _MoveRename Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long ptr to source pathname --> 22 ioVRefNum word source vol identifier --> 28 ioNewName long ptr to destination pathname --> 32 ioBuffer long ptr to optional name (may be NIL) --> 36 ioNewDirID long destination directory ID --> 48 ioDirID long source directory ID PBHMoveRename allows you to move (not copy) an item and optionally to rename it. The source and destination pathnames must point to the same file server volume. IOVRefNum contains a source volume identifier. The source pathname is specified by the ioFileName/ioDirID pair. The destination pathname is specified by the ioNewName/ioNewDirID pair. IOBuffer may contain an optional string used in renaming the item. If it is non-NIL then the moved object will be renamed to the specified name in ioBuffer. A fnfErr is returned if the source pathname does not point to an existing object. An AccessDenied error is returned if the user does not have the right to move the object. A dupFnErr is returned if the destination already exists. A badMovErr is returned if an attempt is made to move a directory into one of its descendent directories. æKY PBHMoveRenameAsync æFp Files.p æT FUNCTION æTN 7037,A660 æD FUNCTION PBHMoveRenameAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7037,$A660,$3E80; æDT myVariable := PBHMoveRenameAsync(paramBlock,A0); æRI V-397 æC Trap macro _MoveRename Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long ptr to source pathname --> 22 ioVRefNum word source vol identifier --> 28 ioNewName long ptr to destination pathname --> 32 ioBuffer long ptr to optional name (may be NIL) --> 36 ioNewDirID long destination directory ID --> 48 ioDirID long source directory ID PBHMoveRename allows you to move (not copy) an item and optionally to rename it. The source and destination pathnames must point to the same file server volume. IOVRefNum contains a source volume identifier. The source pathname is specified by the ioFileName/ioDirID pair. The destination pathname is specified by the ioNewName/ioNewDirID pair. IOBuffer may contain an optional string used in renaming the item. If it is non-NIL then the moved object will be renamed to the specified name in ioBuffer. A fnfErr is returned if the source pathname does not point to an existing object. An AccessDenied error is returned if the user does not have the right to move the object. A dupFnErr is returned if the destination already exists. A badMovErr is returned if an attempt is made to move a directory into one of its descendent directories. æKY PBHOpenDeny æFp Files.p æT FUNCTION æD FUNCTION PBHOpenDeny(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHOpenDeny(paramBlock,async); æRI V-398 æC Trap macro _OpenDeny Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long ptr to pathname --> 22 ioVRefNum word vol identifier <-- 24 ioRefNum word file refNum --> 26 ioDenyModes word access rights data --> 48 ioDirID long directory ID PBHOpenDeny opens a file’s data fork under specific access rights. It creates an access path to the file having the name pointed to by ioFileName/ioDirID. The path reference number is returned in ioRefNum. IODenyModes contains a word of access rights information. The format for these access rights is: bits 15–6 Reserved—should be cleared. 5 If set, other writers are denied access. 4 If set, other readers are denied access. 3–2 Reserved—should be cleared. 1 If set, write permission requested. 0 If set, read permission requested. A fnfErr is returned if the input specification does not point to an existing file. A permErr is returned if the file is already open and you cannot open it under the deny modes that you have specified. An opWrErr is returned if you have asked for write permission and the file is already opened by you for write. The already opened path reference number is returned in ioRefNum. An AccessDenied error is returned if you do not have the right to access the file. æKY PBHOpenDenySync æFp Files.p æT FUNCTION æTN 7038,A260 æD FUNCTION PBHOpenDenySync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7038,$A260,$3E80; æDT myVariable := PBHOpenDenySync(paramBlock,A0); æRI V-398 æC Trap macro _OpenDeny Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long ptr to pathname --> 22 ioVRefNum word vol identifier <-- 24 ioRefNum word file refNum --> 26 ioDenyModes word access rights data --> 48 ioDirID long directory ID PBHOpenDeny opens a file’s data fork under specific access rights. It creates an access path to the file having the name pointed to by ioFileName/ioDirID. The path reference number is returned in ioRefNum. IODenyModes contains a word of access rights information. The format for these access rights is: bits 15–6 Reserved—should be cleared. 5 If set, other writers are denied access. 4 If set, other readers are denied access. 3–2 Reserved—should be cleared. 1 If set, write permission requested. 0 If set, read permission requested. A fnfErr is returned if the input specification does not point to an existing file. A permErr is returned if the file is already open and you cannot open it under the deny modes that you have specified. An opWrErr is returned if you have asked for write permission and the file is already opened by you for write. The already opened path reference number is returned in ioRefNum. An AccessDenied error is returned if you do not have the right to access the file. æKY PBHOpenDenyAsync æFp Files.p æT FUNCTION æTN 7038,A660 æD FUNCTION PBHOpenDenyAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7038,$A660,$3E80; æDT myVariable := PBHOpenDenyAsync(paramBlock,A0); æRI V-398 æC Trap macro _OpenDeny Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long ptr to pathname --> 22 ioVRefNum word vol identifier <-- 24 ioRefNum word file refNum --> 26 ioDenyModes word access rights data --> 48 ioDirID long directory ID PBHOpenDeny opens a file’s data fork under specific access rights. It creates an access path to the file having the name pointed to by ioFileName/ioDirID. The path reference number is returned in ioRefNum. IODenyModes contains a word of access rights information. The format for these access rights is: bits 15–6 Reserved—should be cleared. 5 If set, other writers are denied access. 4 If set, other readers are denied access. 3–2 Reserved—should be cleared. 1 If set, write permission requested. 0 If set, read permission requested. A fnfErr is returned if the input specification does not point to an existing file. A permErr is returned if the file is already open and you cannot open it under the deny modes that you have specified. An opWrErr is returned if you have asked for write permission and the file is already opened by you for write. The already opened path reference number is returned in ioRefNum. An AccessDenied error is returned if you do not have the right to access the file. æKY PBHOpenRFDeny æFp Files.p æT FUNCTION æD FUNCTION PBHOpenRFDeny(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBHOpenRFDeny(paramBlock,async); æRI V-398 æC Trap macro _OpenRFDeny Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long ptr to pathname --> 22 ioVRefNum word vol identifier <-- 24 ioRefNum word file refNum --> 26 ioDenyModes word access rights data --> 48 ioDirID long directory ID PBHOpenRFDeny opens a file’s resource fork under specific access rights. It creates an access path to the file having the name pointed to by ioFileName/ioDirID. The path reference number is returned in ioRefNum. The format of the access rights data contained in ioDenyModes is described under the OpenDeny call. A fnfErr is returned if the input specification does not point to an existing file. A permErr is returned if the file is already open and you cannot open it under the deny modes that you have specified. An opWrErr is returned if you have asked for write permission and the file is already opened by you for write. The already-opened path reference number is returned in ioRefNum. An AccessDenied error is returned if you do not have the right to access the file. æKY PBHOpenRFDenySync æFp Files.p æT FUNCTION æTN 7039,A260 æD FUNCTION PBHOpenRFDenySync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7039,$A260,$3E80; æDT myVariable := PBHOpenRFDenySync(paramBlock,A0); æRI V-398 æC Trap macro _OpenRFDeny Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long ptr to pathname --> 22 ioVRefNum word vol identifier <-- 24 ioRefNum word file refNum --> 26 ioDenyModes word access rights data --> 48 ioDirID long directory ID PBHOpenRFDeny opens a file’s resource fork under specific access rights. It creates an access path to the file having the name pointed to by ioFileName/ioDirID. The path reference number is returned in ioRefNum. The format of the access rights data contained in ioDenyModes is described under the OpenDeny call. A fnfErr is returned if the input specification does not point to an existing file. A permErr is returned if the file is already open and you cannot open it under the deny modes that you have specified. An opWrErr is returned if you have asked for write permission and the file is already opened by you for write. The already-opened path reference number is returned in ioRefNum. An AccessDenied error is returned if you do not have the right to access the file. æKY PBHOpenRFDenyAsync æFp Files.p æT FUNCTION æTN 7039,A660 æD FUNCTION PBHOpenRFDenyAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7039,$A660,$3E80; æDT myVariable := PBHOpenRFDenyAsync(paramBlock,A0); æRI V-398 æC Trap macro _OpenRFDeny Parameter block --> 12 ioCompletion long optional completion routine ptr <-- 16 ioResult word error result code --> 18 ioFileName long ptr to pathname --> 22 ioVRefNum word vol identifier <-- 24 ioRefNum word file refNum --> 26 ioDenyModes word access rights data --> 48 ioDirID long directory ID PBHOpenRFDeny opens a file’s resource fork under specific access rights. It creates an access path to the file having the name pointed to by ioFileName/ioDirID. The path reference number is returned in ioRefNum. The format of the access rights data contained in ioDenyModes is described under the OpenDeny call. A fnfErr is returned if the input specification does not point to an existing file. A permErr is returned if the file is already open and you cannot open it under the deny modes that you have specified. An opWrErr is returned if you have asked for write permission and the file is already opened by you for write. The already-opened path reference number is returned in ioRefNum. An AccessDenied error is returned if you do not have the right to access the file. æKY PBExchangeFiles æFp Files.p æT FUNCTION æD FUNCTION PBExchangeFiles(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBExchangeFiles(paramBlock,async); æC æKY PBExchangeFilesSync æFp Files.p æT FUNCTION æTN 7017,A260 æD FUNCTION PBExchangeFilesSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7017,$A260,$3E80; æDT myVariable := PBExchangeFilesSync(paramBlock,A0); æC æKY PBExchangeFilesAsync æFp Files.p æT FUNCTION æTN 7017,A660 æD FUNCTION PBExchangeFilesAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7017,$A660,$3E80; æDT myVariable := PBExchangeFilesAsync(paramBlock,A0); æC æKY PBCreateFileIDRef æFp Files.p æT FUNCTION æD FUNCTION PBCreateFileIDRef(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBCreateFileIDRef(paramBlock,async); æC æKY PBCreateFileIDRefSync æFp Files.p æT FUNCTION æTN 7014,A260 æD FUNCTION PBCreateFileIDRefSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7014,$A260,$3E80; æDT myVariable := PBCreateFileIDRefSync(paramBlock,A0); æC æKY PBCreateFileIDRefAsync æFp Files.p æT FUNCTION æTN 7014,A660 æD FUNCTION PBCreateFileIDRefAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7014,$A660,$3E80; æDT myVariable := PBCreateFileIDRefAsync(paramBlock,A0); æC æKY PBResolveFileIDRef æFp Files.p æT FUNCTION æD FUNCTION PBResolveFileIDRef(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBResolveFileIDRef(paramBlock,async); æC æKY PBResolveFileIDRefSync æFp Files.p æT FUNCTION æTN 7016,A260 æD FUNCTION PBResolveFileIDRefSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7016,$A260,$3E80; æDT myVariable := PBResolveFileIDRefSync(paramBlock,A0); æC æKY PBResolveFileIDRefAsync æFp Files.p æT FUNCTION æTN 7016,A660 æD FUNCTION PBResolveFileIDRefAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7016,$A660,$3E80; æDT myVariable := PBResolveFileIDRefAsync(paramBlock,A0); æC æKY PBDeleteFileIDRef æFp Files.p æT FUNCTION æD FUNCTION PBDeleteFileIDRef(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDeleteFileIDRef(paramBlock,async); æC æKY PBDeleteFileIDRefSync æFp Files.p æT FUNCTION æTN 7015,A260 æD FUNCTION PBDeleteFileIDRefSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7015,$A260,$3E80; æDT myVariable := PBDeleteFileIDRefSync(paramBlock,A0); æC æKY PBDeleteFileIDRefAsync æFp Files.p æT FUNCTION æTN 7015,A660 æD FUNCTION PBDeleteFileIDRefAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7015,$A660,$3E80; æDT myVariable := PBDeleteFileIDRefAsync(paramBlock,A0); æC æKY PBGetForeignPrivs æFp Files.p æT FUNCTION æD FUNCTION PBGetForeignPrivs(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBGetForeignPrivs(paramBlock,async); æC æKY PBGetForeignPrivsSync æFp Files.p æT FUNCTION æTN 7060,A260 æD FUNCTION PBGetForeignPrivsSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7060,$A260,$3E80; æDT myVariable := PBGetForeignPrivsSync(paramBlock,A0); æC æKY PBGetForeignPrivsAsync æFp Files.p æT FUNCTION æTN 7060,A660 æD FUNCTION PBGetForeignPrivsAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7060,$A660,$3E80; æDT myVariable := PBGetForeignPrivsAsync(paramBlock,A0); æC æKY PBSetForeignPrivs æFp Files.p æT FUNCTION æD FUNCTION PBSetForeignPrivs(paramBlock: HParmBlkPtr;async: BOOLEAN): OSErr; æDT myVariable := PBSetForeignPrivs(paramBlock,async); æC æKY PBSetForeignPrivsSync æFp Files.p æT FUNCTION æTN 7061,A260 æD FUNCTION PBSetForeignPrivsSync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7061,$A260,$3E80; æDT myVariable := PBSetForeignPrivsSync(paramBlock,A0); æC æKY PBSetForeignPrivsAsync æFp Files.p æT FUNCTION æTN 7061,A660 æD FUNCTION PBSetForeignPrivsAsync(paramBlock: HParmBlkPtr): OSErr; INLINE $205F,$7061,$A660,$3E80; æDT myVariable := PBSetForeignPrivsAsync(paramBlock,A0); æC æKY PBDTGetPath æFp Files.p æT FUNCTION æTN 7020,A260 æD FUNCTION PBDTGetPath(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7020,$A260,$3E80; æDT myVariable := PBDTGetPath(paramBlock,A0); æC æKY PBDTCloseDown æFp Files.p æT FUNCTION æTN 7021,A260 æD FUNCTION PBDTCloseDown(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7021,$A260,$3E80; æDT myVariable := PBDTCloseDown(paramBlock,A0); æC æKY PBDTAddIcon æFp Files.p æT FUNCTION æD FUNCTION PBDTAddIcon(paramBlock: DTPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDTAddIcon(paramBlock,async); æRI æC æKY PBDTAddIconSync æFp Files.p æT FUNCTION æTN 7022,A260 æD FUNCTION PBDTAddIconSync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7022,$A260,$3E80; æDT myVariable := PBDTAddIconSync(paramBlock,A0); æRI æC æKY PBDTAddIconAsync æFp Files.p æT FUNCTION æTN 7022,A660 æD FUNCTION PBDTAddIconAsync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7022,$A660,$3E80; æDT myVariable := PBDTAddIconAsync(paramBlock,A0); æRI æC æKY PBDTGetIcon æFp Files.p æT FUNCTION æD FUNCTION PBDTGetIcon(paramBlock: DTPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDTGetIcon(paramBlock,async); æRI æC æKY PBDTGetIconSync æFp Files.p æT FUNCTION æTN 7023,A260 æD FUNCTION PBDTGetIconSync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7023,$A260,$3E80; æDT myVariable := PBDTGetIconSync(paramBlock,A0); æRI æC æKY PBDTGetIconAsync æFp Files.p æT FUNCTION æTN 7023,A660 æD FUNCTION PBDTGetIconAsync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7023,$A660,$3E80; æDT myVariable := PBDTGetIconAsync(paramBlock,A0); æRI æC æKY PBDTGetIconInfo æFp Files.p æT FUNCTION æD FUNCTION PBDTGetIconInfo(paramBlock: DTPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDTGetIconInfo(paramBlock,async); æRI æC æKY PBDTGetIconInfoSync æFp Files.p æT FUNCTION æTN 7024,A260 æD FUNCTION PBDTGetIconInfoSync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7024,$A260,$3E80; æDT myVariable := PBDTGetIconInfoSync(paramBlock,A0); æRI æC æKY PBDTGetIconInfoAsync æFp Files.p æT FUNCTION æTN 7024,A660 æD FUNCTION PBDTGetIconInfoAsync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7024,$A660,$3E80; æDT myVariable := PBDTGetIconInfoAsync(paramBlock,A0); æRI æC æKY PBDTAddAPPL æFp Files.p æT FUNCTION æD FUNCTION PBDTAddAPPL(paramBlock: DTPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDTAddAPPL(paramBlock,async); æRI æC æKY PBDTAddAPPLSync æFp Files.p æT FUNCTION æTN 7025,A260 æD FUNCTION PBDTAddAPPLSync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7025,$A260,$3E80; æDT myVariable := PBDTAddAPPLSync(paramBlock,A0); æRI æC æKY PBDTAddAPPLAsync æFp Files.p æT FUNCTION æTN 7025,A660 æD FUNCTION PBDTAddAPPLAsync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7025,$A660,$3E80; æDT myVariable := PBDTAddAPPLAsync(paramBlock,A0); æRI æC æKY PBDTRemoveAPPL æFp Files.p æT FUNCTION æD FUNCTION PBDTRemoveAPPL(paramBlock: DTPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDTRemoveAPPL(paramBlock,async); æRI æC æKY PBDTRemoveAPPLSync æFp Files.p æT FUNCTION æTN 7026,A260 æD FUNCTION PBDTRemoveAPPLSync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7026,$A260,$3E80; æDT myVariable := PBDTRemoveAPPLSync(paramBlock,A0); æRI æC æKY PBDTRemoveAPPLAsync æFp Files.p æT FUNCTION æTN 7026,A660 æD FUNCTION PBDTRemoveAPPLAsync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7026,$A660,$3E80; æDT myVariable := PBDTRemoveAPPLAsync(paramBlock,A0); æRI æC æKY PBDTGetAPPL æFp Files.p æT FUNCTION æD FUNCTION PBDTGetAPPL(paramBlock: DTPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDTGetAPPL(paramBlock,async); æRI æC æKY PBDTGetAPPLSync æFp Files.p æT FUNCTION æTN 7027,A260 æD FUNCTION PBDTGetAPPLSync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7027,$A260,$3E80; æDT myVariable := PBDTGetAPPLSync(paramBlock,A0); æRI æC æKY PBDTGetAPPLAsync æFp Files.p æT FUNCTION æTN 7027,A660 æD FUNCTION PBDTGetAPPLAsync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7027,$A660,$3E80; æDT myVariable := PBDTGetAPPLAsync(paramBlock,A0); æRI æC æKY PBDTSetComment æFp Files.p æT FUNCTION æD FUNCTION PBDTSetComment(paramBlock: DTPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDTSetComment(paramBlock,async); æC æKY PBDTSetCommentSync æFp Files.p æT FUNCTION æTN 7028,A260 æD FUNCTION PBDTSetCommentSync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7028,$A260,$3E80; æDT myVariable := PBDTSetCommentSync(paramBlock,A0); æC æKY PBDTSetCommentAsync æFp Files.p æT FUNCTION æTN 7028,A660 æD FUNCTION PBDTSetCommentAsync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7028,$A660,$3E80; æDT myVariable := PBDTSetCommentAsync(paramBlock,A0); æC æKY PBDTRemoveComment æFp Files.p æT FUNCTION æD FUNCTION PBDTRemoveComment(paramBlock: DTPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDTRemoveComment(paramBlock,async); æRI æC æKY PBDTRemoveCommentSync æFp Files.p æT FUNCTION æTN 7029,A260 æD FUNCTION PBDTRemoveCommentSync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7029,$A260,$3E80; æDT myVariable := PBDTRemoveCommentSync(paramBlock,A0); æRI æC æKY PBDTRemoveCommentAsync æFp Files.p æT FUNCTION æTN 7029,A660 æD FUNCTION PBDTRemoveCommentAsync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$7029,$A660,$3E80; æDT myVariable := PBDTRemoveCommentAsync(paramBlock,A0); æRI æC æKY PBDTGetComment æFp Files.p æT FUNCTION æD FUNCTION PBDTGetComment(paramBlock: DTPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDTGetComment(paramBlock,async); æRI æC æKY PBDTGetCommentSync æFp Files.p æT FUNCTION æTN 702A,A260 æD FUNCTION PBDTGetCommentSync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$702A,$A260,$3E80; æDT myVariable := PBDTGetCommentSync(paramBlock,A0); æRI æC æKY PBDTGetCommentAsync æFp Files.p æT FUNCTION æTN 702A,A660 æD FUNCTION PBDTGetCommentAsync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$702A,$A660,$3E80; æDT myVariable := PBDTGetCommentAsync(paramBlock,A0); æRI æC æKY PBDTFlush æFp Files.p æT FUNCTION æD FUNCTION PBDTFlush(paramBlock: DTPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDTFlush(paramBlock,async); æRI æC æKY PBDTFlushSync æFp Files.p æT FUNCTION æTN 702B,A260 æD FUNCTION PBDTFlushSync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$702B,$A260,$3E80; æDT myVariable := PBDTFlushSync(paramBlock,A0); æRI æC æKY PBDTFlushAsync æFp Files.p æT FUNCTION æTN 702B,A660 æD FUNCTION PBDTFlushAsync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$702B,$A660,$3E80; æDT myVariable := PBDTFlushAsync(paramBlock,A0); æRI æC æKY PBDTReset æFp Files.p æT FUNCTION æD FUNCTION PBDTReset(paramBlock: DTPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDTReset(paramBlock,async); æRI æC æKY PBDTResetSync æFp Files.p æT FUNCTION æTN 702C,A260 æD FUNCTION PBDTResetSync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$702C,$A260,$3E80; æDT myVariable := PBDTResetSync(paramBlock,A0); æRI æC æKY PBDTResetAsync æFp Files.p æT FUNCTION æTN 702C,A660 æD FUNCTION PBDTResetAsync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$702C,$A660,$3E80; æDT myVariable := PBDTResetAsync(paramBlock,A0); æRI æC æKY PBDTGetInfo æFp Files.p æT FUNCTION æD FUNCTION PBDTGetInfo(paramBlock: DTPBPtr;async: BOOLEAN): OSErr; æDT myVariable := PBDTGetInfo(paramBlock,async); æRI æC æKY PBDTGetInfoSync æFp Files.p æT FUNCTION æTN 702D,A260 æD FUNCTION PBDTGetInfoSync(paramBlock: DTPBPtr): OSErr; INLINE $205F,$702D,$A26