|
|
1.1 root 1: /* tty.h */
2:
3: #define OBMINSP 20 /* min space in buffer before */
4: /* processes awakened to write */
5: #define EBUFLEN 20 /* size of echo queue */
6:
7: /* size constants */
8:
9: #ifndef Ntty
10: #define Ntty 1 /* number of serial tty lines */
11: #endif
12: #ifndef IBUFLEN
13: #define IBUFLEN 128 /* num. chars in input queue */
14: #endif
15: #ifndef OBUFLEN
16: #define OBUFLEN 64 /* num. chars in output queue */
17: #endif
18:
19: /* mode constants */
20:
21: #define IMRAW 'R' /* raw mode => nothing done */
22: #define IMCOOKED 'C' /* cooked mode => line editing */
23: #define IMCBREAK 'K' /* honor echo, etc, no line edit*/
24: #define OMRAW 'R' /* raw mode => normal processing*/
25:
26: struct tty { /* tty line control block */
27: int ihead; /* head of input queue */
28: int itail; /* tail of input queue */
29: char ibuff[IBUFLEN]; /* input buffer for this line */
30: int isem; /* input semaphore */
31: int ohead; /* head of output queue */
32: int otail; /* tail of output queue */
33: char obuff[OBUFLEN]; /* output buffer for this line */
34: int osem; /* output semaphore */
35: int odsend; /* sends delayed for space */
36: int ehead; /* head of echo queue */
37: int etail; /* tail of echo queue */
38: char ebuff[EBUFLEN]; /* echo queue */
39: char imode; /* IMRAW, IMCBREAK, IMCOOKED */
40: Bool iecho; /* is input echoed? */
41: Bool ieback; /* do erasing backspace on echo?*/
42: Bool evis; /* echo control chars as ^X ? */
43: Bool ecrlf; /* echo CR-LF for newline? */
44: Bool icrlf; /* map '\r' to '\n' on input? */
45: Bool ierase; /* honor erase character? */
46: char ierasec; /* erase character (backspace) */
47: Bool ikill; /* honor line kill character? */
48: char ikillc; /* line kill character */
49: Bool iintr; /* is interrupt char honored? */
50: char iintrc; /* interrupt character */
51: int iintpid; /* interrupt process id */
52: Bool ieof; /* honor end-of-file char? */
53: char ieofc; /* end-of-file character */
54: int icursor; /* current cursor position */
55: Bool oflow; /* honor ostop/ostart? */
56: Bool oheld; /* output currently being held? */
57: char ostop; /* character that stops output */
58: char ostart; /* character that starts output */
59: Bool ocrlf; /* echo CR/LF for LF ? */
60: char ifullc; /* char to send when input full */
61: struct csr *ioaddr; /* device address of this unit */
62: };
63: extern struct tty tty[];
64:
65: #define BACKSP '\b' /* backspace one character pos. */
66: #define BELL '\007' /* usually an audiable tone */
67: #define BLANK ' ' /* used to print a "space" */
68: #define EOFC '\004' /* end-of-file character (^D) */
69: #define KILLCH '\025' /* line kill character (^U) */
70: #define NEWLINE '\n' /* line feed */
71: #define RETURN '\r' /* carriage return */
72: #define STOPCH '\023' /* control-S stops output */
73: #define STRTCH '\021' /* control-Q restarts output */
74: #define INTRCH '\002' /* control-B is interrupt */
75: #define UPARROW '^' /* usually for visuals like ^X */
76:
77: /* ttycontrol function codes */
78:
79: #define TCSETBRK 1 /* turn on BREAK in transmitter */
80: #define TCRSTBRK 2 /* turn off BREAK " " */
81: #define TCNEXTC 3 /* look ahead 1 character */
82: #define TCMODER 4 /* set input mode to raw */
83: #define TCMODEC 5 /* set input mode to cooked */
84: #define TCMODEK 6 /* set input mode to cbreak */
85: #define TCICHARS 8 /* return number of input chars */
86: #define TCECHO 9 /* turn on echo */
87: #define TCNOECHO 10 /* turn off echo */
88: #define TCINT 11 /* set input interrupt pid */
89: #define TCINTCH 12 /* set input interrupt char */
90: #define TCNOINT 13 /* turn off input interrupt */
91: #define TFULLC BELL /* char to echo when buffer full*/
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.