code wiki / (root) / nx_termios.nx

nx_termios.nx

buildroot/runtime/nx_termios.nx

5521 B162 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind orphan library
docsdependenciesstructsconstsfunctions

about

nx_termios.nx -- raw / cooked terminal mode via ioctl(TCGETS/TCSETS). Switches the controlling TTY between cooked (line-buffered, echo on) and raw (byte-by-byte, no echo, no signals) modes. Required for interactive TUI applications. Pairs with nx_tty.nx (output) and nx_input.nx (input). Per POSIX termios. Raw mode disables: - ICANON (canonical line buffering) - ECHO (echo input to terminal) - ISIG (Ctrl+C/Z signal generation) - IEXTEN (extended input processing) - IXON (XON/XOFF flow control) - ICRNL (CR -> NL input translation) - OPOST (output post-processing) ...and sets c_cc[VMIN]=1, c_cc[VTIME]=0 (return on each byte). genealogy_id: posix_termios_1003.1 + bsd_v6_tty_driver + stevens_advanced_programming_1992 lineage_id: tty_mode_toggle_via_ioctl axioms: NX_AX_LOGIC_EXCLUDED_MIDDLE (TTY is in raw OR cooked mode at any instant; no third state)

dependencies 3 imports · 0 importers

syscalls.nx runtime.nx nx_axioms.nx nx_termios.nx

imports: syscalls.nxruntime.nxnx_axioms.nx

imported by: nobody (leaf or entry point)

structs

none

consts

37const NX_TIOC_GETS: i64 = 0x5401 // TCGETS
38const NX_TIOC_SETS: i64 = 0x5402 // TCSETS
39const NX_TIOC_GWINSZ: i64 = 0x5413 // TIOCGWINSZ
46const NX_T_BRKINT: i64 = 0x0002
47const NX_T_ICRNL: i64 = 0x0100
48const NX_T_INPCK: i64 = 0x0010
49const NX_T_ISTRIP: i64 = 0x0020
50const NX_T_IXON: i64 = 0x0400
53const NX_T_OPOST: i64 = 0x0001
56const NX_T_CS8: i64 = 0x0030
59const NX_T_ICANON: i64 = 0x0002
60const NX_T_ECHO: i64 = 0x0008
61const NX_T_ISIG: i64 = 0x0001
62const NX_T_IEXTEN: i64 = 0x8000
65const NX_T_VMIN: i64 = 6
66const NX_T_VTIME: i64 = 5
74const NX_TERMIOS_BYTES: i64 = 60

functions

77func nx_termios_get32(buf: *u8, off: i64) -> i64
86func nx_termios_set32(buf: *u8, off: i64, v: i64) -> i64
96func nx_termios_get(buf: *u8) -> i64
called by 1: nx_termios_enter_raw calls 1: sys_ioctl
100func nx_termios_set(buf: *u8) -> i64
110func nx_termios_enter_raw(save_buf: *u8) -> i64
143func nx_termios_restore(save_buf: *u8) -> i64
calls 1: nx_termios_set
153func nx_termios_winsize(out_rows: *i64, out_cols: *i64) -> i64
calls 1: sys_ioctl