Browse Source

Merge pull request #388 from besser82/enhancement/json_object_sizeof

json_object: Add size_t json_object_sizeof()
tags/json-c-0.14-20200419
Eric Haszlakiewicz GitHub 7 years ago
parent
commit
94fd101601
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions
  1. +5
    -0
      json_object.c
  2. +5
    -0
      json_object.h

+ 5
- 0
json_object.c View File

@@ -509,6 +509,11 @@ int json_object_object_length(const struct json_object *jso)
return lh_table_length(jso->o.c_object);
}

size_t json_object_sizeof(void)
{
return sizeof(struct json_object);
}

struct json_object* json_object_object_get(const struct json_object* jso,
const char *key)
{


+ 5
- 0
json_object.h View File

@@ -392,6 +392,11 @@ JSON_EXPORT struct lh_table* json_object_get_object(const struct json_object *ob
*/
JSON_EXPORT int json_object_object_length(const struct json_object* obj);

/** Get the sizeof (struct json_object).
* @returns a size_t with the sizeof (struct json_object)
*/
JSON_EXPORT size_t json_object_sizeof(void);

/** Add an object field to a json_object of type json_type_object
*
* The reference count will *not* be incremented. This is to make adding


Loading…
Cancel
Save