Repository navigation
Expand file tree
/
Copy pathtty.wave
More file actions
51 lines (46 loc) · 1.52 KB
/
Copy pathtty.wave
File metadata and controls
51 lines (46 loc) · 1.52 KB
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
// This file is part of the Wave language project.
// Copyright (c) 2024-2026 Wave Foundation
// Copyright (c) 2024-2026 LunaStev and contributors
// SPDX-License-Identifier: Apache-2.0
// The portable terminal surface is present on Windows, but termios-specific
// mutation remains unavailable until a console-mode API is added.
pub const TTY_SYS_IOCTL: i64 = 0;
pub const TTY_SYS_FCNTL: i64 = 0;
pub const TTY_TCGETS: i64 = 0;
pub const TTY_TCSETS: i64 = 0;
pub const TTY_TCSETSW: i64 = 0;
pub const TTY_TCSETSF: i64 = 0;
pub const TTY_TCSANOW: i32 = 0;
pub const TTY_TCSADRAIN: i32 = 1;
pub const TTY_TCSAFLUSH: i32 = 2;
pub const TTY_F_GETFL: i32 = 3;
pub const TTY_F_SETFL: i32 = 4;
pub const TTY_O_NONBLOCK: i32 = 0;
pub const TTY_ICANON: u32 = 2;
pub const TTY_ECHO: u32 = 4;
pub const TTY_VTIME_IDX: i32 = 5;
pub const TTY_VMIN_IDX: i32 = 6;
pub struct Termios {
c_iflag: u32;
c_oflag: u32;
c_cflag: u32;
c_lflag: u32;
c_line: u8;
c_cc: array<u8, 32>;
c_ispeed: u32;
c_ospeed: u32;
}
pub struct TtyRawState {
term: Termios;
flags: i32;
active: i32;
}
pub fun tty_getattr(fd: i32, t: ptr<Termios>) -> i64 { return -38; }
pub fun tty_setattr(fd: i32, action: i32, t: ptr<Termios>) -> i64 { return -38; }
pub fun tty_getfl(fd: i32) -> i64 { return -38; }
pub fun tty_setfl(fd: i32, flags: i32) -> i64 { return -38; }
pub fun tty_enable_raw_nonblock(fd: i32, st: ptr<TtyRawState>) -> i64 {
if (st != null) { deref st.active = 0; }
return -38;
}
pub fun tty_restore(fd: i32, st: ptr<TtyRawState>) { }