Instead of just reading from stdin with no echo or editing.
Signed-off-by: Keith Packard <keithp@keithp.com>
#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[] = {
#endif
static inline int
-ao_scheme_getc() {
+_ao_scheme_getc() {
static uint8_t at_eol;
int c;
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)
static int lex_unget_c;
+#ifndef ao_scheme_getc
+#define ao_scheme_getc(f) getc(f)
+#endif
+
static inline int
lex_get(FILE *in)
{
c = lex_unget_c;
lex_unget_c = 0;
} else {
- c = getc(in);
+ c = ao_scheme_getc(in);
}
return c;
}