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

Function rte_kvargs_get_with_value

dpdk/lib/kvargs/rte_kvargs.c:207–223  ·  view source on GitHub ↗

Lookup a value in an rte_kvargs list by its key and value. */

Source from the content-addressed store, hash-verified

205
206/* Lookup a value in an rte_kvargs list by its key and value. */
207const char *
208rte_kvargs_get_with_value(const struct rte_kvargs *kvlist, const char *key,
209 const char *value)
210{
211 unsigned int i;
212
213 if (kvlist == NULL)
214 return NULL;
215 for (i = 0; i < kvlist->count; ++i) {
216 if (key != NULL && strcmp(kvlist->pairs[i].key, key) != 0)
217 continue;
218 if (value != NULL && strcmp(kvlist->pairs[i].value, value) != 0)
219 continue;
220 return kvlist->pairs[i].value;
221 }
222 return NULL;
223}
224
225/* Lookup a value in an rte_kvargs list by its key. */
226const char *

Callers 1

rte_kvargs_getFunction · 0.85

Calls 1

strcmpFunction · 0.85

Tested by

no test coverage detected