;
; EXPORT DATE: 9/11
;Equates for FASTOPEN.

;FASTOPEN NAME CACHING Subfunctions
FONC_Look_up	equ	1
FONC_insert	equ	2
FONC_delete	equ	3
FONC_update	equ	4
FONC_purge	equ	5		;reserved for the future use.

;FASTOPEN EXTENT  CACHING Subfunctions
FSK_Open       equ     11					       ;AN000;
FSK_Close      equ     12					       ;AN000;
FSK_Delete     equ     13					       ;AN000;
FSK_Lookup     equ     14					       ;AN000;
FSK_Insert     equ     15					       ;AN000;
FSK_Trunc      equ     16					       ;AN000;

HeaderSize     equ    8        ; size of file header (8 bytes)	       ;AN000;
ExtendSize     equ    8        ; size of extend (8 bytes)	       ;AN000;
Num_Of_Pages   equ    1        ; number of pages		       ;AN000;
Num_Of_Segs    equ    2        ; number of frame segments	       ;AN000;
Stayresident  equ    04ch     ; terminate and stay resident function code


;Equates used in DOS.
FastOpen_Set	       equ     00000001B
FastOpen_Reset	       equ     11111110B
Lookup_Success	       equ     00000010B
Lookup_Reset	       equ     11111101B
Special_Fill_Set       equ     00000100B
Special_Fill_Reset     equ     11111011B
No_Lookup	       equ     00001000B
Set_For_Search	       equ     00010000B	     ;DCR 167


;============= FastOpen Data Structures =====================

Fastopen_Entry	STRUC			;Fastopen Entry pointer in DOS
Fastopen_Entry_size	dw	?	;size of the following
Fastopen_Name_Caching	dd	?
;Fastopen_FatChain_Caching dd	  ?	;reserved for future use
Fastopen_Entry	ENDS
;


CMPCT_DIR_INFO	STRUC			;compact version of Dir Info.
CDI_file_name	db	11 dup (?)
CDI_file_attr	db	?
CDI_codepage	dw	?
CDI_extcluster	dw	?
CDI_attr2	db	?
CDI_time	dw	?
CDI_date	dw	?
CDI_cluster	dw	?
CDI_filesize	dd	?
CMPCT_DIR_INFO	ENDS
;

ORIG_DIR_INFO	STRUC
ODI_head	db	17 dup (?)
ODI_skip	db	5  dup (?)	;reserved for DOS. FASTOPEN does not
ODI_tail	db	10 dup (?)	;  use ODI_skip part.
ORIG_DIR_INFO	ENDS
;

ODI_head_leng	equ	17
ODI_skip_leng	equ	5
ODI_tail_leng	equ	10
;

FASTOPEN_EXTENDED_INFO	STRUC
FEI_dirpos	db	?
FEI_dirsec	dd	?
FEI_clusnum	dw	?
FEI_lastent	dw	?		; for search first
FEI_dirstart	dw	?		; for search first
FASTOPEN_EXTENDED_INFO	ENDS
;

NAME_RECORD	STRUC
nLRU_ptr	dw	?
nMRU_ptr	dw	?		;reverse of nLRU_ptr
nChild_ptr	dw	?
nSibling_ptr	dw	?
nBackward_ptr	dw	?		;points to preceding node
Cmpct_Dir_Info_struc_size equ CMPCT_DIR_INFO_struc_size	; NASM port equate
nCmpct_Dir_Info db	Cmpct_Dir_Info_struc_size dup (?)
Fastopen_Extended_Info_struc_size equ FASTOPEN_EXTENDED_INFO_struc_size	; NASM port equate
nExtended_Info	db	Fastopen_Extended_Info_struc_size dup (?)
NAME_RECORD	ENDS
;

DRIVE_CACHE_HEADER	STRUC		;drive cache header
DCH_LRU_ROOT	 dw	 ?		;Header of the LRU chain of this drive
DCH_MRU_ROOT	 dw	 ?		;offset to the last entry of LRU chain
DCH_Child_ptr	 dw	 ?		;the first child in Name cache seg.
DCH_Sibling_ptr  dw	 ?		;points to the next drive cache header
DCH_Drive_letter db	?             ;drive letter
DCH_Num_Entries  dw	 ?		;Number of entries in the Name cache.
DCH_Name_Buff	 dw	 ?		;pointer to name cahe buffer
DRIVE_CACHE_HEADER	ENDS
;





;======== FAST SEEK FUNCTION  DATA  STRUCTURES =======================

DRIVE_HEADER	STRUC		   ; Drive header structure		;AN000;
Drive_Number	     dw     ?	   ; drive number			;AN000;
Extent_Count	     dw     ?	   ; reserved for debugging
MRU_Hdr_Ptr	     dw     ?	   ; pointer to OPEN Queue
Free_ptr	     dw     ?	   ; pointer to FREE buffer		;AN000;
Close_Ptr	     dw     ?	   ; pointer to CLOSE Queue	     ;AN000;
Buff_Size	     dw     ?	   ; cache buffer size including header ;AN000;
Free_Size	     dw     ?	   ; size of Free area in bytes
Next_Drv_Hdr_Ptr     dw     ?	   ; pointer to next drive header
DRIVE_HEADER   ENDS



FILE_HEADER	STRUC		   ; File header structure		;AN000;
FH_Phys_Clus_Num     dw     ?	   ; starting physcial clustnum of file ;AN000;
FH_Refer_Count	     dw     ?	   ; reference count			;AN000;
FH_Next_Extn_Ptr     dw     ?	   ; pointer to first extent of the file;AN000;
FH_Next_Hdr_Ptr      dw     ?	   ; pointer to next file header	;AN000;
FH_MRU_Extn_Ptr      dw     ?	   ; pointer to  MRU extent
		     dw     ?
		     dw     ?
		     dw     ?
FILE_HEADER	ENDS							;AN000;



EXTENT_HEADER	STRUC		   ; extend header structure		;AN000;
EH_Logic_Clus_Num    dw     ?	   ; starting logical clus num of extent;AN000;
EH_Phys_Clus_Num     dw     ?	   ; starting physical clus numof  extnt;AN000;
EH_Count	     dw     ?	   ; range of logical clusnum in the extnt
EH_Next_Extn_Ptr     dw     ?	   ; pointer to next extent		;AN000;
EH_Prev_Extn_Ptr     dw     ?	   ; pointer to previous extent  ;AN000;
EH_Next_LRU_Ptr      dw     ?	   ; pointer to next LRU extent
EH_Prev_LRU_Ptr      dw     ?	   ; pointer tp previous LRU extent
		     dw     ?
EXTENT_HEADER	ENDS



