/*	workfile managenent definitions			*/
/*							*/
/*	Please note that the file SYSDEF.H must be	*/
/*	included prior to this file in order to provide	*/
/*	system type definitions.			*/

#define	er_blun		-4

#define	st_normal_mode	1
#define	st_ifl		2
#define	st_insert	3
#define	st_update	4
#define	st_special	5
#define	ST_NORMAL_MODE	1
#define	ST_IFL		2
#define	ST_INSERT	3
#define	ST_UPDATE	4
#define	ST_SPECIAL	5
#define ST_DELETING	6

#define	true		1
#define	false		0
#define	then

#define _tmpsize	512

#if VAXVMS
#define	_bck_fil	18
#define	_BCK_FIL	18
#define	_MAXLEN		170
#define	_maxlen		170
#else
#define	_bck_fil	13
#define	_BCK_FIL	13
#define	_MAXLEN		140
#define	_maxlen		140
#endif

#define	_bck_size	_tmpsize - ( _bck_fil*sizeof(int))

#define	kb_lun		0
#define	in_lun		1
#define	out_lun		2
#define	ind_lun		3
#define tmp1_lun	4
#define	tmp2_lun	4

#if	VAXVMS
typedef short int indextype ;
typedef long  int indexlink ;
#else
typedef int indextype ;
typedef int indexlink ;
#endif


  struct
	tempblock
		{ int	rsize[_bck_fil] ;
		  char	txt[_bck_size]  ;
		} ;

  struct
	stats
		{ int	writes ;
		  int	reads  ;
		  int	r_faults ;
		  int	w_faults ;
		  int	hits ;
		} ;

  struct
	 deletline
		{
		  int len ;
		  char c[_maxlen+2] ;
		  int partial ;
		} ;

  struct
	 textline
		{ int	len ;
		  char	c[_maxlen+2] ;
		} ;

  struct
	tempindex
		{ indexlink	link ;
		  indextype	lcount ;
#if CHARCOUNT
		  indextype	chcount ;
#endif
		} ;

  struct
	textwindow
		{ int	botlin ;
		  int	toplin ;
		  struct textline lines[_bck_fil] ;
		} ;

  struct
	deltype {
		  struct deletline lastline ;
		  struct textline lastword ;
		  char	 lastc ;
		} ;
