summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-04-10 12:19:13 +1000
committerGeoff Levand <geoff@infradead.org>2013-04-10 10:49:01 -0700
commitee86a0bd989511319adf3467b41b5b2e1f486aa6 (patch)
tree43ecd9479052388dc6bd3dae697fc2a9f6962d42 /lib
parent6b2d8ff75f1b9554d01dc6872b4498d660827e58 (diff)
downloadtalos-petitboot-ee86a0bd989511319adf3467b41b5b2e1f486aa6.tar.gz
talos-petitboot-ee86a0bd989511319adf3467b41b5b2e1f486aa6.zip
lib/types: Create common file for type definitions
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am1
-rw-r--r--lib/pb-protocol/pb-protocol.h27
-rw-r--r--lib/types/types.h32
3 files changed, 34 insertions, 26 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 6440fe4..7847d09 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -28,6 +28,7 @@ libpbcore_la_SOURCES = \
waiter/waiter.h \
pb-protocol/pb-protocol.c \
pb-protocol/pb-protocol.h \
+ types/types.h \
talloc/talloc.c \
talloc/talloc.h \
system/system.c \
diff --git a/lib/pb-protocol/pb-protocol.h b/lib/pb-protocol/pb-protocol.h
index bfa9222..07ef7e1 100644
--- a/lib/pb-protocol/pb-protocol.h
+++ b/lib/pb-protocol/pb-protocol.h
@@ -5,6 +5,7 @@
#include <stdio.h>
#include <list/list.h>
+#include <types/types.h>
#define PB_SOCKET_PATH "/tmp/petitboot.ui"
@@ -21,32 +22,6 @@ struct pb_protocol_message {
char payload[];
};
-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);
diff --git a/lib/types/types.h b/lib/types/types.h
new file mode 100644
index 0000000..acd9e3e
--- /dev/null
+++ b/lib/types/types.h
@@ -0,0 +1,32 @@
+#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 */
OpenPOWER on IntegriCloud