Retrieve either static or dynamic token at a given index. */
| 80 | |
| 81 | /** Retrieve either static or dynamic token at a given index. */ |
| 82 | static cmdline_parse_token_hdr_t * |
| 83 | get_token(cmdline_parse_inst_t *inst, unsigned int index) |
| 84 | { |
| 85 | cmdline_parse_token_hdr_t *token_p; |
| 86 | |
| 87 | /* check presence of static tokens first */ |
| 88 | if (inst->tokens[0] || !inst->f) |
| 89 | return inst->tokens[index]; |
| 90 | /* generate dynamic token */ |
| 91 | token_p = NULL; |
| 92 | inst->f(&token_p, NULL, &inst->tokens[index]); |
| 93 | return token_p; |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * try to match the buffer with an instruction (only the first |
no outgoing calls
no test coverage detected