[9] | 1 | /* Copyright (c) 1985 Ceriel J.H. Jacobs */
|
---|
| 2 |
|
---|
| 3 | /* $Header: /cvsup/minix/src/commands/yap/term.h,v 1.1.1.1 2005/04/21 14:55:41 beng Exp $ */
|
---|
| 4 |
|
---|
| 5 | /* All terminal and terminal dependent stuff */
|
---|
| 6 |
|
---|
| 7 | # ifndef _TERM_
|
---|
| 8 | # define PUBLIC extern
|
---|
| 9 | # else
|
---|
| 10 | # define PUBLIC
|
---|
| 11 | # endif
|
---|
| 12 |
|
---|
| 13 | # if USG_TTY
|
---|
| 14 | # include <termio.h>
|
---|
| 15 | # elif POSIX_TTY
|
---|
| 16 | # include <termios.h>
|
---|
| 17 | # else
|
---|
| 18 | # include <sgtty.h>
|
---|
| 19 | # endif
|
---|
| 20 |
|
---|
| 21 | #include <sys/types.h>
|
---|
| 22 | #include <signal.h>
|
---|
| 23 | #include <sys/ioctl.h>
|
---|
| 24 |
|
---|
| 25 | /* Terminal setting */
|
---|
| 26 |
|
---|
| 27 | PUBLIC int expandtabs; /* Tabs need expanding? */
|
---|
| 28 | PUBLIC int stupid; /* Stupid terminal */
|
---|
| 29 | PUBLIC int hardcopy; /* Hardcopy terminal */
|
---|
| 30 |
|
---|
| 31 | /* termcap stuff */
|
---|
| 32 | PUBLIC
|
---|
| 33 | char *CE, /* clear to end of line */
|
---|
| 34 | *CL, /* clear screen */
|
---|
| 35 | *SO, /* stand out */
|
---|
| 36 | *SE, /* stand end */
|
---|
| 37 | *US, /* underline start */
|
---|
| 38 | *UE, /* underline end */
|
---|
| 39 | *UC, /* underline character */
|
---|
| 40 | *MD, /* bold start */
|
---|
| 41 | *ME, /* attributes (like bold) off */
|
---|
| 42 | *TI, /* initialize for CM */
|
---|
| 43 | *TE, /* End of CM */
|
---|
| 44 | *CM, /* Cursor addressing */
|
---|
| 45 | *TA, /* Tab */
|
---|
| 46 | *SR, /* Scroll reverse */
|
---|
| 47 | *AL; /* insert line */
|
---|
| 48 | PUBLIC
|
---|
| 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 */
|
---|
| 54 | PUBLIC
|
---|
| 55 | char HO[20], /* Sequence to get to home position */
|
---|
| 56 | BO[20]; /* sequence to get to lower left hand corner */
|
---|
| 57 | PUBLIC
|
---|
| 58 | int erasech, /* users erase character */
|
---|
| 59 | killch; /* users kill character */
|
---|
| 60 | PUBLIC struct state *sppat; /* Special patterns to be recognized */
|
---|
| 61 | PUBLIC char
|
---|
| 62 | *BC; /* Back space */
|
---|
| 63 |
|
---|
| 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)
|
---|
| 68 | #ifdef VT100_PATCH
|
---|
| 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)
|
---|
| 77 | # else
|
---|
| 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)
|
---|
| 86 | # endif
|
---|
| 87 | #define givetab() tputs(TA,1,fputch)
|
---|
| 88 |
|
---|
| 89 | VOID inittty();
|
---|
| 90 | /*
|
---|
| 91 | * void inittty()
|
---|
| 92 | *
|
---|
| 93 | * Initialises the terminal (sets it in cbreak mode, etc)
|
---|
| 94 | */
|
---|
| 95 |
|
---|
| 96 | VOID resettty();
|
---|
| 97 | /*
|
---|
| 98 | * void resettty()
|
---|
| 99 | *
|
---|
| 100 | * resets the terminal to the mode in which it was before yap was invoked
|
---|
| 101 | */
|
---|
| 102 |
|
---|
| 103 | VOID ini_terminal();
|
---|
| 104 | /*
|
---|
| 105 | * void ini_terminal()
|
---|
| 106 | *
|
---|
| 107 | * Handles the termcap entry for your terminal. In some cases, the terminal
|
---|
| 108 | * will be considered stupid.
|
---|
| 109 | */
|
---|
| 110 |
|
---|
| 111 | VOID mgoto();
|
---|
| 112 | /*
|
---|
| 113 | * void mgoto(n)
|
---|
| 114 | * int n; Line to go to
|
---|
| 115 | *
|
---|
| 116 | * Put the cursor at the start of the n'th screen line.
|
---|
| 117 | * This can be done in several ways (of course).
|
---|
| 118 | */
|
---|
| 119 |
|
---|
| 120 | VOID clrbline();
|
---|
| 121 | /*
|
---|
| 122 | * void clrbline()
|
---|
| 123 | *
|
---|
| 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.
|
---|
| 126 | */
|
---|
| 127 |
|
---|
| 128 | VOID home();
|
---|
| 129 | VOID bottom();
|
---|
| 130 | /*
|
---|
| 131 | * Obvious
|
---|
| 132 | */
|
---|
| 133 |
|
---|
| 134 | #ifdef WINDOW
|
---|
| 135 | int window();
|
---|
| 136 | #endif
|
---|
| 137 | # undef PUBLIC
|
---|