#include "udev.h"
#include "name.h"
#include "framebuffer.h"
#include <string.h>
#include <stdlib.h>
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 *find) |
Create a new device by searching for a specific G13 name. | |
g13_device * | g13_device_ref (g13_device *g13d) |
Increment the reference count for the device. | |
void | g13_device_unref (g13_device *g13d) |
Decrement the device reference count. | |
struct udev_device * | g13_device_get_parent (g13_device *g13d) |
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 *g13d, 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 *g13d) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_subsystem (g13_device *g13d) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_devtype (g13_device *g13d) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_syspath (g13_device *g13d) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_sysname (g13_device *g13d) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_sysnum (g13_device *g13d) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_devnode (g13_device *g13d) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_property_value (g13_device *g13d, const char *key) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_driver (g13_device *g13d) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
dev_t | g13_device_get_devnum (g13_device *g13d) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_action (g13_device *g13d) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
const char * | g13_device_get_sysattr_value (g13_device *g13d, const char *sysattr) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd. | |
Variables | |
int | __g13_initialized = 0 |
struct udev * | __g13_udev = NULL |
struct udev_enumerate * | __g13_enumerate = NULL |
const char* g13_device_get_action | ( | g13_device * | g13d | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_devnode | ( | g13_device * | g13d | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
dev_t g13_device_get_devnum | ( | g13_device * | g13d | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_devpath | ( | g13_device * | g13d | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_devtype | ( | g13_device * | g13d | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_driver | ( | g13_device * | g13d | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
struct udev_device* g13_device_get_parent | ( | g13_device * | g13d | ) | [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 * | g13d, | |
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 * | g13d, | |
const char * | key | |||
) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_subsystem | ( | g13_device * | g13d | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_sysattr_value | ( | g13_device * | g13d, | |
const char * | sysattr | |||
) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_sysname | ( | g13_device * | g13d | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_sysnum | ( | g13_device * | g13d | ) |
Thin wrapper to support g13_device* types without accessing g13_device member udevd.
const char* g13_device_get_syspath | ( | g13_device * | g13d | ) |
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 * | g13d | ) |
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.
struct udev_enumerate* __g13_enumerate = NULL |
int __g13_initialized = 0 |
Referenced by g13_init(), g13_initialized(), and g13_shutdown().
struct udev* __g13_udev = NULL |
Referenced by g13_device_new_from_list_entry(), g13_enumerate_new(), g13_init(), g13_shutdown(), and g13_udev().