MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cmd_set_raw_tok

Function cmd_set_raw_tok

dpdk/app/test-pmd/cmdline_flow.c:13409–13438  ·  view source on GitHub ↗

Populate the next dynamic token. */

Source from the content-addressed store, hash-verified

13407
13408/** Populate the next dynamic token. */
13409static void
13410cmd_set_raw_tok(cmdline_parse_token_hdr_t **hdr,
13411 cmdline_parse_token_hdr_t **hdr_inst)
13412{
13413 struct context *ctx = &cmd_flow_context;
13414
13415 /* Always reinitialize context before requesting the first token. */
13416 if (!(hdr_inst - cmd_set_raw.tokens)) {
13417 cmd_flow_context_init(ctx);
13418 ctx->curr = START_SET;
13419 }
13420 /* Return NULL when no more tokens are expected. */
13421 if (!ctx->next_num && (ctx->curr != START_SET)) {
13422 *hdr = NULL;
13423 return;
13424 }
13425 /* Determine if command should end here. */
13426 if (ctx->eol && ctx->last && ctx->next_num) {
13427 const enum index *list = ctx->next[ctx->next_num - 1];
13428 int i;
13429
13430 for (i = 0; list[i]; ++i) {
13431 if (list[i] != END)
13432 continue;
13433 *hdr = NULL;
13434 return;
13435 }
13436 }
13437 *hdr = &cmd_set_raw_token_hdr;
13438}
13439
13440/** Token generator and output processing callback (cmdline API). */
13441static void

Callers 1

cmd_set_raw_cbFunction · 0.85

Calls 1

cmd_flow_context_initFunction · 0.85

Tested by

no test coverage detected