# This makes sure pkg.m4 is available.
m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
-PKG_CHECK_MODULES(UDEV, [ libudev >= 160 ])
+PKG_CHECK_MODULES(UDEV, [ libudev >= 172 ])
AC_SUBST(UDEV_CFLAGS)
AC_SUBST(UDEV_LIBS)
return r;
}
-static bool device_has_tag(struct udev_device *d, const char *tag) {
- struct udev_list_entry *first, *item;
-
- assert(d);
- assert(tag);
-
- /* FIXME */
- udev_device_get_is_initialized(d);
-
- first = udev_device_get_tags_list_entry(d);
- udev_list_entry_foreach(item, first)
- if (streq(udev_list_entry_get_name(item), tag))
- return true;
-
- return false;
-}
-
static int trigger_device(Manager *m, const char *prefix) {
struct udev_enumerate *e;
struct udev_list_entry *first, *item;
if (!d)
return -ENODEV;
- if (!device_has_tag(d, "seat")) {
+ if (!udev_device_has_tag(d, "seat")) {
r = -ENODEV;
goto finish;
}
* direct client API
*
* udev:
- * drop redundant udev_device_get_is_initialized() use as soon as libudev is fixed
- * use device_has_tag() as soon as it is available
* enumerate recursively with libudev when triggering
* use sysfs in device hash table, not sysname, when fb driver is fixed
*
#include "util.h"
#include "sysfs-show.h"
-static bool device_has_tag(struct udev_device *d, const char *tag) {
- struct udev_list_entry *first, *item;
-
- assert(d);
- assert(tag);
-
- /* FIXME */
- udev_device_get_is_initialized(d);
-
- first = udev_device_get_tags_list_entry(d);
- udev_list_entry_foreach(item, first)
- if (streq(udev_list_entry_get_name(item), tag))
- return true;
-
- return false;
-}
-
static int show_sysfs_one(
struct udev *udev,
const char *seat,
sn = "seat0";
/* fixme, also check for tag 'seat' here */
- if (!streq(seat, sn) || !device_has_tag(d, "seat")) {
+ if (!streq(seat, sn) || !udev_device_has_tag(d, "seat")) {
udev_device_unref(d);
*item = udev_list_entry_get_next(*item);
continue;
if (isempty(lookahead_sn))
lookahead_sn = "seat0";
- found = streq(seat, lookahead_sn) && device_has_tag(lookahead_d, "seat");
+ found = streq(seat, lookahead_sn) && udev_device_has_tag(lookahead_d, "seat");
udev_device_unref(lookahead_d);
if (found)