MCPcopy Index your code
hub / github.com/NetHack/NetHack / xwaitforspace

Function xwaitforspace

win/tty/getline.c:229–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229void
230xwaitforspace(const char *s) /* chars allowed besides return */
231{
232 int c, x = ttyDisplay ? (int) ttyDisplay->dismiss_more : '\n';
233
234 morc = 0;
235 while (
236#ifdef HANGUPHANDLING
237 !program_state.done_hup &&
238#endif
239 (c = tty_nhgetch()) != EOF) {
240 if (c == '\n' || c == '\r')
241 break;
242
243 if (iflags.cbreak) {
244 if (c == '\033') {
245 if (ttyDisplay)
246 ttyDisplay->dismiss_more = 1;
247 morc = '\033';
248 break;
249 }
250 if ((s && strchr(s, c)) || c == x || (x == '\n' && c == '\r')) {
251 morc = (char) c;
252 break;
253 }
254 tty_nhbell();
255 }
256 }
257}
258
259/*
260 * Implement extended command completion by using this hook into

Callers 4

moreFunction · 0.85
getretFunction · 0.85
dmoreFunction · 0.85
process_menu_windowFunction · 0.85

Calls 2

tty_nhgetchFunction · 0.85
tty_nhbellFunction · 0.70

Tested by

no test coverage detected