Lines Matching refs:node
69 static void strbuf_node_cleanup(struct strbuf_node *node) {
72 for (i = 0; i < node->children_count; i++)
73 strbuf_node_cleanup(node->children[i].child);
74 free(node->children);
75 free(node);
102 static void bubbleinsert(struct strbuf_node *node,
110 int left = 0, right = node->children_count;
114 if (strbuf_children_cmp(&node->children[middle], &new) <= 0)
120 memmove(node->children + left + 1, node->children + left,
121 sizeof(struct strbuf_child_entry) * (node->children_count - left));
122 node->children[left] = new;
124 node->children_count ++;
130 struct strbuf_node *node;
146 node = str->root;
151 /* match against current node */
152 off = node->value_off + node->value_len - len;
153 if (depth == len || (node->value_len >= len && memcmp(str->buf + off, s, len) == 0)) {
159 /* lookup child node */
162 child = bsearch(&search, node->children, node->children_count,
167 node = child->child;
180 /* new node */
188 child = realloc(node->children, (node->children_count + 1) * sizeof(struct strbuf_child_entry));
196 node->children = child;
197 bubbleinsert(node, c, node_child);