LIRC libraries
LinuxInfraredRemoteControl
drv_enum.h
Go to the documentation of this file.
1 #ifndef _DRV_ENUM_H
2 #define _DRV_ENUM_H
3 
21 #include <stdint.h>
22 
23 #include "driver.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
31  const char* idVendor;
32  const char* idProduct;
33  const char* subsystem;
34  const char* parent_subsys;
35 };
36 
38 void glob_t_init(glob_t* glob);
39 
41 void glob_t_add_path(glob_t* glob, const char* path);
42 
44 void drv_enum_free(glob_t* glob);
45 
50 void drv_enum_add_udev_info(glob_t* glob);
51 
53 int drv_enum_glob(glob_t* glob, const char* pattern);
54 
56 int drv_enum_globs(glob_t* globbuf, const char* const* patterns);
57 
59 int drv_enum_udev(glob_t* globbuf,
60  const struct drv_enum_udev_what* what);
61 
63 int drv_enum_usb(glob_t* glob,
64  int (*is_device_ok)(uint16_t vendor, uint16_t product));
65 
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif // _DRV_ENUM_H
void drv_enum_add_udev_info(glob_t *glob)
Try to add udev info to existing entries in glob.
void glob_t_add_path(glob_t *glob, const char *path)
Add a path to glob, allocating memory as necessary.
Definition: drv_enum.c:48
void drv_enum_free(glob_t *glob)
Free memory obtained using any of the drv_enum_* functions.
Definition: drv_enum.c:63
int drv_enum_glob(glob_t *glob, const char *pattern)
List all devices matching glob(3) pattern.
Definition: drv_enum.c:212
void glob_t_init(glob_t *glob)
Setup a glob_t variable to empty state.
Definition: drv_enum.c:40
Interface to the userspace drivers.
int drv_enum_usb(glob_t *glob, int(*is_device_ok)(uint16_t vendor, uint16_t product))
List all available devices matched by is_device_ok() using libusb.
Definition: drv_enum.c:252
int drv_enum_globs(glob_t *globbuf, const char *const *patterns)
List devices matching any of patterns in null-terminated list.
Definition: drv_enum.c:179
const char * parent_subsys
Require a given subsystem parent.
Definition: drv_enum.h:34
const char * subsystem
Require given subsystem.
Definition: drv_enum.h:33
Condition to match in drv_enum_udev().
Definition: drv_enum.h:30
int drv_enum_udev(glob_t *globbuf, const struct drv_enum_udev_what *what)
List all devices matching any of conditions in {0}-terminated list.
Definition: drv_enum.c:412