From: Keith Packard Date: Fri, 6 Nov 2009 05:43:21 +0000 (-0800) Subject: Move ao_match_word from ao_ignite.c to ao_cmd.c X-Git-Tag: debian/0.6+27+gb0d7e3f~13 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=4114210e0b813f4af99d0cb7755ad2ac2c4b120e Move ao_match_word from ao_ignite.c to ao_cmd.c This is a generally useful command line utility. Signed-off-by: Keith Packard --- diff --git a/src/ao.h b/src/ao.h index bc9afcc3..508ed37a 100644 --- a/src/ao.h +++ b/src/ao.h @@ -350,6 +350,9 @@ ao_cmd_hex(void); void ao_cmd_decimal(void); +uint8_t +ao_match_word(__code char *word); + struct ao_cmds { char cmd; void (*func)(void); diff --git a/src/ao_cmd.c b/src/ao_cmd.c index e3f85bc9..81a52708 100644 --- a/src/ao_cmd.c +++ b/src/ao_cmd.c @@ -171,6 +171,20 @@ ao_cmd_decimal(void) ao_cmd_status = r; } +uint8_t +ao_match_word(__code char *word) +{ + while (*word) { + if (ao_cmd_lex_c != *word) { + ao_cmd_status = ao_cmd_syntax_error; + return 0; + } + word++; + ao_cmd_lex(); + } + return 1; +} + static void eol(void) { diff --git a/src/ao_ignite.c b/src/ao_ignite.c index 8206e342..981cf0ce 100644 --- a/src/ao_ignite.c +++ b/src/ao_ignite.c @@ -121,20 +121,6 @@ ao_igniter(void) } } -static uint8_t -ao_match_word(__code char *word) -{ - while (*word) { - if (ao_cmd_lex_c != *word) { - ao_cmd_status = ao_cmd_syntax_error; - return 0; - } - word++; - ao_cmd_lex(); - } - return 1; -} - void ao_ignite_manual(void) {