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
| 570 | by calling more() or displaying both on the same line. |
| 571 | */ |
| 572 | void |
| 573 | curses_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 | |
| 600 | void |
| 601 | curses_putmixed(winid window, int attr, const char *str) |
no test coverage detected