|
|
1.1 root 1:
2:
3: stty() COHERENT System Call stty()
4:
5:
6:
7:
8: Set terminal modes
9:
10: #iinncclluuddee <ssggttttyy.hh>
11: iinntt ssttttyy(_f_d, _s_g_p)
12: iinntt _f_d;
13: ssttrruucctt ssggttttyybb *_s_g_p;
14:
15: The COHERENT system call ssttttyy sets a terminal's attributes. See
16: the Lexicon article for ssttttyy for information on terminal
17: attributes and their legal values.
18:
19: ***** Example *****
20:
21: This example demonstrates both ssttttyy and ggttttyy. It sets terminal
22: input to read one character at a time (that is, it reads the
23: terminal in ``raw'' form). When you type `q', it restores the
24: terminal to its previous settings, and exits. For an additional
25: example, see the ppiippee Lexicon article.
26:
27:
28: #include <sgtty.h>
29:
30:
31:
32: main()
33: {
34: struct sgttyb os, ns;
35: char buff;
36:
37:
38:
39: printf("Waiting for q\n");
40: gtty(1, &os); /* save old state */
41: ns = os; /* get base of new state */
42: ns.sg_flags |= RAW;/* prevent <ctl-c> from working */
43: ns.sg_flags &= ~(ECHO|CRMOD);/* no echo for now... */
44: stty(1, &ns); /* set mode */
45:
46:
47:
48: do {
49: buff = getchar();/* wait for the keyboard */
50: } while(buff != 'q');
51:
52:
53:
54: stty(1, &os); /* reset mode */
55: }
56:
57:
58: ***** Files *****
59:
60: <ssggttttyy.hh> -- Header file
61:
62:
63:
64: COHERENT Lexicon Page 1
65:
66:
67:
68:
69: stty() COHERENT System Call stty()
70:
71:
72:
73: ***** See Also *****
74:
75: CCOOHHEERREENNTT ssyysstteemm ccaallllss, eexxeecc, ggttttyy(), iiooccttll(), ooppeenn(), rreeaadd(),
76: ssggttttyy.hh, ssttttyy, wwrriittee()
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130: COHERENT Lexicon Page 2
131:
132:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.