1 /* Copyright (c) 1985 Ceriel J.H. Jacobs */
5 /* All terminal and terminal dependent stuff */
21 #include <sys/types.h>
23 #include <sys/ioctl.h>
25 /* Terminal setting */
27 PUBLIC
int expandtabs
; /* Tabs need expanding? */
28 PUBLIC
int stupid
; /* Stupid terminal */
29 PUBLIC
int hardcopy
; /* Hardcopy terminal */
33 char *CE
, /* clear to end of line */
34 *CL
, /* clear screen */
37 *US
, /* underline start */
38 *UE
, /* underline end */
39 *UC
, /* underline character */
41 *ME
, /* attributes (like bold) off */
42 *TI
, /* initialize for CM */
44 *CM
, /* Cursor addressing */
46 *SR
, /* Scroll reverse */
47 *AL
; /* insert line */
49 int LINES
, /* # of lines on screen */
50 COLS
, /* # of colums */
51 AM
, /* Automatic margins */
52 XN
, /* newline ignored after wrap */
53 DB
; /* terminal retains lines below */
55 char HO
[20], /* Sequence to get to home position */
56 BO
[20]; /* sequence to get to lower left hand corner */
58 int erasech
, /* users erase character */
59 killch
; /* users kill character */
60 PUBLIC
struct state
*sppat
; /* Special patterns to be recognized */
64 #define backspace() putline(BC)
65 #define clrscreen() tputs(CL,LINES,fputch)
66 #define clrtoeol() tputs(CE,1,fputch)
67 #define scrollreverse() tputs(SR,LINES,fputch)
69 #define insert_line(l) ins_line(l)
70 #define standout() tputs(SO,1,fputch)
71 #define standend() tputs(SE,1,fputch)
72 #define underline() tputs(US,1,fputch)
73 #define end_underline() tputs(UE,1,fputch)
74 #define bold() tputs(MD,1,fputch)
75 #define end_bold() tputs(ME,1,fputch)
76 #define underchar() tputs(UC,1,fputch)
78 #define insert_line() tputs(AL,LINES,fputch)
79 #define standout() putline(SO)
80 #define standend() putline(SE)
81 #define underline() putline(US)
82 #define end_underline() putline(UE)
83 #define bold() putline(MD)
84 #define end_bold() putline(ME)
85 #define underchar() putline(UC)
87 #define givetab() tputs(TA,1,fputch)
93 * Initialises the terminal (sets it in cbreak mode, etc)
100 * resets the terminal to the mode in which it was before yap was invoked
105 * void ini_terminal()
107 * Handles the termcap entry for your terminal. In some cases, the terminal
108 * will be considered stupid.
114 * int n; Line to go to
116 * Put the cursor at the start of the n'th screen line.
117 * This can be done in several ways (of course).
124 * clears the bottom line, by either clearing it to end of line,
125 * or pushing it of the screen by inserting a line before it.