altos: Export 'ao_cmd_is_white' for use by other code
authorKeith Packard <keithp@keithp.com>
Sun, 13 Nov 2011 02:48:07 +0000 (18:48 -0800)
committerKeith Packard <keithp@keithp.com>
Sun, 13 Nov 2011 02:48:07 +0000 (18:48 -0800)
This function tests the current input character.

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

index f57398ced86b2d7edc018f8f03c83fd6a0fe0a47..2139983c511308adc8572c8b5e5e8fca6a0f838c 100644 (file)
@@ -349,6 +349,9 @@ ao_cmd_put8(uint8_t v);
 void
 ao_cmd_put16(uint16_t v);
 
 void
 ao_cmd_put16(uint16_t v);
 
+uint8_t
+ao_cmd_is_white(void);
+
 void
 ao_cmd_white(void);
 
 void
 ao_cmd_white(void);
 
index 0c902f6be935368842f4e152bd062c295a90c182..14cb7569b5df9b0e9840afc8d494cccd5f1386ba 100644 (file)
@@ -121,10 +121,16 @@ ao_cmd_put8(uint8_t v)
        putnibble(v & 0xf);
 }
 
        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)
 {
 void
 ao_cmd_white(void)
 {
-       while (ao_cmd_lex_c == ' ' || ao_cmd_lex_c == '\t')
+       while (ao_cmd_is_white())
                ao_cmd_lex();
 }
 
                ao_cmd_lex();
 }