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

Function addto_windowchain

src/windows.c:341–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339
340#ifdef WINCHAIN
341void
342addto_windowchain(const char *s)
343{
344 int i;
345
346 for (i = 0; winchoices[i].procs; i++) {
347 if ('+' != winchoices[i].procs->name[0])
348 continue;
349 if (!strcmpi(s, winchoices[i].procs->name)) {
350 struct winlink *p = wl_new();
351
352 p->wincp = &winchoices[i];
353 wl_addtail(p);
354 /* NB: The ini_routine() will be called during commit. */
355 return;
356 }
357 }
358
359 windowprocs.win_raw_print = def_raw_print;
360
361 raw_printf("Window processor %s not recognized. Choices are:", s);
362 for (i = 0; winchoices[i].procs; i++) {
363 if ('+' != winchoices[i].procs->name[0])
364 continue;
365 raw_printf(" %s", winchoices[i].procs->name);
366 }
367
368 nh_terminate(EXIT_FAILURE);
369}
370
371void
372commit_windowchain(void)

Callers 1

optfn_windowchainFunction · 0.85

Calls 4

wl_newFunction · 0.85
wl_addtailFunction · 0.85
raw_printfFunction · 0.70
nh_terminateFunction · 0.70

Tested by

no test coverage detected