aboutsummaryrefslogtreecommitdiff
path: root/src/include/ipxe
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2012-03-27 17:27:27 +0100
committerMichael Brown <mcb30@ipxe.org>2012-03-29 13:44:48 +0100
commit0d2fba2887a78b8bc4cd0d7fc6946d001075d92f (patch)
tree544a87c6d6a994c1bfd4824df7b9b1e0281b5b24 /src/include/ipxe
parent0b445275c421f9292adca5b4480dad7a0136f6a0 (diff)
downloadipxe-0d2fba2887a78b8bc4cd0d7fc6946d001075d92f.zip
ipxe-0d2fba2887a78b8bc4cd0d7fc6946d001075d92f.tar.gz
ipxe-0d2fba2887a78b8bc4cd0d7fc6946d001075d92f.tar.bz2
[menu] Add the abstract concept of a menu
Inspired-by: Robin Smidsrød <robin@smidsrod.no> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe')
-rw-r--r--src/include/ipxe/menu.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/include/ipxe/menu.h b/src/include/ipxe/menu.h
new file mode 100644
index 0000000..943aa57
--- /dev/null
+++ b/src/include/ipxe/menu.h
@@ -0,0 +1,47 @@
+#ifndef _IPXE_MENU_H
+#define _IPXE_MENU_H
+
+/** @file
+ *
+ * Menu selection
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+#include <ipxe/list.h>
+
+/** A menu */
+struct menu {
+ /** List of menus */
+ struct list_head list;
+ /** Name */
+ const char *name;
+ /** Title */
+ const char *title;
+ /** Menu items */
+ struct list_head items;
+};
+
+/** A menu item */
+struct menu_item {
+ /** List of menu items */
+ struct list_head list;
+ /** Label */
+ const char *label;
+ /** Text */
+ const char *text;
+ /** Shortcut key */
+ int shortcut;
+ /** Is default item */
+ int is_default;
+};
+
+extern struct menu * create_menu ( const char *name, const char *title );
+extern struct menu_item * add_menu_item ( struct menu *menu, const char *label,
+ const char *text, int shortcut,
+ int is_default );
+extern void destroy_menu ( struct menu *menu );
+extern struct menu * find_menu ( const char *name );
+
+#endif /* _IPXE_MENU_H */