altos: Expose ao_put_string function
authorKeith Packard <keithp@keithp.com>
Sun, 24 Mar 2013 22:08:31 +0000 (15:08 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 24 Mar 2013 22:08:31 +0000 (15:08 -0700)
This works like puts, except it doesn't add a trailing newline.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/core/ao.h
src/core/ao_cmd.c

index adda0b6f5e4ac507e7ae12007b14fd83e2267c9e..7ff49dd560b26d079712bfcf7a6c7150148043ae 100644 (file)
@@ -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);
 
index c0e1a6b59c5fe3f1a823474a18c2c3e2ab5566ef..de5ccc351d5f40e48ebb45acfe4f9a0abffce5ed 100644 (file)
@@ -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');
                }
        }