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

Function init_oracles

src/rumors.c:576–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574}
575
576staticfn void
577init_oracles(dlb *fp)
578{
579 int i;
580 char line[BUFSZ];
581 int cnt = 0;
582
583 /* this assumes we're only called once */
584 (void) dlb_fgets(line, sizeof line, fp); /* skip "don't edit" comment*/
585 (void) dlb_fgets(line, sizeof line, fp);
586 if (sscanf(line, "%5d\n", &cnt) == 1 && cnt > 0) {
587 svo.oracle_cnt = (unsigned) cnt;
588 svo.oracle_loc = (unsigned long *) alloc((unsigned) cnt * sizeof(long));
589 for (i = 0; i < cnt; i++) {
590 (void) dlb_fgets(line, sizeof line, fp);
591 (void) sscanf(line, "%5lx\n", &svo.oracle_loc[i]);
592 }
593 }
594 return;
595}
596
597void
598save_oracles(NHFILE *nhfp)

Callers 1

outoracleFunction · 0.85

Calls 2

dlb_fgetsFunction · 0.85
allocFunction · 0.70

Tested by

no test coverage detected