-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtermios.rd
158 lines (109 loc) · 3.1 KB
/
termios.rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
=begin
= ruby-termios
Ruby-termios enables you to use termios(3) interface.
== Termios module
Termios module are simple wrapper for termios(3). It can be included
into IO-family classes and can extend IO-family objects. In addition,
the methods can use as module function.
=== Module Functions
--- Termios.tcdrain(io)
--- Termios.drain(io)
It calls tcdrain(3) for ((|io|)).
--- Termios.tcflow(io, action)
--- Termios.flow(io, action)
It calls tcflow(3) for ((|io|)).
--- Termios.tcflush(io, queue_selector)
--- Termios.flush(io, queue_selector)
It calls tcflush(3) for ((|io|)).
--- Termios.tcgetattr(io)
--- Termios.getattr(io)
It calls tcgetattr(3) for ((|io|)).
--- Termios.tcgetpgrp(io)
--- Termios.getpgrp(io)
It calls tcgetpgrp(3) for ((|io|)).
--- Termios.tcsendbreak(io, duration)
--- Termios.sendbreak(io, duration)
It calls tcsendbreak(3) for ((|io|)).
--- Termios.tcsetattr(io, flag, termios)
--- Termios.setattr(io, flag, termios)
It calls tcsetattr(3) for ((|io|)).
--- Termios.tcsetpgrp(io, pgrpid)
--- Termios.setpgrp(io, pgrpid)
It calls tcsetpgrp(3) for ((|io|)).
--- Termios.new_termios
It is alias of ((<Termios::Termios.new>)).
=== Methods
The methods can use for objects which include Termios module or are
extended by Termios module.
--- tcdrain
It calls tcdrain(3) for ((|self|)).
--- tcflow
It calls tcflow(3) for ((|self|)).
--- tcflush(queue_selector)
It calls tcflush(3) for ((|self|)).
--- tcgetattr
It calls tcgetattr(3) for ((|self|)).
--- tcgetpgrp
It calls tcgetpgrp(3) for ((|self|)).
--- tcsendbreak(duratiofn)
It calls tcsendbreak(3) for ((|self|)).
--- tcsetattr(flag, termios)
It calls tcsetattr(3) for ((|self|)).
--- tcsetpgrp(pgrpid)
It calls tcsetpgrp(3) for ((|self|)).
=== Constants
Many constants which are derived from "termios.h" are defined on Termios
module.
IFLAGS, OFLAGS, CFLAGS and LFLAGS are Hash object. They contains Symbols of
constants for c_iflag, c_oflag, c_cflag and c_lflag.
CCINDEX and BAUDS are Hash object too. They contains Symbols of constats for
c_cc or ispeed and ospeed.
== Termios::Termios class
A wrapper class for "struct termios" in C.
=== Class Methods
--- Termios::Termios.new
It creates a new Termios::Termios object.
=== Instance Methods
--- iflag
--- c_iflag
It returns value of c_iflag.
--- iflag=(flag)
--- c_iflag=(flag)
It sets flag to c_iflag.
--- oflag
--- c_oflag
It returns value of c_oflag.
--- oflag=(flag)
--- c_oflag=(flag)
It sets flag to c_oflag.
--- cflag
--- c_cflag
It returns value of c_cflag.
--- cflag=(flag)
--- c_cflag=(flag)
It sets flag to c_cflag.
--- lflag
--- c_lflag
It returns value of c_lflag.
--- lflag=(flag)
--- c_lflag=(flag)
It sets flag to c_lflag.
--- cc
--- c_cc
It returns values of c_cc.
--- cc=(cc_ary)
--- c_cc=(cc_ary)
It sets cc_ary to c_cc.
--- ispeed
--- c_ispeed
It returns c_ispeeed.
--- ispeed=(speed)
--- c_ispeed=(speed)
It sets speed to c_ispeed.
--- ospeed
--- c_ospeed
It returns c_ospeeed.
--- ospeed=(speed)
--- c_ospeed=(speed)
It sets speed to c_ospeed.
=end