Changeset ee170a1 for lib/parson.c


Ignore:
Timestamp:
2015-02-22T17:01:53Z (9 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Children:
56b57b1a
Parents:
989f431
Message:

Added json_object_get_tuple() which helps with implementing a JSON Object
foreach.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/parson.c

    r989f431 ree170a1  
    873873        return NULL;
    874874    return object->names[index];
     875}
     876
     877int json_object_get_tuple(const JSON_Object *object, size_t index,
     878                          const char **key, const JSON_Value **value) {
     879    if (index >= json_object_get_count(object))
     880        return 0;
     881    *key = object->names[index];
     882    *value = object->values[index];
     883    return 1;
    875884}
    876885
Note: See TracChangeset for help on using the changeset viewer.