MCPcopy Index your code
hub / github.com/NetHack/NetHack / term_for_boolean

Function term_for_boolean

src/options.c:8737–8752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8735}
8736
8737staticfn const char *
8738term_for_boolean(int idx, boolean *b)
8739{
8740 int i, f_t = (*b) ? 1: 0;
8741 const char *boolean_term;
8742 static const char *const booleanterms[2][num_terms] = {
8743 { "false", "off", "disabled", "excluded from build" },
8744 { "true", "on", "enabled", "included"},
8745 };
8746
8747 boolean_term = booleanterms[f_t][0];
8748 i = (int) allopt[idx].termpref;
8749 if (i > Term_False && i < num_terms && i < SIZE(booleanterms[0]))
8750 boolean_term = booleanterms[f_t][i];
8751 return boolean_term;
8752}
8753
8754#define HELP_IDX (SIZE(allopt))
8755

Callers 1

dosetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected