summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jefs.fs22
1 files changed, 20 insertions, 2 deletions
diff --git a/jefs.fs b/jefs.fs
index f6fecf8..663f556 100644
--- a/jefs.fs
+++ b/jefs.fs
@@ -6,6 +6,7 @@
: emit ( chr -- ) sp cell+ 1 swap 1 1 syscall3 2drop ;
: cr 10 emit ;
+: binary 2 base ! ;
: octal 8 base ! ;
: decimal 10 base ! ;
: hex 16 base ! ;
@@ -366,6 +367,14 @@ make line-buffer line-buffer-length allot
60 constant termios#
make termios termios# allot
+19 constant NCCS
+: termios.c_iflag ;
+: termios.c_oflag 4 + ;
+: termios.c_cflag 8 + ;
+: termios.c_lflag 12 + ;
+: termios.c_line 16 + ;
+: termios.c_cc 17 + ;
+
\ CONSTANTS {{{
hex
5401 constant TCGETS
@@ -415,9 +424,18 @@ termios TCGETS stdin ioctl ( noname ) swap execute value tty
60 constant old-termios#
make old-termios old-termios# allot
-termios old-termios termios# cmove
-
+: restore-termios old-termios TCSETSF stdin ioctl ;
+: backup-termios old-termios TCGETS stdin ioctl ;
+: cooked restore-termios ;
+\ SETTING RAW MODE FLAGS {{{
+\ see termios(3)
+: raw-iflag termios termios.c_iflag @ ;
+: raw-oflag ;
+: raw-lflag ;
+: raw-cflag ;
+\ }}}
+: raw backup-termios ;
\ }}}
\ DUMP {{{