| 8505 | } |
| 8506 | |
| 8507 | staticfn unsigned int |
| 8508 | longest_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 */ |
| 8535 | staticfn int |
no test coverage detected