]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
menu: export menu_default_choice() function
authorAnatolij Gustschin <agust@denx.de>
Sat, 23 Mar 2013 14:52:04 +0000 (14:52 +0000)
committerAnatolij 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>
common/menu.c
doc/README.menu
include/menu.h

index 322b75e62f27e23d433c7504fc072502e651f33c..64b461abb491b8584d8cfc76087c0c808e8d7ebc 100644 (file)
@@ -176,7 +176,7 @@ static inline struct menu_item *menu_item_by_key(struct menu *m,
  * 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;
index c9493984cada06c01ab256fc1867d478354e98a6..a8999cab51188c1e12c09e38f2cde8c15d4415e1 100644 (file)
@@ -65,6 +65,11 @@ int menu_item_add(struct menu *m, char *item_key, void *item_data);
  */
 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.
index f4dd5af165f10b2d9c0988762f14bfbbdae61c72..d8200eee8375a1bc72d5567bcbb3f57aaf9c72be 100644 (file)
@@ -29,6 +29,7 @@ int menu_get_choice(struct menu *m, void **choice);
 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);