summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fc9d64f)
raw | patch | inline | side by side (parent: fc9d64f)
author | Anatolij Gustschin <agust@denx.de> | |
Sat, 23 Mar 2013 14:52:04 +0000 (14:52 +0000) | ||
committer | Anatolij Gustschin <agust@denx.de> | |
Fri, 29 Mar 2013 08:35:34 +0000 (09:35 +0100) |
Checking the default menu item and obtaining its data can
be useful in custom menu code. Export menu_default_choice()
function which serves this purpose.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
be useful in custom menu code. Export menu_default_choice()
function which serves this purpose.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
common/menu.c | patch | blob | history | |
doc/README.menu | patch | blob | history | |
include/menu.h | patch | blob | history |
diff --git a/common/menu.c b/common/menu.c
index 322b75e62f27e23d433c7504fc072502e651f33c..64b461abb491b8584d8cfc76087c0c808e8d7ebc 100644 (file)
--- a/common/menu.c
+++ b/common/menu.c
* Set *choice to point to the default item's data, if any default item was
* set, and returns 1. If no default item was set, returns -ENOENT.
*/
-static inline int menu_default_choice(struct menu *m, void **choice)
+int menu_default_choice(struct menu *m, void **choice)
{
if (m->default_item) {
*choice = m->default_item->data;
diff --git a/doc/README.menu b/doc/README.menu
index c9493984cada06c01ab256fc1867d478354e98a6..a8999cab51188c1e12c09e38f2cde8c15d4415e1 100644 (file)
--- a/doc/README.menu
+++ b/doc/README.menu
*/
int menu_default_set(struct menu *m, char *item_key);
+/*
+ * menu_default_choice() - Set *choice to point to the default item's data
+ */
+int menu_default_choice(struct menu *m, void **choice);
+
/*
* menu_get_choice() - Returns the user's selected menu entry, or the
* default if the menu is set to not prompt or the timeout expires.
diff --git a/include/menu.h b/include/menu.h
index f4dd5af165f10b2d9c0988762f14bfbbdae61c72..d8200eee8375a1bc72d5567bcbb3f57aaf9c72be 100644 (file)
--- a/include/menu.h
+++ b/include/menu.h
int menu_item_add(struct menu *m, char *item_key, void *item_data);
int menu_destroy(struct menu *m);
void menu_display_statusline(struct menu *m);
+int menu_default_choice(struct menu *m, void **choice);
#if defined(CONFIG_MENU_SHOW)
int menu_show(int bootdelay);