aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-04-02 02:03:55 -0500
committerJesse Luehrs <doy@tozt.net>2013-04-02 02:03:55 -0500
commit660a905b7fd41f59456c166b9ce9b91461c41844 (patch)
tree641e90acd54cb812d20fc76eb40faea224f273ce /src/util.rs
parent1c75c7d80869fdb6772533f31700854122a53d48 (diff)
downloadrust-term-660a905b7fd41f59456c166b9ce9b91461c41844.tar.gz
rust-term-660a905b7fd41f59456c166b9ce9b91461c41844.zip
reorganize a couple things
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs9
1 files changed, 9 insertions, 0 deletions
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;
+}