aboutsummaryrefslogtreecommitdiffstats
path: root/src/ios.rs
blob: f8b464aa3a613f8398f8c5020bb2146ec721836f (plain) (blame)
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
use core::libc::c_int;

#[link_name = "termios_wrapper"]
extern mod c {
    fn cooked () -> c_int;
    fn cbreak () -> c_int;
    fn raw () -> c_int;
    fn echo (enable: c_int) -> c_int;
}

pub fn cooked () -> bool {
    unsafe { c::cooked() as bool }
}

pub fn cbreak () -> bool {
    unsafe { c::cbreak() as bool }
}

pub fn raw () -> bool {
    unsafe { c::raw() as bool }
}

pub fn echo (enable: bool) -> bool {
    unsafe { c::echo(enable as c_int) as bool }
}