aboutsummaryrefslogtreecommitdiffstats
path: root/src/ios.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-03-20 00:09:10 -0500
committerJesse Luehrs <doy@tozt.net>2013-03-20 00:09:10 -0500
commit28eeecd93029db4b756844852e3608eba83bf455 (patch)
tree750691848cf968d0e9533f17bb29d523b238017b /src/ios.rs
parentd2a8e7df2deb31f87470511f8fb3e0d0ad48fde6 (diff)
downloadrust-term-28eeecd93029db4b756844852e3608eba83bf455.tar.gz
rust-term-28eeecd93029db4b756844852e3608eba83bf455.zip
rearrange things a bit
Diffstat (limited to 'src/ios.rs')
-rw-r--r--src/ios.rs50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/ios.rs b/src/ios.rs
index 3ae2297..7a9c33f 100644
--- a/src/ios.rs
+++ b/src/ios.rs
@@ -1,5 +1,30 @@
use core::libc::c_int;
+pub fn cooked () -> int {
+ unsafe { c::cooked() as int }
+}
+
+pub fn cbreak () -> int {
+ unsafe { c::cbreak() as int }
+}
+
+pub fn raw () -> int {
+ unsafe { c::raw() as int }
+}
+
+pub fn echo (enable: bool) -> int {
+ unsafe { c::echo(enable as c_int) as int }
+}
+
+pub fn preserve<T> (body: &fn () -> T) -> T {
+ let _guard = PreserveTermios();
+ body()
+}
+
+pub fn isatty() -> bool {
+ unsafe { c_isatty(0) as bool }
+}
+
enum struct_termios {}
struct PreserveTermios {
@@ -31,28 +56,3 @@ extern {
#[link_name = "isatty"]
fn c_isatty(fd: c_int) -> c_int;
}
-
-pub fn cooked () -> int {
- unsafe { c::cooked() as int }
-}
-
-pub fn cbreak () -> int {
- unsafe { c::cbreak() as int }
-}
-
-pub fn raw () -> int {
- unsafe { c::raw() as int }
-}
-
-pub fn echo (enable: bool) -> int {
- unsafe { c::echo(enable as c_int) as int }
-}
-
-pub fn preserve<T> (body: &fn () -> T) -> T {
- let _guard = PreserveTermios();
- body()
-}
-
-pub fn isatty() -> bool {
- unsafe { c_isatty(0) as bool }
-}