Re: [PATCH] Introduce APIs for splitting/joining strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > 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 **
> > 

> 
> Opps, the virstring.c file should have this patch spliced in

Oh, you're copying code.  Which means my suggestion of letting the
user specify a length rather than forcing them to NULL-terminate
their array would mean you are no longer matching the version
that you copied from (not necessarily a bad thing).

> +/**
> + * virStringSplit:
> + * @string: a string to split
> + * @delim: a string which specifies the places at which to split
> + *     the string. The delimiter is not included in any of the
> resulting
> + *     strings, unless @max_tokens is reached.
> + * @max_tokens: the maximum number of pieces to split @string into.
> + *     If this is less than 1, the string is split completely.

"less than 1" means "exactly 0", since it is an unsigned param.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]