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

Function spcfn_misc_menu_cmd

src/options.c:5451–5475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5449}
5450
5451staticfn int
5452spcfn_misc_menu_cmd(int midx, int req, boolean negated, char *opts, char *op)
5453{
5454 if (req == do_init) {
5455 return optn_ok;
5456 }
5457 if (req == do_set) {
5458 if (negated) {
5459 bad_negation(default_menu_cmd_info[midx].name, FALSE);
5460 return optn_err;
5461 } else if ((op = string_for_opt(opts, FALSE)) != empty_optstr) {
5462 char c = txt2key(op);
5463
5464 if (illegal_menu_cmd_key((uchar) c))
5465 return optn_err;
5466 add_menu_cmd_alias(c, default_menu_cmd_info[midx].cmd);
5467 }
5468 return optn_ok;
5469 }
5470 if (req == get_val || req == get_cnf_val) {
5471 opts[0] = '\0';
5472 return optn_ok;
5473 }
5474 return optn_ok;
5475}
5476
5477
5478/*

Callers 2

parseoptionsFunction · 0.85
shared_menu_optfnFunction · 0.85

Calls 5

bad_negationFunction · 0.85
string_for_optFunction · 0.85
txt2keyFunction · 0.85
illegal_menu_cmd_keyFunction · 0.85
add_menu_cmd_aliasFunction · 0.85

Tested by

no test coverage detected