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

Function topl_putsym

win/tty/topl.c:304–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304static void
305topl_putsym(char c)
306{
307 struct WinDesc *cw = wins[WIN_MESSAGE];
308
309 if (cw == (struct WinDesc *) 0)
310 panic("Putsym window MESSAGE nonexistent");
311
312 switch (c) {
313 case '\b':
314 if (ttyDisplay->curx == 0 && ttyDisplay->cury > 0)
315 tty_curs(BASE_WINDOW, CO, (int) ttyDisplay->cury - 1);
316 backsp();
317 nhassert(ttyDisplay->curx > 0);
318 ttyDisplay->curx--;
319 cw->curx = ttyDisplay->curx;
320 return;
321 case '\n':
322 cl_end();
323 ttyDisplay->curx = 0;
324 ttyDisplay->cury++;
325 cw->cury = ttyDisplay->cury;
326#ifdef WIN32CON
327 (void) putchar(c);
328#endif
329 break;
330 default:
331 if (ttyDisplay->curx == CO - 1)
332 topl_putsym('\n'); /* 1 <= curx < CO; avoid CO */
333#ifdef WIN32CON
334 (void) putchar(c);
335#endif
336 ttyDisplay->curx++;
337 }
338 cw->curx = ttyDisplay->curx;
339 if (cw->curx == 0)
340 cl_end();
341#ifndef WIN32CON
342 (void) putchar(c);
343#endif
344}
345
346void
347putsyms(const char *str)

Callers 2

moreFunction · 0.85
putsymsFunction · 0.85

Calls 4

tty_cursFunction · 0.85
backspFunction · 0.70
cl_endFunction · 0.70
panicFunction · 0.50

Tested by

no test coverage detected