X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_kvargs%2Frte_kvargs.h;h=1946195de497e754b9dd823bac34dba5154405df;hb=0270853d94e298820f3361b43dfdbf95e6a05c88;hp=7f32fd1f6fa1bf6e4fc5dae0e207bfc40c30d9e4;hpb=5d6af85ab00c23f41429f335e462482093994b6e;p=dpdk.git diff --git a/lib/librte_kvargs/rte_kvargs.h b/lib/librte_kvargs/rte_kvargs.h index 7f32fd1f6f..1946195de4 100644 --- a/lib/librte_kvargs/rte_kvargs.h +++ b/lib/librte_kvargs/rte_kvargs.h @@ -110,7 +110,7 @@ struct rte_kvargs *rte_kvargs_parse_delim(const char *args, * rte_kvargs_parse(). * * @param kvlist - * The rte_kvargs structure + * The rte_kvargs structure. No error if NULL. */ void rte_kvargs_free(struct rte_kvargs *kvlist); @@ -119,11 +119,10 @@ void rte_kvargs_free(struct rte_kvargs *kvlist); * * For each key/value association that matches the given key, calls the * handler function with the for a given arg_name passing the value on the - * dictionary for that key and a given extra argument. If *kvlist* is NULL - * function does nothing. + * dictionary for that key and a given extra argument. * * @param kvlist - * The rte_kvargs structure + * The rte_kvargs structure. No error if NULL. * @param key_match * The key on which the handler should be called, or NULL to process handler * on all associations @@ -153,6 +152,32 @@ int rte_kvargs_process(const struct rte_kvargs *kvlist, unsigned rte_kvargs_count(const struct rte_kvargs *kvlist, const char *key_match); +/** + * Generic kvarg handler for string comparison. + * + * This function can be used for a generic string comparison processing + * on a list of kvargs. + * + * @param key + * kvarg pair key. + * + * @param value + * kvarg pair value. + * + * @param opaque + * Opaque pointer to a string. + * + * @return + * 0 if the strings match. + * !0 otherwise or on error. + * + * Unless strcmp, comparison ordering is not kept. + * In order for rte_kvargs_process to stop processing on match error, + * a negative value is returned even if strcmp had returned a positive one. + */ +__rte_experimental +int rte_kvargs_strcmp(const char *key, const char *value, void *opaque); + #ifdef __cplusplus } #endif