-static void trie_fnmatch_f(struct trie_f *trie, const struct trie_node_f *node, size_t p,
- struct linebuf *buf, const char *search,
- void (*cb)(struct trie_f *trie, const char *key, const char *value)) {
- size_t len;
- size_t i;
- const char *prefix;
-
- prefix = trie_string(trie, node->prefix_off);
- len = strlen(prefix + p);
- linebuf_add(buf, prefix + p, len);
-
- for (i = 0; i < node->children_count; i++) {
- const struct trie_child_entry_f *child = &trie_node_children(trie, node)[i];
-
- linebuf_add_char(buf, child->c);
- trie_fnmatch_f(trie, trie_node_from_off(trie, child->child_off), 0, buf, search, cb);
- linebuf_rem_char(buf);
- }
-
- if (node->values_count && fnmatch(linebuf_get(buf), search, 0) == 0)
- for (i = 0; i < node->values_count; i++)
- cb(trie, trie_string(trie, trie_node_values(trie, node)[i].key_off),
- trie_string(trie, trie_node_values(trie, node)[i].value_off));
-
- linebuf_rem(buf, len);
-}
+static int udev_builtin_hwdb_search(struct udev_device *dev, struct udev_device *srcdev,
+ const char *subsystem, const char *prefix,
+ const char *filter, bool test) {
+ struct udev_device *d;
+ char s[16];
+ bool last = false;
+ int r = 0;