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

Function longest_option_name

src/options.c:8507–8532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8505}
8506
8507staticfn unsigned int
8508longest_option_name(int startpass, int endpass)
8509{
8510 /* spin through the options to find the longest name */
8511 unsigned longest_name_len = 0;
8512 int i, pass, optflags;
8513 const char *name;
8514
8515 for (pass = 0; pass < 2; pass++)
8516 for (i = 0; (name = allopt[i].name) != 0; i++) {
8517 if (pass == 0
8518 && (allopt[i].opttyp != BoolOpt || !allopt[i].addr))
8519 continue;
8520 optflags = allopt[i].setwhere;
8521 if (optflags < startpass || optflags > endpass)
8522 continue;
8523 if ((is_wc_option(name) && !wc_supported(name))
8524 || (is_wc2_option(name) && !wc2_supported(name)))
8525 continue;
8526
8527 unsigned len = Strlen(name);
8528 if (len > longest_name_len)
8529 longest_name_len = len;
8530 }
8531 return longest_name_len;
8532}
8533
8534/* guts of doset_simple(); called repeatedly until no choice is made */
8535staticfn int

Callers 2

doset_simple_menuFunction · 0.85
dosetFunction · 0.85

Calls 4

is_wc_optionFunction · 0.85
wc_supportedFunction · 0.85
is_wc2_optionFunction · 0.85
wc2_supportedFunction · 0.85

Tested by

no test coverage detected