|
|
1.1 root 1: /* tty.h */
2:
1.1.1.2 ! root 3: #define IOCHERR 0200 /* bit set on when an error */
! 4: /* occurred reading the char. */
! 5: #define OBMINSP 40 /* min space in buffer before */
1.1 root 6: /* processes awakened to write */
7: #define EBUFLEN 20 /* size of echo queue */
8:
9: /* size constants */
10:
11: #ifndef Ntty
12: #define Ntty 1 /* number of serial tty lines */
13: #endif
14: #ifndef IBUFLEN
1.1.1.2 ! root 15: #define IBUFLEN 256 /* num. chars in input queue */
1.1 root 16: #endif
17: #ifndef OBUFLEN
1.1.1.2 ! root 18: #define OBUFLEN 128 /* num. chars in output queue */
1.1 root 19: #endif
20:
21: /* mode constants */
22:
23: #define IMRAW 'R' /* raw mode => nothing done */
24: #define IMCOOKED 'C' /* cooked mode => line editing */
25: #define IMCBREAK 'K' /* honor echo, etc, no line edit*/
26: #define OMRAW 'R' /* raw mode => normal processing*/
27:
28: struct tty { /* tty line control block */
29: int ihead; /* head of input queue */
30: int itail; /* tail of input queue */
31: char ibuff[IBUFLEN]; /* input buffer for this line */
32: int isem; /* input semaphore */
33: int ohead; /* head of output queue */
34: int otail; /* tail of output queue */
35: char obuff[OBUFLEN]; /* output buffer for this line */
36: int osem; /* output semaphore */
37: int odsend; /* sends delayed for space */
38: int ehead; /* head of echo queue */
39: int etail; /* tail of echo queue */
40: char ebuff[EBUFLEN]; /* echo queue */
41: char imode; /* IMRAW, IMCBREAK, IMCOOKED */
42: Bool iecho; /* is input echoed? */
43: Bool ieback; /* do erasing backspace on echo?*/
44: Bool evis; /* echo control chars as ^X ? */
45: Bool ecrlf; /* echo CR-LF for newline? */
46: Bool icrlf; /* map '\r' to '\n' on input? */
47: Bool ierase; /* honor erase character? */
1.1.1.2 ! root 48: char ierasec; /* erases character, usu. backsp*/
1.1 root 49: Bool ikill; /* honor line kill character? */
50: char ikillc; /* line kill character */
51: int icursor; /* current cursor position */
52: Bool oflow; /* honor ostop/ostart? */
53: Bool oheld; /* output currently being held? */
54: char ostop; /* character that stops output */
55: char ostart; /* character that starts output */
56: Bool ocrlf; /* echo CR/LF for LF ? */
57: char ifullc; /* char to send when input full */
58: struct csr *ioaddr; /* device address of this unit */
1.1.1.2 ! root 59: int intrstate; /* device interrupt state */
1.1 root 60: };
61: extern struct tty tty[];
62:
1.1.1.2 ! root 63: #define BACKSP '\b'
! 64: #define BELL '\07'
! 65: #define ATSIGN '@'
! 66: #define BLANK ' '
! 67: #define NEWLINE '\n'
! 68: #define RETURN '\r'
1.1 root 69: #define STOPCH '\023' /* control-S stops output */
70: #define STRTCH '\021' /* control-Q restarts output */
1.1.1.2 ! root 71: #define UPARROW '^'
1.1 root 72:
73: /* ttycontrol function codes */
74:
75: #define TCSETBRK 1 /* turn on BREAK in transmitter */
76: #define TCRSTBRK 2 /* turn off BREAK " " */
77: #define TCNEXTC 3 /* look ahead 1 character */
78: #define TCMODER 4 /* set input mode to raw */
79: #define TCMODEC 5 /* set input mode to cooked */
80: #define TCMODEK 6 /* set input mode to cbreak */
81: #define TCICHARS 8 /* return number of input chars */
82: #define TCECHO 9 /* turn on echo */
83: #define TCNOECHO 10 /* turn off echo */
84: #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.