From 4b8a988fb0e663eb178882900ecf29d35485aba6 Mon Sep 17 00:00:00 2001 From: kitty Date: Sun, 8 Mar 2026 22:14:19 +1100 Subject: BINARY, some setup for raw mode --- jefs.fs | 22 ++++++++++++++++++++-- 1 file 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 {{{ -- cgit v1.2.3