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

Function tty_ibmgraphics_fixup

sys/windows/consoletty.c:1946–1973  ·  view source on GitHub ↗

* This is called when making the switch to a symset * with an IBM handler to allow any operating system * specific changes to be carried out. */

Source from the content-addressed store, hash-verified

1944 * specific changes to be carried out.
1945 */
1946void
1947tty_ibmgraphics_fixup(void)
1948{
1949#ifdef VIRTUAL_TERMINAL_SEQUENCES
1950 char buf[BUFSZ], *bp, *localestr;
1951
1952 if (!console.hConOut)
1953 console.hConOut = GetStdHandle(STD_OUTPUT_HANDLE);
1954 /* the locale */
1955 Snprintf(buf, sizeof buf, "%s", console.orig_localestr);
1956 if ((bp = strstri(buf, ".utf8")) != 0)
1957 *bp = '\0';
1958 localestr = setlocale(LC_ALL, buf);
1959 if (localestr) {
1960 if (console.localestr)
1961 free(console.localestr);
1962 console.localestr = dupstr(localestr);
1963 }
1964 set_known_good_console_font();
1965 /* the console mode */
1966 GetConsoleMode(console.hConOut, &console.out_cmode);
1967 if ((console.out_cmode & ENABLE_VIRTUAL_TERMINAL_PROCESSING) == 0) {
1968 console.out_cmode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
1969 SetConsoleMode(console.hConOut, console.out_cmode);
1970 GetConsoleMode(console.hConOut, &console.out_cmode);
1971 }
1972#endif /* VIRTUAL_TERMINAL_SEQUENCES */
1973}
1974
1975#ifdef PORT_DEBUG
1976void

Callers 1

consoletty.cFile · 0.85

Calls 3

strstriFunction · 0.85
dupstrFunction · 0.85

Tested by

no test coverage detected