Lines Matching refs:node
37 struct json_tree_node *node;
39 node = p_new(tree->pool, struct json_tree_node, 1);
40 node->parent = tree->cur;
41 node->value_type = type;
42 node->value.str = p_strdup(tree->pool, value);
45 tree->cur->value.child = node;
47 tree->cur_child->next = node;
48 tree->cur_child = node;
52 json_tree_set_cur(struct json_tree *tree, struct json_tree_node *node)
54 tree->cur = node;
68 /* "key": value - we already added the node and set its key,
75 /* element in array - add a new node */
141 json_tree_find_key(const struct json_tree_node *node, const char *key)
143 i_assert(node->value_type == JSON_TYPE_OBJECT);
145 node = json_tree_get_child(node);
146 for (; node != NULL; node = node->next) {
147 if (node->key != NULL && strcmp(node->key, key) == 0)
148 return node;
154 json_tree_find_child_with(const struct json_tree_node *node,
159 i_assert(node->value_type == JSON_TYPE_OBJECT ||
160 node->value_type == JSON_TYPE_ARRAY);
162 for (node = json_tree_get_child(node); node != NULL; node = node->next) {
163 if (node->value_type != JSON_TYPE_OBJECT)
166 child = json_tree_find_key(node, key);
170 return node;