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

Function tty_putmixed

win/tty/wintty.c:4169–4195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4167#endif /* POSITIONBAR */
4168
4169void
4170tty_putmixed(winid window, int attr, const char *str)
4171{
4172 struct WinDesc *cw;
4173 char buf[BUFSZ];
4174#ifdef ENHANCED_SYMBOLS
4175 int utf8flag = 0;
4176#endif
4177
4178 if (window == WIN_ERR || (cw = wins[window]) == (struct WinDesc *) 0) {
4179 tty_raw_print(str);
4180 return;
4181 }
4182 ttyDisplay->mixed = 1;
4183#ifdef ENHANCED_SYMBOLS
4184 if ((windowprocs.wincap2 & WC2_U_UTF8STR) && SYMHANDLING(H_UTF8)) {
4185 mixed_to_utf8(buf, sizeof buf, str, &utf8flag);
4186 if (cw->type == NHW_MESSAGE)
4187 ttyDisplay->topl_utf8 = utf8flag;
4188 } else
4189#endif
4190 decode_mixed(buf, str);
4191 /* now send it to the normal tty_putstr */
4192 tty_putstr(window, attr, buf);
4193 ttyDisplay->topl_utf8 = 0;
4194 ttyDisplay->mixed = 0;
4195}
4196
4197/*
4198 * +------------------+

Callers

nothing calls this directly

Calls 4

tty_raw_printFunction · 0.85
mixed_to_utf8Function · 0.85
decode_mixedFunction · 0.85
tty_putstrFunction · 0.85

Tested by

no test coverage detected