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

Function nhwindows_hangup

src/windows.c:614–640  ·  view source on GitHub ↗

hangup has occurred; switch to no-op user interface */

Source from the content-addressed store, hash-verified

612
613/* hangup has occurred; switch to no-op user interface */
614void
615nhwindows_hangup(void)
616{
617 char *(*previnterface_getmsghistory)(boolean) = 0;
618
619#ifdef ALTMETA
620 /* command processor shouldn't look for 2nd char after seeing ESC */
621 iflags.altmeta = FALSE;
622#endif
623
624 /* don't call exit_nhwindows() directly here; if a hangup occurs
625 while interface code is executing, exit_nhwindows could knock
626 the interface's active data structures out from under itself */
627 if (iflags.window_inited
628 && windowprocs.win_exit_nhwindows != hup_exit_nhwindows)
629 previnterface_exit_nhwindows = windowprocs.win_exit_nhwindows;
630
631 /* also, we have to leave the old interface's getmsghistory()
632 in place because it will be called while saving the game */
633 if (windowprocs.win_getmsghistory != hup_procs.win_getmsghistory)
634 previnterface_getmsghistory = windowprocs.win_getmsghistory;
635
636 windowprocs = hup_procs;
637
638 if (previnterface_getmsghistory)
639 windowprocs.win_getmsghistory = previnterface_getmsghistory;
640}
641
642staticfn void
643hup_exit_nhwindows(const char *lastgasp)

Callers 1

hangupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected