summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6847417)
Lets other readline users specify alternate prompts.
Signed-off-by: Keith Packard <keithp@keithp.com>
ao_put_string(const char *s);
void
ao_put_string(const char *s);
void
+ao_cmd_readline(const char *prompt);
static uint8_t cmd_len;
static uint8_t cmd_i;
static uint8_t cmd_len;
static uint8_t cmd_i;
+static const char backspace[] = "\010 \010";
+
void
ao_put_string(const char *s)
{
void
ao_put_string(const char *s)
{
-static void
-backspace(void)
-{
- ao_put_string ("\010 \010");
-}
-
+ao_cmd_readline(const char *prompt)
cmd_len = 0;
for (;;) {
flush();
cmd_len = 0;
for (;;) {
flush();
if (c == '\010' || c == '\177') {
if (cmd_len != 0) {
if (ao_echo())
if (c == '\010' || c == '\177') {
if (cmd_len != 0) {
if (ao_echo())
+ ao_put_string(backspace);
if (c == '\025') {
while (cmd_len != 0) {
if (ao_echo())
if (c == '\025') {
while (cmd_len != 0) {
if (ao_echo())
+ ao_put_string(backspace);
-static
-uint32_t
-_ao_cmd_hex(uint8_t lim)
+static uint32_t
+get_hex(uint8_t lim)
{
uint32_t result = 0;
uint8_t i;
{
uint32_t result = 0;
uint8_t i;
uint8_t
ao_cmd_hexbyte(void)
{
uint8_t
ao_cmd_hexbyte(void)
{
}
uint32_t
ao_cmd_hex(void)
{
}
uint32_t
ao_cmd_hex(void)
{
- return _ao_cmd_hex(0xff);
void (*func)(void);
for (;;) {
void (*func)(void);
for (;;) {
ao_cmd_lex();
ao_cmd_white();
c = ao_cmd_lex_c;
ao_cmd_lex();
ao_cmd_white();
c = ao_cmd_lex_c;