| 7402 | #endif |
| 7403 | |
| 7404 | void |
| 7405 | allopt_array_init(void) |
| 7406 | { |
| 7407 | int i; |
| 7408 | static boolean options_array_inited_already = FALSE; |
| 7409 | |
| 7410 | if (!options_array_inited_already) { |
| 7411 | memcpy(allopt, allopt_init, sizeof(allopt)); |
| 7412 | determine_ambiguities(); |
| 7413 | for (i = 0; allopt[i].name; i++) { |
| 7414 | if (allopt[i].addr) |
| 7415 | *(allopt[i].addr) = allopt[i].initval; |
| 7416 | } |
| 7417 | heed_all_options(); |
| 7418 | /* |
| 7419 | * Call each option function with an init flag and give it a chance |
| 7420 | * to make any preparations that it might require. We do this |
| 7421 | * whether or not the option itself is ever specified; that's |
| 7422 | * irrelevant for the init call. Doing this allows the prep code for |
| 7423 | * option settings to remain adjacent to, and in the same function as, |
| 7424 | * the code that processes those options. |
| 7425 | */ |
| 7426 | for (i = 0; i < OPTCOUNT; ++i) { |
| 7427 | if (allopt[i].optfn) |
| 7428 | (*allopt[i].optfn)(i, do_init, FALSE, empty_optstr, |
| 7429 | empty_optstr); |
| 7430 | } |
| 7431 | options_array_inited_already = TRUE; |
| 7432 | } |
| 7433 | } |
| 7434 | |
| 7435 | /* |
| 7436 | ******************************************* |
no test coverage detected