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

Function pfxfn_cond_

src/options.c:4993–5036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4991 */
4992
4993staticfn int
4994pfxfn_cond_(
4995 int optidx UNUSED,
4996 int req,
4997 boolean negated,
4998 char *opts,
4999 char *op UNUSED)
5000{
5001 if (req == do_init) {
5002 condopt(0, (boolean *) 0, 0); /* make the choices match defaults */
5003 return optn_ok;
5004 }
5005 if (req == do_set) {
5006 int reslt = parse_cond_option(negated, opts);
5007
5008 switch (reslt) {
5009 case 0:
5010 opt_set_in_config[pfx_cond_] = TRUE;
5011 break;
5012 case 3:
5013 config_error_add("Ambiguous condition option %s", opts);
5014 break;
5015 case 1:
5016 case 2:
5017 default:
5018 config_error_add("Unknown condition option %s (%d)", opts, reslt);
5019 break;
5020 }
5021 if (reslt != 0)
5022 return optn_err;
5023 /* [FIXME? redraw seems like overkill; botl update should suffice] */
5024 go.opt_need_redraw = TRUE;
5025 return optn_ok;
5026 }
5027 if (req == get_val || req == get_cnf_val) {
5028 opts[0] = '\0';
5029 return optn_ok;
5030 }
5031 if (req == do_handler) { /* not used */
5032 (void) cond_menu(); /* in botl.c */
5033 return optn_ok;
5034 }
5035 return optn_ok;
5036}
5037
5038staticfn int
5039pfxfn_font(int optidx, int req, boolean negated, char *opts, char *op)

Callers

nothing calls this directly

Calls 4

condoptFunction · 0.85
parse_cond_optionFunction · 0.85
config_error_addFunction · 0.85
cond_menuFunction · 0.85

Tested by

no test coverage detected