diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-09-30 13:42:26 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2008-09-30 13:42:26 +0200 |
commit | c97f839eed652c3e05eb71bc2ba5fbe40678e7b7 (patch) | |
tree | 3e12c6ec853720c92ddb470460dfa3cf1892776c /udev/lib/test-libudev.c | |
parent | 4aa0b15efbb44dbcbb0a4fa6e7bb45e70e1ec537 (diff) |
libudev: enumerate - scan devices and subsystems, add subsystem and attribute filter
Diffstat (limited to 'udev/lib/test-libudev.c')
-rw-r--r-- | udev/lib/test-libudev.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/udev/lib/test-libudev.c b/udev/lib/test-libudev.c index 0f45413d50..5e9897c715 100644 --- a/udev/lib/test-libudev.c +++ b/udev/lib/test-libudev.c @@ -309,7 +309,8 @@ int main(int argc, char *argv[], char *envp[]) udev_enumerate = udev_enumerate_new(udev); if (udev_enumerate == NULL) return -1; - udev_enumerate_scan_devices(udev_enumerate, subsystem, NULL); + udev_enumerate_add_match_subsystem(udev_enumerate, subsystem); + udev_enumerate_scan_devices(udev_enumerate); test_enumerate_print_list(udev_enumerate); udev_enumerate_unref(udev_enumerate); @@ -317,7 +318,8 @@ int main(int argc, char *argv[], char *envp[]) udev_enumerate = udev_enumerate_new(udev); if (udev_enumerate == NULL) return -1; - udev_enumerate_scan_devices(udev_enumerate, "block", NULL); + udev_enumerate_add_match_subsystem(udev_enumerate,"block"); + udev_enumerate_scan_devices(udev_enumerate); test_enumerate_print_list(udev_enumerate); udev_enumerate_unref(udev_enumerate); @@ -325,7 +327,8 @@ int main(int argc, char *argv[], char *envp[]) udev_enumerate = udev_enumerate_new(udev); if (udev_enumerate == NULL) return -1; - udev_enumerate_scan_devices(udev_enumerate, "!block", NULL); + udev_enumerate_add_nomatch_subsystem(udev_enumerate, "block"); + udev_enumerate_scan_devices(udev_enumerate); test_enumerate_print_list(udev_enumerate); udev_enumerate_unref(udev_enumerate); @@ -333,7 +336,10 @@ int main(int argc, char *argv[], char *envp[]) udev_enumerate = udev_enumerate_new(udev); if (udev_enumerate == NULL) return -1; - udev_enumerate_scan_devices(udev_enumerate, "pci", "mem", "vc", NULL); + udev_enumerate_add_match_subsystem(udev_enumerate, "pci"); + udev_enumerate_add_match_subsystem(udev_enumerate, "mem"); + udev_enumerate_add_match_subsystem(udev_enumerate, "vc"); + udev_enumerate_scan_devices(udev_enumerate); test_enumerate_print_list(udev_enumerate); udev_enumerate_unref(udev_enumerate); |