#include <libudev.h>
Go to the source code of this file.
Defines | |
#define | _GNU_SOURCE 1 |
#define | LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE 1 |
#define | G13_DRIVER_NAME "hid-g13" |
#define | g13_list_entry_foreach(entry, first) |
typedef of udev's list entry iterator to provide a common API for g13. | |
Typedefs | |
typedef struct udev_list_entry | g13_list_entry |
typedef of udev's list entry structure to a g13 type to provide type checking on g13 functions and to guard against udev structures being used in g13 functions as parameters. | |
typedef struct udev_device | g13_device |
typedef of udev's device structure to a g13 type to provide type checking on g13 functions and to guard against udev structures being used in g13 functions as parameters. | |
typedef struct udev_enumerate | g13_enumerate |
typedef of udev's enumerate structure to a g13 type to provide type checking on g13 functions and to guard against udev structures being used in g13 functions as parameters. | |
Functions | |
g13_list_entry * | g13_list_entry_get_next (g13_list_entry *list_entry) |
Convenience replacement for udev_list_entry_get_next(). | |
void | g13_init () |
Initializes the g13 library by preparing the various udev structures that are needed for finding g13 devices. | |
void | g13_shutdown () |
Shuts down the g13 library. | |
int | g13_initialized () |
struct udev * | g13_udev () |
g13_enumerate * | g13_enumerate_new () |
g13_enumerate * | g13_enumerate_ref (g13_enumerate *e) |
Increment the refcount of an enumeration context. | |
void | g13_enumerate_unref (g13_enumerate *e) |
Drop a reference of an enumeration context. | |
int | g13_enumerate_scan_devices (g13_enumerate *e) |
Inititiate a udev scanning for g13 devices on the specified enumeration. | |
g13_list_entry * | g13_enumerate_get_list_entry (g13_enumerate *e) |
g13_list_entry * | g13_enumerate_scan_devices_get_list_entry (g13_enumerate *e) |
Scans the enumeration for G13 devices and returns the first entry. | |
const char * | g13_list_entry_get_name (g13_list_entry *entry) |
Convenience replacement for udev_list_entry_get_name(). | |
const char * | g13_list_entry_get_value (g13_list_entry *entry) |
Convenience replacement for udev_list_entry_get_value(). | |
g13_device * | g13_device_new_from_list_entry (g13_list_entry *list_entry) |
Create a new device from a list entry. | |
g13_device * | g13_device_new_from_name (const char *name) |
Create a new device by searching for a specific G13 name. | |
g13_device * | g13_device_ref (g13_device *device) |
Increment the reference count for the device. | |
void | g13_device_unref (g13_device *device) |
Decrement the device reference count. | |
struct udev_device * | g13_device_get_parent (g13_device *g13_device) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
struct udev_device * | g13_device_get_parent_with_subsystem_devtype (g13_device *g13_device, const char *subsystem, const char *devtype) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_devpath (g13_device *g13_device) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_subsystem (g13_device *g13_device) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_devtype (g13_device *g13_device) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_syspath (g13_device *g13_device) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_sysname (g13_device *g13_device) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_sysnum (g13_device *g13_device) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_devnode (g13_device *g13_device) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_property_value (g13_device *g13_device, const char *key) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_driver (g13_device *g13_device) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
dev_t | g13_device_get_devnum (g13_device *g13_device) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_action (g13_device *g13_device) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_sysattr_value (g13_device *g13_device, const char *sysattr) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. |
#define _GNU_SOURCE 1 |
#define G13_DRIVER_NAME "hid-g13" |
Referenced by g13_enumerate_new().
#define g13_list_entry_foreach | ( | entry, | |||
first | ) |
for (entry = first; \ entry != NULL; \ entry = g13_list_entry_get_next(entry))
typedef of udev's list entry iterator to provide a common API for g13.
There is no problem in using the udev list iterator, but the intent is to prevent mixing udev_ with g13_ typedefs.
Referenced by g13_device_new_from_name().
#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE 1 |
typedef of udev's device structure to a g13 type to provide type checking on g13 functions and to guard against udev structures being used in g13 functions as parameters.
typedef of udev's enumerate structure to a g13 type to provide type checking on g13 functions and to guard against udev structures being used in g13 functions as parameters.
typedef of udev's list entry structure to a g13 type to provide type checking on g13 functions and to guard against udev structures being used in g13 functions as parameters.
const char* g13_device_get_action | ( | g13_device * | g13_device | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_devnode | ( | g13_device * | g13_device | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
dev_t g13_device_get_devnum | ( | g13_device * | g13_device | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_devpath | ( | g13_device * | g13_device | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_devtype | ( | g13_device * | g13_device | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_driver | ( | g13_device * | g13_device | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
struct udev_device* g13_device_get_parent | ( | g13_device * | g13_device | ) | [read] |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
struct udev_device* g13_device_get_parent_with_subsystem_devtype | ( | g13_device * | g13_device, | |
const char * | subsystem, | |||
const char * | devtype | |||
) | [read] |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_property_value | ( | g13_device * | g13_device, | |
const char * | key | |||
) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_subsystem | ( | g13_device * | g13_device | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_sysattr_value | ( | g13_device * | g13_device, | |
const char * | sysattr | |||
) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_sysname | ( | g13_device * | g13_device | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_sysnum | ( | g13_device * | g13_device | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_syspath | ( | g13_device * | g13_device | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
Referenced by g13_create_led_path(), g13_device_get_backlight_rgb(), g13_device_get_fb_node(), g13_device_get_keymap(), g13_device_get_keymap_index(), g13_device_get_keymap_switching(), g13_device_get_minor(), g13_device_get_name(), g13_device_set_backlight_rgb(), g13_device_set_keymap_from_string(), g13_device_set_keymap_index(), g13_device_set_keymap_switching(), and g13_device_set_name().
g13_device* g13_device_new_from_list_entry | ( | g13_list_entry * | list_entry | ) |
Create a new device from a list entry.
References __g13_udev, g13_init(), g13_initialized(), and g13_list_entry_get_name().
Referenced by G13::Device::create(), and g13_device_new_from_name().
g13_device* g13_device_new_from_name | ( | const char * | name | ) |
Create a new device by searching for a specific G13 name.
name | the G13 device name to look for |
References g13_device_free_name(), g13_device_get_name(), g13_device_new_from_list_entry(), g13_device_unref(), g13_enumerate_scan_devices_get_list_entry(), and g13_list_entry_foreach.
Referenced by G13::Device::create().
g13_device* g13_device_ref | ( | g13_device * | device | ) |
Increment the reference count for the device.
Referenced by G13::Device::Device().
void g13_device_unref | ( | g13_device * | device | ) |
Decrement the device reference count.
If the refcount is zero the device resources will be freed.
Referenced by g13_device_new_from_name(), and G13::Device::~Device().
g13_list_entry* g13_enumerate_get_list_entry | ( | g13_enumerate * | e | ) |
e | The g13 enumeration to return the entry from or NULL to use the default enumeration |
References __g13_enumerate, g13_init(), and g13_initialized().
g13_enumerate* g13_enumerate_new | ( | ) |
References __g13_udev, G13_DRIVER_NAME, and g13_init().
Referenced by g13_init().
g13_enumerate* g13_enumerate_ref | ( | g13_enumerate * | e | ) |
Increment the refcount of an enumeration context.
This is a shallow wrapper around udev_enumerate_ref() provided to allow g13 enumeration contexts to be referenced without casting.
int g13_enumerate_scan_devices | ( | g13_enumerate * | e | ) |
Inititiate a udev scanning for g13 devices on the specified enumeration.
e | the enumeration to perform the scan on or NULL to use the default enumeration |
References __g13_enumerate, g13_init(), and g13_initialized().
g13_list_entry* g13_enumerate_scan_devices_get_list_entry | ( | g13_enumerate * | e | ) |
Scans the enumeration for G13 devices and returns the first entry.
e | The g13 enumeration to return the devices of or NULL to use the default enumeration |
References __g13_enumerate, g13_init(), and g13_initialized().
Referenced by g13_device_new_from_name().
void g13_enumerate_unref | ( | g13_enumerate * | e | ) |
Drop a reference of an enumeration context.
If the refcount reaches zero, all resources of the enumeration context will be released.
void g13_init | ( | ) |
Initializes the g13 library by preparing the various udev structures that are needed for finding g13 devices.
This will be implicitly called by g13 library functions such as g13_enumerate_devices() that need udev structures initiated.
Whether the library is initialized explicity with a call to g13_init() or implicitly through a call to g13_enumerate_devices(), g13_shutdown() should be called after all g13 library work is done. This is typically at the end of the program.
References __g13_enumerate, __g13_initialized, __g13_udev, and g13_enumerate_new().
Referenced by g13_device_new_from_list_entry(), g13_enumerate_get_list_entry(), g13_enumerate_new(), g13_enumerate_scan_devices(), and g13_enumerate_scan_devices_get_list_entry().
int g13_initialized | ( | ) |
References __g13_initialized.
Referenced by g13_device_new_from_list_entry(), g13_enumerate_get_list_entry(), g13_enumerate_scan_devices(), and g13_enumerate_scan_devices_get_list_entry().
const char* g13_list_entry_get_name | ( | g13_list_entry * | entry | ) |
Convenience replacement for udev_list_entry_get_name().
Referenced by g13_device_new_from_list_entry().
g13_list_entry* g13_list_entry_get_next | ( | g13_list_entry * | list_entry | ) |
Convenience replacement for udev_list_entry_get_next().
const char* g13_list_entry_get_value | ( | g13_list_entry * | entry | ) |
Convenience replacement for udev_list_entry_get_value().
void g13_shutdown | ( | ) |
Shuts down the g13 library.
Primary purpose is to clean up udev structures allocated during g13_init().
References __g13_enumerate, __g13_initialized, and __g13_udev.
struct udev* g13_udev | ( | ) | [read] |
References __g13_udev.