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

Function optfn_suppress_alert

src/options.c:4134–4161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4132#endif /* WIN32CON */
4133
4134staticfn int
4135optfn_suppress_alert(
4136 int optidx, int req, boolean negated,
4137 char *opts, char *op)
4138{
4139 if (req == do_init) {
4140 return optn_ok;
4141 }
4142 if (req == do_set) {
4143 if (negated) {
4144 bad_negation(allopt[optidx].name, FALSE);
4145 return optn_err;
4146 } else if (op != empty_optstr)
4147 (void) feature_alert_opts(op, allopt[optidx].name);
4148 return optn_ok;
4149 }
4150 if (req == get_val || req == get_cnf_val) {
4151 if (req == get_cnf_val && flags.suppress_alert == 0L)
4152 opts[0] = '\0';
4153 else if (flags.suppress_alert == 0L)
4154 Strcpy(opts, none);
4155 else
4156 Sprintf(opts, "%lu.%lu.%lu", FEATURE_NOTICE_VER_MAJ,
4157 FEATURE_NOTICE_VER_MIN, FEATURE_NOTICE_VER_PATCH);
4158 return optn_ok;
4159 }
4160 return optn_ok;
4161}
4162
4163extern const char *const known_handling[]; /* symbols.c */
4164extern const char *const known_restrictions[]; /* symbols.c */

Callers

nothing calls this directly

Calls 2

bad_negationFunction · 0.85
feature_alert_optsFunction · 0.85

Tested by

no test coverage detected