Skip to content

Commit

Permalink
reorganize a couple things
Browse files Browse the repository at this point in the history
  • Loading branch information
doy committed Apr 2, 2013
1 parent 1c75c7d commit 660a905
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
23 changes: 7 additions & 16 deletions src/term.rs
Expand Up @@ -5,12 +5,17 @@

#[crate_type = "lib"];

use core::libc::c_int;

pub use ios::{cooked,cbreak,raw,echo,size};
pub use util::isatty;

use info::{escape,escape1,escape2};
use trie::Trie;

pub mod info;
pub mod ios;
mod trie;
mod util;

enum Keypress {
KeyCharacter(char),
KeyBackspace,
Expand Down Expand Up @@ -444,17 +449,3 @@ fn build_escapes_trie () -> ~Trie<Keypress> {

trie
}

pub fn isatty() -> bool {
unsafe { c_isatty(0) as bool }
}

pub mod ios;
pub mod info;
mod util;
mod trie;

extern {
#[link_name = "isatty"]
fn c_isatty(fd: c_int) -> c_int;
}
9 changes: 9 additions & 0 deletions src/util.rs
Expand Up @@ -39,3 +39,12 @@ pub fn timed_read (timeout: int) -> Option<char> {
extern mod io_helper {
fn timed_read (timeout: c_int) -> c_int;
}

pub fn isatty() -> bool {
unsafe { c_isatty(0) as bool }
}

extern {
#[link_name = "isatty"]
fn c_isatty(fd: c_int) -> c_int;
}

0 comments on commit 660a905

Please sign in to comment.