Browse Source

Merge cca74c6de6 into ebeb6a40c9

pull/62/merge
Greg Hazel 12 years ago
parent
commit
0f92f6a91e
4 changed files with 12 additions and 0 deletions
  1. +5
    -0
      json_object.c
  2. +2
    -0
      json_object.h
  3. +4
    -0
      linkhash.c
  4. +1
    -0
      linkhash.h

+ 5
- 0
json_object.c View File

@@ -390,6 +390,11 @@ void json_object_object_add(struct json_object* jso, const char *key,
existing_entry->v = val;
}

int json_object_object_length(struct json_object *jso)
{
return lh_table_length(jso->o.c_object);
}

struct json_object* json_object_object_get(struct json_object* jso, const char *key)
{
struct json_object *result = NULL;


+ 2
- 0
json_object.h View File

@@ -215,6 +215,8 @@ extern struct json_object* json_object_new_object(void);
*/
extern struct lh_table* json_object_get_object(struct json_object *obj);

extern int json_object_object_length(struct json_object* obj);

/** 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


+ 4
- 0
linkhash.c View File

@@ -227,3 +227,7 @@ int lh_table_delete(struct lh_table *t, const void *k)
return lh_table_delete_entry(t, e);
}

int lh_table_length(struct lh_table *t)
{
return t->count;
}

+ 1
- 0
linkhash.h View File

@@ -280,6 +280,7 @@ extern int lh_table_delete_entry(struct lh_table *t, struct lh_entry *e);
*/
extern int lh_table_delete(struct lh_table *t, const void *k);

extern int lh_table_length(struct lh_table *t);

void lh_abort(const char *msg, ...);
void lh_table_resize(struct lh_table *t, int new_size);


Loading…
Cancel
Save