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

Function curses_putmixed

win/curses/cursmain.c:600–636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

598}
599
600void
601curses_putmixed(winid window, int attr, const char *str)
602{
603 const char *substr = 0;
604 char buf[BUFSZ];
605 boolean done_output = FALSE;
606#ifdef ENHANCED_SYMBOLS
607 int utf8flag = 0;
608#endif
609
610 if (window == WIN_MESSAGE) {
611 str = mixed_to_glyphinfo(str, &mesg_gi);
612 mesg_mixed = 1;
613 } else {
614 if ((substr = strstri(str, "\\G")) != 0) {
615#ifdef ENHANCED_SYMBOLS
616 if ((windowprocs.wincap2 & WC2_U_UTF8STR) && SYMHANDLING(H_UTF8)) {
617 mixed_to_utf8(buf, sizeof buf, str, &utf8flag);
618 } else {
619#endif
620 decode_mixed(buf, str);
621#ifdef ENHANCED_SYMBOLS
622 }
623#endif
624 /* now send buf to the normal putstr */
625 curses_putstr(window, attr, buf);
626 done_output = TRUE;
627 }
628 }
629
630 if (!done_output) {
631 /* just send str to the normal putstr */
632 curses_putstr(window, attr, str);
633 }
634 if (window == WIN_MESSAGE)
635 mesg_mixed = 0;
636}
637
638/* Display the file named str. Complain about missing files
639 iff complain is TRUE.

Callers

nothing calls this directly

Calls 5

mixed_to_glyphinfoFunction · 0.85
strstriFunction · 0.85
mixed_to_utf8Function · 0.85
decode_mixedFunction · 0.85
curses_putstrFunction · 0.85

Tested by

no test coverage detected