MCPcopy Index your code
hub / github.com/NetHack/NetHack / whatdoes_help

Function whatdoes_help

src/pager.c:2420–2445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2418*/
2419
2420staticfn void
2421whatdoes_help(void)
2422{
2423 dlb *fp;
2424 char *p, buf[BUFSZ];
2425 winid tmpwin;
2426
2427 fp = dlb_fopen(KEYHELP, "r");
2428 if (!fp) {
2429 pline("Cannot open \"%s\" data file!", KEYHELP);
2430 display_nhwindow(WIN_MESSAGE, TRUE);
2431 return;
2432 }
2433 tmpwin = create_nhwindow(NHW_TEXT);
2434 while (dlb_fgets(buf, (int) sizeof buf, fp)) {
2435 if (*buf == '#')
2436 continue;
2437 for (p = buf; *p; p++)
2438 if (*p != ' ' && *p != '\t')
2439 break;
2440 putstr(tmpwin, 0, p);
2441 }
2442 (void) dlb_fclose(fp);
2443 display_nhwindow(tmpwin, TRUE);
2444 destroy_nhwindow(tmpwin);
2445}
2446
2447#if 0
2448#define WD_STACKLIMIT 5

Callers 1

pager.cFile · 0.85

Calls 4

dlb_fopenFunction · 0.85
dlb_fgetsFunction · 0.85
dlb_fcloseFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected