1 /* 2 * Copyright (c) 1980 Regents of the University of California. 3 * All rights reserved. The Berkeley software License Agreement 4 * specifies the terms and conditions for redistribution. 5 * 6 * @(#)2648.h 5.1 (Berkeley) 04/26/85 7 */ 8 9 /* 10 * lib2648: routines to deal directly with the HP 2648 Graphics terminal. 11 */ 12 13 #include <stdio.h> 14 15 #define ESC '\033' /* Escape */ 16 17 /* Normal/inverse video */ 18 #define NORMAL 0 /* not inverse video */ 19 #define INVERSE 1 /* inverse video */ 20 21 /* Kinds of lines we can draw */ 22 #define MX 10 /* exclusive or what's on screen */ 23 #define MC 11 /* clear what's on screen */ 24 #define MS 12 /* set what's on screen */ 25 26 /* Escape sequence modes the terminal might be in */ 27 #define NONE 20 /* not in an escape sequence */ 28 #define ESCD 21 /* in an escape * d sequence */ 29 #define ESCP 22 /* in an escape * p sequence */ 30 #define ESCM 23 /* in an escape * m sequence */ 31 #define TEXT 24 /* in graphics text mode */ 32 33 /* 34 * Constants for 2648 ^E/^F handshaking. 35 */ 36 #define ENQ 5 /* ^E sent by system to terminal */ 37 #define ACK 6 /* ^F reply by terminal to system */ 38 #define TBLKSIZ 32 /* Max # chars between handshakes */ 39 40 /* 41 * Misc. variables used by lib2648. 42 */ 43 int _on2648; /* true if getenv("TERM") is hp2648 */ 44 int _video; /* are we in inverse video mode? */ 45 int _actsmode; /* line type mode screen actually in */ 46 int _supsmode; /* line type mode screen supposed to be in */ 47 int _escmode; /* flavor of escape sequence currently in */ 48 int _cursoron; /* true if cursor is on */ 49 50 int _outcount; /* # of consecutive chars without read sent */ 51 char _pushback[BUFSIZ]; /* queue of chars pushed back onto the input */ 52 char *_pb_front, *_pb_back; 53 54 int _penx, _peny; /* where pen is really at */ 55 int _curx, _cury; /* where cursor is really at */ 56 int _supx, _supy; /* where pen and cursor are supposed to be */ 57 58 #ifdef TRACE 59 FILE *trace; /* trace file for debugging */ 60 #endif 61