Populate the next dynamic token. */
| 12421 | |
| 12422 | /** Populate the next dynamic token. */ |
| 12423 | static void |
| 12424 | cmd_flow_tok(cmdline_parse_token_hdr_t **hdr, |
| 12425 | cmdline_parse_token_hdr_t **hdr_inst) |
| 12426 | { |
| 12427 | struct context *ctx = &cmd_flow_context; |
| 12428 | |
| 12429 | /* Always reinitialize context before requesting the first token. */ |
| 12430 | if (!(hdr_inst - cmd_flow.tokens)) |
| 12431 | cmd_flow_context_init(ctx); |
| 12432 | /* Return NULL when no more tokens are expected. */ |
| 12433 | if (!ctx->next_num && ctx->curr) { |
| 12434 | *hdr = NULL; |
| 12435 | return; |
| 12436 | } |
| 12437 | /* Determine if command should end here. */ |
| 12438 | if (ctx->eol && ctx->last && ctx->next_num) { |
| 12439 | const enum index *list = ctx->next[ctx->next_num - 1]; |
| 12440 | int i; |
| 12441 | |
| 12442 | for (i = 0; list[i]; ++i) { |
| 12443 | if (list[i] != END) |
| 12444 | continue; |
| 12445 | *hdr = NULL; |
| 12446 | return; |
| 12447 | } |
| 12448 | } |
| 12449 | *hdr = &cmd_flow_token_hdr; |
| 12450 | } |
| 12451 | |
| 12452 | static SLIST_HEAD(, indlst_conf) indlst_conf_head = |
| 12453 | SLIST_HEAD_INITIALIZER(); |
no test coverage detected