Change YES() to take const char* arguments.

This commit is contained in:
Jason S. Ninneman 2017-06-18 19:51:59 -07:00
parent 9229fdf2a3
commit 624ba16aad
5 changed files with 13 additions and 13 deletions

8
misc.c
View file

@ -250,7 +250,7 @@ char* get_input()
return (input);
}
bool YES(vocab_t question, vocab_t yes_response, vocab_t no_response)
bool YES(const char* question, const char* yes_response, const char* no_response)
/* Print message X, wait for yes/no answer. If yes, print Y and return true;
* if no, print Z and return false. */
{
@ -258,7 +258,7 @@ bool YES(vocab_t question, vocab_t yes_response, vocab_t no_response)
bool outcome;
for (;;) {
RSPEAK(question);
speak(question);
reply = get_input();
@ -276,11 +276,11 @@ bool YES(vocab_t question, vocab_t yes_response, vocab_t no_response)
free(firstword);
if (yes == 0 || y == 0) {
RSPEAK(yes_response);
speak(yes_response);
outcome = true;
break;
} else if (no == 0 || n == 0) {
RSPEAK(no_response);
speak(no_response);
outcome = false;
break;
} else