From fc9d64ffcd94c1e22675830eae13956cc4fd822d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Sat, 23 Mar 2013 14:50:40 +0000 Subject: menu: Add support for user defined item choice function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Anatolij Gustschin --- doc/README.menu | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/README.menu') diff --git a/doc/README.menu b/doc/README.menu index 6ce6bba..c949398 100644 --- a/doc/README.menu +++ b/doc/README.menu @@ -51,7 +51,9 @@ struct menu; * menu_create() - Creates a menu handle with default settings */ 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); /* * menu_item_add() - Adds or replaces a menu item -- cgit v1.1