
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@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@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org