diff --git a/src/screen_utils.c b/src/screen_utils.c
index 1203a938c8c4ca657c1f31b2a78bb7b316e470ce..8889ac13277b8b8cb0b2edf53609847bc469ae80 100644 (file)
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
#include "wreadln.h"
#include <mpd/client.h>
+#include <ctype.h>
void
screen_bell(void)
return key;
}
+bool
+screen_get_yesno(const char *prompt, bool def)
+{
+ /* NOTE: if one day a translator decides to use a multi-byte character
+ for one of the yes/no keys, we'll have to parse it properly */
+
+ int key = tolower(screen_getch(prompt));
+ if (key == YES[0])
+ return true;
+ else if (key == NO[0])
+ return false;
+ else
+ return def;
+}
+
char *
screen_readln(const char *prompt,
const char *value,