forked from enlightenment/efl
parent
50101673d4
commit
496e6350b2
|
@ -26,6 +26,12 @@ 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
|
function, as one of the primary focuses of the library is to reduce the
|
||||||
complexity of managing devices.
|
complexity of managing devices.
|
||||||
|
|
||||||
|
@li @link Eeze.h Eeze functions @endlink
|
||||||
|
@li @ref udev UDEV functions
|
||||||
|
@li @ref watch Functions that watch for events
|
||||||
|
@li @ref syspath Functions that accept a device /sys/ path
|
||||||
|
@li @ref find Functions which find types of devices
|
||||||
|
|
||||||
@verbatim
|
@verbatim
|
||||||
Pants
|
Pants
|
||||||
@endverbatim
|
@endverbatim
|
||||||
|
|
|
@ -109,7 +109,7 @@ extern "C" {
|
||||||
* @brief Flags for watch events
|
* @brief Flags for watch events
|
||||||
*
|
*
|
||||||
* These events are used to specify the events to watch in a
|
* These events are used to specify the events to watch in a
|
||||||
* @ref Eeze_Udev_Watch. They can be OR'ed together.
|
* #Eeze_Udev_Watch. They can be ORed together.
|
||||||
*@{
|
*@{
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
|
@ -186,7 +186,7 @@ typedef struct Eeze_Udev_Watch Eeze_Udev_Watch;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @addtogroup watch
|
* @addtogroup watch
|
||||||
* @brief Callback type for use with @ref Eeze_Udev_Watch
|
* @brief Callback type for use with #Eeze_Udev_Watch
|
||||||
*/
|
*/
|
||||||
typedef void(*Eeze_Udev_Watch_Cb)(const char *, Eeze_Udev_Event, void *, Eeze_Udev_Watch *);
|
typedef void(*Eeze_Udev_Watch_Cb)(const char *, Eeze_Udev_Event, void *, Eeze_Udev_Watch *);
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,13 @@
|
||||||
extern _udev *udev;
|
extern _udev *udev;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup find Find
|
* @addtogroup find Find
|
||||||
*
|
*
|
||||||
* These are functions which find/supplement lists of devices.
|
* These are functions which find/supplement lists of devices.
|
||||||
*
|
*
|
||||||
* @ingroup udev
|
* @ingroup udev
|
||||||
|
*
|
||||||
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,8 +24,6 @@ extern _udev *udev;
|
||||||
*
|
*
|
||||||
* @param syspath The syspath of the device to find matches for
|
* @param syspath The syspath of the device to find matches for
|
||||||
* @return All devices which are the same as the one passed
|
* @return All devices which are the same as the one passed
|
||||||
*
|
|
||||||
* @ingroup find
|
|
||||||
*/
|
*/
|
||||||
EAPI Eina_List *
|
EAPI Eina_List *
|
||||||
eeze_udev_find_similar_from_syspath(const char *syspath)
|
eeze_udev_find_similar_from_syspath(const char *syspath)
|
||||||
|
@ -96,8 +96,6 @@ eeze_udev_find_similar_from_syspath(const char *syspath)
|
||||||
* This function will update @p list to include all devices matching
|
* This function will update @p list to include all devices matching
|
||||||
* devices with syspaths currently stored in @p list. All strings are
|
* devices with syspaths currently stored in @p list. All strings are
|
||||||
* stringshared.
|
* stringshared.
|
||||||
*
|
|
||||||
* @ingroup find
|
|
||||||
*/
|
*/
|
||||||
EAPI Eina_List *
|
EAPI Eina_List *
|
||||||
eeze_udev_find_unlisted_similar(Eina_List * list)
|
eeze_udev_find_unlisted_similar(Eina_List * list)
|
||||||
|
@ -158,15 +156,13 @@ eeze_udev_find_unlisted_similar(Eina_List * list)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find devices using an @ref type and/or a name.
|
* Find devices using an #Eeze_Udev_Type and/or a name.
|
||||||
*
|
*
|
||||||
* @param etype An @ref Eeze_Udev_Type or 0
|
* @param etype An #Eeze_Udev_Type or 0
|
||||||
* @param name A filter for the device name or NULL
|
* @param name A filter for the device name or #NULL
|
||||||
* @return A stringshared Eina_List of matched devices or NULL on failure
|
* @return A stringshared Eina_List of matched devices or #NULL on failure
|
||||||
*
|
*
|
||||||
* Return a list of syspaths (/sys/$syspath) for matching udev devices.
|
* Return a list of syspaths (/sys/$syspath) for matching udev devices.
|
||||||
*
|
|
||||||
* @ingroup find
|
|
||||||
*/
|
*/
|
||||||
EAPI Eina_List *
|
EAPI Eina_List *
|
||||||
eeze_udev_find_by_type(Eeze_Udev_Type etype, const char *name)
|
eeze_udev_find_by_type(Eeze_Udev_Type etype, const char *name)
|
||||||
|
@ -315,8 +311,6 @@ out:
|
||||||
*
|
*
|
||||||
* Return a list of syspaths (/sys/$syspath) for matching udev devices.
|
* Return a list of syspaths (/sys/$syspath) for matching udev devices.
|
||||||
* Requires at least one filter.
|
* Requires at least one filter.
|
||||||
*
|
|
||||||
* @ingroup find
|
|
||||||
*/
|
*/
|
||||||
EAPI Eina_List *
|
EAPI Eina_List *
|
||||||
eeze_udev_find_by_filter(const char *subsystem, const char *type,
|
eeze_udev_find_by_filter(const char *subsystem, const char *type,
|
||||||
|
@ -399,3 +393,5 @@ eeze_udev_find_by_sysattr(const char *sysattr, const char *value)
|
||||||
udev_enumerate_unref(en);
|
udev_enumerate_unref(en);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
|
|
@ -9,12 +9,14 @@
|
||||||
extern _udev *udev;
|
extern _udev *udev;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup syspath Syspath
|
* @addtogroup syspath Syspath
|
||||||
*
|
*
|
||||||
* These are functions which interact with the syspath (/sys/$PATH) of
|
* These are functions which interact with the syspath (/sys/$PATH) of
|
||||||
* a device.
|
* a device.
|
||||||
*
|
*
|
||||||
* @ingroup udev
|
* @ingroup udev
|
||||||
|
*
|
||||||
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,8 +26,6 @@ extern _udev *udev;
|
||||||
* @return The syspath of the parent device
|
* @return The syspath of the parent device
|
||||||
*
|
*
|
||||||
* Return a stringshared syspath (/sys/$syspath) for the parent device.
|
* Return a stringshared syspath (/sys/$syspath) for the parent device.
|
||||||
*
|
|
||||||
* @ingroup syspath
|
|
||||||
*/
|
*/
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eeze_udev_syspath_get_parent(const char *syspath)
|
eeze_udev_syspath_get_parent(const char *syspath)
|
||||||
|
@ -49,8 +49,6 @@ eeze_udev_syspath_get_parent(const char *syspath)
|
||||||
*
|
*
|
||||||
* @param syspath The device to find parents of
|
* @param syspath The device to find parents of
|
||||||
* @return A stringshared list of the parent devices of @p syspath
|
* @return A stringshared list of the parent devices of @p syspath
|
||||||
*
|
|
||||||
* @ingroup syspath
|
|
||||||
*/
|
*/
|
||||||
EAPI Eina_List *
|
EAPI Eina_List *
|
||||||
eeze_udev_syspath_get_parents(const char *syspath)
|
eeze_udev_syspath_get_parents(const char *syspath)
|
||||||
|
@ -85,8 +83,6 @@ eeze_udev_syspath_get_parents(const char *syspath)
|
||||||
* @return A stringshared char* with the /dev/ path or NULL on failure
|
* @return A stringshared char* with the /dev/ path or NULL on failure
|
||||||
*
|
*
|
||||||
* Takes /sys/$PATH and turns it into the corresponding "/dev/x/y".
|
* Takes /sys/$PATH and turns it into the corresponding "/dev/x/y".
|
||||||
*
|
|
||||||
* @ingroup syspath
|
|
||||||
*/
|
*/
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eeze_udev_syspath_get_devpath(const char *syspath)
|
eeze_udev_syspath_get_devpath(const char *syspath)
|
||||||
|
@ -116,8 +112,6 @@ eeze_udev_syspath_get_devpath(const char *syspath)
|
||||||
*
|
*
|
||||||
* Takes /sys/$PATH and returns the corresponding device subsystem,
|
* Takes /sys/$PATH and returns the corresponding device subsystem,
|
||||||
* such as "input" for keyboards/mice.
|
* such as "input" for keyboards/mice.
|
||||||
*
|
|
||||||
* @ingroup syspath
|
|
||||||
*/
|
*/
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eeze_udev_syspath_get_subsystem(const char *syspath)
|
eeze_udev_syspath_get_subsystem(const char *syspath)
|
||||||
|
@ -141,8 +135,6 @@ eeze_udev_syspath_get_subsystem(const char *syspath)
|
||||||
* @param syspath The /sys/ path with or without the /sys/
|
* @param syspath The /sys/ path with or without the /sys/
|
||||||
* @param property The property to get; full list of these is a FIXME
|
* @param property The property to get; full list of these is a FIXME
|
||||||
* @return A stringshared char* with the property or NULL on failure
|
* @return A stringshared char* with the property or NULL on failure
|
||||||
*
|
|
||||||
* @ingroup syspath
|
|
||||||
*/
|
*/
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eeze_udev_syspath_get_property(const char *syspath, const char *property)
|
eeze_udev_syspath_get_property(const char *syspath, const char *property)
|
||||||
|
@ -168,8 +160,6 @@ eeze_udev_syspath_get_property(const char *syspath, const char *property)
|
||||||
* @param syspath The /sys/ path with or without the /sys/
|
* @param syspath The /sys/ path with or without the /sys/
|
||||||
* @param sysattr The sysattr to get; full list of these is a FIXME
|
* @param sysattr The sysattr to get; full list of these is a FIXME
|
||||||
* @return A stringshared char* with the sysattr or NULL on failure
|
* @return A stringshared char* with the sysattr or NULL on failure
|
||||||
*
|
|
||||||
* @ingroup syspath
|
|
||||||
*/
|
*/
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eeze_udev_syspath_get_sysattr(const char *syspath, const char *sysattr)
|
eeze_udev_syspath_get_sysattr(const char *syspath, const char *sysattr)
|
||||||
|
@ -195,8 +185,6 @@ eeze_udev_syspath_get_sysattr(const char *syspath, const char *sysattr)
|
||||||
*
|
*
|
||||||
* @param syspath The /sys/ path with or without the /sys/
|
* @param syspath The /sys/ path with or without the /sys/
|
||||||
* @return If true, the device is a mouse
|
* @return If true, the device is a mouse
|
||||||
*
|
|
||||||
* @ingroup syspath
|
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
eeze_udev_syspath_is_mouse(const char *syspath)
|
eeze_udev_syspath_is_mouse(const char *syspath)
|
||||||
|
@ -237,8 +225,6 @@ eeze_udev_syspath_is_mouse(const char *syspath)
|
||||||
*
|
*
|
||||||
* @param syspath The /sys/ path with or without the /sys/
|
* @param syspath The /sys/ path with or without the /sys/
|
||||||
* @return If true, the device is a keyboard
|
* @return If true, the device is a keyboard
|
||||||
*
|
|
||||||
* @ingroup syspath
|
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
eeze_udev_syspath_is_kbd(const char *syspath)
|
eeze_udev_syspath_is_kbd(const char *syspath)
|
||||||
|
@ -279,8 +265,6 @@ eeze_udev_syspath_is_kbd(const char *syspath)
|
||||||
*
|
*
|
||||||
* @param syspath The /sys/ path with or without the /sys/
|
* @param syspath The /sys/ path with or without the /sys/
|
||||||
* @return If true, the device is a touchpad
|
* @return If true, the device is a touchpad
|
||||||
*
|
|
||||||
* @ingroup syspath
|
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
eeze_udev_syspath_is_touchpad(const char *syspath)
|
eeze_udev_syspath_is_touchpad(const char *syspath)
|
||||||
|
@ -314,8 +298,6 @@ eeze_udev_syspath_is_touchpad(const char *syspath)
|
||||||
* @return A stringshared char* which corresponds to the /sys/ path of the device or NULL on failure
|
* @return 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/")
|
* Takes "/dev/path" and returns the corresponding /sys/ path (without the "/sys/")
|
||||||
*
|
|
||||||
* @ingroup syspath
|
|
||||||
*/
|
*/
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eeze_udev_devpath_get_syspath(const char *devpath)
|
eeze_udev_devpath_get_syspath(const char *devpath)
|
||||||
|
@ -347,3 +329,5 @@ eeze_udev_devpath_get_syspath(const char *devpath)
|
||||||
udev_enumerate_unref(en);
|
udev_enumerate_unref(en);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
|
|
@ -9,11 +9,13 @@
|
||||||
extern _udev *udev;
|
extern _udev *udev;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup walks Walks
|
* @addtogroup walks Walks
|
||||||
*
|
*
|
||||||
* These are functions which walk up the device chain.
|
* These are functions which walk up the device chain.
|
||||||
*
|
*
|
||||||
* @ingroup udev
|
* @ingroup udev
|
||||||
|
*
|
||||||
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,8 +27,6 @@ extern _udev *udev;
|
||||||
* @param value OPTIONAL: The value that @p sysattr should have, or NULL
|
* @param value OPTIONAL: The value that @p sysattr should have, or NULL
|
||||||
*
|
*
|
||||||
* @return If the sysattr (with value) is found, returns TRUE. Else, false.
|
* @return If the sysattr (with value) is found, returns TRUE. Else, false.
|
||||||
*
|
|
||||||
* @ingroup walks
|
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
eeze_udev_walk_check_sysattr(const char *syspath, const char *sysattr,
|
eeze_udev_walk_check_sysattr(const char *syspath, const char *sysattr,
|
||||||
|
@ -66,8 +66,6 @@ eeze_udev_walk_check_sysattr(const char *syspath, const char *sysattr,
|
||||||
* @param sysattr The attribute to find
|
* @param sysattr The attribute to find
|
||||||
*
|
*
|
||||||
* @return The stringshared value of @p sysattr if found, or NULL
|
* @return The stringshared value of @p sysattr if found, or NULL
|
||||||
*
|
|
||||||
* @ingroup walks
|
|
||||||
*/
|
*/
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eeze_udev_walk_get_sysattr(const char *syspath, const char *sysattr)
|
eeze_udev_walk_get_sysattr(const char *syspath, const char *sysattr)
|
||||||
|
@ -95,3 +93,5 @@ eeze_udev_walk_get_sysattr(const char *syspath, const char *sysattr)
|
||||||
udev_device_unref(device);
|
udev_device_unref(device);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
|
|
@ -30,7 +30,7 @@ struct _store_data
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup watch Watch
|
* @addtogroup watch Watch
|
||||||
*
|
*
|
||||||
* @brief These are functions which monitor udev for events.
|
* @brief These are functions which monitor udev for events.
|
||||||
*
|
*
|
||||||
|
@ -40,6 +40,8 @@ struct _store_data
|
||||||
* the watch object itself in case you want to stop the watch easily in a callback.
|
* the watch object itself in case you want to stop the watch easily in a callback.
|
||||||
*
|
*
|
||||||
* @ingroup udev
|
* @ingroup udev
|
||||||
|
*
|
||||||
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* private function to further filter watch results based on Eeze_Udev_Type
|
/* private function to further filter watch results based on Eeze_Udev_Type
|
||||||
|
@ -280,10 +282,9 @@ error:
|
||||||
/**
|
/**
|
||||||
* Add a watch for a device type
|
* Add a watch for a device type
|
||||||
*
|
*
|
||||||
* @param type The @ref Eeze_Udev_Type to watch
|
* @param type The #Eeze_Udev_Type to watch
|
||||||
* @param event The events to watch; an OR list of @ref event (ie (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE)), or 0 for all events
|
* @param event The events to watch; an OR list of #Eeze_Udev_Event (ie (#EEZE_UDEV_EVENT_ADD | #EEZE_UDEV_EVENT_REMOVE)), or 0 for all events
|
||||||
* @param func The function to call when the watch receives data;
|
* @param cb The function to call when the watch receives data of type #Eeze_Udev_Watch_Cb
|
||||||
* must take (const char *device, int event_type, void *data, Eeze_Udev_Watch *watch)
|
|
||||||
* @param user_data Data to pass to the callback function
|
* @param user_data Data to pass to the callback function
|
||||||
*
|
*
|
||||||
* @return A watch struct for the watch type specified, or NULL on failure
|
* @return A watch struct for the watch type specified, or NULL on failure
|
||||||
|
@ -291,8 +292,6 @@ error:
|
||||||
* Eeze watches will monitor udev for changes of type(s) @p event to devices of type @p type. When these changes occur, the stringshared
|
* Eeze watches will monitor udev for changes of type(s) @p event to devices of type @p type. When these changes occur, the stringshared
|
||||||
* syspath of the device will be sent to function @p func, along with the bitmask of the event type which can be detected through
|
* syspath of the device will be sent to function @p func, along with the bitmask of the event type which can be detected through
|
||||||
* binary &.
|
* binary &.
|
||||||
*
|
|
||||||
* @ingroup watch
|
|
||||||
*/
|
*/
|
||||||
EAPI Eeze_Udev_Watch *
|
EAPI Eeze_Udev_Watch *
|
||||||
eeze_udev_watch_add(Eeze_Udev_Type type, int event,
|
eeze_udev_watch_add(Eeze_Udev_Type type, int event,
|
||||||
|
@ -389,8 +388,6 @@ error:
|
||||||
* @return The data originally associated with the watch, or NULL
|
* @return The data originally associated with the watch, or NULL
|
||||||
*
|
*
|
||||||
* Deletes a watch, closing file descriptors and freeing related udev memory.
|
* Deletes a watch, closing file descriptors and freeing related udev memory.
|
||||||
*
|
|
||||||
* @ingroup watch
|
|
||||||
*/
|
*/
|
||||||
EAPI void *
|
EAPI void *
|
||||||
eeze_udev_watch_del(Eeze_Udev_Watch * watch)
|
eeze_udev_watch_del(Eeze_Udev_Watch * watch)
|
||||||
|
@ -414,3 +411,4 @@ eeze_udev_watch_del(Eeze_Udev_Watch * watch)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
|
Loading…
Reference in New Issue