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

Function optfn_msghistory

src/options.c:2522–2546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2520}
2521
2522staticfn int
2523optfn_msghistory(
2524 int optidx, int req, boolean negated,
2525 char *opts, char *op)
2526{
2527 if (req == do_init) {
2528 return optn_ok;
2529 }
2530 if (req == do_set) {
2531 op = string_for_env_opt(allopt[optidx].name, opts, negated);
2532 if ((negated && op == empty_optstr)
2533 || (!negated && op != empty_optstr)) {
2534 iflags.msg_history = negated ? 0 : atoi(op);
2535 } else if (negated) {
2536 bad_negation(allopt[optidx].name, TRUE);
2537 return optn_err;
2538 }
2539 return optn_ok;
2540 }
2541 if (req == get_val || req == get_cnf_val) {
2542 Sprintf(opts, "%u", iflags.msg_history);
2543 return optn_ok;
2544 }
2545 return optn_ok;
2546}
2547
2548staticfn int
2549optfn_name(

Callers

nothing calls this directly

Calls 2

string_for_env_optFunction · 0.85
bad_negationFunction · 0.85

Tested by

no test coverage detected