-/*
- * Initialize a rte_kvargs structure to an empty key/value list.
- */
-int
-rte_kvargs_init(struct rte_kvargs *kvlist)
-{
- kvlist->count = 0;
- kvlist->size = RTE_KVARGS_MAX;
- memset(kvlist->pairs, 0, kvlist->size);
- return 0;
-}
-
-/*
- * Add a key-value pair at the end of a given key/value list.
- * Return an error if the list is full or if the key is duplicated.
- */
-static int
-rte_kvargs_add_pair(struct rte_kvargs *kvlist, char *key, char *val)
-{
- unsigned i;
- struct rte_kvargs_pair* entry;
-
- /* is the list full? */
- if (kvlist->count >= kvlist->size) {
- RTE_LOG(ERR, PMD, "Couldn't add %s, key/value list is full\n", key);
- return -1;
- }
-
- /* Check if the key is duplicated */
- for (i = 0; i < kvlist->count; i++) {
- entry = &kvlist->pairs[i];
- if (strcmp(entry->key, key) == 0) {
- RTE_LOG(ERR, PMD, "Couldn't add %s, duplicated key\n", key);
- return -1;
- }
- }
-
- entry = &kvlist->pairs[kvlist->count];
- entry->key = key;
- entry->value = val;
- kvlist->count++;
- return 0;
-}
-