diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2016-12-07 11:13:36 +1100 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2016-12-20 15:04:07 +1100 |
commit | 4b06a4645e19830581505a675075773adc0857c2 (patch) | |
tree | 94d77cc95f94432277e401763c65d3d7cbcc37d8 /ui | |
parent | ea8bd5f424a9b01c71e1694bb5b6ffc13e3da4f5 (diff) | |
download | petitboot-4b06a4645e19830581505a675075773adc0857c2.zip petitboot-4b06a4645e19830581505a675075773adc0857c2.tar.gz |
types: shorten boot_status definitions
struct boot_status is a bit misnamed; we report status on things that
aren't just the boot status (eg, discovery).
This change refactors struct boot_status into just struct status. We
give the type enum a name, and shorten the enum values to suit.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/common/discover-client.c | 6 | ||||
-rw-r--r-- | ui/common/discover-client.h | 4 | ||||
-rw-r--r-- | ui/ncurses/nc-cui.c | 4 | ||||
-rw-r--r-- | ui/test/discover-test.c | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/ui/common/discover-client.c b/ui/common/discover-client.c index 27bba32..dce74f9 100644 --- a/ui/common/discover-client.c +++ b/ui/common/discover-client.c @@ -131,7 +131,7 @@ void discover_client_enumerate(struct discover_client *client) } static void update_status(struct discover_client *client, - struct boot_status *status) + struct status *status) { if (client->ops.update_status) client->ops.update_status(status, client->ops.cb_arg); @@ -156,8 +156,8 @@ static int discover_client_process(void *arg) struct discover_client *client = arg; struct pb_protocol_message *message; struct system_info *sysinfo; - struct boot_status *status; struct boot_option *opt; + struct status *status; struct config *config; struct device *dev; char *dev_id; @@ -206,7 +206,7 @@ static int discover_client_process(void *arg) device_remove(client, dev_id); break; case PB_PROTOCOL_ACTION_STATUS: - status = talloc_zero(ctx, struct boot_status); + status = talloc_zero(ctx, struct status); rc = pb_protocol_deserialise_boot_status(status, message); if (rc) { diff --git a/ui/common/discover-client.h b/ui/common/discover-client.h index 59d2df9..95a5d9e 100644 --- a/ui/common/discover-client.h +++ b/ui/common/discover-client.h @@ -24,7 +24,7 @@ struct pb_boot_data { * devices' boot options), so callbacks may store boot options and devices * as long as the client remains allocated. * - * The boot_status and system_info structs are allocated by the client, + * The status and system_info structs are allocated by the client, * and will be free()ed after the callback is invoked. If the callback * stores these structures for usage beyond the duration of the callback, * it must talloc_steal() them. @@ -35,7 +35,7 @@ struct discover_client_ops { int (*boot_option_add)(struct device *dev, struct boot_option *option, void *arg); void (*device_remove)(struct device *device, void *arg); - void (*update_status)(struct boot_status *status, void *arg); + void (*update_status)(struct status *status, void *arg); void (*update_sysinfo)(struct system_info *sysinfo, void *arg); void (*update_config)(struct config *sysinfo, void *arg); void *cb_arg; diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c index 304371c..a6537cb 100644 --- a/ui/ncurses/nc-cui.c +++ b/ui/ncurses/nc-cui.c @@ -694,13 +694,13 @@ static void cui_device_remove(struct device *dev, void *arg) nc_scr_post(cui->current); } -static void cui_update_status(struct boot_status *status, void *arg) +static void cui_update_status(struct status *status, void *arg) { struct cui *cui = cui_from_arg(arg); nc_scr_status_printf(cui->current, "%s: %s", - status->type == BOOT_STATUS_ERROR ? + status->type == STATUS_ERROR ? _("Error") : _("Info"), status->message); diff --git a/ui/test/discover-test.c b/ui/test/discover-test.c index b099b59..ea76764 100644 --- a/ui/test/discover-test.c +++ b/ui/test/discover-test.c @@ -75,7 +75,7 @@ static void print_device_remove(struct device *device, printf("\tname: %s\n", device->name); } -static void print_status(struct boot_status *status, +static void print_status(struct status *status, void __attribute__((unused)) *arg) { printf("status:\n"); |