libudev.h revision 912541b0246ef315d4d851237483b98c9dd3f992
/*
* libudev - interface to udev device information
*
* Copyright (C) 2008-2011 Kay Sievers <kay.sievers@vrfy.org>
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*/
#ifndef _LIBUDEV_H_
#define _LIBUDEV_H_
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* udev - library context
*
* reads the udev config and system environment
* allows custom logging
*/
struct udev;
/*
* udev_list
*
* access to libudev generated lists
*/
struct udev_list_entry;
struct udev_list_entry *udev_list_entry_get_by_name(struct udev_list_entry *list_entry, const char *name);
/**
* udev_list_entry_foreach:
* @list_entry: entry to store the current position
* @first_entry: first entry to start with
*
* Helper to iterate over all entries of a list.
*/
for (list_entry = first_entry; \
list_entry != NULL; \
/*
* udev_device
*
*/
struct udev_device;
struct udev_device *udev_device_new_from_subsystem_sysname(struct udev *udev, const char *subsystem, const char *sysname);
/* udev_device_get_parent_*() does not take a reference on the returned device, it is automatically unref'd with the parent */
/* retrieve device properties */
/*
* udev_monitor
*
* access to kernel uevents and udev events
*/
struct udev_monitor;
/* kernel and udev generated events over netlink */
/* custom socket (use netlink and filters instead) */
/* bind socket */
/* in-kernel socket filters to select messages that get delivered to a listener */
/*
* udev_enumerate
*
* search sysfs for specific devices and provide a sorted list
*/
struct udev_enumerate;
/* device properties filter */
int udev_enumerate_add_match_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem);
int udev_enumerate_add_nomatch_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem);
int udev_enumerate_add_match_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value);
int udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value);
int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, const char *property, const char *value);
int udev_enumerate_add_match_parent(struct udev_enumerate *udev_enumerate, struct udev_device *parent);
/* run enumeration with active filters */
/* return device list */
/*
* udev_queue
*
* access to the currently running udev events
*/
struct udev_queue;
int udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue, unsigned long long int seqnum);
/*
* udev_util
*
* udev specific utilities
*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif