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

Function read_config_file

src/cfgfiles.c:1623–1647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1621}
1622
1623boolean
1624read_config_file(const char *filename, int src)
1625{
1626 FILE *fp;
1627 boolean rv = TRUE;
1628
1629 if (!(fp = fopen_config_file(filename, src)))
1630 return FALSE;
1631#ifndef SFCTOOL
1632 /* begin detection of duplicate configfile options */
1633 reset_duplicate_opt_detection();
1634#endif /* SFCTOOL */
1635 free_config_sections();
1636 iflags.parse_config_file_src = src;
1637
1638 rv = parse_conf_file(fp, parse_config_line);
1639 (void) fclose(fp);
1640
1641 free_config_sections();
1642#ifndef SFCTOOL
1643 /* turn off detection of duplicate configfile options */
1644 reset_duplicate_opt_detection();
1645#endif /* SFCTOOL */
1646 return rv;
1647}
1648
1649struct _cnf_parser_state {
1650 char *inbuf;

Callers 5

test_portable_configFunction · 0.85
initoptionsFunction · 0.85
initoptions_initFunction · 0.85
rcfileFunction · 0.85
read_sysconfFunction · 0.85

Calls 5

fopen_config_fileFunction · 0.85
free_config_sectionsFunction · 0.85
parse_conf_fileFunction · 0.85
fcloseFunction · 0.85

Tested by 1

test_portable_configFunction · 0.68