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

Function optfn_videocolors

src/options.c:4537–4570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4535
4536#ifdef VIDEOSHADES
4537staticfn int
4538optfn_videocolors(
4539 int optidx, int req, boolean negated UNUSED,
4540 char *opts, char *op UNUSED)
4541{
4542 if (req == do_init) {
4543 return optn_ok;
4544 }
4545 if (req == do_set) {
4546 /* videocolors:string */
4547
4548 if ((opts = string_for_env_opt(allopt[optidx].name, opts, FALSE))
4549 == empty_optstr) {
4550 return optn_err;
4551 }
4552 if (!assign_videocolors(opts)) {
4553 config_error_add("Unknown error handling '%s'",
4554 allopt[optidx].name);
4555 return optn_err;
4556 }
4557 return optn_ok;
4558 }
4559 if (req == get_val || req == get_cnf_val) {
4560 Sprintf(opts, "%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d",
4561 ttycolors[CLR_RED], ttycolors[CLR_GREEN],
4562 ttycolors[CLR_BROWN], ttycolors[CLR_BLUE],
4563 ttycolors[CLR_MAGENTA], ttycolors[CLR_CYAN],
4564 ttycolors[CLR_ORANGE], ttycolors[CLR_BRIGHT_GREEN],
4565 ttycolors[CLR_YELLOW], ttycolors[CLR_BRIGHT_BLUE],
4566 ttycolors[CLR_BRIGHT_MAGENTA], ttycolors[CLR_BRIGHT_CYAN]);
4567 return optn_ok;
4568 }
4569 return optn_ok;
4570}
4571
4572staticfn int
4573optfn_videoshades(

Callers

nothing calls this directly

Calls 3

string_for_env_optFunction · 0.85
assign_videocolorsFunction · 0.85
config_error_addFunction · 0.85

Tested by

no test coverage detected