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

Function initoptions

src/options.c:7078–7115  ·  view source on GitHub ↗

process options, possibly including SYSCF */

Source from the content-addressed store, hash-verified

7076
7077/* process options, possibly including SYSCF */
7078void
7079initoptions(void)
7080{
7081 /*
7082 * Most places that call initoptions_init()/initoptions() would
7083 * have the calls next to each other, so instead of adding
7084 * initoptions_init() everywhere, just add it where it's needed in
7085 * a non-adjacent place and call it here for all the other cases.
7086 */
7087 if (go.opt_phase != builtin_opt)
7088 initoptions_init();
7089#ifdef SYSCF
7090/* someday there may be other SYSCF alternatives besides text file */
7091#ifdef SYSCF_FILE
7092 /* If SYSCF_FILE is specified, it _must_ exist... */
7093 assure_syscf_file();
7094 config_error_init(TRUE, SYSCF_FILE, FALSE);
7095
7096 /* ... and _must_ parse correctly. */
7097 go.opt_phase = syscf_opt;
7098 if (!read_config_file(SYSCF_FILE, set_in_sysconf)) {
7099 if (config_error_done() && !iflags.initoptions_noterminate)
7100 nh_terminate(EXIT_FAILURE);
7101 }
7102 config_error_done();
7103 /*
7104 * TODO [maybe]: parse the sysopt entries which are space-separated
7105 * lists of usernames into arrays with one name per element.
7106 */
7107#endif
7108#endif /* SYSCF */
7109
7110 /* Carry out options that got deferred from early_options */
7111 if (gd.deferred_showpaths)
7112 do_deferred_showpaths(0); /* does not return */
7113
7114 initoptions_finish();
7115}
7116
7117/* set up default values for options where 0 or False isn't sufficient */
7118void

Callers 9

mainFunction · 0.85
libnhmain.cFile · 0.85
MAINFunction · 0.85
early_optionsFunction · 0.85
mainFunction · 0.85
pcmainFunction · 0.85
scores_onlyFunction · 0.85
MAINFunction · 0.85
mainFunction · 0.85

Calls 8

initoptions_initFunction · 0.85
assure_syscf_fileFunction · 0.85
config_error_initFunction · 0.85
read_config_fileFunction · 0.85
config_error_doneFunction · 0.85
do_deferred_showpathsFunction · 0.85
initoptions_finishFunction · 0.85
nh_terminateFunction · 0.70

Tested by

no test coverage detected