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

Function curses_putstr

win/curses/cursmain.c:572–598  ·  view source on GitHub ↗

putstr(window, attr, str) -- Print str on the window with the given attribute. Only printable ASCII characters (040-0126) must be supported. Multiple putstr()s are output on separate lines. Attributes can be one of ATR_NONE (or 0) ATR_ULINE ATR_BOLD

Source from the content-addressed store, hash-verified

570 by calling more() or displaying both on the same line.
571*/
572void
573curses_putstr(winid wid, int attr, const char *text)
574{
575 int mesgflags, curses_attr;
576
577 mesgflags = attr & (ATR_URGENT | ATR_NOHISTORY);
578 attr &= ~mesgflags;
579
580 /* this is comparable to tty's cw->flags &= ~WIN_STOP; if messages are
581 being suppressed after >>ESC, override that and resume showing them */
582 if ((mesgflags & ATR_URGENT) != 0) {
583 curs_mesg_suppress_seq = -1L;
584 curs_mesg_no_suppress = TRUE;
585 }
586
587 if (wid == WIN_MESSAGE && (mesgflags & ATR_NOHISTORY) != 0) {
588 /* display message without saving it in recall history */
589 curses_count_window(text);
590 } else {
591 /* We need to convert NetHack attributes to curses attributes */
592 curses_attr = curses_convert_attr(attr);
593 curses_puts(wid, curses_attr, text);
594 }
595
596 /* urgent message handling is a one-shot operation; we're done */
597 curs_mesg_no_suppress = FALSE;
598}
599
600void
601curses_putmixed(winid window, int attr, const char *str)

Callers 1

curses_putmixedFunction · 0.85

Calls 3

curses_count_windowFunction · 0.85
curses_convert_attrFunction · 0.85
curses_putsFunction · 0.85

Tested by

no test coverage detected