[libvirt] [PATCH v6 2/9] util: add functions for interating over json object
Eric Blake
eblake at redhat.com
Thu May 3 15:08:44 UTC 2012
On 05/03/2012 04:10 AM, Daniel P. Berrange wrote:
> On Wed, May 02, 2012 at 10:32:37PM +0400, Dmitry Guryanov wrote:
>> Add function virJSONValueObjectKeysNumber, virJSONValueObjectGetKey
>> and virJSONValueObjectGetValue, which allow you to iterate over all
>> fields of json object: you can get number of fields and then get
>> name and value, stored in field with that name by index.
>>
>> Signed-off-by: Dmitry Guryanov <dguryanov at parallels.com>
>> +int virJSONValueObjectKeysNumber(virJSONValuePtr object);
>> +const char *virJSONValueObjectGetKey(virJSONValuePtr object, unsigned int n);
>> +virJSONValuePtr virJSONValueObjectGetValue(virJSONValuePtr object, unsigned int n);
>> +
>> const char *virJSONValueGetString(virJSONValuePtr object);
>> int virJSONValueGetNumberInt(virJSONValuePtr object, int *value);
>> int virJSONValueGetNumberUint(virJSONValuePtr object, unsigned int *value);
>
> ACK to adding this API to GIT now, regardless of the other patches
>
> Though having said that when pushing, we should be sure to add the
> 3 new symbols to libvirt_private.syms
I added that, and pushed this patch.
I agree with the decision to hold off on the rest of the series until
after the actual hypervisor is available to target.
--
Eric Blake eblake at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120503/e60d8605/attachment-0001.sig>
More information about the libvir-list
mailing list