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

Function optfn_scroll_amount

src/options.c:3762–3791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3760}
3761
3762staticfn int
3763optfn_scroll_amount(
3764 int optidx, int req, boolean negated,
3765 char *opts, char *op)
3766{
3767 if (req == do_init) {
3768 return optn_ok;
3769 }
3770 if (req == do_set) {
3771 /* WINCAP scroll_amount:nn */
3772
3773 op = string_for_opt(opts, negated);
3774 if ((negated && op == empty_optstr)
3775 || (!negated && op != empty_optstr)) {
3776 iflags.wc_scroll_amount = negated ? 1 : atoi(op);
3777 } else if (negated) {
3778 bad_negation(allopt[optidx].name, TRUE);
3779 return optn_err;
3780 }
3781 return optn_ok;
3782 }
3783 if (req == get_val || req == get_cnf_val) {
3784 if (iflags.wc_scroll_amount)
3785 Sprintf(opts, "%d", iflags.wc_scroll_amount);
3786 else
3787 Strcpy(opts, defopt);
3788 return optn_ok;
3789 }
3790 return optn_ok;
3791}
3792
3793staticfn int
3794optfn_scroll_margin(

Callers

nothing calls this directly

Calls 2

string_for_optFunction · 0.85
bad_negationFunction · 0.85

Tested by

no test coverage detected