LIRC libraries
LinuxInfraredRemoteControl
drv_enum.h
Go to the documentation of this file.
1 #ifndef _DRV_ENUM_H
2 #define _DRV_ENUM_H
3 
25 #include <stdint.h>
26 
27 #include "driver.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
35  const char* idVendor;
36  const char* idProduct;
37  const char* subsystem;
38  const char* parent_subsys;
39 };
40 
42 void glob_t_init(glob_t* glob);
43 
45 void glob_t_add_path(glob_t* glob, const char* path);
46 
48 void drv_enum_free(glob_t* glob);
49 
54 void drv_enum_add_udev_info(glob_t* glob);
55 
57 int drv_enum_glob(glob_t* glob, const char* pattern);
58 
60 int drv_enum_globs(glob_t* globbuf, const char* const* patterns);
61 
63 int drv_enum_udev(glob_t* globbuf,
64  const struct drv_enum_udev_what* what);
65 
67 int drv_enum_usb(glob_t* glob,
68  int (*is_device_ok)(uint16_t vendor, uint16_t product));
69 
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif // _DRV_ENUM_H
void drv_enum_add_udev_info(glob_t *glob)
Try to add udev info to existing entries in glob.
Definition: drv_enum.c:174
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:38
const char * subsystem
Require given subsystem.
Definition: drv_enum.h:37
Condition to match in drv_enum_udev().
Definition: drv_enum.h:34
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