diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-04-02 02:03:55 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-04-02 02:03:55 -0500 |
commit | 660a905b7fd41f59456c166b9ce9b91461c41844 (patch) | |
tree | 641e90acd54cb812d20fc76eb40faea224f273ce | |
parent | 1c75c7d80869fdb6772533f31700854122a53d48 (diff) | |
download | rust-term-660a905b7fd41f59456c166b9ce9b91461c41844.tar.gz rust-term-660a905b7fd41f59456c166b9ce9b91461c41844.zip |
reorganize a couple things
-rw-r--r-- | src/term.rs | 23 | ||||
-rw-r--r-- | src/util.rs | 9 |
2 files changed, 16 insertions, 16 deletions
diff --git a/src/term.rs b/src/term.rs index e1d01cc..609fcd4 100644 --- a/src/term.rs +++ b/src/term.rs @@ -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, @@ -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; -} diff --git a/src/util.rs b/src/util.rs index c9f85e5..43a1a69 100644 --- a/src/util.rs +++ b/src/util.rs @@ -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; +} |