| 24 | } |
| 25 | |
| 26 | char |
| 27 | topl_yn_function(const char *query, const char *resp, char def) |
| 28 | { |
| 29 | char buf[30]; |
| 30 | char c = queued_resp((char *) resp); |
| 31 | if (!c) { |
| 32 | enter_topl_mode((char *) query); |
| 33 | topl_set_resp((char *) resp, def); |
| 34 | |
| 35 | do { |
| 36 | c = readchar(); |
| 37 | if (c && resp && !strchr(resp, c)) { |
| 38 | nhbell(); |
| 39 | c = '\0'; |
| 40 | } |
| 41 | } while (!c); |
| 42 | |
| 43 | topl_set_resp("", '\0'); |
| 44 | leave_topl_mode(buf); |
| 45 | if (c == '#') |
| 46 | yn_number = atoi(buf); |
| 47 | } |
| 48 | return c; |
| 49 | } |
| 50 | |
| 51 | char |
| 52 | mac_yn_function(query, resp, def) |
no test coverage detected