Lines Matching defs:syspath
44 struct syspath {
45 char *syspath;
66 struct syspath *devices;
147 free(udev_enumerate->devices[i].syspath);
168 static int syspath_add(struct udev_enumerate *udev_enumerate, const char *syspath)
171 struct syspath *entry;
175 struct syspath *buf;
181 buf = realloc(udev_enumerate->devices, (udev_enumerate->devices_max + add) * sizeof(struct syspath));
188 path = strdup(syspath);
192 entry->syspath = path;
201 const struct syspath *path1 = p1;
202 const struct syspath *path2 = p2;
207 ret = memcmp(path1->syspath, path2->syspath, len);
218 static bool devices_delay_end(struct udev *udev, const char *syspath)
228 if (strstr(syspath + strlen("/sys"), delay_device_list[i]) != NULL)
237 static size_t devices_delay_later(struct udev *udev, const char *syspath)
249 if ((c = strstr(syspath, "/sound/card"))) {
254 return c - syspath + 1;
276 struct syspath *prev = NULL;
280 qsort_safe(udev_enumerate->devices, udev_enumerate->devices_cur, sizeof(struct syspath), syspath_cmp);
284 struct syspath *entry = &udev_enumerate->devices[i];
289 memcmp(entry->syspath, prev->syspath, entry->len) == 0)
294 if (devices_delay_end(udev_enumerate->udev, entry->syspath)) {
295 syspath_add(udev_enumerate, entry->syspath);
305 move_later_prefix = devices_delay_later(udev_enumerate->udev, entry->syspath);
314 !strneq(entry->syspath, udev_enumerate->devices[move_later].syspath, move_later_prefix)) {
317 udev_enumerate->devices[move_later].syspath, NULL);
321 udev_list_entry_add(&udev_enumerate->devices_list, entry->syspath, NULL);
326 udev_enumerate->devices[move_later].syspath, NULL);
330 struct syspath *entry = &udev_enumerate->devices[i];
332 udev_list_entry_add(&udev_enumerate->devices_list, entry->syspath, NULL);
333 free(entry->syspath);
675 char syspath[UTIL_PATH_SIZE];
684 strscpyl(syspath, sizeof(syspath), path, "/", dent->d_name, NULL);
685 dev = udev_device_new_from_syspath(udev_enumerate->udev, syspath);
768 * @syspath: path of a device
774 _public_ int udev_enumerate_add_syspath(struct udev_enumerate *udev_enumerate, const char *syspath)
780 if (syspath == NULL)
782 /* resolve to real syspath */
783 udev_device = udev_device_new_from_syspath(udev_enumerate->udev, syspath);