diff options
Diffstat (limited to 'mdk-stage1')
-rw-r--r-- | mdk-stage1/frontend-common.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mdk-stage1/frontend-common.c b/mdk-stage1/frontend-common.c index a66db457a..6ea2984cd 100644 --- a/mdk-stage1/frontend-common.c +++ b/mdk-stage1/frontend-common.c @@ -14,6 +14,7 @@ #include <stdlib.h> #include <stdarg.h> +#include <string.h> #include <probing.h> @@ -43,3 +44,21 @@ void error_message(char *msg, ...) verror_message(msg, args); va_end(args); } + +enum return_type ask_from_list_comments(char *msg, char ** elems, char ** elems_comments, char ** choice) +{ + int answer = 0; + enum return_type results; + + results = ask_from_list_index(msg, elems, elems_comments, &answer); + + if (results == RETURN_OK) + *choice = strdup(elems[answer]); + + return results; +} + +enum return_type ask_from_list(char *msg, char ** elems, char ** choice) +{ + return ask_from_list_comments(msg, elems, NULL, choice); +} |