;       SCCSID = @(#)fatea.inc	6.1 90/11/17
;	SCCSID = @(#)fatea.inc 0.00 5/23/89
; Include file for FAT EA support.
;
; open mode for EA file
; When we open the EA file, we need to use EAORmode because the EA file is
; mark read only. After it's opened, we change the open mode to EARWmode so
; we can write to the file using DOS_Write.

_EAOmode = sharing_deny_both or open_autofail
_EAOmode = _EAOmode or open_write_through or locality_random

EAORmode = _EAOmode or open_for_read	 ; read only mode
EAORWmode = _EAOmode or open_for_both	 ; read/write mode

; file attribute used for creating the EA file

EAAttr = attr_system or attr_hidden or attr_read_only

EABlockIDHigh	equ	8989h
EABlockIDLow	equ	9898h

EA_READ 	equ	0h		; read type operation
EA_WRITE	equ	1h		; write type operation

EA_INVALID	equ	0ffffh		; the EA handle is invalid

EA_DSIGNATURE	equ	'AE'		; EAData signature
EA_FSIGNATURE	equ	'DE'		; EA file signature
EA_LOGTYPE	equ	0h		; format of log data
EA_JFNFLG	equ	0h		; flags for writes to EA file
EA_HTOBASE	equ	7h		; right shift to get Base offset from
EA_BLOCKCOUNT	equ	128		; number of handles per Base entry
EA_BLOCKSIZE	equ	256		; bytes of handles per Base entry
EA_BLKOFFMASK	equ	0ff00h		; mask to round offset down to base ent.
EA_BLKHMASK	equ	0ff80h		; mask to round handle down to base ent.
EA_BASEENTRIES	equ	240		; number of base table entries
EA_BASESIZE	equ	EA_BASEENTRIES * 2  ; number of bytes in the base table

; BUGBUG is EA_LASTBASE correct?
EA_LASTBASE	equ	510		; byte offset of last base table entry

MAXEAHANDLE	equ	(EA_BASEENTRIES * 128) - 1 ; largest possible EA handle

; EA file header

EAFileHeader	struc

eaf_signature	dw	EA_FSIGNATURE	; EA file signature word
eaf_formattype	dw	0		; format type for EA file only 0 defined
eaf_logtype	dw	0		; format of log information
eaf_logdata	dw	8 dup (?)	; log data
eaf_reserved	db	10 dup (0)	; reserved bytes
eaf_basetable	dw	240 dup (?)	; EABaseTable

EAFileHeader	ends

; EA data header

EADataHeader	struc

ead_signature	dw	?		; EA signature word
ead_owneahand	dw	?		; EA handle that references this EAData
ead_needeacnt	dd	?		; number of NEED attributes in FEAlist
ead_filename	db	14 dup (?)	; asciiz filename of owner file
ead_reserved	dd	?		; reserved dword

EADataHeader	ends

EA_CBLISTOFF	equ	size EADataHeader

LogStruc	struc

ls_logtype	dw	0		; format of the log data
ls_cluster1	dw	?		; first fat cluster to change
ls_clusval1	dw	?		; value for the first fat cluster
ls_cluster2	dw	?		; first fat cluster to change
ls_clusval2	dw	?		; value for the first fat cluster
ls_cluster3	dw	?		; first fat cluster to change
ls_clusval3	dw	?		; value for the first fat cluster
ls_handle	dw	?		; first handle to change
ls_handval	dw	?		; value first handle should have

LogStruc	ends
