summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkitty <nepeta@canaglie.net>2026-03-08 22:14:19 +1100
committerkitty <nepeta@canaglie.net>2026-03-08 22:14:19 +1100
commit4b8a988fb0e663eb178882900ecf29d35485aba6 (patch)
tree175a13825a62be8f8a5b8c4c85c44df76ec2f66c
parent332f7c13b9918ee1461617b5f36e4f2547369122 (diff)
BINARY, some setup for raw 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 {{{