Re: [PATCH 02/23] util: buffer: Add API to set indentation level to a given value

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

 



On 03/15/2017 11:37 AM, Peter Krempa wrote:
> It will be useful to set indentation level to 0 after formatting a
> nested structure rather than having to track the depth.
> ---
>  src/libvirt_private.syms |  1 +
>  src/util/virbuffer.c     | 19 +++++++++++++++++++
>  src/util/virbuffer.h     |  2 ++
>  3 files changed, 22 insertions(+)
> 

> +
> +/**
> + * virBufferAdjustIndent:

Too much copy-and-paste.

> + * @buf: the buffer
> + * @indent: new indentation size.
> + *
> + * Set the auto-indent value to @indent. See virBufferAdjustIndent on how auto
> + * indentation is applied.
> + */
> +void
> +virBufferSetIndent(virBufferPtr buf, int indent)
> +{
> +    if (!buf || buf->error)
> +        return;
> +
> +    buf->indent = indent;
> +}
> +

No testsuite addition?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]
  Powered by Linux