altos/lambdakey-v1.0: Switch back to command buffered input
authorKeith Packard <keithp@keithp.com>
Sun, 7 Jan 2018 02:11:19 +0000 (18:11 -0800)
committerKeith Packard <keithp@keithp.com>
Sun, 7 Jan 2018 02:11:19 +0000 (18:11 -0800)
Instead of just reading from stdin with no echo or editing.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/lambdakey-v1.0/ao_lambdakey.c
src/lambdakey-v1.0/ao_scheme_os.h
src/scheme/ao_scheme_read.c

index 2bd626f14c7718080e2e8c4004646bd861d0a632..f1a2aa38ed2cb9d73ce600c259838d7649239daa 100644 (file)
@@ -16,7 +16,7 @@
 #include <ao_scheme.h>
 
 static void scheme_cmd() {
-       ao_scheme_read_eval_print(stdin, stdout, true);
+       ao_scheme_read_eval_print(stdin, stdout, false);
 }
 
 static const struct ao_cmds blink_cmds[] = {
index 5641b476c79f537197bd682eef76178e57f30e05..6a2ab819c981f6f59e2c7784faf37cfe2dc051c1 100644 (file)
@@ -30,7 +30,7 @@
 #endif
 
 static inline int
-ao_scheme_getc() {
+_ao_scheme_getc() {
        static uint8_t  at_eol;
        int c;
 
@@ -44,11 +44,7 @@ ao_scheme_getc() {
        return c;
 }
 
-static inline void
-ao_scheme_os_flush(void)
-{
-       flush();
-}
+#define ao_scheme_getc(f) ({ (void) (f); _ao_scheme_getc(); })
 
 static inline void
 ao_scheme_abort(void)
index a26965f2056aa73ef1fbb6e89839f986004bb13a..f9630d39e96ef92db8a109a69c071cd0ad45d535 100644 (file)
@@ -150,6 +150,10 @@ static const uint16_t      lex_classes[128] = {
 
 static int lex_unget_c;
 
+#ifndef ao_scheme_getc
+#define ao_scheme_getc(f) getc(f)
+#endif
+
 static inline int
 lex_get(FILE *in)
 {
@@ -158,7 +162,7 @@ lex_get(FILE *in)
                c = lex_unget_c;
                lex_unget_c = 0;
        } else {
-               c = getc(in);
+               c = ao_scheme_getc(in);
        }
        return c;
 }