libudev.h revision 67410e9f73a6cdd8453c78b966451b5151def14a
/***
This file is part of systemd.
Copyright 2008-2012 Kay Sievers <kay@vrfy.org>
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.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#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 */
int udev_device_set_sysattr_value(struct udev_device *udev_device, const char *sysattr, char *value);
/*
* udev_monitor
*
* access to kernel uevents and udev events
*/
struct udev_monitor;
/* kernel and udev generated events over netlink */
/* 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_hwdb
*
* access to the static hardware properties database
*/
struct udev_hwdb;
struct udev_list_entry *udev_hwdb_get_properties_list_entry(struct udev_hwdb *hwdb, const char *modalias, unsigned int flags);
/*
* udev_util
*
* udev specific utilities
*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif