]> xenbits.xensource.com Git - libvirt.git/commit
Introduce APIs for splitting/joining strings
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 30 Nov 2012 15:21:02 +0000 (15:21 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 30 Nov 2012 20:05:43 +0000 (20:05 +0000)
commit76c1fd33c8093d6a7173a85486e1e6f51a832135
treea2a2f5de3e405eeb5a6e900e0ae6b87449e9ece3
parentcbb106f807b32f1f6af22d1e92fe0ff9ba6d73b3
Introduce APIs for splitting/joining strings

This introduces a few new APIs for dealing with strings.
One to split a char * into a char **, another to join a
char ** into a char *, and finally one to free a char **

There is a simple test suite to validate the edge cases
too. No more need to use the horrible strtok_r() API,
or hand-written code for splitting strings.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
.gitignore
src/Makefile.am
src/libvirt_private.syms
src/util/virstring.c [new file with mode: 0644]
src/util/virstring.h [new file with mode: 0644]
tests/Makefile.am
tests/virstringtest.c [new file with mode: 0644]