/*static char *SCCSID = "@(#)pr_cache.h	6.3 92/01/31";*/
#include "PR_CACHE.NAM"
/* Prototypes for all CACHE\ functions */

	extern void BufWrit (PBUFNODE pbufToWrite, PFRAME pfrm);

	extern void far BufWritFar (PBUFNODE pbufToWrite, PFRAME pfrm);

	extern PBUFNODE CCH (LSN lsn, PFRAME pfrm);

	extern USHORT far ChkError (PSECTOR psec, USHORT cb,
				    PBUFNODE pbuf, PFRAME pfrm);

	extern void FLW (PFRAME pfrm);

	extern PBUFNODE GFB (PFRAME pfrm);

	extern void GFBWait (PFRAME pfrm);

	extern void far GFBWaitFar (PFRAME pfrm);

	extern PBUFNODE HashFind (LSN lsn);

	extern PVOID InitLzRd (LSN lsnDesired,
			PBUFNODE far *ppBuf,
			PFRAME pfrm);

	extern void IRA (PFHT pfht,
			PBUFNODE pbuf,
			USHORT cusToRead,
			LSN lsnSeek);

	extern UINT LazyRead (PBUFNODE pbuf, PFRAME pfrm);

	extern VOID far LSDBMError (PBUFNODE pbuf, PFRAME pfrm);

	extern PVOID LSDDB (PSECPTR pscpDesired,
			    USHORT priBuf,
			    PBUFNODE far *ppbuf,
			    PFRAME    pfrm);

	extern PVOID LSD (PSECPTR pscpDesired,
			USHORT priBuf,
			PBUFNODE  far *ppbuf,
			PFRAME	  pfrm);

	extern void far MarkBadDisk (PFRAME pfrm);

	extern VOID far RetBuf (PBUFNODE pbuf);

	extern PVOID RdBufOrGetInBuf (LSN lsn,
			USHORT cusSec,
			USHORT priBuf,
			PBUFNODE  far *ppbuf,
			BOOL fOmitRead,
			POFT  poft,
			ULONG ulSeekPtr,
			PFRAME pfrm);

	extern void SelFlush (USHORT flMask , PFRAME pfrm);

	extern void PlaceBuf (PBUFNODE pbuf,
			      USHORT priBuf);


	extern void AddHash (PBUFNODE pbuf);

	extern void SetDirt (PVOID fpbChanged,
			PBUFNODE fpbufDirtyBuf,
			BOOL fWrtThru,
			PFRAME pfrm);

	extern void SetDEDirt (PDIRENT pde,
			PBUFNODE pbuf,
			BOOL fWrtThru,
			PFRAME pfrm);

	extern void SetDBDirt (PBUFNODE pbuf,
			BOOL fWrtThru,
			PFRAME pfrm);

	extern void AddLW (PBUFNODE fpbuf, PFRAME pfrm);

	extern void UpdateSB (void);

	extern USHORT VSV (PSECPTR pscp,
			 PSECTOR far *ppsec,
			 PBUFNODE far *ppbuf);

	extern USHORT WBU (PBUFNODE pbuf, PFRAME pfrm);

	extern VOID HotFix (LSN lsn, PFRAME pfrm);

	extern PVOID far RdHF (LSN vlsn, PFRAME pfrm);

	extern VOID far WtHF (LSN vlsn, PFRAME pfrm);

/* put HotFix functions in second code segment */


#include "PR_CACHE.SEG"

/*
 * Macros using functions whose prototypes are given in the same file
 * and that may have far wrappers must be defined after xxx.SEG inclusion.
 */


#define RdBuf(lsn, priBuf, ppbuf, pfrm)					  \
	      RdBufOrGetInBuf(lsn, 1, priBuf, ppbuf, FALSE,		  \
			      NULL, NULL, pfrm)


#define WriRdBuf(lsn, priBuf, ppbuf, poft, ulSeekPtr, pfrm)		  \
		 RdBufOrGetInBuf(lsn, 1, priBuf, ppbuf, FALSE,		  \
				 poft, ulSeekPtr, pfrm)


#define GetInBuf(lsn, cusSec, priBuf, ppbuf, pfrm)			  \
		RdBufOrGetInBuf(lsn, cusSec, priBuf, ppbuf, TRUE,	  \
				NULL, NULL, pfrm)

#define WriGetInBuf(lsn, cusSec, priBuf, ppbuf, poft, ulSeekPtr, pfrm)	  \
		    RdBufOrGetInBuf(lsn, cusSec, priBuf, ppbuf, TRUE,	  \
				    poft, ulSeekPtr, pfrm)


#define LSDBM_FLAG		0x8000
#define LSDBM(pscp,us,ppbuf,pfrm)    LSD(pscp,((us)|LSDBM_FLAG),ppbuf,pfrm)
