summaryrefslogtreecommitdiff
path: root/include/menu.h
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2013-03-23 14:50:40 +0000
committerAnatolij Gustschin <agust@denx.de>2013-03-29 09:35:33 +0100
commitfc9d64ffcd94c1e22675830eae13956cc4fd822d (patch)
treef14a977c82a3fb1ee3f606d71f8c1ff5306ee1f1 /include/menu.h
parent009d75ccc11d27b9a083375a88bb93cb746b4800 (diff)
menu: Add support for user defined item choice function
Selecting menu items is currently done in menu_interactive_choice() by reading the user input strings from standard input. Extend menu_interactive_choice() to support user defined function for selecting menu items. This function and its argument can be specified when creating the menu. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'include/menu.h')
-rw-r--r--include/menu.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/menu.h b/include/menu.h
index 7af5fdb0edf..f4dd5af165f 100644
--- a/include/menu.h
+++ b/include/menu.h
@@ -21,7 +21,9 @@
struct menu;
struct menu *menu_create(char *title, int timeout, int prompt,
- void (*item_data_print)(void *));
+ void (*item_data_print)(void *),
+ char *(*item_choice)(void *),
+ void *item_choice_data);
int menu_default_set(struct menu *m, char *item_key);
int menu_get_choice(struct menu *m, void **choice);
int menu_item_add(struct menu *m, char *item_key, void *item_data);