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

Function parse_tokenize_string

dpdk/examples/ip_pipeline/parser.c:236–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236int
237parse_tokenize_string(char *string, char *tokens[], uint32_t *n_tokens)
238{
239 uint32_t i;
240
241 if ((string == NULL) ||
242 (tokens == NULL) ||
243 (*n_tokens < 1))
244 return -EINVAL;
245
246 for (i = 0; i < *n_tokens; i++) {
247 tokens[i] = strtok_r(string, PARSE_DELIMITER, &string);
248 if (tokens[i] == NULL)
249 break;
250 }
251
252 if ((i == *n_tokens) &&
253 (NULL != strtok_r(string, PARSE_DELIMITER, &string)))
254 return -E2BIG;
255
256 *n_tokens = i;
257 return 0;
258}
259
260int
261parse_hex_string(char *src, uint8_t *dst, uint32_t *size)

Callers 3

load_dscp_tableFunction · 0.70
cli_processFunction · 0.70
cli_rule_file_processFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected