MCPcopy Index your code
hub / github.com/python/cpython / cfmakeraw

Function cfmakeraw

Lib/tty.py:18–44  ·  view source on GitHub ↗

Make termios mode raw.

(mode)

Source from the content-addressed store, hash-verified

16CC = 6
17
18def cfmakeraw(mode):
19 """Make termios mode raw."""
20 # Clear all POSIX.1-2017 input mode flags.
21 # See chapter 11 "General Terminal Interface"
22 # of POSIX.1-2017 Base Definitions.
23 mode[IFLAG] &= ~(IGNBRK | BRKINT | IGNPAR | PARMRK | INPCK | ISTRIP |
24 INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF)
25
26 # Do not post-process output.
27 mode[OFLAG] &= ~OPOST
28
29 # Disable parity generation and detection; clear character size mask;
30 # let character size be 8 bits.
31 mode[CFLAG] &= ~(PARENB | CSIZE)
32 mode[CFLAG] |= CS8
33
34 # Clear all POSIX.1-2017 local mode flags.
35 mode[LFLAG] &= ~(ECHO | ECHOE | ECHOK | ECHONL | ICANON |
36 IEXTEN | ISIG | NOFLSH | TOSTOP)
37
38 # POSIX.1-2017, 11.1.7 Non-Canonical Mode Input Processing,
39 # Case B: MIN>0, TIME=0
40 # A pending read shall block until MIN (here 1) bytes are received,
41 # or a signal is received.
42 mode[CC] = list(mode[CC])
43 mode[CC][VMIN] = 1
44 mode[CC][VTIME] = 0
45
46def cfmakecbreak(mode):
47 """Make termios mode cbreak."""

Callers 1

setrawFunction · 0.85

Calls 1

listClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…