/* <scrdef.h>
 *
 *	[obsolete] Screen package definitions
 */
#ifndef _SCRDEF_H
#define _SCRDEF_H

/*	request types */
#define SCR$C_PUT_SCREEN	0
#define SCR$C_GET_SCREEN	1
#define SCR$C_ERASE_PAGE	2
#define SCR$C_ERASE_LINE	3
#define SCR$C_SET_CURSOR	4
#define SCR$C_DOWN_SCROLL	5
#define SCR$C_SCREEN_INFO	6
#define SCR$C_PUT_LINE		7
#define SCR$C_MOVE_CURSOR	8
#define SCR$C_SET_SCROLL	9
#define SCR$C_UP_SCROLL		10

/*	bit masks and values for screen attributes */
#define SCR$V_BOLD	0
#define SCR$V_REVERSE	1
#define SCR$V_BLINK	2
#define SCR$V_UNDERLINE 3
#define SCR$M_BOLD	(1<<SCR$V_BOLD)		/* 0x01 */
#define SCR$M_REVERSE	(1<<SCR$V_REVERSE)	/* 0x02 */
#define SCR$M_BLINK	(1<<SCR$V_BLINK)	/* 0x04 */
#define SCR$M_UNDERLINE (1<<SCR$V_UNDERLINE)	/* 0x08 */
#define SCR$M_NORMAL	0x00		/* no bits set */
union scrdef {
    unsigned char scr$b_attr;
    struct {
	unsigned scr$v_bold	: 1;
	unsigned scr$v_reverse	: 1;
	unsigned scr$v_blink	: 1;
	unsigned scr$v_underline: 1;
	unsigned		: 4;
    } scr$r_scrdef_bits;
};

/*	format of SCR$SCREEN_INFO return buffer */
#define SCR$V_SCREEN	0
#define SCR$V_ANSICRT	1
#define SCR$V_REGIS	2
#define SCR$V_BLOCK	3
#define SCR$V_AVO	4
#define SCR$V_EDIT	5
#define SCR$V_DECCRT	6
#define SCR$M_SCREEN	(1<<SCR$V_SCREEN)	/* 0x01 */
#define SCR$M_ANSICRT	(1<<SCR$V_ANSICRT)	/* 0x02 */
#define SCR$M_REGIS	(1<<SCR$V_REGIS)	/* 0x04 */
#define SCR$M_BLOCK	(1<<SCR$V_BLOCK)	/* 0x08 */
#define SCR$M_AVO	(1<<SCR$V_AVO)		/* 0x10 */
#define SCR$M_EDIT	(1<<SCR$V_EDIT)		/* 0x20 */
#define SCR$M_DECCRT	(1<<SCR$V_DECCRT)	/* 0x40 */
#define SCR$K_LENGTH	20	/* length of info return buffer */
#define SCR$C_LENGTH	20
struct scrdef1 {
    union {
	unsigned long scr$l_flags;	/* flags longword */
	struct {
	    unsigned scr$v_screen : 1;	/* 1 = screen oriented, 0 = scrolling */
	    unsigned scr$v_ansicrt: 1;	/* ANSI terminal */
	    unsigned scr$v_regis  : 1;	/* REGIS terminal */
	    unsigned scr$v_block  : 1;	/* block mode terminal */
	    unsigned scr$v_avo	  : 1;	/* advanced video terminal */
	    unsigned scr$v_edit   : 1;	/* terminal has edit capability */
	    unsigned scr$v_deccrt : 1;	/* terminal is a DEC CRT */
	    unsigned		  : 1;
	} scr$r_flags_bits;
    } scr$r_flags_overlay;
    unsigned short scr$w_width;		/* width of each line */
    unsigned short scr$w_pagesize;	/* lines in screen */
    unsigned char scr$b_devtype;	/* device type (see $DCDEF) */
    char	: 8, : 8, : 8, : 8,	/* char fill[11]; (reserved) */
		: 8, : 8, : 8, : 8,  : 8, : 8, : 8;
};

#endif	/*_SCRDEF_H*/
