The device and boot_option types are defined in pb-protocol.h, but
aren't really specific to the procotol. This means a lot of
non-messaging-related files are #including the protocol definitions
unnecessarily.
This change separates the types out into lib/types/types.h.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Geoff Levand <geoff@infradead.org>
17 files changed:
#include <talloc/talloc.h>
#include <list/list.h>
#include <log/log.h>
#include <talloc/talloc.h>
#include <list/list.h>
#include <log/log.h>
-#include <pb-protocol/pb-protocol.h>
+#include <types/types.h>
#include <system/system.h>
#include "device-handler.h"
#include <system/system.h>
#include "device-handler.h"
#include "log/log.h"
#include "talloc/talloc.h"
#include "log/log.h"
#include "talloc/talloc.h"
-#include "pb-protocol/pb-protocol.h"
+#include "types/types.h"
#include "parser-conf.h"
#include "parser-utils.h"
#include "paths.h"
#include "parser-conf.h"
#include "parser-utils.h"
#include "paths.h"
#include "log/log.h"
#include "talloc/talloc.h"
#include "log/log.h"
#include "talloc/talloc.h"
-#include "pb-protocol/pb-protocol.h"
+#include "types/types.h"
#include "parser-conf.h"
#include "parser-utils.h"
#include "paths.h"
#include "parser-conf.h"
#include "parser-utils.h"
#include "paths.h"
#include <log/log.h>
#include <talloc/talloc.h>
#include <log/log.h>
#include <talloc/talloc.h>
-#include "pb-protocol/pb-protocol.h"
+#include "types/types.h"
#include "event.h"
#include "udev.h"
#include "device-handler.h"
#include "event.h"
#include "udev.h"
#include "device-handler.h"
#ifndef PARSER_UTILS_H
#define PARSER_UTILS_H
#ifndef PARSER_UTILS_H
#define PARSER_UTILS_H
-#include "pb-protocol/pb-protocol.h"
+#include "types/types.h"
#include "parser.h"
#define streq(a,b) (!strcasecmp((a),(b)))
#include "parser.h"
#define streq(a,b) (!strcasecmp((a),(b)))
-#include "pb-protocol/pb-protocol.h"
+#include "types/types.h"
#include <log/log.h>
#include "device-handler.h"
#include <log/log.h>
#include "device-handler.h"
#include "log/log.h"
#include "talloc/talloc.h"
#include "log/log.h"
#include "talloc/talloc.h"
-#include "pb-protocol/pb-protocol.h"
+#include "types/types.h"
#include "parser-conf.h"
#include "parser-utils.h"
#include "paths.h"
#include "parser-conf.h"
#include "parser-utils.h"
#include "paths.h"
waiter/waiter.h \
pb-protocol/pb-protocol.c \
pb-protocol/pb-protocol.h \
waiter/waiter.h \
pb-protocol/pb-protocol.c \
pb-protocol/pb-protocol.h \
talloc/talloc.c \
talloc/talloc.h \
system/system.c \
talloc/talloc.c \
talloc/talloc.h \
system/system.c \
#include <stdio.h>
#include <list/list.h>
#include <stdio.h>
#include <list/list.h>
+#include <types/types.h>
#define PB_SOCKET_PATH "/tmp/petitboot.ui"
#define PB_SOCKET_PATH "/tmp/petitboot.ui"
-struct device {
- char *id;
- char *name;
- char *description;
- char *icon_file;
-
- struct list boot_options;
-
- int n_options;
- void *ui_info;
-};
-
-struct boot_option {
- char *id;
- char *name;
- char *description;
- char *icon_file;
- char *boot_image_file;
- char *initrd_file;
- char *boot_args;
-
- struct list_item list;
-
- void *ui_info;
-};
-
void pb_protocol_dump_device(const struct device *dev, const char *text,
FILE *stream);
int pb_protocol_device_len(const struct device *dev);
void pb_protocol_dump_device(const struct device *dev, const char *text,
FILE *stream);
int pb_protocol_device_len(const struct device *dev);
--- /dev/null
+#ifndef _TYPES_H
+#define _TYPES_H
+
+#include <list/list.h>
+
+struct device {
+ char *id;
+ char *name;
+ char *description;
+ char *icon_file;
+
+ int n_options;
+ struct list boot_options;
+
+ void *ui_info;
+};
+
+struct boot_option {
+ char *id;
+ char *name;
+ char *description;
+ char *icon_file;
+ char *boot_image_file;
+ char *initrd_file;
+ char *boot_args;
+
+ struct list_item list;
+
+ void *ui_info;
+};
+
+#endif /* _TYPES_H */
#include <unistd.h>
#include <log/log.h>
#include <unistd.h>
#include <log/log.h>
-#include "pb-protocol/pb-protocol.h"
+#include <types/types.h>
#include <talloc/talloc.h>
#include "discover/device-handler.h"
#include <talloc/talloc.h>
#include "discover/device-handler.h"
#ifndef _DISCOVER_CLIENT_H
#define _DISCOVER_CLIENT_H
#ifndef _DISCOVER_CLIENT_H
#define _DISCOVER_CLIENT_H
-#include <pb-protocol/pb-protocol.h>
+#include <types/types.h>
#if !defined(_PB_UI_SYSTEM_H)
#define _PB_UI_SYSTEM_H
#if !defined(_PB_UI_SYSTEM_H)
#define _PB_UI_SYSTEM_H
-#include "pb-protocol/pb-protocol.h"
#include "system/system.h"
#include "system/system.h"
+#include "types/types.h"
#include "ui/common/timer.h"
#include <signal.h>
#include "ui/common/timer.h"
#include <signal.h>
#include <linux/input.h> /* This must be included before ncurses.h */
#include <form.h>
#include <linux/input.h> /* This must be included before ncurses.h */
#include <form.h>
-#include "pb-protocol/pb-protocol.h"
+#include "types/types.h"
#include "ui/common/ui-system.h"
#include "nc-scr.h"
#include "ui/common/ui-system.h"
#include "nc-scr.h"
#include <menu.h>
#include "log/log.h"
#include <menu.h>
#include "log/log.h"
-#include "pb-protocol/pb-protocol.h"
+#include "types/types.h"
#include "nc-scr.h"
struct pmenu;
#include "nc-scr.h"
struct pmenu;
#include <assert.h>
#include <string.h>
#include <assert.h>
#include <string.h>
+#include <pb-protocol/pb-protocol.h>
+
#include "pbt-client.h"
#include "log/log.h"
#include "pbt-client.h"
#include "log/log.h"
#define _PBT_MENU_H
#include "list/list.h"
#define _PBT_MENU_H
#include "list/list.h"
-#include "pb-protocol/pb-protocol.h"
+#include "types/types.h"