rollback api to 0.12

This commit is contained in:
Haffon
2017-09-07 10:02:21 +08:00
parent 86a3a6475f
commit b301f4ea01
6 changed files with 20 additions and 20 deletions

View File

@@ -161,7 +161,7 @@ static int json_escape_str(struct printbuf *pb, const char *str, int len, int fl
/* reference counting */
extern struct json_object* json_object_retain(struct json_object *jso)
extern struct json_object* json_object_get(struct json_object *jso)
{
if (!jso) return jso;
@@ -174,7 +174,7 @@ extern struct json_object* json_object_retain(struct json_object *jso)
return jso;
}
int json_object_release(struct json_object *jso)
int json_object_put(struct json_object *jso)
{
if(!jso) return 0;
@@ -414,7 +414,7 @@ static void json_object_lh_entry_free(struct lh_entry *ent)
{
if (!ent->k_is_constant)
free(lh_entry_k(ent));
json_object_release((struct json_object*)lh_entry_v(ent));
json_object_put((struct json_object*)lh_entry_v(ent));
}
static void json_object_object_delete(struct json_object* jso)
@@ -487,7 +487,7 @@ int json_object_object_add_ex(struct json_object* jso,
}
existing_value = (json_object *) lh_entry_v(existing_entry);
if (existing_value)
json_object_release(existing_value);
json_object_put(existing_value);
existing_entry->v = val;
return 0;
}
@@ -1102,7 +1102,7 @@ static int json_object_array_to_json_string(struct json_object* jso,
static void json_object_array_entry_free(void *data)
{
json_object_release((struct json_object*)data);
json_object_put((struct json_object*)data);
}
static void json_object_array_delete(struct json_object* jso)
@@ -1179,7 +1179,7 @@ int json_object_array_put_idx(struct json_object *jso, size_t idx,
struct json_object *val)
{
assert(json_object_get_type(jso) == json_type_array);
return array_list_insert(jso->o.c_array, idx, val);
return array_list_put_idx(jso->o.c_array, idx, val);
}
int json_object_array_del_idx(struct json_object *jso, size_t idx, size_t count)
@@ -1192,7 +1192,7 @@ struct json_object* json_object_array_get_idx(const struct json_object *jso,
size_t idx)
{
assert(json_object_get_type(jso) == json_type_array);
return (struct json_object*)array_list_get(jso->o.c_array, idx);
return (struct json_object*)array_list_get_idx(jso->o.c_array, idx);
}
static int json_array_equal(struct json_object* jso1,