|
|
1.1 root 1: /*
2: * Kernel portion of typewriter structure.
3: */
4: #ifndef KTTY_H
5: #define KTTY_H
6: #include <sys/types.h>
7: #include <sys/poll.h>
8: #include <sys/clist.h>
9: #include <sgtty.h>
10: #ifdef _I386
11: #include <termio.h>
12: #endif
13: #include <sys/timeout.h>
14:
15: #define NCIB 256 /* Input buffer */
16: #define OHILIM 128 /* Output buffer hi water mark */
17: #define OLOLIM 40 /* Output buffer lo water mark */
18: #define IHILIM 512 /* Input buffer hi water mark */
19: #define ILOLIM 40 /* Input buffer lo water mark */
20: #define ITSLIM (IHILIM-(IHILIM/4)) /* Input buffer tandem stop mark */
21: #define ESC '\\' /* Some characters */
22:
23: typedef struct tty {
24: CQUEUE t_oq; /* Output queue */
25: CQUEUE t_iq; /* Input queue */
26: char *t_ddp; /* Device specific */
27: int (*t_start)(); /* Start function */
28: int (*t_param)(); /* Load parameters function */
29: char t_dispeed; /* Default input speed */
30: char t_dospeed; /* Default output speed */
31: int t_open; /* Open count */
32: int t_flags; /* Flags */
33: char t_nfill; /* Number of fill characters */
34: char t_fillb; /* The fill character */
35: int t_ibx; /* Input buffer index */
36: char t_ib[NCIB]; /* Input buffer */
37: int t_hpos; /* Horizontal position */
38: int t_opos; /* Original horizontal position */
39: struct sgttyb t_sgttyb;/* Stty/gtty information */
40: struct tchars t_tchars;/* Tchars information */
41: #ifdef _I386
42: struct termio t_termio;
43: #endif
44: int t_group; /* Process group */
45: int t_escape; /* Pending escape count */
46: event_t t_ipolls; /* List of input polls enabled on device */
47: event_t t_opolls; /* List of output polls enabled on device */
48: TIM t_rawtim; /* Raw timing struct */
49: int t_cs_sel; /* 0 for resident drivers, CS for loadable */
50: } TTY;
51:
52: /*
53: * Test macros.
54: * Assume `tp' holds a TTY pointer.
55: * `c' a character.
56: * Be very careful if you work on the
57: * tty driver that this is true.
58: */
59: #define ISINTR (tp->t_tchars.t_intrc == c)
60: #define ISQUIT (tp->t_tchars.t_quitc == c)
61: #define ISEOF (tp->t_tchars.t_eofc == c)
62: #define ISBRK (tp->t_tchars.t_brkc == c)
63: #define ISSTART (tp->t_tchars.t_startc == c)
64: #define ISSTOP (tp->t_tchars.t_stopc == c)
65: #define ISCRMOD ((tp->t_sgttyb.sg_flags&CRMOD) != 0)
66: #define ISXTABS ((tp->t_sgttyb.sg_flags&XTABS) != 0)
67: #define ISECHO ((tp->t_sgttyb.sg_flags&ECHO) != 0)
68: #define ISERASE (tp->t_sgttyb.sg_erase == c)
69: #define ISKILL (tp->t_sgttyb.sg_kill == c)
70: #define stopc (tp->t_tchars.t_stopc)
71: #define startc (tp->t_tchars.t_startc)
72:
73: /*
74: * The following are not part of S5 sgtty.
75: */
76: #define ISRIN ((tp->t_sgttyb.sg_flags&RAWIN) != 0)
77: #define ISROUT ((tp->t_sgttyb.sg_flags&RAWOUT)!= 0)
78: #define ISCRT ((tp->t_sgttyb.sg_flags&CRT) != 0)
79: #define ISCBRK ((tp->t_sgttyb.sg_flags&CBREAK)!= 0)
80: #define ISTAND ((tp->t_sgttyb.sg_flags&TANDEM)!= 0)
81: #define ISBBYB ((tp->t_sgttyb.sg_flags&(RAWIN|CBREAK)) != 0)
82:
83: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.