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

Function optfn_scroll_margin

src/options.c:3793–3821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3791}
3792
3793staticfn int
3794optfn_scroll_margin(
3795 int optidx, int req, boolean negated,
3796 char *opts, char *op)
3797{
3798 if (req == do_init) {
3799 return optn_ok;
3800 }
3801 if (req == do_set) {
3802 /* WINCAP scroll_margin:nn */
3803 op = string_for_opt(opts, negated);
3804 if ((negated && op == empty_optstr)
3805 || (!negated && op != empty_optstr)) {
3806 iflags.wc_scroll_margin = negated ? 5 : atoi(op);
3807 } else if (negated) {
3808 bad_negation(allopt[optidx].name, TRUE);
3809 return optn_err;
3810 }
3811 return optn_ok;
3812 }
3813 if (req == get_val || req == get_cnf_val) {
3814 if (iflags.wc_scroll_margin)
3815 Sprintf(opts, "%d", iflags.wc_scroll_margin);
3816 else
3817 Strcpy(opts, defopt);
3818 return optn_ok;
3819 }
3820 return optn_ok;
3821}
3822
3823staticfn int
3824optfn_soundlib(

Callers

nothing calls this directly

Calls 2

string_for_optFunction · 0.85
bad_negationFunction · 0.85

Tested by

no test coverage detected