Lines Matching refs:enumerator
52 _cleanup_(sd_device_enumerator_unrefp) sd_device_enumerator *enumerator = NULL; in sd_device_enumerator_new()
56 enumerator = new(sd_device_enumerator, 1); in sd_device_enumerator_new()
57 if (!enumerator) in sd_device_enumerator_new()
60 *enumerator = (sd_device_enumerator) { in sd_device_enumerator_new()
66 *ret = TAKE_PTR(enumerator); in sd_device_enumerator_new()
78 static void device_enumerator_unref_devices(sd_device_enumerator *enumerator) { in device_enumerator_unref_devices() argument
79 assert(enumerator); in device_enumerator_unref_devices()
81 hashmap_clear_with_destructor(enumerator->devices_by_syspath, sd_device_unref); in device_enumerator_unref_devices()
82 device_unref_many(enumerator->devices, enumerator->n_devices); in device_enumerator_unref_devices()
83 enumerator->devices = mfree(enumerator->devices); in device_enumerator_unref_devices()
84 enumerator->n_devices = 0; in device_enumerator_unref_devices()
87 static sd_device_enumerator *device_enumerator_free(sd_device_enumerator *enumerator) { in device_enumerator_free() argument
88 assert(enumerator); in device_enumerator_free()
90 device_enumerator_unref_devices(enumerator); in device_enumerator_free()
92 hashmap_free(enumerator->devices_by_syspath); in device_enumerator_free()
93 strv_free(enumerator->prioritized_subsystems); in device_enumerator_free()
94 set_free(enumerator->match_subsystem); in device_enumerator_free()
95 set_free(enumerator->nomatch_subsystem); in device_enumerator_free()
96 hashmap_free(enumerator->match_sysattr); in device_enumerator_free()
97 hashmap_free(enumerator->nomatch_sysattr); in device_enumerator_free()
98 hashmap_free(enumerator->match_property); in device_enumerator_free()
99 set_free(enumerator->match_sysname); in device_enumerator_free()
100 set_free(enumerator->nomatch_sysname); in device_enumerator_free()
101 set_free(enumerator->match_tag); in device_enumerator_free()
102 set_free(enumerator->match_parent); in device_enumerator_free()
104 return mfree(enumerator); in device_enumerator_free()
109 int device_enumerator_add_prioritized_subsystem(sd_device_enumerator *enumerator, const char *subsy… in device_enumerator_add_prioritized_subsystem() argument
112 assert(enumerator); in device_enumerator_add_prioritized_subsystem()
115 if (strv_contains(enumerator->prioritized_subsystems, subsystem)) in device_enumerator_add_prioritized_subsystem()
118 r = strv_extend(&enumerator->prioritized_subsystems, subsystem); in device_enumerator_add_prioritized_subsystem()
122 enumerator->scan_uptodate = false; in device_enumerator_add_prioritized_subsystem()
127 _public_ int sd_device_enumerator_add_match_subsystem(sd_device_enumerator *enumerator, const char … in sd_device_enumerator_add_match_subsystem() argument
131 assert_return(enumerator, -EINVAL); in sd_device_enumerator_add_match_subsystem()
135 set = &enumerator->match_subsystem; in sd_device_enumerator_add_match_subsystem()
137 set = &enumerator->nomatch_subsystem; in sd_device_enumerator_add_match_subsystem()
143 enumerator->scan_uptodate = false; in sd_device_enumerator_add_match_subsystem()
148 _public_ int sd_device_enumerator_add_match_sysattr(sd_device_enumerator *enumerator, const char *s… in sd_device_enumerator_add_match_sysattr() argument
152 assert_return(enumerator, -EINVAL); in sd_device_enumerator_add_match_sysattr()
156 hashmap = &enumerator->match_sysattr; in sd_device_enumerator_add_match_sysattr()
158 hashmap = &enumerator->nomatch_sysattr; in sd_device_enumerator_add_match_sysattr()
166 enumerator->scan_uptodate = false; in sd_device_enumerator_add_match_sysattr()
171 _public_ int sd_device_enumerator_add_match_property(sd_device_enumerator *enumerator, const char *… in sd_device_enumerator_add_match_property() argument
174 assert_return(enumerator, -EINVAL); in sd_device_enumerator_add_match_property()
179 …r = hashmap_put_strdup_full(&enumerator->match_property, &trivial_hash_ops_free_free, property, va… in sd_device_enumerator_add_match_property()
183 enumerator->scan_uptodate = false; in sd_device_enumerator_add_match_property()
188 static int device_enumerator_add_match_sysname(sd_device_enumerator *enumerator, const char *sysnam… in device_enumerator_add_match_sysname() argument
191 assert_return(enumerator, -EINVAL); in device_enumerator_add_match_sysname()
194 … r = set_put_strdup(match ? &enumerator->match_sysname : &enumerator->nomatch_sysname, sysname); in device_enumerator_add_match_sysname()
198 enumerator->scan_uptodate = false; in device_enumerator_add_match_sysname()
203 _public_ int sd_device_enumerator_add_match_sysname(sd_device_enumerator *enumerator, const char *s… in sd_device_enumerator_add_match_sysname() argument
204 return device_enumerator_add_match_sysname(enumerator, sysname, true); in sd_device_enumerator_add_match_sysname()
207 _public_ int sd_device_enumerator_add_nomatch_sysname(sd_device_enumerator *enumerator, const char … in sd_device_enumerator_add_nomatch_sysname() argument
208 return device_enumerator_add_match_sysname(enumerator, sysname, false); in sd_device_enumerator_add_nomatch_sysname()
211 _public_ int sd_device_enumerator_add_match_tag(sd_device_enumerator *enumerator, const char *tag) { in sd_device_enumerator_add_match_tag() argument
214 assert_return(enumerator, -EINVAL); in sd_device_enumerator_add_match_tag()
217 r = set_put_strdup(&enumerator->match_tag, tag); in sd_device_enumerator_add_match_tag()
221 enumerator->scan_uptodate = false; in sd_device_enumerator_add_match_tag()
226 int device_enumerator_add_match_parent_incremental(sd_device_enumerator *enumerator, sd_device *par… in device_enumerator_add_match_parent_incremental() argument
230 assert(enumerator); in device_enumerator_add_match_parent_incremental()
237 r = set_put_strdup(&enumerator->match_parent, path); in device_enumerator_add_match_parent_incremental()
241 enumerator->scan_uptodate = false; in device_enumerator_add_match_parent_incremental()
246 _public_ int sd_device_enumerator_add_match_parent(sd_device_enumerator *enumerator, sd_device *par… in sd_device_enumerator_add_match_parent() argument
247 assert_return(enumerator, -EINVAL); in sd_device_enumerator_add_match_parent()
250 set_clear(enumerator->match_parent); in sd_device_enumerator_add_match_parent()
252 return device_enumerator_add_match_parent_incremental(enumerator, parent); in sd_device_enumerator_add_match_parent()
255 _public_ int sd_device_enumerator_allow_uninitialized(sd_device_enumerator *enumerator) { in sd_device_enumerator_allow_uninitialized() argument
256 assert_return(enumerator, -EINVAL); in sd_device_enumerator_allow_uninitialized()
258 enumerator->match_initialized = MATCH_INITIALIZED_ALL; in sd_device_enumerator_allow_uninitialized()
260 enumerator->scan_uptodate = false; in sd_device_enumerator_allow_uninitialized()
265 int device_enumerator_add_match_is_initialized(sd_device_enumerator *enumerator, MatchInitializedTy… in device_enumerator_add_match_is_initialized() argument
266 assert_return(enumerator, -EINVAL); in device_enumerator_add_match_is_initialized()
269 enumerator->match_initialized = type; in device_enumerator_add_match_is_initialized()
271 enumerator->scan_uptodate = false; in device_enumerator_add_match_is_initialized()
339 static int enumerator_sort_devices(sd_device_enumerator *enumerator) { in enumerator_sort_devices() argument
345 assert(enumerator); in enumerator_sort_devices()
347 if (enumerator->sorted) in enumerator_sort_devices()
350 devices = new(sd_device*, hashmap_size(enumerator->devices_by_syspath)); in enumerator_sort_devices()
354 STRV_FOREACH(prioritized_subsystem, enumerator->prioritized_subsystems) { in enumerator_sort_devices()
360 HASHMAP_FOREACH_KEY(device, syspath, enumerator->devices_by_syspath) { in enumerator_sort_devices()
381 device = hashmap_get(enumerator->devices_by_syspath, q); in enumerator_sort_devices()
397 … assert_se(hashmap_remove(enumerator->devices_by_syspath, syspath) == devices[i]); in enumerator_sort_devices()
409 HASHMAP_FOREACH(device, enumerator->devices_by_syspath) in enumerator_sort_devices()
421 r = hashmap_put(enumerator->devices_by_syspath, syspath, devices[i]); in enumerator_sort_devices()
431 device_unref_many(enumerator->devices, enumerator->n_devices); in enumerator_sort_devices()
433 enumerator->n_devices = n; in enumerator_sort_devices()
434 free_and_replace(enumerator->devices, devices); in enumerator_sort_devices()
436 enumerator->sorted = true; in enumerator_sort_devices()
445 int device_enumerator_add_device(sd_device_enumerator *enumerator, sd_device *device) { in device_enumerator_add_device() argument
449 assert_return(enumerator, -EINVAL); in device_enumerator_add_device()
456 r = hashmap_ensure_put(&enumerator->devices_by_syspath, &string_hash_ops, syspath, device); in device_enumerator_add_device()
464 enumerator->sorted = false; in device_enumerator_add_device()
468 static bool match_property(sd_device_enumerator *enumerator, sd_device *device) { in match_property() argument
472 assert(enumerator); in match_property()
475 if (hashmap_isempty(enumerator->match_property)) in match_property()
478 HASHMAP_FOREACH_KEY(value, property, enumerator->match_property) { in match_property()
499 static bool match_tag(sd_device_enumerator *enumerator, sd_device *device) { in match_tag() argument
502 assert(enumerator); in match_tag()
505 SET_FOREACH(tag, enumerator->match_tag) in match_tag()
512 static bool match_sysname(sd_device_enumerator *enumerator, const char *sysname) { in match_sysname() argument
513 assert(enumerator); in match_sysname()
516 return set_fnmatch(enumerator->match_sysname, enumerator->nomatch_sysname, sysname); in match_sysname()
519 static int match_initialized(sd_device_enumerator *enumerator, sd_device *device) { in match_initialized() argument
522 assert(enumerator); in match_initialized()
525 if (enumerator->match_initialized == MATCH_INITIALIZED_ALL) in match_initialized()
534 if (enumerator->match_initialized == MATCH_INITIALIZED_COMPAT) { in match_initialized()
548 return (enumerator->match_initialized == MATCH_INITIALIZED_NO) == (r == 0); in match_initialized()
552 sd_device_enumerator *enumerator, in test_matches() argument
558 assert(enumerator); in test_matches()
563 r = match_initialized(enumerator, device); in test_matches()
568 !device_match_parent(device, enumerator->match_parent, NULL)) in test_matches()
571 if (!match_tag(enumerator, device)) in test_matches()
574 if (!match_property(enumerator, device)) in test_matches()
577 if (!device_match_sysattr(device, enumerator->match_sysattr, enumerator->nomatch_sysattr)) in test_matches()
583 static bool match_subsystem(sd_device_enumerator *enumerator, const char *subsystem) { in match_subsystem() argument
584 assert(enumerator); in match_subsystem()
589 return set_fnmatch(enumerator->match_subsystem, enumerator->nomatch_subsystem, subsystem); in match_subsystem()
593 sd_device_enumerator *enumerator, in enumerator_add_parent_devices() argument
599 assert(enumerator); in enumerator_add_parent_devices()
621 if (!match_subsystem(enumerator, ss)) in enumerator_add_parent_devices()
630 if (!match_sysname(enumerator, usn)) in enumerator_add_parent_devices()
633 k = test_matches(enumerator, device, ignore_parent_match); in enumerator_add_parent_devices()
641 k = device_enumerator_add_device(enumerator, device); in enumerator_add_parent_devices()
653 int device_enumerator_add_parent_devices(sd_device_enumerator *enumerator, sd_device *device) { in device_enumerator_add_parent_devices() argument
654 return enumerator_add_parent_devices(enumerator, device, /* ignore_parent_match = */ true); in device_enumerator_add_parent_devices()
669 sd_device_enumerator *enumerator, in enumerator_scan_dir_and_add_devices() argument
678 assert(enumerator); in enumerator_scan_dir_and_add_devices()
701 if (!match_sysname(enumerator, de->d_name)) in enumerator_scan_dir_and_add_devices()
715 k = test_matches(enumerator, device, /* ignore_parent_match = */ false); in enumerator_scan_dir_and_add_devices()
722 k = device_enumerator_add_device(enumerator, device); in enumerator_scan_dir_and_add_devices()
729 … k = enumerator_add_parent_devices(enumerator, device, /* ignore_parent_match = */ false); in enumerator_scan_dir_and_add_devices()
738 sd_device_enumerator *enumerator, in enumerator_scan_dir() argument
761 if (!match_subsystem(enumerator, subsystem ? : de->d_name)) in enumerator_scan_dir()
764 k = enumerator_scan_dir_and_add_devices(enumerator, basedir, de->d_name, subdir); in enumerator_scan_dir()
772 static int enumerator_scan_devices_tag(sd_device_enumerator *enumerator, const char *tag) { in enumerator_scan_devices_tag() argument
777 assert(enumerator); in enumerator_scan_devices_tag()
816 if (!match_subsystem(enumerator, subsystem)) in enumerator_scan_devices_tag()
825 if (!match_sysname(enumerator, sysname)) in enumerator_scan_devices_tag()
828 if (!device_match_parent(device, enumerator->match_parent, NULL)) in enumerator_scan_devices_tag()
831 if (!match_property(enumerator, device)) in enumerator_scan_devices_tag()
834 … if (!device_match_sysattr(device, enumerator->match_sysattr, enumerator->nomatch_sysattr)) in enumerator_scan_devices_tag()
837 k = device_enumerator_add_device(enumerator, device); in enumerator_scan_devices_tag()
847 static int enumerator_scan_devices_tags(sd_device_enumerator *enumerator) { in enumerator_scan_devices_tags() argument
851 assert(enumerator); in enumerator_scan_devices_tags()
853 SET_FOREACH(tag, enumerator->match_tag) { in enumerator_scan_devices_tags()
856 k = enumerator_scan_devices_tag(enumerator, tag); in enumerator_scan_devices_tags()
864 static int parent_add_child(sd_device_enumerator *enumerator, const char *path) { in parent_add_child() argument
882 if (!match_subsystem(enumerator, subsystem)) in parent_add_child()
889 if (!match_sysname(enumerator, sysname)) in parent_add_child()
892 if (!match_property(enumerator, device)) in parent_add_child()
895 if (!device_match_sysattr(device, enumerator->match_sysattr, enumerator->nomatch_sysattr)) in parent_add_child()
898 r = device_enumerator_add_device(enumerator, device); in parent_add_child()
905 static int parent_crawl_children(sd_device_enumerator *enumerator, const char *path, unsigned maxde… in parent_crawl_children() argument
927 k = parent_add_child(enumerator, child); in parent_crawl_children()
932 parent_crawl_children(enumerator, child, maxdepth - 1); in parent_crawl_children()
940 static int enumerator_scan_devices_children(sd_device_enumerator *enumerator) { in enumerator_scan_devices_children() argument
944 SET_FOREACH(path, enumerator->match_parent) { in enumerator_scan_devices_children()
945 k = parent_add_child(enumerator, path); in enumerator_scan_devices_children()
949 k = parent_crawl_children(enumerator, path, DEVICE_ENUMERATE_MAX_DEPTH); in enumerator_scan_devices_children()
957 static int enumerator_scan_devices_all(sd_device_enumerator *enumerator) { in enumerator_scan_devices_all() argument
962 k = enumerator_scan_dir(enumerator, "bus", "devices", NULL); in enumerator_scan_devices_all()
966 k = enumerator_scan_dir(enumerator, "class", NULL, NULL); in enumerator_scan_devices_all()
973 int device_enumerator_scan_devices(sd_device_enumerator *enumerator) { in device_enumerator_scan_devices() argument
976 assert(enumerator); in device_enumerator_scan_devices()
978 if (enumerator->scan_uptodate && in device_enumerator_scan_devices()
979 enumerator->type == DEVICE_ENUMERATION_TYPE_DEVICES) in device_enumerator_scan_devices()
982 device_enumerator_unref_devices(enumerator); in device_enumerator_scan_devices()
984 if (!set_isempty(enumerator->match_tag)) { in device_enumerator_scan_devices()
985 k = enumerator_scan_devices_tags(enumerator); in device_enumerator_scan_devices()
988 } else if (enumerator->match_parent) { in device_enumerator_scan_devices()
989 k = enumerator_scan_devices_children(enumerator); in device_enumerator_scan_devices()
993 k = enumerator_scan_devices_all(enumerator); in device_enumerator_scan_devices()
998 enumerator->scan_uptodate = true; in device_enumerator_scan_devices()
999 enumerator->type = DEVICE_ENUMERATION_TYPE_DEVICES; in device_enumerator_scan_devices()
1004 _public_ sd_device *sd_device_enumerator_get_device_first(sd_device_enumerator *enumerator) { in sd_device_enumerator_get_device_first() argument
1005 assert_return(enumerator, NULL); in sd_device_enumerator_get_device_first()
1007 if (device_enumerator_scan_devices(enumerator) < 0) in sd_device_enumerator_get_device_first()
1010 if (enumerator_sort_devices(enumerator) < 0) in sd_device_enumerator_get_device_first()
1013 enumerator->current_device_index = 0; in sd_device_enumerator_get_device_first()
1015 if (enumerator->n_devices == 0) in sd_device_enumerator_get_device_first()
1018 return enumerator->devices[0]; in sd_device_enumerator_get_device_first()
1021 _public_ sd_device *sd_device_enumerator_get_device_next(sd_device_enumerator *enumerator) { in sd_device_enumerator_get_device_next() argument
1022 assert_return(enumerator, NULL); in sd_device_enumerator_get_device_next()
1024 if (!enumerator->scan_uptodate || in sd_device_enumerator_get_device_next()
1025 !enumerator->sorted || in sd_device_enumerator_get_device_next()
1026 enumerator->type != DEVICE_ENUMERATION_TYPE_DEVICES || in sd_device_enumerator_get_device_next()
1027 enumerator->current_device_index + 1 >= enumerator->n_devices) in sd_device_enumerator_get_device_next()
1030 return enumerator->devices[++enumerator->current_device_index]; in sd_device_enumerator_get_device_next()
1033 int device_enumerator_scan_subsystems(sd_device_enumerator *enumerator) { in device_enumerator_scan_subsystems() argument
1036 assert(enumerator); in device_enumerator_scan_subsystems()
1038 if (enumerator->scan_uptodate && in device_enumerator_scan_subsystems()
1039 enumerator->type == DEVICE_ENUMERATION_TYPE_SUBSYSTEMS) in device_enumerator_scan_subsystems()
1042 device_enumerator_unref_devices(enumerator); in device_enumerator_scan_subsystems()
1045 if (match_subsystem(enumerator, "module")) { in device_enumerator_scan_subsystems()
1046 k = enumerator_scan_dir_and_add_devices(enumerator, "module", NULL, NULL); in device_enumerator_scan_subsystems()
1052 if (match_subsystem(enumerator, "subsystem")) { in device_enumerator_scan_subsystems()
1053 k = enumerator_scan_dir_and_add_devices(enumerator, "bus", NULL, NULL); in device_enumerator_scan_subsystems()
1059 if (match_subsystem(enumerator, "drivers")) { in device_enumerator_scan_subsystems()
1060 k = enumerator_scan_dir(enumerator, "bus", "drivers", "drivers"); in device_enumerator_scan_subsystems()
1065 enumerator->scan_uptodate = true; in device_enumerator_scan_subsystems()
1066 enumerator->type = DEVICE_ENUMERATION_TYPE_SUBSYSTEMS; in device_enumerator_scan_subsystems()
1071 _public_ sd_device *sd_device_enumerator_get_subsystem_first(sd_device_enumerator *enumerator) { in sd_device_enumerator_get_subsystem_first() argument
1072 assert_return(enumerator, NULL); in sd_device_enumerator_get_subsystem_first()
1074 if (device_enumerator_scan_subsystems(enumerator) < 0) in sd_device_enumerator_get_subsystem_first()
1077 if (enumerator_sort_devices(enumerator) < 0) in sd_device_enumerator_get_subsystem_first()
1080 enumerator->current_device_index = 0; in sd_device_enumerator_get_subsystem_first()
1082 if (enumerator->n_devices == 0) in sd_device_enumerator_get_subsystem_first()
1085 return enumerator->devices[0]; in sd_device_enumerator_get_subsystem_first()
1088 _public_ sd_device *sd_device_enumerator_get_subsystem_next(sd_device_enumerator *enumerator) { in sd_device_enumerator_get_subsystem_next() argument
1089 assert_return(enumerator, NULL); in sd_device_enumerator_get_subsystem_next()
1091 if (!enumerator->scan_uptodate || in sd_device_enumerator_get_subsystem_next()
1092 !enumerator->sorted || in sd_device_enumerator_get_subsystem_next()
1093 enumerator->type != DEVICE_ENUMERATION_TYPE_SUBSYSTEMS || in sd_device_enumerator_get_subsystem_next()
1094 enumerator->current_device_index + 1 >= enumerator->n_devices) in sd_device_enumerator_get_subsystem_next()
1097 return enumerator->devices[++enumerator->current_device_index]; in sd_device_enumerator_get_subsystem_next()
1100 int device_enumerator_scan_devices_and_subsystems(sd_device_enumerator *enumerator) { in device_enumerator_scan_devices_and_subsystems() argument
1103 assert(enumerator); in device_enumerator_scan_devices_and_subsystems()
1105 if (enumerator->scan_uptodate && in device_enumerator_scan_devices_and_subsystems()
1106 enumerator->type == DEVICE_ENUMERATION_TYPE_ALL) in device_enumerator_scan_devices_and_subsystems()
1109 device_enumerator_unref_devices(enumerator); in device_enumerator_scan_devices_and_subsystems()
1111 if (!set_isempty(enumerator->match_tag)) in device_enumerator_scan_devices_and_subsystems()
1112 r = enumerator_scan_devices_tags(enumerator); in device_enumerator_scan_devices_and_subsystems()
1113 else if (enumerator->match_parent) in device_enumerator_scan_devices_and_subsystems()
1114 r = enumerator_scan_devices_children(enumerator); in device_enumerator_scan_devices_and_subsystems()
1118 r = enumerator_scan_devices_all(enumerator); in device_enumerator_scan_devices_and_subsystems()
1120 if (match_subsystem(enumerator, "module")) { in device_enumerator_scan_devices_and_subsystems()
1121 k = enumerator_scan_dir_and_add_devices(enumerator, "module", NULL, NULL); in device_enumerator_scan_devices_and_subsystems()
1125 if (match_subsystem(enumerator, "subsystem")) { in device_enumerator_scan_devices_and_subsystems()
1126 k = enumerator_scan_dir_and_add_devices(enumerator, "bus", NULL, NULL); in device_enumerator_scan_devices_and_subsystems()
1131 if (match_subsystem(enumerator, "drivers")) { in device_enumerator_scan_devices_and_subsystems()
1132 k = enumerator_scan_dir(enumerator, "bus", "drivers", "drivers"); in device_enumerator_scan_devices_and_subsystems()
1138 enumerator->scan_uptodate = true; in device_enumerator_scan_devices_and_subsystems()
1139 enumerator->type = DEVICE_ENUMERATION_TYPE_ALL; in device_enumerator_scan_devices_and_subsystems()
1144 sd_device *device_enumerator_get_first(sd_device_enumerator *enumerator) { in device_enumerator_get_first() argument
1145 assert_return(enumerator, NULL); in device_enumerator_get_first()
1147 if (!enumerator->scan_uptodate) in device_enumerator_get_first()
1150 if (enumerator_sort_devices(enumerator) < 0) in device_enumerator_get_first()
1153 enumerator->current_device_index = 0; in device_enumerator_get_first()
1155 if (enumerator->n_devices == 0) in device_enumerator_get_first()
1158 return enumerator->devices[0]; in device_enumerator_get_first()
1161 sd_device *device_enumerator_get_next(sd_device_enumerator *enumerator) { in device_enumerator_get_next() argument
1162 assert_return(enumerator, NULL); in device_enumerator_get_next()
1164 if (!enumerator->scan_uptodate || in device_enumerator_get_next()
1165 !enumerator->sorted || in device_enumerator_get_next()
1166 enumerator->current_device_index + 1 >= enumerator->n_devices) in device_enumerator_get_next()
1169 return enumerator->devices[++enumerator->current_device_index]; in device_enumerator_get_next()
1172 sd_device **device_enumerator_get_devices(sd_device_enumerator *enumerator, size_t *ret_n_devices) { in device_enumerator_get_devices() argument
1173 assert(enumerator); in device_enumerator_get_devices()
1176 if (!enumerator->scan_uptodate) in device_enumerator_get_devices()
1179 if (enumerator_sort_devices(enumerator) < 0) in device_enumerator_get_devices()
1182 *ret_n_devices = enumerator->n_devices; in device_enumerator_get_devices()
1183 return enumerator->devices; in device_enumerator_get_devices()