From: Keith Packard Date: Sun, 24 Mar 2013 22:08:31 +0000 (-0700) Subject: altos: Expose ao_put_string function X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=2a66aab0b0efb63bf3619ec03abb357823e9cdde;p=fw%2Faltos altos: Expose ao_put_string function This works like puts, except it doesn't add a trailing newline. Signed-off-by: Keith Packard --- diff --git a/src/core/ao.h b/src/core/ao.h index adda0b6f..7ff49dd5 100644 --- a/src/core/ao.h +++ b/src/core/ao.h @@ -143,6 +143,9 @@ extern __pdata uint32_t ao_cmd_lex_u32; extern __pdata char ao_cmd_lex_c; extern __pdata enum ao_cmd_status ao_cmd_status; +void +ao_put_string(__code char *s); + void ao_cmd_lex(void); diff --git a/src/core/ao_cmd.c b/src/core/ao_cmd.c index c0e1a6b5..de5ccc35 100644 --- a/src/core/ao_cmd.c +++ b/src/core/ao_cmd.c @@ -29,8 +29,8 @@ static __xdata char cmd_line[CMD_LEN]; static __pdata uint8_t cmd_len; static __pdata uint8_t cmd_i; -static void -put_string(__code char *s) +void +ao_put_string(__code char *s) { char c; while ((c = *s++)) @@ -40,7 +40,7 @@ put_string(__code char *s) static void backspace(void) { - put_string ("\010 \010"); + ao_put_string ("\010 \010"); } static void @@ -48,7 +48,7 @@ readline(void) { char c; if (ao_echo()) - put_string("> "); + ao_put_string("> "); cmd_len = 0; for (;;) { flush(); @@ -317,13 +317,13 @@ help(void) cs = ao_cmds[cmds]; for (cmd = 0; cs[cmd].func; cmd++) { h = cs[cmd].help; - put_string(h); + ao_put_string(h); e = strlen(h); h += e + 1; e = 45 - e; while (e--) putchar(' '); - put_string(h); + ao_put_string(h); putchar('\n'); } }