Move serial encoding handling to terminfo.c

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-05-08 00:17:23 +02:00
parent 710d05aa8c
commit d8e9099811
3 changed files with 93 additions and 35 deletions

View file

@ -38,9 +38,6 @@ static const struct grub_arg_option options[] =
{"word", 'w', 0, N_("Set the serial port word length."), 0, ARG_TYPE_INT},
{"parity", 'r', 0, N_("Set the serial port parity."), 0, ARG_TYPE_STRING},
{"stop", 't', 0, N_("Set the serial port stop bits."), 0, ARG_TYPE_INT},
{"ascii", 'a', 0, N_("Terminal is ASCII-only."), 0, ARG_TYPE_NONE},
{"utf8", 'l', 0, N_("Terminal is logical-ordered UTF-8."), 0, ARG_TYPE_NONE},
{"visual-utf8", 'v', 0, N_("Terminal is visually-ordered UTF-8."), 0, ARG_TYPE_NONE},
{0, 0, 0, 0, 0, 0}
};
@ -201,9 +198,7 @@ struct grub_terminfo_input_state grub_serial_terminfo_input =
struct grub_terminfo_output_state grub_serial_terminfo_output =
{
.put = serial_hw_put,
.normal_color = 0x7,
.highlight_color = 0x70
.put = serial_hw_put
};
static struct grub_term_input grub_serial_term_input =
@ -313,15 +308,6 @@ grub_cmd_serial (grub_extcmd_t cmd,
}
}
grub_serial_term_output.flags &= ~GRUB_TERM_CODE_TYPE_MASK;
if (state[7].set)
grub_serial_term_output.flags |= GRUB_TERM_CODE_TYPE_UTF8_LOGICAL;
else if (state[8].set)
grub_serial_term_output.flags |= GRUB_TERM_CODE_TYPE_UTF8_VISUAL;
else
grub_serial_term_output.flags |= GRUB_TERM_CODE_TYPE_ASCII;
/* Initialize with new settings. */
hwiniterr = serial_hw_init ();