Beispiel #1
0
struct json *json_get_object_item(struct json *object, const char *string)
{
	struct json *c = object->child;
	while (c && json_strcasecmp(c->string, string))
		c = c->next;
	return c;
}
Beispiel #2
0
struct json *json_detach_item_from_object(struct json *object,
					 const char *string)
{
	int i = 0;
	struct json *c = object->child;
	while (c && json_strcasecmp(c->string, string))
		i++, c = c->next;
	if (c)
		return json_detach_item_from_array(object, i);
	return 0;
}
Beispiel #3
0
void json_replace_item_in_object(struct json *object, const char *string,
			       struct json *newitem)
{
	int i = 0;
	struct json *c = object->child;
	while (c && json_strcasecmp(c->string, string))
		i++, c = c->next;
	if (c) {
		newitem->string = json_strdup(string);
		json_replace_item_in_array(object, i, newitem);
	}
}
Beispiel #4
0
json *json_get_item(json *object, const char *string) {
    json *c = object->child;
    while (c && json_strcasecmp(c->name, string))
        c = c->next;
    return c;
}