[libvirt] [PATCH 6/7] util: add virBufferTrimChars
Erik Skultety
eskultet at redhat.com
Tue Jan 14 11:11:17 UTC 2020
On Tue, Jan 14, 2020 at 08:35:40AM +0100, Ján Tomko wrote:
> A new helper for trimming combinations of specified characters from
> the tail of the buffer.
>
> Signed-off-by: Ján Tomko <jtomko at redhat.com>
> ---
>
...
> /**
> * virBufferAddStr:
> diff --git a/src/util/virbuffer.h b/src/util/virbuffer.h
> index 38758a9125..183f78f279 100644
> --- a/src/util/virbuffer.h
> +++ b/src/util/virbuffer.h
> @@ -92,4 +92,5 @@ size_t virBufferGetIndent(const virBuffer *buf);
> size_t virBufferGetEffectiveIndent(const virBuffer *buf);
>
> void virBufferTrim(virBufferPtr buf, const char *trim, int len);
> +void virBufferTrimChars(virBufferPtr buf, const char *trim);
> void virBufferAddStr(virBufferPtr buf, const char *str);
> diff --git a/tests/virbuftest.c b/tests/virbuftest.c
> index 1780b62bf4..7919075000 100644
> --- a/tests/virbuftest.c
> +++ b/tests/virbuftest.c
> @@ -12,6 +12,7 @@
> struct testBufAddStrData {
> const char *data;
> const char *expect;
> + const char *arg;
Maybe *opaque? #naming,#bikeshedding...
Reviewed-by: Erik Skultety <eskultet at redhat.com>
More information about the libvir-list
mailing list