/*	TERM.H		Header file for TERMx.C files 

	14 Feb 1988	A.Herrmann
*/

#define TRUE	1
#define FALSE	0

/* Terminal window */
#define TERWDW	0		/* window number	*/
#define	TELMIN	0		/* min line number	*/
#define TELMAX	23		/* max line number	*/
#define	TECMIN	0		/* max column number	*/
#define TECMAX	79		/* max column number	*/
#define	TEHLIN	0		/* home line number	*/
#define	TEHCOL	0		/* home column number	*/
#define TABPOS	8		/* tab interval		*/

/* Status window */
#define STAWDW	2		/* ditto		*/
#define	STLMIN	24
#define	STLMAX	24
#define	STCMIN	0
#define	STCMAX	79
#define	STHLIN	0
#define	STHCOL	0

/* Communication items (must correspond to position in struct items) */
#define MAXITEM	15	/* max number of items	*/
#define	MAXALT	5	/* dito of alternatives	*/
#define	XOITEM	0	/* Xon/Xoff		*/
#define	IFITEM	1	/* Input file 		*/
#define	OFITEM	2	/* Output file 		*/
#define	FOITEM	3	/* File format 		*/
#define	LFITEM	4	/* LF after CR		*/
#define	ECITEM	5	/* Echo mode		*/
#define CCITEM  6	/* Control char 	*/
#define VTITEM	7	/* VT100 emulation 	*/
#define	CSITEM	8	/* Character set	*/
#define	PTITEM	9	/* Printer log		*/
#define	PRITEM	10	/* Protocol		*/
#define	BDITEM	11	/* Baud rate		*/
#define	BCITEM	12	/* Bits per char	*/
#define	STITEM	13	/* Stop bits		*/
#define	PAITEM	14	/* Parity		*/
#define	STLINE	-1	/* entire status line	*/
typedef	void (*ALTFCT)();	/* function to select alternatives	*/

/* Input and output control chars */
#define _BS	0x08
#define _TAB	0x09
#define _LF	0x0A
#define _FF	0x0C
#define _CR	0x0D
#define	_ESC	0x1B
#define	_BLANK	0x20
#define	_DEL	0x7F
#define _XON	0x11	/* Ctrl/Q */
#define _XOFF	0x13	/* Ctrl/S */
#define ABORT	0x03	/* Ctrl/C */
#define SWITCH	0x1E	/* Ctrl/^ */

/* Other codes */
#define QUIT        0
#define PRV        -1
#define NXT         1

/* File format codes */
#define	ASCII	0
#define	BINARY	1

/* Protocol modes */
#define NOP	0
#define RTS	1
#define DTR	2
#define XONOFF	3

/* Character Masks */
#define C5MASK	0x1F
#define C6MASK	0x3F
#define C7MASK	0x7F
#define C8MASK	0xFF

/* PIO port addresses */
#define PIOBC	0x03
#define PIOBD	0x01

/* PIO output code */
#define PIOOUT	0x0F

/* SIO port addresses */
#define A_DATA	0x04
#define A_CONT	0x06
#define	B_DATA	0x05
#define	B_CONT	0x07

/* Number of SIO registers */
#define	SIOREGS	8

/* SIO Read Register 0 masks */
#define	CAVAIL	0x01		/* Receive char available	*/
#define INTPEN	0x02		/* Interrupt pending		*/
#define TEMPTY	0x04		/* Transmit buffer empty	*/

