/* Returns 1 if successful, -EINVAL if m or choice is NULL, -ENOENT if no default has been set and the menu is set to not prompt or the timeout expires, or -EINTR if the user exits the menu via ^c.  */
int menu_get_choice(struct menu *m, void **choice)
/* Returns 1 if successful, -EINVAL if m or choice is NULL, -ENOENT if no default has been set and the menu is set to not prompt or the timeout expires, or -EINTR if the user exits the menu via ^c.  */
int menu_get_choice(struct menu *m, void **choice)
{
	if (!m || !choice)
		return -EINVAL;
	if (!m->prompt || m->item_cnt == 1)
		return menu_default_choice(m, choice);
	return menu_interactive_choice(m, choice);
}