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

Function optfn_cursesgraphics

src/options.c:1344–1390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1342
1343#ifdef CURSES_GRAPHICS
1344staticfn int
1345optfn_cursesgraphics(
1346 int optidx, int req, boolean negated,
1347 char *opts, char *op UNUSED)
1348{
1349#ifdef BACKWARD_COMPAT
1350 boolean badflag = FALSE;
1351#endif
1352
1353 if (req == do_init) {
1354 return optn_ok;
1355 }
1356 if (req == do_set) {
1357 /* "cursesgraphics" */
1358
1359#ifdef BACKWARD_COMPAT
1360 if (!negated) {
1361 /* There is no rogue level cursesgraphics-specific set */
1362 if (gs.symset[PRIMARYSET].name) {
1363 badflag = TRUE;
1364 } else {
1365 gs.symset[PRIMARYSET].name = dupstr(allopt[optidx].name);
1366 if (!read_sym_file(PRIMARYSET)) {
1367 badflag = TRUE;
1368 clear_symsetentry(PRIMARYSET, TRUE);
1369 } else
1370 switch_symbols(TRUE);
1371 }
1372 if (badflag) {
1373 config_error_add("Failure to load symbol set %s.",
1374 allopt[optidx].name);
1375 return optn_err;
1376 }
1377 }
1378 return optn_ok;
1379#else
1380 config_error_add("'%s' no longer supported; use 'symset:%s' instead",
1381 allopt[optidx].name, allopt[optidx].name);
1382 return optn_err;
1383#endif
1384 }
1385 if (req == get_val || req == get_cnf_val) {
1386 opts[0] = '\0';
1387 return optn_ok;
1388 }
1389 return optn_ok;
1390}
1391#endif
1392
1393staticfn int

Callers

nothing calls this directly

Calls 5

dupstrFunction · 0.85
read_sym_fileFunction · 0.85
clear_symsetentryFunction · 0.85
switch_symbolsFunction · 0.85
config_error_addFunction · 0.85

Tested by

no test coverage detected