# libudev
# ------------------------------------------------------------------------------
LIBUDEV_CURRENT=11
-LIBUDEV_REVISION=4
+LIBUDEV_REVISION=5
LIBUDEV_AGE=11
SUBDIRS += libudev/docs
libudev/libudev-monitor.c \
libudev/libudev-queue.c
-libudev_libudev_la_CFLAGS = \
- -fvisibility=default
-
libudev_libudev_la_LDFLAGS = \
- -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
- -export-symbols $(top_srcdir)/libudev/exported_symbols
+ -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE)
noinst_LTLIBRARIES = \
libudev/libudev-private.la
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libudev/libudev.pc
-EXTRA_DIST += libudev/exported_symbols libudev/COPYING
+EXTRA_DIST += libudev/COPYING
# move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
libudev-install-move-hook:
if test "$(libdir)" != "$(rootlib_execdir)"; then \
+ - make private functions in libudev-device.c static
+
- delete mobile-action-modeswitch
(moved to usb_modeswitch)
+++ /dev/null
-udev_new
-udev_ref
-udev_unref
-udev_set_log_fn
-udev_get_log_priority
-udev_set_log_priority
-udev_get_userdata
-udev_set_userdata
-udev_get_sys_path
-udev_get_dev_path
-udev_get_run_path
-udev_list_entry_get_next
-udev_list_entry_get_by_name
-udev_list_entry_get_name
-udev_list_entry_get_value
-udev_device_new_from_syspath
-udev_device_new_from_devnum
-udev_device_new_from_subsystem_sysname
-udev_device_new_from_environment
-udev_device_get_parent
-udev_device_get_parent_with_subsystem_devtype
-udev_device_ref
-udev_device_unref
-udev_device_get_udev
-udev_device_get_syspath
-udev_device_get_devpath
-udev_device_get_devnode
-udev_device_get_sysname
-udev_device_get_sysnum
-udev_device_get_subsystem
-udev_device_get_devtype
-udev_device_get_is_initialized
-udev_device_get_devlinks_list_entry
-udev_device_get_properties_list_entry
-udev_device_get_tags_list_entry
-udev_device_get_sysattr_list_entry
-udev_device_get_property_value
-udev_device_get_action
-udev_device_get_driver
-udev_device_get_devnum
-udev_device_get_seqnum
-udev_device_get_usec_since_initialized
-udev_device_get_sysattr_value
-udev_enumerate_new
-udev_enumerate_ref
-udev_enumerate_unref
-udev_enumerate_get_udev
-udev_enumerate_get_list_entry
-udev_enumerate_add_match_subsystem
-udev_enumerate_add_nomatch_subsystem
-udev_enumerate_add_match_sysattr
-udev_enumerate_add_nomatch_sysattr
-udev_enumerate_add_match_property
-udev_enumerate_add_match_tag
-udev_enumerate_add_match_is_initialized
-udev_enumerate_add_match_sysname
-udev_enumerate_scan_devices
-udev_enumerate_scan_subsystems
-udev_enumerate_add_syspath
-udev_monitor_new_from_socket
-udev_monitor_new_from_netlink
-udev_monitor_set_receive_buffer_size
-udev_monitor_enable_receiving
-udev_monitor_ref
-udev_monitor_unref
-udev_monitor_get_udev
-udev_monitor_get_fd
-udev_monitor_receive_device
-udev_monitor_filter_add_match_subsystem_devtype
-udev_monitor_filter_add_match_tag
-udev_monitor_filter_update
-udev_monitor_filter_remove
-udev_queue_new
-udev_queue_ref
-udev_queue_unref
-udev_queue_get_udev
-udev_queue_get_kernel_seqnum
-udev_queue_get_udev_seqnum
-udev_queue_get_udev_is_active
-udev_queue_get_queue_is_empty
-udev_queue_get_seqnum_is_finished
-udev_queue_get_seqnum_sequence_is_finished
-udev_queue_get_queued_list_entry
-udev_queue_get_failed_list_entry
*
* Returns: the value of a device property, or #NULL if there is no such property.
**/
-const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key)
+UDEV_EXPORT const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key)
{
struct udev_list_entry *list_entry;
*
* Returns: a new udev device, or #NULL, if it does not exist
**/
-struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char *syspath)
+UDEV_EXPORT struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char *syspath)
{
size_t len;
const char *subdir;
*
* Returns: a new udev device, or #NULL, if it does not exist
**/
-struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum)
+UDEV_EXPORT struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum)
{
char path[UTIL_PATH_SIZE];
const char *type_str;
*
* Returns: a new udev device, or #NULL, if it does not exist
**/
-struct udev_device *udev_device_new_from_subsystem_sysname(struct udev *udev, const char *subsystem, const char *sysname)
+UDEV_EXPORT struct udev_device *udev_device_new_from_subsystem_sysname(struct udev *udev, const char *subsystem, const char *sysname)
{
char path_full[UTIL_PATH_SIZE];
char *path;
*
* Returns: a new udev device, or #NULL, if it does not exist
**/
-struct udev_device *udev_device_new_from_environment(struct udev *udev)
+UDEV_EXPORT struct udev_device *udev_device_new_from_environment(struct udev *udev)
{
int i;
struct udev_device *udev_device;
*
* Returns: a new udev device, or #NULL, if it no parent exist.
**/
-struct udev_device *udev_device_get_parent(struct udev_device *udev_device)
+UDEV_EXPORT struct udev_device *udev_device_get_parent(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: a new udev device, or #NULL if no matching parent exists.
**/
-struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, const char *subsystem, const char *devtype)
+UDEV_EXPORT struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, const char *subsystem, const char *devtype)
{
struct udev_device *parent;
*
* Returns: the udev library context
**/
-struct udev *udev_device_get_udev(struct udev_device *udev_device)
+UDEV_EXPORT struct udev *udev_device_get_udev(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the passed udev device
**/
-struct udev_device *udev_device_ref(struct udev_device *udev_device)
+UDEV_EXPORT struct udev_device *udev_device_ref(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
* the resources of the device will be released.
*
**/
-void udev_device_unref(struct udev_device *udev_device)
+UDEV_EXPORT void udev_device_unref(struct udev_device *udev_device)
{
if (udev_device == NULL)
return;
*
* Returns: the devpath of the udev device
**/
-const char *udev_device_get_devpath(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_devpath(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the sys path of the udev device
**/
-const char *udev_device_get_syspath(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_syspath(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the sys name of the device device
**/
-const char *udev_device_get_sysname(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_sysname(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the trailing number of of the device name
**/
-const char *udev_device_get_sysnum(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_sysnum(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the device node file name of the udev device, or #NULL if no device node exists
**/
-const char *udev_device_get_devnode(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_devnode(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the subsystem name of the udev device, or #NULL if it can not be determined
**/
-const char *udev_device_get_subsystem(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_subsystem(struct udev_device *udev_device)
{
char subsystem[UTIL_NAME_SIZE];
*
* Returns: the devtype name of the udev device, or #NULL if it can not be determined
**/
-const char *udev_device_get_devtype(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_devtype(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the first entry of the device node link list
**/
-struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device)
+UDEV_EXPORT struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the first entry of the property list
**/
-struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device)
+UDEV_EXPORT struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the driver string, or #NULL if there is no driver attached.
**/
-const char *udev_device_get_driver(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_driver(struct udev_device *udev_device)
{
char driver[UTIL_NAME_SIZE];
*
* Returns: the device major/minor number.
**/
-dev_t udev_device_get_devnum(struct udev_device *udev_device)
+UDEV_EXPORT dev_t udev_device_get_devnum(struct udev_device *udev_device)
{
if (udev_device == NULL)
return makedev(0, 0);
*
* Returns: the kernel action value, or #NULL if there is no action value available.
**/
-const char *udev_device_get_action(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_action(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the kernel event sequence number, or 0 if there is no sequence number available.
**/
-unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device)
+UDEV_EXPORT unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device)
{
if (udev_device == NULL)
return 0;
*
* Returns: the number of microseconds since the device was first seen.
**/
-unsigned long long int udev_device_get_usec_since_initialized(struct udev_device *udev_device)
+UDEV_EXPORT unsigned long long int udev_device_get_usec_since_initialized(struct udev_device *udev_device)
{
unsigned long long now;
*
* Returns: the content of a sys attribute file, or #NULL if there is no sys attribute value.
**/
-const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr)
+UDEV_EXPORT const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr)
{
struct udev_list_entry *list_entry;
char path[UTIL_PATH_SIZE];
*
* Returns: the first entry of the property list
**/
-struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device *udev_device)
+UDEV_EXPORT struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device *udev_device)
{
if (!udev_device->sysattr_list_read) {
int ret;
*
* Returns: 1 if the device is set up. 0 otherwise.
**/
-int udev_device_get_is_initialized(struct udev_device *udev_device)
+UDEV_EXPORT int udev_device_get_is_initialized(struct udev_device *udev_device)
{
if (!udev_device->info_loaded)
udev_device_read_db(udev_device, NULL);
*
* Returns: the first entry of the tag list
**/
-struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device)
+UDEV_EXPORT struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: an enumeration context
**/
-struct udev_enumerate *udev_enumerate_new(struct udev *udev)
+UDEV_EXPORT struct udev_enumerate *udev_enumerate_new(struct udev *udev)
{
struct udev_enumerate *udev_enumerate;
*
* Returns: the passed enumeration context
**/
-struct udev_enumerate *udev_enumerate_ref(struct udev_enumerate *udev_enumerate)
+UDEV_EXPORT struct udev_enumerate *udev_enumerate_ref(struct udev_enumerate *udev_enumerate)
{
if (udev_enumerate == NULL)
return NULL;
* Drop a reference of an enumeration context. If the refcount reaches zero,
* all resources of the enumeration context will be released.
**/
-void udev_enumerate_unref(struct udev_enumerate *udev_enumerate)
+UDEV_EXPORT void udev_enumerate_unref(struct udev_enumerate *udev_enumerate)
{
unsigned int i;
*
* Returns: the udev library context.
*/
-struct udev *udev_enumerate_get_udev(struct udev_enumerate *udev_enumerate)
+UDEV_EXPORT struct udev *udev_enumerate_get_udev(struct udev_enumerate *udev_enumerate)
{
if (udev_enumerate == NULL)
return NULL;
*
* Returns: the first entry of the sorted list of device paths.
*/
-struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *udev_enumerate)
+UDEV_EXPORT struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *udev_enumerate)
{
if (udev_enumerate == NULL)
return NULL;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_match_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem)
+UDEV_EXPORT int udev_enumerate_add_match_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem)
{
if (udev_enumerate == NULL)
return -EINVAL;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_nomatch_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem)
+UDEV_EXPORT int udev_enumerate_add_nomatch_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem)
{
if (udev_enumerate == NULL)
return -EINVAL;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_match_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value)
+UDEV_EXPORT int udev_enumerate_add_match_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value)
{
if (udev_enumerate == NULL)
return -EINVAL;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value)
+UDEV_EXPORT int udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value)
{
if (udev_enumerate == NULL)
return -EINVAL;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, const char *property, const char *value)
+UDEV_EXPORT int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, const char *property, const char *value)
{
if (udev_enumerate == NULL)
return -EINVAL;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_match_tag(struct udev_enumerate *udev_enumerate, const char *tag)
+UDEV_EXPORT int udev_enumerate_add_match_tag(struct udev_enumerate *udev_enumerate, const char *tag)
{
if (udev_enumerate == NULL)
return -EINVAL;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_match_is_initialized(struct udev_enumerate *udev_enumerate)
+UDEV_EXPORT int udev_enumerate_add_match_is_initialized(struct udev_enumerate *udev_enumerate)
{
if (udev_enumerate == NULL)
return -EINVAL;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname)
+UDEV_EXPORT int udev_enumerate_add_match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname)
{
if (udev_enumerate == NULL)
return -EINVAL;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_syspath(struct udev_enumerate *udev_enumerate, const char *syspath)
+UDEV_EXPORT int udev_enumerate_add_syspath(struct udev_enumerate *udev_enumerate, const char *syspath)
{
struct udev_device *udev_device;
*
* Returns: 0 on success, otherwise a negative error value.
**/
-int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate)
+UDEV_EXPORT int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate)
{
struct udev *udev = udev_enumerate_get_udev(udev_enumerate);
char base[UTIL_PATH_SIZE];
*
* Returns: 0 on success, otherwise a negative error value.
**/
-int udev_enumerate_scan_subsystems(struct udev_enumerate *udev_enumerate)
+UDEV_EXPORT int udev_enumerate_scan_subsystems(struct udev_enumerate *udev_enumerate)
{
struct udev *udev = udev_enumerate_get_udev(udev_enumerate);
char base[UTIL_PATH_SIZE];
*
* Returns: the next entry from the list, #NULL is no more entries are found.
*/
-struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *list_entry)
+UDEV_EXPORT struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *list_entry)
{
struct udev_list_node *next;
*
* Returns: the entry where @name matched, #NULL if no matching entry is found.
*/
-struct udev_list_entry *udev_list_entry_get_by_name(struct udev_list_entry *list_entry, const char *name)
+UDEV_EXPORT struct udev_list_entry *udev_list_entry_get_by_name(struct udev_list_entry *list_entry, const char *name)
{
struct udev_list_entry *entry;
*
* Returns: the name string of this entry.
*/
-const char *udev_list_entry_get_name(struct udev_list_entry *list_entry)
+UDEV_EXPORT const char *udev_list_entry_get_name(struct udev_list_entry *list_entry)
{
if (list_entry == NULL)
return NULL;
*
* Returns: the value string of this entry.
*/
-const char *udev_list_entry_get_value(struct udev_list_entry *list_entry)
+UDEV_EXPORT const char *udev_list_entry_get_value(struct udev_list_entry *list_entry)
{
if (list_entry == NULL)
return NULL;
*
* Returns: a new udev monitor, or #NULL, in case of an error
**/
-struct udev_monitor *udev_monitor_new_from_socket(struct udev *udev, const char *socket_path)
+UDEV_EXPORT struct udev_monitor *udev_monitor_new_from_socket(struct udev *udev, const char *socket_path)
{
struct udev_monitor *udev_monitor;
struct stat statbuf;
*
* Returns: a new udev monitor, or #NULL, in case of an error
**/
-struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, const char *name)
+UDEV_EXPORT struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, const char *name)
{
return udev_monitor_new_from_netlink_fd(udev, name, -1);
}
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_monitor_filter_update(struct udev_monitor *udev_monitor)
+UDEV_EXPORT int udev_monitor_filter_update(struct udev_monitor *udev_monitor)
{
struct sock_filter ins[512];
struct sock_fprog filter;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor)
+UDEV_EXPORT int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor)
{
int err = 0;
const int on = 1;
*
* Returns: 0 on success, otherwise -1 on error.
*/
-int udev_monitor_set_receive_buffer_size(struct udev_monitor *udev_monitor, int size)
+UDEV_EXPORT int udev_monitor_set_receive_buffer_size(struct udev_monitor *udev_monitor, int size)
{
if (udev_monitor == NULL)
return -1;
*
* Returns: the passed udev monitor
**/
-struct udev_monitor *udev_monitor_ref(struct udev_monitor *udev_monitor)
+UDEV_EXPORT struct udev_monitor *udev_monitor_ref(struct udev_monitor *udev_monitor)
{
if (udev_monitor == NULL)
return NULL;
* will be released.
*
**/
-void udev_monitor_unref(struct udev_monitor *udev_monitor)
+UDEV_EXPORT void udev_monitor_unref(struct udev_monitor *udev_monitor)
{
if (udev_monitor == NULL)
return;
*
* Returns: the udev library context
**/
-struct udev *udev_monitor_get_udev(struct udev_monitor *udev_monitor)
+UDEV_EXPORT struct udev *udev_monitor_get_udev(struct udev_monitor *udev_monitor)
{
if (udev_monitor == NULL)
return NULL;
*
* Returns: the socket file descriptor
**/
-int udev_monitor_get_fd(struct udev_monitor *udev_monitor)
+UDEV_EXPORT int udev_monitor_get_fd(struct udev_monitor *udev_monitor)
{
if (udev_monitor == NULL)
return -1;
*
* Returns: a new udev device, or #NULL, in case of an error
**/
-struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monitor)
+UDEV_EXPORT struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monitor)
{
struct udev_device *udev_device;
struct msghdr smsg;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor, const char *subsystem, const char *devtype)
+UDEV_EXPORT int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor, const char *subsystem, const char *devtype)
{
if (udev_monitor == NULL)
return -EINVAL;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_monitor_filter_add_match_tag(struct udev_monitor *udev_monitor, const char *tag)
+UDEV_EXPORT int udev_monitor_filter_add_match_tag(struct udev_monitor *udev_monitor, const char *tag)
{
if (udev_monitor == NULL)
return -EINVAL;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_monitor_filter_remove(struct udev_monitor *udev_monitor)
+UDEV_EXPORT int udev_monitor_filter_remove(struct udev_monitor *udev_monitor)
{
static struct sock_fprog filter = { 0, NULL };
# define err(udev, arg...) udev_log_null(udev, ## arg)
#endif
+#define UDEV_EXPORT __attribute__ ((visibility("default")))
+
static inline void udev_log_init(const char *program_name)
{
openlog(program_name, LOG_PID | LOG_CONS, LOG_DAEMON);
*
* Returns: the udev queue context, or #NULL on error.
**/
-struct udev_queue *udev_queue_new(struct udev *udev)
+UDEV_EXPORT struct udev_queue *udev_queue_new(struct udev *udev)
{
struct udev_queue *udev_queue;
*
* Returns: the same udev queue context.
**/
-struct udev_queue *udev_queue_ref(struct udev_queue *udev_queue)
+UDEV_EXPORT struct udev_queue *udev_queue_ref(struct udev_queue *udev_queue)
{
if (udev_queue == NULL)
return NULL;
* Drop a reference of a udev queue context. If the refcount reaches zero,
* the resources of the queue context will be released.
**/
-void udev_queue_unref(struct udev_queue *udev_queue)
+UDEV_EXPORT void udev_queue_unref(struct udev_queue *udev_queue)
{
if (udev_queue == NULL)
return;
*
* Returns: the udev library context.
**/
-struct udev *udev_queue_get_udev(struct udev_queue *udev_queue)
+UDEV_EXPORT struct udev *udev_queue_get_udev(struct udev_queue *udev_queue)
{
if (udev_queue == NULL)
return NULL;
*
* Returns: the current kernel event sequence number.
**/
-unsigned long long int udev_queue_get_kernel_seqnum(struct udev_queue *udev_queue)
+UDEV_EXPORT unsigned long long int udev_queue_get_kernel_seqnum(struct udev_queue *udev_queue)
{
unsigned long long int seqnum;
*
* Returns: the last known udev event sequence number.
**/
-unsigned long long int udev_queue_get_udev_seqnum(struct udev_queue *udev_queue)
+UDEV_EXPORT unsigned long long int udev_queue_get_udev_seqnum(struct udev_queue *udev_queue)
{
unsigned long long int seqnum_udev;
FILE *queue_file;
*
* Returns: a flag indicating if udev is active.
**/
-int udev_queue_get_udev_is_active(struct udev_queue *udev_queue)
+UDEV_EXPORT int udev_queue_get_udev_is_active(struct udev_queue *udev_queue)
{
unsigned long long int seqnum_start;
FILE *queue_file;
*
* Returns: a flag indicating if udev is currently handling events.
**/
-int udev_queue_get_queue_is_empty(struct udev_queue *udev_queue)
+UDEV_EXPORT int udev_queue_get_queue_is_empty(struct udev_queue *udev_queue)
{
unsigned long long int seqnum_kernel;
unsigned long long int seqnum_udev = 0;
*
* Returns: a flag indicating if any of the sequence numbers in the given range is currently active.
**/
-int udev_queue_get_seqnum_sequence_is_finished(struct udev_queue *udev_queue,
+UDEV_EXPORT int udev_queue_get_seqnum_sequence_is_finished(struct udev_queue *udev_queue,
unsigned long long int start, unsigned long long int end)
{
unsigned long long int seqnum;
*
* Returns: a flag indicating if the given sequence number is currently active.
**/
-int udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue, unsigned long long int seqnum)
+UDEV_EXPORT int udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue, unsigned long long int seqnum)
{
if (!udev_queue_get_seqnum_sequence_is_finished(udev_queue, seqnum, seqnum))
return 0;
*
* Returns: the first entry of the list of queued events.
**/
-struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev_queue)
+UDEV_EXPORT struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev_queue)
{
unsigned long long int seqnum;
FILE *queue_file;
*
* Returns: the first entry of the list of recorded failed events.
**/
-struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev_queue)
+UDEV_EXPORT struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev_queue)
{
char path[UTIL_PATH_SIZE];
DIR *dir;
*
* Returns: stored userdata
**/
-void *udev_get_userdata(struct udev *udev)
+UDEV_EXPORT void *udev_get_userdata(struct udev *udev)
{
if (udev == NULL)
return NULL;
*
* Store custom @userdata in the library context.
**/
-void udev_set_userdata(struct udev *udev, void *userdata)
+UDEV_EXPORT void udev_set_userdata(struct udev *udev, void *userdata)
{
if (udev == NULL)
return;
*
* Returns: a new udev library context
**/
-struct udev *udev_new(void)
+UDEV_EXPORT struct udev *udev_new(void)
{
struct udev *udev;
const char *env;
*
* Returns: the passed udev library context
**/
-struct udev *udev_ref(struct udev *udev)
+UDEV_EXPORT struct udev *udev_ref(struct udev *udev)
{
if (udev == NULL)
return NULL;
* reaches zero, the resources of the context will be released.
*
**/
-void udev_unref(struct udev *udev)
+UDEV_EXPORT void udev_unref(struct udev *udev)
{
if (udev == NULL)
return;
* into the users' logging functionality.
*
**/
-void udev_set_log_fn(struct udev *udev,
+UDEV_EXPORT void udev_set_log_fn(struct udev *udev,
void (*log_fn)(struct udev *udev,
int priority, const char *file, int line, const char *fn,
const char *format, va_list args))
*
* Returns: the current logging priority
**/
-int udev_get_log_priority(struct udev *udev)
+UDEV_EXPORT int udev_get_log_priority(struct udev *udev)
{
return udev->log_priority;
}
* Set the current logging priority. The value controls which messages
* are logged.
**/
-void udev_set_log_priority(struct udev *udev, int priority)
+UDEV_EXPORT void udev_set_log_priority(struct udev *udev, int priority)
{
char num[32];
*
* Returns: the sys mount point
**/
-const char *udev_get_sys_path(struct udev *udev)
+UDEV_EXPORT const char *udev_get_sys_path(struct udev *udev)
{
if (udev == NULL)
return NULL;
*
* Returns: the device directory path
**/
-const char *udev_get_dev_path(struct udev *udev)
+UDEV_EXPORT const char *udev_get_dev_path(struct udev *udev)
{
if (udev == NULL)
return NULL;
*
* Returns: the runtime directory path
**/
-const char *udev_get_run_path(struct udev *udev)
+UDEV_EXPORT const char *udev_get_run_path(struct udev *udev)
{
if (udev->run_path != NULL)
return udev->run_path;