[dpdk-dev] [PATCH 06/11] kvargs: simpler parsing and allow duplicated keys

Richardson, Bruce bruce.richardson at intel.com
Wed Jan 29 18:17:59 CET 2014

> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Olivier Matz
> Sent: Tuesday, January 28, 2014 4:07 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH 06/11] kvargs: simpler parsing and allow
> duplicated keys
> Remove the rte_kvargs_add_pair() function whose only role was to check if
> a key is duplicated. Having duplicated keys is now allowed by kvargs API.
> Also replace rte_strsplit() by more a standard function strtok_r() that is
> easier to understand for people already knowing the libc. It also avoids
> useless calls to strnlen(). The delimiters macros become strings instead of
> chars due to the strtok_r() API.

As a general rule, we try to use only string functions which track the buffer length they are working with, which is why the function rte_strsplit() is used. While strtok_r() is indeed a standard C function, why not use the code as originally written?

More information about the dev mailing list