Syspath
Eeze » main » udev

These are functions which interact with the syspath (/sys/$PATH) of a device. More...

Functions

EAPI const char * eeze_udev_devpath_get_syspath (const char *devpath)
 Get the syspath of a device from the /dev/ path. More...
 
EAPI const char * eeze_udev_syspath_get_parent (const char *syspath)
 Find the root device of a device from its syspath. More...
 
EAPI Eina_Listeeze_udev_syspath_get_parents (const char *syspath)
 Returns a list of all parent device syspaths for syspath. More...
 
EAPI const char * eeze_udev_syspath_get_devpath (const char *syspath)
 Get the /dev/ path from the /sys/ path. More...
 
EAPI const char * eeze_udev_syspath_get_devname (const char *syspath)
 Get the /dev/ name from the /sys/ path. More...
 
EAPI const char * eeze_udev_syspath_get_subsystem (const char *syspath)
 Get the subsystem of a device from the /sys/ path. More...
 
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. More...
 
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. More...
 
EAPI Eina_Bool eeze_udev_syspath_is_mouse (const char *syspath)
 Checks whether the device is a mouse. More...
 
EAPI Eina_Bool eeze_udev_syspath_is_kbd (const char *syspath)
 Checks whether the device is a keyboard. More...
 
EAPI Eina_Bool eeze_udev_syspath_is_touchpad (const char *syspath)
 Checks whether the device is a touchpad. More...
 
EAPI Eina_Bool eeze_udev_syspath_is_joystick (const char *syspath)
 Checks whether the device is a joystick. More...
 

Detailed Description

These are functions which interact with the syspath (/sys/$PATH) of a device.

Function Documentation

◆ eeze_udev_devpath_get_syspath()

EAPI const char* eeze_udev_devpath_get_syspath ( const char *  devpath)

Get the syspath of a device from the /dev/ path.

Parameters
devpathThe /dev/ path of the device
Returns
A stringshared char* which corresponds to the /sys/ path of the device or NULL on failure

Takes "/dev/path" and returns the corresponding /sys/ path (without the "/sys/")

References eina_stringshare_add().

◆ eeze_udev_syspath_get_parent()

EAPI const char* eeze_udev_syspath_get_parent ( const char *  syspath)

Find the root device of a device from its syspath.

Parameters
syspathThe syspath of a device, with or without "/sys/"
Returns
The syspath of the parent device

Return a stringshared syspath (/sys/$syspath) for the parent device.

References EAPI, and eina_stringshare_add().

◆ eeze_udev_syspath_get_parents()

EAPI Eina_List* eeze_udev_syspath_get_parents ( const char *  syspath)

Returns a list of all parent device syspaths for syspath.

Parameters
syspathThe device to find parents of
Returns
A stringshared list of the parent devices of syspath

References EAPI, eina_list_append(), and eina_stringshare_add().

◆ eeze_udev_syspath_get_devpath()

EAPI const char* eeze_udev_syspath_get_devpath ( const char *  syspath)

Get the /dev/ path from the /sys/ path.

Parameters
syspathThe /sys/ path with or without the /sys/
Returns
A stringshared char* with the /dev/ path or NULL on failure

Takes /sys/$PATH and turns it into the corresponding "/dev/x/y".

References EAPI, and eina_stringshare_add().

◆ eeze_udev_syspath_get_devname()

EAPI const char* eeze_udev_syspath_get_devname ( const char *  syspath)

Get the /dev/ name from the /sys/ path.

Parameters
syspathThe /sys/ path with or without the /sys/
Returns
A stringshared char* of the device name without the /dev/ path, or NULL on failure

Takes /sys/$PATH and turns it into the corresponding /dev/x/"y".

References EAPI, and eina_stringshare_add().

◆ eeze_udev_syspath_get_subsystem()

EAPI const char* eeze_udev_syspath_get_subsystem ( const char *  syspath)

Get the subsystem of a device from the /sys/ path.

Parameters
syspathThe /sys/ path with or without the /sys/
Returns
A stringshared char* with the subsystem of the device or NULL on failure

Takes /sys/$PATH and returns the corresponding device subsystem, such as "input" for keyboards/mice.

References EAPI, and eina_stringshare_add().

◆ eeze_udev_syspath_get_property()

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.

Parameters
syspathThe /sys/ path with or without the /sys/
propertyThe property to get; full list of these is a FIXME
Returns
A stringshared char* with the property or NULL on failure

References EAPI, and eina_stringshare_add().

◆ eeze_udev_syspath_get_sysattr()

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.

Parameters
syspathThe /sys/ path with or without the /sys/
sysattrThe sysattr to get; full list of these is a FIXME
Returns
A stringshared char* with the sysattr or NULL on failure

References EAPI, and eina_stringshare_add().

◆ eeze_udev_syspath_is_mouse()

EAPI Eina_Bool eeze_udev_syspath_is_mouse ( const char *  syspath)

Checks whether the device is a mouse.

Parameters
syspathThe /sys/ path with or without the /sys/
Returns
If true, the device is a mouse

References EAPI, EINA_FALSE, and EINA_TRUE.

◆ eeze_udev_syspath_is_kbd()

EAPI Eina_Bool eeze_udev_syspath_is_kbd ( const char *  syspath)

Checks whether the device is a keyboard.

Parameters
syspathThe /sys/ path with or without the /sys/
Returns
If true, the device is a keyboard

References EAPI, EINA_FALSE, and EINA_TRUE.

◆ eeze_udev_syspath_is_touchpad()

EAPI Eina_Bool eeze_udev_syspath_is_touchpad ( const char *  syspath)

Checks whether the device is a touchpad.

Parameters
syspathThe /sys/ path with or without the /sys/
Returns
If true, the device is a touchpad

References EAPI, EINA_FALSE, and EINA_TRUE.

◆ eeze_udev_syspath_is_joystick()

EAPI Eina_Bool eeze_udev_syspath_is_joystick ( const char *  syspath)

Checks whether the device is a joystick.

Parameters
syspathThe /sys/ path with or without the /sys/
Returns
If true, the device is a joystick
Since
1.7

References EAPI, EINA_FALSE, and EINA_TRUE.