Eeze.h File Reference

- Main Page
- Related Pages
- Modules
- Data Structures
- Files
- Examples

- File List
- Globals

Data Structures | Macros | Typedefs | Functions | Variables
Eeze.h File Reference

Easy device manipulation. More...

## Data Structures
struct | _Eeze_Version

## Macros
#define | EAPI
#define | EEZE_VERSION_MAJOR EFL_VERSION_MAJOR
#define | EEZE_VERSION_MINOR EFL_VERSION_MINOR
#define | EAPI

## Typedefs
typedef struct Eeze_Udev_Watch | Eeze_Udev_Watch
| Opaque structure to hold data for a udev watch.
typedef struct _Eeze_Version | Eeze_Version
typedef void(* | Eeze_Udev_Watch_Cb) (const char *, Eeze_Udev_Event, void *, Eeze_Udev_Watch *)
| Callback type for use with Eeze_Udev_Watch.

## Enumerations
enum | Eeze_Udev_Event { EEZE_UDEV_EVENT_NONE = 0xf0 , EEZE_UDEV_EVENT_ADD = (1 << 1) , EEZE_UDEV_EVENT_REMOVE = (1 << 2) , EEZE_UDEV_EVENT_CHANGE = (1 << 3) , EEZE_UDEV_EVENT_ONLINE = (1 << 4) , EEZE_UDEV_EVENT_OFFLINE = (1 << 5) }
| Flags for watch events. More...
enum | Eeze_Udev_Type { EEZE_UDEV_TYPE_NONE , EEZE_UDEV_TYPE_KEYBOARD , EEZE_UDEV_TYPE_MOUSE , EEZE_UDEV_TYPE_TOUCHPAD , EEZE_UDEV_TYPE_DRIVE_MOUNTABLE , EEZE_UDEV_TYPE_DRIVE_INTERNAL , EEZE_UDEV_TYPE_DRIVE_REMOVABLE , EEZE_UDEV_TYPE_DRIVE_CDROM , EEZE_UDEV_TYPE_POWER_AC , EEZE_UDEV_TYPE_POWER_BAT , EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR , EEZE_UDEV_TYPE_NET , EEZE_UDEV_TYPE_V4L , EEZE_UDEV_TYPE_BLUETOOTH , EEZE_UDEV_TYPE_JOYSTICK , EEZE_UDEV_TYPE_DRM , EEZE_UDEV_TYPE_BACKLIGHT , EEZE_UDEV_TYPE_LEDS , EEZE_UDEV_TYPE_GRAPHICS , EEZE_UDEV_TYPE_GPIO }
| Convenience types to simplify udev access. More...

## Functions
EAPI int | eeze_init (void)
| Initialize the eeze library.
EAPI int | eeze_shutdown (void)
| Shut down the eeze library.
EAPI void * | eeze_udev_get (void)
EAPI Eina_List * | eeze_udev_find_similar_from_syspath (const char *syspath)
| Returns a stringshared list of all syspaths that are (or should be) the same device as the device pointed at by `syspath`.
EAPI Eina_List * | eeze_udev_find_unlisted_similar (Eina_List *list)
| Updates a list of all syspaths that are (or should be) the same device.
EAPI Eina_List * | eeze_udev_find_by_sysattr (const char *sysattr, const char *value)
| Find a list of devices by a sysattr (and, optionally, a value of that sysattr).
EAPI Eina_List * | eeze_udev_find_by_type (Eeze_Udev_Type type, const char *name)
| Find devices using an Eeze_Udev_Type and/or a name.
EAPI Eina_List * | eeze_udev_find_by_filter (const char *subsystem, const char *type, const char *name)
| A more advanced find, allows finds using udev properties.
EAPI Eina_List * | eeze_udev_find_by_subsystem_sysname (const char *subsystem, const char *sysname)
| A more advanced find, allows finds using udev subsystem and sysname.
EAPI const char * | eeze_udev_devpath_get_syspath (const char *devpath)
| Get the syspath of a device from the /dev/ path.
EAPI const char * | eeze_udev_syspath_get_parent (const char *syspath)
| Find the root device of a device from its syspath.
EAPI Eina_Stringshare * | eeze_udev_syspath_get_parent_filtered (const char *syspath, const char *subsystem, const char *devtype)
| Find the parent device of a device from its syspath with a filter applied.
EAPI Eina_List * | eeze_udev_syspath_get_parents (const char *syspath)
| Returns a list of all parent device syspaths for `syspath`.
EAPI const char * | eeze_udev_syspath_get_devpath (const char *syspath)
| Get the /dev/ path from the /sys/ path.
EAPI const char * | eeze_udev_syspath_get_devname (const char *syspath)
| Get the /dev/ name from the /sys/ path.
EAPI const char * | eeze_udev_syspath_get_subsystem (const char *syspath)
| Get the subsystem of a device from the /sys/ path.
EAPI Eina_Bool | eeze_udev_syspath_check_property (const char *syspath, const char *property, const char *value)
| Check the property value of a device from the /sys/ path against a provided value.
EAPI const char * | eeze_udev_syspath_get_property (const char *syspath, const char *property)
| Get the property value of a device from the /sys/ path.
EAPI const char * | eeze_udev_syspath_get_sysattr (const char *syspath, const char *sysattr)
| Get the sysattr value of a device from the /sys/ path.
EAPI Eina_Bool | eeze_udev_syspath_check_sysattr (const char *syspath, const char *sysattr, const char *value)
| Check the sysattr value of a device from the /sys/ path against a provided value.
EAPI Eina_Bool | eeze_udev_syspath_set_sysattr (const char *syspath, const char *sysattr, double value)
| Set the sysattr value of a device from the /sys/ path.
EAPI Eina_List * | eeze_udev_syspath_get_sysattr_list (const char *syspath)
| Get the sysattr list of a device from the /sys/ path.
EAPI Eina_Bool | eeze_udev_syspath_is_mouse (const char *syspath)
| Checks whether the device is a mouse.
EAPI Eina_Bool | eeze_udev_syspath_is_kbd (const char *syspath)
| Checks whether the device is a keyboard.
EAPI Eina_Bool | eeze_udev_syspath_is_touchpad (const char *syspath)
| Checks whether the device is a touchpad.
EAPI Eina_Bool | eeze_udev_syspath_is_joystick (const char *syspath)
| Checks whether the device is a joystick.
EAPI int | eeze_udev_syspath_get_sysnum (const char *syspath)
| Get the sysnum value of a device from the /sys/ path.
EAPI Eina_Bool | eeze_udev_walk_check_sysattr (const char *syspath, const char *sysattr, const char *value)
| Walks up the device chain starting at `syspath`, checking each device for `sysattr` with (optional) `value`.
EAPI const char * | eeze_udev_walk_get_sysattr (const char *syspath, const char *sysattr)
| Walks up the device chain starting at `syspath`, checking each device for `sysattr`, and returns the value if found.
EAPI Eeze_Udev_Watch * | eeze_udev_watch_add (Eeze_Udev_Type type, int event, Eeze_Udev_Watch_Cb cb, void *user_data)
| Add a watch for a device type.
EAPI void * | eeze_udev_watch_del (Eeze_Udev_Watch *watch)
| Deletes a watch.

## Variables
EAPI Eeze_Version * | eeze_version

## Detailed Description

Easy device manipulation.

Eeze is a library for manipulating devices through udev with a simple and fast api. It interfaces directly with libudev, avoiding such middleman daemons as udisks/upower or hal, to immediately gather device information the instant it becomes known to the system. This can be used to determine such things as:

- If a cdrom has a disk inserted
- The temperature of a cpu core
- The remaining power left in a battery
- The current power consumption of various parts
- Monitor in realtime the status of peripheral devices Each of the above examples can be performed by using only a single eeze function, as one of the primary focuses of the library is to reduce the complexity of managing devices.

For udev functions, see udev.

## Enumeration Type Documentation

## ◆ Eeze_Udev_Event

enum Eeze_Udev_Event

Flags for watch events.

These events are used to specify the events to watch in a Eeze_Udev_Watch. They can be ORed together.

Enumerator
EEZE_UDEV_EVENT_NONE | No event specified
EEZE_UDEV_EVENT_ADD | Device added
EEZE_UDEV_EVENT_REMOVE | Device removed
EEZE_UDEV_EVENT_CHANGE | Device changed
EEZE_UDEV_EVENT_ONLINE | Device has come online
EEZE_UDEV_EVENT_OFFLINE | Device has gone offline

## ◆ Eeze_Udev_Type

enum Eeze_Udev_Type Eeze_Udev_Type

Convenience types to simplify udev access.

These types allow easy access to certain udev device types. They may only be used in specified functions.

Enumerator
EEZE_UDEV_TYPE_NONE | No type
EEZE_UDEV_TYPE_KEYBOARD | Keyboard device
EEZE_UDEV_TYPE_MOUSE | Mouse device
EEZE_UDEV_TYPE_TOUCHPAD | Touchpad device
EEZE_UDEV_TYPE_DRIVE_MOUNTABLE | Mountable drive
EEZE_UDEV_TYPE_DRIVE_INTERNAL | Internal drive
EEZE_UDEV_TYPE_DRIVE_REMOVABLE | Removable drive
EEZE_UDEV_TYPE_DRIVE_CDROM | cd drive
EEZE_UDEV_TYPE_POWER_AC | AC adapter
EEZE_UDEV_TYPE_POWER_BAT | Battery
EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR | Temperature sensor
EEZE_UDEV_TYPE_NET | Network devices
EEZE_UDEV_TYPE_V4L | WebCam
EEZE_UDEV_TYPE_BLUETOOTH | Bluetooth
EEZE_UDEV_TYPE_JOYSTICK | Joystick Since 1.7
EEZE_UDEV_TYPE_DRM | Drm Since 1.12
EEZE_UDEV_TYPE_BACKLIGHT | Backlight Since 1.12
EEZE_UDEV_TYPE_LEDS | Leds Since 1.12
EEZE_UDEV_TYPE_GRAPHICS | Graphics Since 1.18
EEZE_UDEV_TYPE_GPIO | GPIOS (includes gpioN and gpiochipN) Since 1.19

## Function Documentation

## ◆ eeze_udev_get()

EAPI void * eeze_udev_get | ( | void |  | ) |

Returns
  the main udev context used by the library This allows for external reuse of the udev context, reducing direct dependency on libudev.

Warning
  DO NOT CLOSE THIS CONTEXT.

Since
  1.10

References eeze_udev_get().

Referenced by eeze_udev_get().