LIRC libraries: /home/mk/tmp/lirc/lib/drv_enum.c File Reference

| LIRC libraries LinuxInfraredRemoteControl

Functions
drv_enum.c File Reference
User-space driver API

### (57e5fec 2017-01-18 23:08:05 +0100)

Implemenents drv_enum.h. More...

`#include <glob.h>`
`#include <stdbool.h>`
`#include <sys/stat.h>`
`#include <sys/types.h>`
`#include <dirent.h>`
`#include <errno.h>`
`#include "drv_enum.h"`
`#include "driver.h"`
`#include "lirc_log.h"`

Go to the source code of this file.

## Functions
void | glob_t_init (glob_t *glob)
| Setup a glob_t variable to empty state. More...
void | glob_t_add_path (glob_t *glob, const char *path)
| Add a path to glob, allocating memory as necessary. More...
void | drv_enum_free (glob_t *glob)
| Free memory allocated by for a glob_t. More...
int | drv_enum_globs (glob_t *globbuf, const char *const *patterns)
| List devices matching any of patterns in null-terminated list. More...
int | drv_enum_glob (glob_t *globbuf, const char *const pattern)
| List all devices matching glob(3) pattern. More...
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. More...
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. More...

## Detailed Description

Implemenents drv_enum.h.

Author
  Alec Leamas

License:
  GPL2 or later

Date
  December 2016

Definition in file drv_enum.c.

## Function Documentation

## § drv_enum_free()

void drv_enum_free | ( | glob_t * | glob | ) |

Free memory allocated by for a glob_t.

Free memory obtained using any of the drv_enum_* functions.

Definition at line 63 of file drv_enum.c.

## § drv_enum_glob()

int drv_enum_glob | ( | glob_t * | glob,
|  | const char * | pattern
| ) |  |

List all devices matching glob(3) pattern.

Definition at line 212 of file drv_enum.c.

## § drv_enum_globs()

int drv_enum_globs | ( | glob_t * | globbuf,
|  | const char *const * | patterns
| ) |  |

List devices matching any of patterns in null-terminated list.

Definition at line 179 of file drv_enum.c.

## § drv_enum_udev()

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 at line 412 of file drv_enum.c.

## § drv_enum_usb()

int drv_enum_usb | ( | glob_t * | glob,
|  | int(*)(uint16_t vendor, uint16_t product) | is_device_ok
| ) |  |

List all available devices matched by is_device_ok() using libusb.

Definition at line 252 of file drv_enum.c.

## § glob_t_add_path()

void glob_t_add_path | ( | glob_t * | glob,
|  | const char * | path
| ) |  |

Add a path to glob, allocating memory as necessary.

Definition at line 48 of file drv_enum.c.

## § glob_t_init()

void glob_t_init | ( | glob_t * | glob | ) |

Setup a glob_t variable to empty state.

Definition at line 40 of file drv_enum.c.