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

Function optfn_statuslines

src/options.c:4066–4107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4064}
4065
4066staticfn int
4067optfn_statuslines(
4068 int optidx, int req, boolean negated,
4069 char *opts, char *op)
4070{
4071 int retval = optn_ok, itmp = 0;
4072
4073 if (req == do_init) {
4074 return optn_ok;
4075 }
4076 if (req == do_set) {
4077 /* WINCAP2
4078 * statuslines:n */
4079
4080 op = string_for_opt(opts, negated);
4081 if (negated) {
4082 bad_negation(allopt[optidx].name, TRUE);
4083 itmp = 2;
4084 retval = optn_err;
4085 } else if (op != empty_optstr) {
4086 itmp = atoi(op);
4087 }
4088 if (itmp < 2 || itmp > 3) {
4089 config_error_add("'%s:%s' is invalid; must be 2 or 3",
4090 allopt[optidx].name, op);
4091 retval = optn_silenterr;
4092 } else {
4093 iflags.wc2_statuslines = itmp;
4094 if (!go.opt_initial)
4095 go.opt_need_redraw = TRUE;
4096 }
4097 return retval;
4098 }
4099 if (req == get_val || req == get_cnf_val) {
4100 if (wc2_supported(allopt[optidx].name))
4101 Strcpy(opts, (iflags.wc2_statuslines < 3) ? "2" : "3");
4102 else
4103 Strcpy(opts, "unknown");
4104 return optn_ok;
4105 }
4106 return optn_ok;
4107}
4108
4109#ifdef WIN32CON
4110staticfn int

Callers

nothing calls this directly

Calls 4

string_for_optFunction · 0.85
bad_negationFunction · 0.85
config_error_addFunction · 0.85
wc2_supportedFunction · 0.85

Tested by

no test coverage detected