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

Function parse_conf_str

src/cfgfiles.c:1809–1837  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1807}
1808
1809boolean
1810parse_conf_str(const char *str, boolean (*proc)(char *arg))
1811{
1812 size_t len;
1813 struct _cnf_parser_state parser;
1814
1815 cnf_parser_init(&parser);
1816 free_config_sections();
1817 config_error_init(FALSE, "parse_conf_str", FALSE);
1818 while (str && *str) {
1819 len = 0;
1820 while (*str && len < (parser.inbufsz-1)) {
1821 parser.inbuf[len] = *str;
1822 len++;
1823 str++;
1824 if (parser.inbuf[len-1] == '\n')
1825 break;
1826 }
1827 parser.inbuf[len] = '\0';
1828 parse_conf_buf(&parser, proc);
1829 if (parser.pbreak)
1830 break;
1831 }
1832 cnf_parser_done(&parser);
1833
1834 free_config_sections();
1835 config_error_done();
1836 return parser.rv;
1837}
1838
1839/* parse_conf_file
1840 *

Callers 1

nhl_parse_configFunction · 0.85

Calls 6

cnf_parser_initFunction · 0.85
free_config_sectionsFunction · 0.85
config_error_initFunction · 0.85
parse_conf_bufFunction · 0.85
cnf_parser_doneFunction · 0.85
config_error_doneFunction · 0.85

Tested by

no test coverage detected