/*static char *SCCSID = "@(#)pr_fsys.h	6.1 90/11/18";*/
/*static char *SCCSID = "@(#)pr_fsys.h    13.3 90/01/26";*/
extern   BUFNODE * _adr_to_bhdr( DIRBLK *);
#ifdef	 DEBUG
extern  void             _chkheld( BUFNODE *);
extern	void		 trap (void);
#else
#define _chkheld(x)
#define trap(x)
#endif

extern  void             findpnode ( DIRBLK *, long,  DIRENT **,  DIRENT **);

extern  long             _namecmp ( DIRENT *,  DIRENT *);
extern	void		 _setbit (long, long);

/*	Hard Error Macros */

#ifdef	DEBUG
			/* use (val,trap) if not tested,,
			       (val,notrap) after testing */
  #define ERRRET(val,tflag)	  if (val==0) {tflag(); return(1);}
  #define ERRGOTO(val,lab,tflag)  if (val==0) {tflag(); goto lab;}
#else
  #define ERRRET(val,tflag)	  if (val==0) return(1);
  #define ERRGOTO(val,lab,tflag)  if (val==0) goto lab;
#endif


int  join ( DIRBLK *topblk,
                   BUFNODE *topbufp,
                   DIRBLK *botblk,
                   BUFNODE *botbufp,
                   DIRBLK  *nodeblk,
                   BUFNODE *nodebufp,
                   DIRENT *nodeent);
int  balance ( DIRBLK *topblk,
                      BUFNODE *topbufp,
                      DIRBLK *botblk,
                      BUFNODE *botbufp,
                      DIRBLK  *nodeblk,
                      BUFNODE *nodebufp,
                      DIRENT *nodeent);
void FixUp ( DIRENT *dirptr,
		   unsigned long newsec,
		   int cnt);

int  adjust (long sector);

int  insert ( DIRBLK *blkptr,
                     BUFNODE *blkbufp,
                     DIRENT *newrec,
		    long newdp);

void DumpHeap (unsigned char *);
