-#define REFRESH_TO_EOL() { \
- if (num < eol_num) { \
- wlen = eol_num - num; \
- putnstr(buf + num, wlen); \
- num = eol_num; \
- } \
+static void getcmd_putch(int ch) { putchar(ch);}
+static int getcmd_getch(void) { return vt_parse();}
+static void getcmd_cbeep(void) { getcmd_putch('\a');}
+
+static void beginning_of_line(uint8_t *num)
+{
+ while (*num) {
+ getcmd_putch(CTL_BACKSPACE);
+ (*num)--;
+ }
+}
+
+static void erase_to_eol(uint_fast8_t *num, uint_fast8_t *eol_num)
+{
+ if (*num < *eol_num) {
+ /* printf_P(PSTR("%*S"), (int)(*eol_num - *num), PSTR("")); */
+ print_blanks(*eol_num - *num);
+ do {
+ getcmd_putch(CTL_BACKSPACE);
+ } while (--(*eol_num) > *num);
+ }
+}
+
+static void refresh_to_eol(char *buf, uint_fast8_t *num, uint_fast8_t *eol_num)
+{
+ if (*num < *eol_num) {
+ uint_fast8_t wlen = *eol_num - *num;
+ putnstr(buf + *num, wlen);
+ *num = *eol_num;
+ }