1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

C fn definitions on Linux

This commit is contained in:
Alexander Medvednikov
2019-11-22 19:00:56 +03:00
parent e9e931fe4a
commit f4fe90ea6d
4 changed files with 14 additions and 3 deletions

View File

@ -34,10 +34,15 @@ enum Action {
suspend
}
fn C.tcgetattr() int
fn C.tcsetattr() int
fn C.ioctl() int
fn C.raise()
// Toggle raw mode of the terminal by changing its attributes
// Catches SIGUSER (CTRL+C) Signal to reset tty
fn (r mut Readline) enable_raw_mode() {
if ( C.tcgetattr(0, &r.orig_termios) == -1 ) {
if C.tcgetattr(0, &r.orig_termios) == -1 {
r.is_tty = false
r.is_raw = false
return