sys7.1-doc-wip/Interfaces/AIncludes/FSEqu.a
2019-07-27 22:37:48 +08:00

477 lines
19 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

; Version: 2.95
; Created: Friday, October 20, 1989 at 9:16:12 PM
;
; File: FSEqu.a
;
; Assembler Interface to the Macintosh Libraries
; Copyright Apple Computer, Inc. 1984-1988
; All Rights Reserved
;
; This file is used in these builds: Mac32 HcMac MacPP BigBang Sys606
;
; Change History (most recent first):
;
; <SM2> 8/3/93 BH Added VCB flags for use with manually ejectable volumes:
; vcbManEjBit and vcbFlushCritBit.
; <15> 8/14/91 JL changed lower case equ to EQU to match database output.
; <14> 1/30/91 gbm sab, #38: Change the already including this file variable to
; all uppercase (for security reasons)
; <13> 1/25/91 stb JDR: add constants missing in this file
; <12> 12/5/90 dnf Change <11> was with dba.
; <11> 12/5/90 dnf Add bHasBlankAccessPrivileges bit and volume meta buffer equates
; for GetVolParms.
; <10> 11/27/90 PWD Added equates for VolumeMount and its close relatives.
; <9> 11/27/90 PWD Add VolumeMount equates
; <8> 6/14/90 PK adding vcbAtBB, for sparing
; <5> 3/16/90 dnf Add FSSpec
; <4> 3/11/90 ngk Added more GetVolParms bits
; <2> 2/4/90 DNF Added fsSBNegate
; <1.3> 12/8/89 dnf Rolled in bit position equates for ioSpecBits in CatSearch
; <1.2> 8/2/89 CCH Added HVolumeParam record variant.
; <1.1> 2/6/89 CCH Added HParamBlock record.
; <1.0> 11/9/88 CCH Adding to EASE.
;
;--------------------------------------------------------------------
IF &TYPE('__INCLUDINGFSEQU__') = 'UNDEFINED' THEN
__INCLUDINGFSEQU__ SET 1
SigWord EQU $D2D7 ; signature bytes (MFS volume)
TSigWord EQU $4244 ; signature bytes (HFS volume)
HFSBit EQU 9 ; defines HFS bit in trap word
;_______________________________________________________________________
; fixed location labels: (equivalent of zero page)
FSFCBLen EQU $3F6 ; HFS present flag / FCB size (-1 in old ROM)
WDRfnMin EQU -32767 ; Lowest assigned WD RefNum
WDRfnMax EQU -4096 ; largest possible WDrefnum
HFSTagData EQU $38A ; Room for additional HFS tag data
FCBSPtr EQU $34E ; ptr to FCBs
DefVCBPtr EQU $352 ; pointer to default VCB
VCBQHdr EQU $356 ; VCB queue header
FSQHdr EQU $360 ; file system queue header (10 bytes)
FSBusy EQU $360 ; non-zero when the file system is busy
FSQHead EQU $362 ; ptr to 1st queued cmd: 0 when queue empty
FSQTail EQU $366 ; ptr to last queue element
;bit positions for ioSpecBits values for CatSearch <dnf 1.3>
fsSBPartialName EQU 0 ; ioFileName points to a substring
fsSBFullName EQU 1 ; ioFileName points to a match string
fsSBFlAttrib EQU 2 ; search includes file attributes
fsSBFlFndrInfo EQU 3 ; search includes finder info
fsSBFlLgLen EQU 5 ; search includes data logical length
fsSBFlPyLen EQU 6 ; search includes data physical length
fsSBFlRLgLen EQU 7 ; search includes resource logical length
fsSBFlRPyLen EQU 8 ; search includes resource physical length
fsSBFlCrDat EQU 9 ; search includes create date
fsSBFlMdDat EQU 10 ; search includes modification date
fsSBFlBkDat EQU 11 ; search includes backup date
fsSBFlXFndrInfo EQU 12 ; search includes extended finder info
fsSBFlParID EQU 13 ; search includes file's parent ID
fsSBNegate EQU 14 ; return all non-matches
fsSBDrUsrWds EQU fsSBFlFndrInfo ; search includes directory finder info
fsSBDrNmFls EQU 4 ; search includes directory valence
fsSBDrCrDat EQU fsSBFlCrDat ; directory-named version of fsSBFlCrDat
fsSBDrMdDat EQU fsSBFlMdDat ; directory-named version of fsSBFlMdDat
fsSBDrBkDat EQU fsSBFlBkDat ; directory-named version of fsSBFlBkDat
fsSBDrFndrInfo EQU fsSBFlXFndrInfo ; directory-named version of fsSBFlXFndrInfo
fsSBDrParID EQU fsSBFlParID ; directory-named version of fsSBFlParID
;layout of the GetVolParms buffer and vMAttrib bit values <dnf 1.3>
vMVersion EQU 0
vMAttrib EQU 2
vMLocalHand EQU 6
vMServerAdr EQU 10
vMVolumeGrade EQU 14
vMForeignPrivID EQU 18
bLimitFCBs EQU 31
bLocalWList EQU 30
bNoMiniFndr EQU 29
bNoVNEdit EQU 28
bNoLclSync EQU 27
bTrshOffLine EQU 26
bNoSwitchTo EQU 25
bNoDeskItems EQU 20
bNoBootBlks EQU 19
bAccessCntl EQU 18
bNoSysDir EQU 17
bHasExtFSVol EQU 16
bHasOpenDeny EQU 15
bHasCopyFile EQU 14
bHasMoveRename EQU 13
bHasDesktopMgr EQU 12
bHasShortName EQU 11
bHasFolderLock EQU 10
bHasPersonalAccessPrivileges EQU 9
bHasUserGroupList EQU 8
bHasCatSearch EQU 7
bHasFileIDs EQU 6
bHasBtreeMgr EQU 5
bHasBlankAccessPrivileges EQU 4
; Foreign Privilege Model Identifiers
fsUnixPriv EQU 1
; Authentication Constants
kNoUserAuthentication EQU 1
kPassword EQU 2
kEncryptPassword EQU 3
kTwoWayEncryptPassword EQU 6
; Version Release Stage Codes
developStage EQU $20
alphaStage EQU $40
betaStage EQU $60
finalStage EQU $80
; FSSpec record
FSSpec RECORD 0, INCREMENT
vRefNum ds.w 1
parID ds.l 1
name ds.b 64
size EQU *-FSSpec
ENDR
;;;
;;; HParamBlockRec Record Common
;;;
HParamBlockRec RECORD 0
qLink DS.L 1
qType DS.W 1
ioTrap DS.W 1
ioCmdAddr DS.L 1
ioCompletion DS.L 1
ioResult DS.W 1
ioNamePtr DS.L 1
ioVRefNum DS.W 1
ENDR
;;;
;;; HParamBlockRec.fileParam Record
;;;
HFileParam RECORD 24
ioFRefNum DS.W 1
ioFVersNum DS.B 1
filler1 DS.B 1
ioFDirIndex DS.W 1
ioFlAttrib DS.B 1
ioFlVersNum DS.B 1
ioFlFndrInfo DS.L 4
ioDirID DS.L 1
ioFlStBlk DS.W 1
ioFlLgLen DS.L 1
ioFlPyLen DS.L 1
ioFlRStBlk DS.W 1
ioFlRLgLen DS.L 1
ioFlRPyLen DS.L 1
ioFlCrDat DS.L 1
ioFlMdDat DS.L 1
HFileParamSize EQU *
ENDR
;;;
;;; HParamBlockRec.volumeParam Record
;;;
HVolumeParam RECORD 24
filler2 DS.L 1
ioVolIndex DS.W 1
ioVCrDate DS.L 1
ioVLsMod DS.L 1
ioVAtrb DS.W 1
ioVNmFls DS.W 1
ioVBitMap DS.W 1
ioAllocPtr DS.W 1
ioVNmAlBlks DS.W 1
ioVAlBlkSiz DS.L 1
ioVClpSiz DS.L 1
ioAlBlSt DS.W 1
ioVNxtCNID DS.L 1
ioVFrBlk DS.W 1
ioVSigWord DS.W 1
ioVDrvInfo DS.W 1
ioVDRefNum DS.W 1
ioVFSID DS.W 1
ioVBkUp DS.L 1
ioVSeqNum DS.W 1
ioVWrCnt DS.L 1
ioVFilCnt DS.L 1
ioVDirCnt DS.L 1
ioVFndrInfo DS.L 8
HVolumeParamSize EQU *
ENDR
;
; The VolumeMount trap equates
;
; The ioBuffer field should point to a structure that looks like the
; record AFPVolMountBlock, below. Note that the header is actually a series
; of offsets into a block that is different for each extfs.
;
; First you make a _GetVolMountInfoSize call on an existing volume, then allocate
; a buffer of the size that it requests, the _GetVolMountInfo, then later
; you pass the buffer modified by _GetVolMountInfo back and it mounts the volume.
;
AFPVolMountInfo RECORD 0, INCREMENT
length ds.w 1
media ds.l 1
flags ds.w 1
nbpInterval ds.b 1
nbpCount ds.b 1
uamType ds.w 1
ZoneOffset ds.w 1
serverNameOffset ds.w 1
volNameOffset ds.w 1
UserNameOffset ds.w 1
UserPaswdOffset ds.w 1
VolPaswdOffset ds.w 1
size EQU *-AFPVolMountInfo
ENDR
AFPVolMountBlock RECORD 0, INCREMENT
header ds.b AFPVolMountInfo.size
zoneName ds.b 33
serverName ds.b 32
volName ds.b 28
userName ds.b 32
userPassword ds.b 9
volPassword ds.b 9
size EQU *-AFPVolMountBlock
ENDR
;
; Volume Control Block equates: (prefix: VCB)
;
vcbFlags EQU 6 ; flags word is first word after header
vcbManEjBit EQU 0 ; manual-eject bit: set if volume is in a manual-eject drive <SM1 BH 03Aug93>
vcbFlushCritBit EQU 1 ; critical info bit: set if critical MDB information needs to <SM1 BH 03Aug93>
; be written (for manual-eject drives)
vcbDirty EQU 15 ; flags dirty bit (tst.w tests,clr.b clears)
; first 64/104 bytes of VCB come directly from the directory master block
vcbDInfoSt EQU 8 ; leave room for 6-byte queue header
vcbDILen EQU 64 ; len of VCB data from master directory (from old FSEQU)
vcbSigWord EQU 8 ; signature word
vcbCrDate EQU 10 ; Creation date.
vcbLsBkUp EQU 14 ; last backup date
vcbLsMod EQU 14 ; alternate name for above
vcbAtrb EQU 18 ; volume attributes. bit 15 = vol lock (1=locked)
; bit 7 = wr protect
; bit 6 = busy (1=busy)
; bit 5 = volume consistent if set
; (set for default on GetVolInfo)
; bits 0-4 = consistency prob
; 0: max CNID > VCBNxtCNID
; 1: file count error
; 2: file length error
; 3: catalog B*-tree loop
; 4: extent B*-tree loop
vcbAtVOK EQU 8 ; attrib consistent volume flag (set on clean _Unmount)
; (bit 8 in word, bit 0 in top byte)
vcbAtBB EQU 9 ; bad blocks have been spared in this volume (bit 1 of top byte)
vcbWrProt EQU 7 ; attrib write-protected bit (tst.b ATRB+1 tests)
vcbNmFls EQU 20 ; number files in MFS dir
; number files in HFS root dir
vcbDirSt EQU 22 ; start dir (512-byte) block on diskette (MFS)
vcbVBMSt EQU 22 ; same as VCBDirSt, starting block of allocation map (HFS) (overlaps)
vcbBlLn EQU 24 ; length of dir in (512-byte) blocks (MFS)
vcbAllocPtr EQU 24 ; same as VCBBlLn, Starting block for new file allocations
vcbNmBlks EQU 26 ; number of blocks (of alloc size) this device
vcbNmAlBlks EQU 26 ; (alternate label for a while)
vcbAlBlkSiz EQU 28 ; num of bytes in an allocation block
vcbClpSiz EQU 32 ; num of bytes to try to alloc as a clump
vcbAlBlSt EQU 36 ; starting diskette (512-byte) block in block map
vcbNxtCNID EQU 38 ; next free CNode identifier (HFS)
vcbNxtFNum EQU 38 ; next free file number (MFS)
vcbFreeBks EQU 42 ; number of free blocks on this volume
vcbVN EQU 44 ; volume name (including name length byte)
vcbMaxNam EQU 27 ; 27 byte max name length
IOVDirLen EQU vcbVN-vcbCrDate ; Length of info to copy by GetVolInfo
;
; next 6 fields should be kept together
;
vcbDrvNum EQU 72 ; drive number for this VCB
vcbDRefNum EQU 74 ; driver refnum for this VCB
vcbFSID EQU 76 ; ID of file system handling this volume
vcbVRefNum EQU 78 ; unique refnum for this VCB
vcbMAdr EQU 80 ; volume map address (FS volume)
vcbBufAdr EQU 84 ; volume buffer address
vcbMLen EQU 88 ; length of volume map (FS volume)
vcbDirIndex EQU 90 ; directory index, block number used for
vcbDirBlk EQU 92 ; GetFileInfo searches by index
MFSVCBLen EQU 94 ; Length of MFS VCB
;
; Volume Control Block (VCB) extensions for HFS copied from Volume Info Block:
;
vcbTDInfoSt EQU 94 ; Start of additional HFS info:
vcbVolBkUp EQU 94 ; Date volume was last backed up
vcbVSeqNum EQU 98 ; Index of volume in backup set
vcbWrCnt EQU 100 ; Volume write count
vcbXTClpSiz EQU 104 ; Extent B*-Tree clump size
vcbCTClpSiz EQU 108 ; Catalog B*-Tree clump size
vcbNmRtDirs EQU 112 ; Number of directories in root
vcbFilCnt EQU 114 ; Total number of files in volume
vcbDirCnt EQU 118 ; Total number of directories in volume
vcbFndrInfo EQU 122 ; Finder info for volume
vcbVCSize EQU 154 ; Volume cache size in blocks
vcbVBMCSiz EQU 156 ; Bitmap cache size in blocks
vcbCtlCSiz EQU 158 ; Extent and Catalog B*-Tree cache size (blocks)
;
; additional VCB information NOT copied from the MDB:
;
vcbXTAlBks EQU 160 ; Size of extent B*-Tree in allocation blocks
vcbCTAlBks EQU 162 ; Size of catalog B*-Tree in allocation blocks
vcbXTRef EQU 164 ; File RefNum for Extent B*-Tree
vcbCTRef EQU 166 ; File RefNum for Catalog B*-Tree
vcbCtlBuf EQU 168 ; Pointer to extent desc. and catalog caches
vcbDirIDM EQU 172 ; Directory last searched: 0 if invalid.
vcbOffsM EQU 176 ; Offspring index at last search
vcbLength EQU 178 ; VCB byte length
; File Control Block equates: (prefix: FCB)
fcbModBit EQU 7 ; dirty bit for FCB entry in FCBMdRByt
fcbOwnClp EQU 6 ; Clump-size specified flag (for truncate on close)
fcbFilLck EQU 5 ; 1 if file is locked [write-protected]
fcbShrWrt EQU 4 ; 1 if file is open for shared write access
fcbWrtLck EQU 2 ; 1 if fork is reserved for write (byte range lock)
fcbRscBit EQU 1 ; 1 if this is resource part (in FCBMdRByt)
fcbWrtBit EQU 0 ; write permissions bit in FCBTypByt (1 if ok)
fcbFlgMBit EQU 15 ; dirty bit in FCBFlags (word)
fcbFlgCBit EQU 14 ; clump-size spec'd bit in FCBFlags (word)
fcbFlgPBit EQU 13 ; Write-protected [file lock] bit in FCBFlags (word)
fcbFlgSBit EQU 12 ; Shared-write bit in FCBFlags (word)
fcbFlgLBit EQU 10 ; Byte range locked bit in FCBFlags (word)
fcbFlgRBit EQU 9 ; resource bit in FCBFlags (word)
fcbFlgWBit EQU 8 ; write permissions bit in FCBFlags (word)
WrRsMask EQU $0300 ; rsrc/reg, write permissions mask
PermMask EQU $1300 ; all bits related to access arbitration
fcbFlNm EQU 0 ; FCB file number. Non-zero marks FCB used.
fcbFlags EQU 4 ; FCB flags
fcbMdRByt EQU 4 ; mod, write permissions, resource byte
fcbTypByt EQU 5 ; type byte
fcbSBlk EQU 6 ; File start block (in alloc size blks)
fcbEOF EQU 8 ; logical length or EOF in bytes
fcbPLen EQU 12 ; Physical file length in bytes
fcbCrPs EQU 16 ; current position within file.
ioFIStILen EQU 20 ; Length to straight copy from FCB on _GetFCBInfo
fcbVPtr EQU 20 ; Absolute pointer to the corresponding VCB
fcbBfAdr EQU 24 ; file's buffer address.
fcbFlPos EQU 28 ; directory block this file is in
MFSFCBLen EQU 30 ; Length of MFS FCB structure
;
; FCB Extensions for HFS:
;
fcbClmpSize EQU 30 ; Number of bytes per clump
fcbBTCBPtr EQU 34 ; pointer to B*-Tree control block for this file
fcbExtRec EQU 38 ; First 3 file extents
fcbFType EQU 50 ; file's 4 Finder Type bytes
fcbCatPos EQU 54 ; Catalog hint for use on Close
fcbDirID EQU 58 ; Parent Directory ID
fcbCName EQU 62 ; CName of open file
fcbEntLen EQU 94 ; Length of each element in the FCB array
;_______________________________________________________________________
;
; Directory master block entries: (Prefix Dr)
;
drSigWord EQU 0 ; signature word
drCrDate EQU 2 ; Creation date.
drLsMod EQU 6 ; last backup date
drAtrb EQU 10 ; volume attributes. bit 15=write(locked=1)
drNmFls EQU 12 ; number files in directory
drDirSt EQU 14 ; start dir (512-byte) block on diskette
drVBMSt EQU 14 ; starting sector of allocation map (overlaps)
drBlLn EQU 16 ; length of dir in (512-byte) blocks
drAllocPtr EQU 16 ; Start of next allocation search
drNmAlBlks EQU 18 ; number of blocks (of alloc size) this volume
drAlBlkSiz EQU 20 ; min num of bytes to allocate (must be 512 mult)
drClpSiz EQU 24 ; num of bytes to try to alloc as a clump
drAlBlSt EQU 28 ; starting diskette (512-byte) block in block map
drNxtCNID EQU 30 ; Next CNode identifier
drNxtFNum EQU 30 ; next free file number
drFreeBks EQU 34 ; number of free blocks on this volume
drVN EQU 36 ; volume name (including name length)
MpTblStr EQU 64 ; byte start position of map table within
; master dir block (MFS volume)
;
; Master Directory Block extensions for HFS:
;
drTInfoSt EQU 64
drVolBkup EQU 64 ; Date of last volume backup (overlaps)
drVSeqNum EQU 68 ; Sequence number of volume within backup set
drWrCnt EQU 70 ; Volume write count
drXTClpSiz EQU 74 ; Extent B*-Tree clump size
drCTClpSiz EQU 78 ; Catalog B*-Tree clump size
drNmRtDirs EQU 82 ; Number of subdirectories in the root
drFilCnt EQU 84 ; Total number of files in volume
drDirCnt EQU 88 ; Total number of directories in volume
drFndrInfo EQU 92 ; Finder info for volume
drVCSize EQU 124 ; Volume cache size
drVBMCSize EQU 126 ; Volume Bitmap cache size
drCtlCSize EQU 128 ; Size of common volume cache
;
; length of additional VCB data from master directory block for HFS volumes:
;
vcbTDILen EQU 130-drTInfoSt
;
; Information not copied into VCB:
;
drXTFlSize EQU 130 ; Length of extent B*-Tree (LEOF and PEOF)
drXTExtRec EQU 134 ; First (and only) extent-tree extent record
drCTFlSize EQU 146 ; Length of catalog B*-Tree (LEOF and PEOF)
drCTExtRec EQU 150 ; First catalog extent record
LenMDB EQU 162 ; length of full MDB
drUsrInfo EQU 256 ; User information for volume
;_______________________________________________________________________
;
; File Entry equates: (prefix: Fl)
; (delete indication may be needed; for now just check VCB del fnum . . .)
flWrtFlag EQU 0 ; write-allowed bit in flags byte (0 if allowed)
flTypMask EQU $FE ; (user file-type in bits 1-7)
flFlags EQU 0 ; bit 7=1 (used), bit 0=file lock flag
flTyp EQU 1 ; file type (used as a name extension)
flUsrWds EQU 2 ; user words for file. (16 bytes)
flFlNum EQU 18 ; file number
flStBlk EQU 22 ; Start file block (alloc blk size)(0000 if none)
flLgLen EQU 24 ; File logical length in bytes (EOF)
flPyLen EQU 28 ; File physical length in bytes
flRStBlk EQU 32 ; Start file block, resource fork (0000 if none)
flRLgLen EQU 34 ; File logical length (EOF), resource fork
flRPyLen EQU 38 ; File physical length, resource fork
flCrDat EQU 42 ; File creation date & time (32 bits in seconds)
flMdDat EQU 46 ; last modification date & time (32 bits in seconds)
flNam EQU 50 ; file name, starting with length byte
flNTLen EQU 50 ; length of each file entry, excluding name
;_______________________________________________________________________
;
; Working Directory Control Block equates: (prefix: WD)
;
WDVCBPtr EQU 0 ; pointer to VCB of residing WD (longint)
WDDirID EQU 4 ; WD directory Identification (longint)
WDCatHint EQU 8 ; Catalog node hint
WDProcID EQU 12 ; process that created WD
WDCBLen EQU 16 ; Length of a WDCB
;_______________________________________________________________________
;
; Poor Man's Search Path equates: (prefix: SP)
;
PMSPHook EQU -6 ; Hook for PMSP modification
PMSPIndx EQU -2 ; Index to PMSP index from start of PMSP
SPHdrSize EQU 6 ; Size of negative-offset header
SPVRefNum EQU 0 ; Offset to VRefNum in PMSP entry
SPDirID EQU 2 ; Offset to Directory ID in PMSP entry
SPEntLen EQU 6 ; Length of a PMSP entry
MaxDVCnt EQU 8 ; Leave room for 8 default VRefNums
PMSPSize EQU MaxDVCnt*SPEntLen+SPHdrSize+2
; Size of PMSP table +header + index word
; 31744 = $7C00, a nice round number close to
; (32767*1000)/1024, which is about the largest
; free space unsuspecting, decimal-K minded apps
; might be expected to handle.
AlBlkLim EQU 31744
ENDIF ; ...already included