diff options
author | Keith Packard <keithp@keithp.com> | 2011-11-12 18:48:07 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-11-12 18:48:07 -0800 |
commit | 2ba946fea29ff134ffaeaea9d7932f4bd4e953aa (patch) | |
tree | 68b7ebb5bd19fdd115c453ecc8ac3d96388327f6 | |
parent | 20282ef00afe70e3f3193f6f0200254cb2c33e93 (diff) |
altos: Export 'ao_cmd_is_white' for use by other code
This function tests the current input character.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | src/core/ao.h | 3 | ||||
-rw-r--r-- | src/core/ao_cmd.c | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/core/ao.h b/src/core/ao.h index f57398ce..2139983c 100644 --- a/src/core/ao.h +++ b/src/core/ao.h @@ -349,6 +349,9 @@ ao_cmd_put8(uint8_t v); void ao_cmd_put16(uint16_t v); +uint8_t +ao_cmd_is_white(void); + void ao_cmd_white(void); diff --git a/src/core/ao_cmd.c b/src/core/ao_cmd.c index 0c902f6b..14cb7569 100644 --- a/src/core/ao_cmd.c +++ b/src/core/ao_cmd.c @@ -121,10 +121,16 @@ ao_cmd_put8(uint8_t v) putnibble(v & 0xf); } +uint8_t +ao_cmd_is_white(void) +{ + return ao_cmd_lex_c == ' ' || ao_cmd_lex_c == '\t'; +} + void ao_cmd_white(void) { - while (ao_cmd_lex_c == ' ' || ao_cmd_lex_c == '\t') + while (ao_cmd_is_white()) ao_cmd_lex(); } |