aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-03-19 20:55:28 -0500
committerJesse Luehrs <doy@tozt.net>2013-03-19 20:55:28 -0500
commitbe15c787b357fda85983c01be1f4350c5fddf753 (patch)
tree8d77a9ebb5d2ec05560247724953ca70d87608f4 /src
downloadrust-term-be15c787b357fda85983c01be1f4350c5fddf753.tar.gz
rust-term-be15c787b357fda85983c01be1f4350c5fddf753.zip
project skeleton
Diffstat (limited to 'src')
-rw-r--r--src/info.rs0
-rw-r--r--src/ios.rs30
-rw-r--r--src/term.rs6
-rw-r--r--src/termios_wrapper.c21
4 files changed, 57 insertions, 0 deletions
diff --git a/src/info.rs b/src/info.rs
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/info.rs
diff --git a/src/ios.rs b/src/ios.rs
new file mode 100644
index 0000000..b4c0ad2
--- /dev/null
+++ b/src/ios.rs
@@ -0,0 +1,30 @@
+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;
+ fn crlf (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 }
+}
+
+pub fn crlf (enable: bool) -> bool {
+ unsafe { c::crlf(enable as c_int) as bool }
+}
diff --git a/src/term.rs b/src/term.rs
new file mode 100644
index 0000000..f739fb7
--- /dev/null
+++ b/src/term.rs
@@ -0,0 +1,6 @@
+#[link(name = "term", vers = "0.0.1", author = "doy")];
+
+#[crate_type = "lib"];
+
+pub mod ios;
+pub mod info;
diff --git a/src/termios_wrapper.c b/src/termios_wrapper.c
new file mode 100644
index 0000000..6e2afe4
--- /dev/null
+++ b/src/termios_wrapper.c
@@ -0,0 +1,21 @@
+#include <termios.h>
+
+int cooked()
+{
+}
+
+int cbreak()
+{
+}
+
+int raw()
+{
+}
+
+int echo(int enabled)
+{
+}
+
+int crlf(int enabled)
+{
+}