]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: new function for scaling numbers
authorEric Blake <eblake@redhat.com>
Mon, 5 Mar 2012 16:28:59 +0000 (09:28 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 8 Mar 2012 01:24:43 +0000 (18:24 -0700)
commit0d90823e87432b3cc57f00918359535f53d55d95
treeaa61a75e62b722974c72b374ed922fca1daa1301
parent239fb8c46bbbbc76189dd7874c737dce6399ab87
util: new function for scaling numbers

Scaling an integer based on a suffix is something we plan on reusing
in several contexts: XML parsing, virsh CLI parsing, and possibly
elsewhere.  Make it easy to reuse, as well as adding in support for
powers of 1000.

* src/util/util.h (virScaleInteger): New function.
* src/util/util.c (virScaleInteger): Implement it.
* src/libvirt_private.syms (util.h): Export it.
src/libvirt_private.syms
src/util/util.c
src/util/util.h