diff options
author | Keith Packard <keithp@keithp.com> | 2018-01-06 18:11:19 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2018-01-06 18:11:19 -0800 |
commit | b446d9657cad0ff45f6f65c774d82cb9f2f65088 (patch) | |
tree | 07f482031d8657d2b39eb0c661c0ee40b2430748 /src | |
parent | 16061947d4376b41e596d87f97ec53ec29d17644 (diff) |
altos/lambdakey-v1.0: Switch back to command buffered input
Instead of just reading from stdin with no echo or editing.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/lambdakey-v1.0/ao_lambdakey.c | 2 | ||||
-rw-r--r-- | src/lambdakey-v1.0/ao_scheme_os.h | 8 | ||||
-rw-r--r-- | src/scheme/ao_scheme_read.c | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/lambdakey-v1.0/ao_lambdakey.c b/src/lambdakey-v1.0/ao_lambdakey.c index 2bd626f1..f1a2aa38 100644 --- a/src/lambdakey-v1.0/ao_lambdakey.c +++ b/src/lambdakey-v1.0/ao_lambdakey.c @@ -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[] = { diff --git a/src/lambdakey-v1.0/ao_scheme_os.h b/src/lambdakey-v1.0/ao_scheme_os.h index 5641b476..6a2ab819 100644 --- a/src/lambdakey-v1.0/ao_scheme_os.h +++ b/src/lambdakey-v1.0/ao_scheme_os.h @@ -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) diff --git a/src/scheme/ao_scheme_read.c b/src/scheme/ao_scheme_read.c index a26965f2..f9630d39 100644 --- a/src/scheme/ao_scheme_read.c +++ b/src/scheme/ao_scheme_read.c @@ -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; } |