Lines Matching refs:node
100 static const struct trie_child_entry_f *trie_node_children(sd_hwdb *hwdb, const struct trie_node_f *node) {
101 return (const struct trie_child_entry_f *)((const char *)node + le64toh(hwdb->head->node_size));
104 static const struct trie_value_entry_f *trie_node_values(sd_hwdb *hwdb, const struct trie_node_f *node) {
105 const char *base = (const char *)node;
108 base += node->children_count * le64toh(hwdb->head->child_entry_size);
127 static const struct trie_node_f *node_lookup_f(sd_hwdb *hwdb, const struct trie_node_f *node, uint8_t c) {
132 child = bsearch(&search, trie_node_children(hwdb, node), node->children_count,
168 static int trie_fnmatch_f(sd_hwdb *hwdb, const struct trie_node_f *node, size_t p,
175 prefix = trie_string(hwdb, node->prefix_off);
179 for (i = 0; i < node->children_count; i++) {
180 const struct trie_child_entry_f *child = &trie_node_children(hwdb, node)[i];
189 if (le64toh(node->values_count) && fnmatch(linebuf_get(buf), search, 0) == 0)
190 for (i = 0; i < le64toh(node->values_count); i++) {
191 err = hwdb_add_property(hwdb, trie_string(hwdb, trie_node_values(hwdb, node)[i].key_off),
192 trie_string(hwdb, trie_node_values(hwdb, node)[i].value_off));
203 const struct trie_node_f *node;
209 node = trie_node_from_off(hwdb, hwdb->head->nodes_root_off);
210 while (node) {
214 if (node->prefix_off) {
217 for (; (c = trie_string(hwdb, node->prefix_off)[p]); p++) {
219 return trie_fnmatch_f(hwdb, node, p, &buf, search + i + p);
226 child = node_lookup_f(hwdb, node, '*');
235 child = node_lookup_f(hwdb, node, '?');
244 child = node_lookup_f(hwdb, node, '[');
256 for (n = 0; n < le64toh(node->values_count); n++) {
257 err = hwdb_add_property(hwdb, trie_string(hwdb, trie_node_values(hwdb, node)[n].key_off),
258 trie_string(hwdb, trie_node_values(hwdb, node)[n].value_off));
265 child = node_lookup_f(hwdb, node, search[i]);
266 node = child;