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

Function dprintf

outdated/sys/mac/dprintf.c:17–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17void
18dprintf(char *format, ...)
19{
20 char buffer[500];
21 va_list list;
22 int doit;
23#define DO_DEBUGSTR 1
24#define DO_PLINE 2
25
26 if (flags.debug) {
27 doit = 0;
28 if (macFlags.hasDebugger && KeyDown(0x39)) { /* Caps Lock */
29 doit = DO_DEBUGSTR;
30 } else if (KeyDown(0x3B) && iflags.window_inited && /* Control */
31 (WIN_MESSAGE != -1)
32 && theWindows[WIN_MESSAGE].its_window) {
33 doit = DO_PLINE;
34 }
35
36 if (doit) {
37 va_start(list, format);
38 vsprintf(&buffer[1], format, list);
39 va_end(list);
40
41 if (doit == DO_DEBUGSTR) {
42 buffer[0] = strlen(&buffer[1]);
43 DebugStr((uchar *) buffer);
44 } else if (doit == DO_PLINE)
45 pline("%s", &buffer[1]);
46 }
47 }
48}

Callers 8

_mt_init_stuffFunction · 0.85
RetrievePositionFunction · 0.85
SavePositionFunction · 0.85
SaveSizeFunction · 0.85
GetWinKindFunction · 0.85
mac_create_nhwindowFunction · 0.85
allocate_offscreen_worldFunction · 0.85

Calls 2

KeyDownFunction · 0.85
plineFunction · 0.50

Tested by

no test coverage detected