summaryrefslogtreecommitdiff
path: root/lib/librte_kvargs
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2014-01-28 17:06:42 +0100
committerDavid Marchand <david.marchand@6wind.com>2014-02-26 11:01:14 +0100
commit95418a30be0d3f1495db702d44c50139742663fc (patch)
tree0a3ce235f1696feaecc1839cf63bc3ae51dc938b /lib/librte_kvargs
parentd8e2337ac4e32132e5a26dc351604447b341366d (diff)
downloaddpdk-95418a30be0d3f1495db702d44c50139742663fc.zip
dpdk-95418a30be0d3f1495db702d44c50139742663fc.tar.gz
dpdk-95418a30be0d3f1495db702d44c50139742663fc.tar.xz
kvargs: add the key in handler pameters
This argument can be useful when rte_kvargs_process() is called with key=NULL, in this case the handler is invoked for all entries of the kvlist. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'lib/librte_kvargs')
-rw-r--r--lib/librte_kvargs/rte_kvargs.c2
-rw-r--r--lib/librte_kvargs/rte_kvargs.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/librte_kvargs/rte_kvargs.c b/lib/librte_kvargs/rte_kvargs.c
index c7f626f..c41a016 100644
--- a/lib/librte_kvargs/rte_kvargs.c
+++ b/lib/librte_kvargs/rte_kvargs.c
@@ -161,7 +161,7 @@ rte_kvargs_process(const struct rte_kvargs *kvlist,
for (i = 0; i < kvlist->count; i++) {
pair = &kvlist->pairs[i];
if (strcmp(pair->key, key_match) == 0) {
- if ((*handler)(pair->value, opaque_arg) < 0)
+ if ((*handler)(pair->key, pair->value, opaque_arg) < 0)
return -1;
}
}
diff --git a/lib/librte_kvargs/rte_kvargs.h b/lib/librte_kvargs/rte_kvargs.h
index 98b8a7c..94003e2 100644
--- a/lib/librte_kvargs/rte_kvargs.h
+++ b/lib/librte_kvargs/rte_kvargs.h
@@ -64,7 +64,7 @@ extern "C" {
#define RTE_KVARGS_KV_DELIM "="
/** Type of callback function used by rte_kvargs_process() */
-typedef int (*arg_handler_t)(const char *value, void *opaque);
+typedef int (*arg_handler_t)(const char *key, const char *value, void *opaque);
/** A key/value association */
struct rte_kvargs_pair {