Lines Matching defs:node
103 static const struct trie_child_entry_f *trie_node_children(struct udev_hwdb *hwdb, const struct trie_node_f *node) {
104 return (const struct trie_child_entry_f *)((const char *)node + le64toh(hwdb->head->node_size));
107 static const struct trie_value_entry_f *trie_node_values(struct udev_hwdb *hwdb, const struct trie_node_f *node) {
108 const char *base = (const char *)node;
111 base += node->children_count * le64toh(hwdb->head->child_entry_size);
130 static const struct trie_node_f *node_lookup_f(struct udev_hwdb *hwdb, const struct trie_node_f *node, uint8_t c) {
135 child = bsearch(&search, trie_node_children(hwdb, node), node->children_count,
155 static int trie_fnmatch_f(struct udev_hwdb *hwdb, const struct trie_node_f *node, size_t p,
162 prefix = trie_string(hwdb, node->prefix_off);
166 for (i = 0; i < node->children_count; i++) {
167 const struct trie_child_entry_f *child = &trie_node_children(hwdb, node)[i];
176 if (le64toh(node->values_count) && fnmatch(linebuf_get(buf), search, 0) == 0)
177 for (i = 0; i < le64toh(node->values_count); i++) {
178 err = hwdb_add_property(hwdb, trie_string(hwdb, trie_node_values(hwdb, node)[i].key_off),
179 trie_string(hwdb, trie_node_values(hwdb, node)[i].value_off));
190 const struct trie_node_f *node;
196 node = trie_node_from_off(hwdb, hwdb->head->nodes_root_off);
197 while (node) {
201 if (node->prefix_off) {
204 for (; (c = trie_string(hwdb, node->prefix_off)[p]); p++) {
206 return trie_fnmatch_f(hwdb, node, p, &buf, search + i + p);
213 child = node_lookup_f(hwdb, node, '*');
222 child = node_lookup_f(hwdb, node, '?');
231 child = node_lookup_f(hwdb, node, '[');
243 for (n = 0; n < le64toh(node->values_count); n++) {
244 err = hwdb_add_property(hwdb, trie_string(hwdb, trie_node_values(hwdb, node)[n].key_off),
245 trie_string(hwdb, trie_node_values(hwdb, node)[n].value_off));
252 child = node_lookup_f(hwdb, node, search[i]);
253 node = child;