MCPcopy Create free account
hub / github.com/NetHack/NetHack / topl_yn_function

Function topl_yn_function

outdated/sys/mac/mactopl.c:26–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26char
27topl_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
51char
52mac_yn_function(query, resp, def)

Callers 1

mac_yn_functionFunction · 0.85

Calls 5

queued_respFunction · 0.85
enter_topl_modeFunction · 0.85
topl_set_respFunction · 0.85
readcharFunction · 0.85
leave_topl_modeFunction · 0.85

Tested by

no test coverage detected