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

Re: [libvirt] [PATCH] 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 **
> > 

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


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