Syspath

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

Functions
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_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. More...
EAPI Eina_List * | eeze_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 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. 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_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. More...
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. More...
EAPI Eina_List * | eeze_udev_syspath_get_sysattr_list (const char *syspath)
| Get the sysattr list 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...
EAPI int | eeze_udev_syspath_get_sysnum (const char *syspath)
| Get the sysnum value of a device from the /sys/ path. More...

## Detailed Description

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

## Function Documentation

EAPI const char* eeze_udev_devpath_get_syspath | ( | const char * | devpath | ) |

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

Parameters

  devpath | The /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().

Referenced by eeze_disk_new(), and eeze_disk_new_from_mount().

EAPI const char* eeze_udev_syspath_get_parent | ( | const char * | syspath | ) |

Find the root device of a device from its syspath.

Parameters

  syspath | The 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 eina_stringshare_add(), and efl::eo::parent.

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.

Parameters

  syspath | The syspath of a device, with or without "/sys/"
  subsystem | The desired subsystem of the parent device
  devtype | The desired device type of the parent device

Returns
  The syspath of the parent device

Return a stringshared syspath (/sys/$syspath) for the parent device if one exists which matches the filter.

Since
  1.10

References eina_stringshare_add(), and efl::eo::parent.

Referenced by ecore_drm_device_find().

EAPI Eina_List* eeze_udev_syspath_get_parents | ( | const char * | syspath | ) |

Returns a list of all parent device syspaths for `syspath`.

Parameters

  syspath | The device to find parents of

Returns
  A stringshared list of the parent devices of `syspath`

References eina_list_append(), eina_stringshare_add(), and efl::eo::parent.

EAPI const char* eeze_udev_syspath_get_devpath | ( | const char * | syspath | ) |

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

Parameters

  syspath | The /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 eina_stringshare_add().

Referenced by ecore_drm_device_find().

EAPI const char* eeze_udev_syspath_get_devname | ( | const char * | syspath | ) |

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

Parameters

  syspath | The /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 eina_stringshare_add().

EAPI const char* eeze_udev_syspath_get_subsystem | ( | const char * | syspath | ) |

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

Parameters

  syspath | The /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 eina_stringshare_add().

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.

Parameters

  syspath | The /sys/ path with or without the /sys/
  property | The property to check; full list of these is a FIXME
  value | The value to check the property against

Returns
  `EINA_TRUE` if the property matches the supplied value

Since
  1.10

References EINA_FALSE.

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

  syspath | The /sys/ path with or without the /sys/
  property | The property to get; full list of these is a FIXME

Returns
  A stringshared char* with the property or `NULL` on failure

References eina_stringshare_add().

Referenced by ecore_drm_device_find(), and ecore_drm_inputs_device_axis_size_set().

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

  syspath | The /sys/ path with or without the /sys/
  sysattr | The sysattr to get; full list of these is a FIXME

Returns
  A stringshared char* with the sysattr or `NULL` on failure

References eina_stringshare_add().

Referenced by ecore_drm_device_find().

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.

Parameters

  syspath | The /sys/ path with or without the /sys/
  sysattr | The sysattr to check; full list of these is a FIXME
  value | The value to check the property against

Returns
  `EINA_TRUE` if the sysattr matches the supplied value

Since
  1.10

References EINA_FALSE.

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.

Parameters

  syspath | The /sys/ path with or without the /sys/
  sysattr | The sysattr to set;
  value | The value of sysattr to be set

Returns
  `EINA_TRUE` if the sysattr value is set 1.12

References EINA_FALSE, and EINA_TRUE.

EAPI Eina_List* eeze_udev_syspath_get_sysattr_list | ( | const char * | syspath | ) |

Get the sysattr list of a device from the /sys/ path.

Parameters

  syspath | The /sys/ path with or without the /sys/

Returns
  Eina_list containing list of sysattr for a device or `NULL` on failure

Since
  1.12

References eina_list_append(), and eina_stringshare_add().

EAPI Eina_Bool eeze_udev_syspath_is_mouse | ( | const char * | syspath | ) |

Checks whether the device is a mouse.

Parameters

  syspath | The /sys/ path with or without the /sys/

Returns
  If true, the device is a mouse

References EINA_FALSE, and EINA_TRUE.

EAPI Eina_Bool eeze_udev_syspath_is_kbd | ( | const char * | syspath | ) |

Checks whether the device is a keyboard.

Parameters

  syspath | The /sys/ path with or without the /sys/

Returns
  If true, the device is a keyboard

References EINA_FALSE, and EINA_TRUE.

EAPI Eina_Bool eeze_udev_syspath_is_touchpad | ( | const char * | syspath | ) |

Checks whether the device is a touchpad.

Parameters

  syspath | The /sys/ path with or without the /sys/

Returns
  If true, the device is a touchpad

References EINA_FALSE, and EINA_TRUE.

EAPI Eina_Bool eeze_udev_syspath_is_joystick | ( | const char * | syspath | ) |

Checks whether the device is a joystick.

Parameters

  syspath | The /sys/ path with or without the /sys/

Returns
  If true, the device is a joystick

Since
  1.7

References EINA_FALSE, and EINA_TRUE.

EAPI int eeze_udev_syspath_get_sysnum | ( | const char * | syspath | ) |

Get the sysnum value of a device from the /sys/ path.

Parameters

  syspath | The /sys/ path with or without the /sys/

Returns
  A integer with the sysnum or -1 on failure

Since
  1.12

Referenced by ecore_drm_device_find().