diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-12-07 16:20:22 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-01-27 18:07:59 +0100 |
commit | 0ec7b3e7f21caf6bfde404528928d600b661ea8d (patch) | |
tree | 85e1a8b7e7234d22b9e7fc4947f89d50f4bcbcfb /ui | |
parent | d5cafc733d21167fce7fcc3b45530ecb1f878e09 (diff) |
char: rename CharDriverState Chardev
Pick a uniform chardev type name.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/console.c | 40 | ||||
-rw-r--r-- | ui/gtk.c | 26 |
2 files changed, 33 insertions, 33 deletions
diff --git a/ui/console.c b/ui/console.c index 495d5a2121..7420f28349 100644 --- a/ui/console.c +++ b/ui/console.c @@ -158,7 +158,7 @@ struct QemuConsole { int esc_params[MAX_ESC_PARAMS]; int nb_esc_params; - CharDriverState *chr; + Chardev *chr; /* fifo for key pressed */ QEMUFIFO out_fifo; uint8_t out_fifo_buf[16]; @@ -183,7 +183,7 @@ static int nb_consoles = 0; static bool cursor_visible_phase; static QEMUTimer *cursor_timer; -static void text_console_do_init(CharDriverState *chr, DisplayState *ds); +static void text_console_do_init(Chardev *chr, DisplayState *ds); static void dpy_refresh(DisplayState *s); static DisplayState *get_alloc_displaystate(void); static void text_console_update_cursor_timer(void); @@ -1046,14 +1046,14 @@ void console_select(unsigned int index) } } -typedef struct VCDriverState { - CharDriverState parent; +typedef struct VCChardev { + Chardev parent; QemuConsole *console; -} VCDriverState; +} VCChardev; -static int console_puts(CharDriverState *chr, const uint8_t *buf, int len) +static int console_puts(Chardev *chr, const uint8_t *buf, int len) { - VCDriverState *drv = (VCDriverState *)chr; + VCChardev *drv = (VCChardev *)chr; QemuConsole *s = drv->console; int i; @@ -1962,9 +1962,9 @@ int qemu_console_get_height(QemuConsole *con, int fallback) return con ? surface_height(con->surface) : fallback; } -static void text_console_set_echo(CharDriverState *chr, bool echo) +static void text_console_set_echo(Chardev *chr, bool echo) { - VCDriverState *drv = (VCDriverState *)chr; + VCChardev *drv = (VCChardev *)chr; QemuConsole *s = drv->console; s->echo = echo; @@ -2003,9 +2003,9 @@ static const GraphicHwOps text_console_ops = { .text_update = text_console_update, }; -static void text_console_do_init(CharDriverState *chr, DisplayState *ds) +static void text_console_do_init(Chardev *chr, DisplayState *ds) { - VCDriverState *drv = (VCDriverState *)chr; + VCChardev *drv = (VCChardev *)chr; QemuConsole *s = drv->console; int g_width = 80 * FONT_WIDTH; int g_height = 24 * FONT_HEIGHT; @@ -2058,11 +2058,11 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds) static const CharDriver vc_driver; -static CharDriverState *text_console_init(ChardevVC *vc, Error **errp) +static Chardev *text_console_init(ChardevVC *vc, Error **errp) { ChardevCommon *common = qapi_ChardevVC_base(vc); - CharDriverState *chr; - VCDriverState *drv; + Chardev *chr; + VCChardev *drv; QemuConsole *s; unsigned width = 0; unsigned height = 0; @@ -2099,7 +2099,7 @@ static CharDriverState *text_console_init(ChardevVC *vc, Error **errp) } s->chr = chr; - drv = (VCDriverState *)chr; + drv = (VCChardev *)chr; drv->console = s; if (display_state) { @@ -2110,10 +2110,10 @@ static CharDriverState *text_console_init(ChardevVC *vc, Error **errp) static VcHandler *vc_handler = text_console_init; -static CharDriverState *vc_init(const CharDriver *driver, - const char *id, ChardevBackend *backend, - ChardevReturn *ret, bool *be_opened, - Error **errp) +static Chardev *vc_init(const CharDriver *driver, + const char *id, ChardevBackend *backend, + ChardevReturn *ret, bool *be_opened, + Error **errp) { /* console/chardev init sometimes completes elsewhere in a 2nd * stage, so defer OPENED events until they are fully initialized @@ -2204,7 +2204,7 @@ static const TypeInfo qemu_console_info = { }; static const CharDriver vc_driver = { - .instance_size = sizeof(VCDriverState), + .instance_size = sizeof(VCChardev), .kind = CHARDEV_BACKEND_KIND_VC, .parse = qemu_chr_parse_vc, .create = vc_init, @@ -181,11 +181,11 @@ struct GtkDisplayState { bool ignore_keys; }; -typedef struct VCDriverState { - CharDriverState parent; +typedef struct VCChardev { + Chardev parent; VirtualConsole *console; bool echo; -} VCDriverState; +} VCChardev; static void gd_grab_pointer(VirtualConsole *vc, const char *reason); static void gd_ungrab_pointer(GtkDisplayState *s); @@ -1689,18 +1689,18 @@ static void gd_vc_adjustment_changed(GtkAdjustment *adjustment, void *opaque) } } -static int gd_vc_chr_write(CharDriverState *chr, const uint8_t *buf, int len) +static int gd_vc_chr_write(Chardev *chr, const uint8_t *buf, int len) { - VCDriverState *vcd = (VCDriverState *)chr; + VCChardev *vcd = (VCChardev *)chr; VirtualConsole *vc = vcd->console; vte_terminal_feed(VTE_TERMINAL(vc->vte.terminal), (const char *)buf, len); return len; } -static void gd_vc_chr_set_echo(CharDriverState *chr, bool echo) +static void gd_vc_chr_set_echo(Chardev *chr, bool echo) { - VCDriverState *vcd = (VCDriverState *)chr; + VCChardev *vcd = (VCChardev *)chr; VirtualConsole *vc = vcd->console; if (vc) { @@ -1711,19 +1711,19 @@ static void gd_vc_chr_set_echo(CharDriverState *chr, bool echo) } static int nb_vcs; -static CharDriverState *vcs[MAX_VCS]; +static Chardev *vcs[MAX_VCS]; -static CharDriverState *gd_vc_handler(ChardevVC *vc, Error **errp) +static Chardev *gd_vc_handler(ChardevVC *vc, Error **errp) { static const CharDriver gd_vc_driver = { - .instance_size = sizeof(VCDriverState), + .instance_size = sizeof(VCChardev), .kind = CHARDEV_BACKEND_KIND_VC, .chr_write = gd_vc_chr_write, .chr_set_echo = gd_vc_chr_set_echo, }; ChardevCommon *common = qapi_ChardevVC_base(vc); - CharDriverState *chr; + Chardev *chr; if (nb_vcs == MAX_VCS) { error_setg(errp, "Maximum number of consoles reached"); @@ -1768,14 +1768,14 @@ static gboolean gd_vc_in(VteTerminal *terminal, gchar *text, guint size, } static GSList *gd_vc_vte_init(GtkDisplayState *s, VirtualConsole *vc, - CharDriverState *chr, int idx, + Chardev *chr, int idx, GSList *group, GtkWidget *view_menu) { char buffer[32]; GtkWidget *box; GtkWidget *scrollbar; GtkAdjustment *vadjustment; - VCDriverState *vcd = (VCDriverState *)chr; + VCChardev *vcd = (VCChardev *)chr; vc->s = s; vc->vte.echo = vcd->echo; |