]> git.ipfire.org Git - thirdparty/systemd.git/blame - udev/lib/libudev.h
update INSTALL
[thirdparty/systemd.git] / udev / lib / libudev.h
CommitLineData
33a5cc29
KS
1/*
2 * libudev - interface to udev device information
3 *
4 * Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef _LIBUDEV_H_
21#define _LIBUDEV_H_
22
23struct udev;
24struct udev_device;
25
26extern struct udev *udev_new(void);
27extern struct udev *udev_ref(struct udev *udev);
28extern void udev_unref(struct udev *udev);
29extern void udev_set_log_fn(struct udev *udev,
30 void (*log_fn)(struct udev *udev,
31 int priority, const char *file, int line, const char *fn,
32 const char *format, va_list args));
33extern const char *udev_get_sys_path(struct udev *udev);
34extern const char *udev_get_dev_path(struct udev *udev);
35
36extern struct udev_device *udev_device_new_from_devpath(struct udev *udev, const char *devpath);
37extern struct udev_device *udev_device_ref(struct udev_device *udev_device);
38extern void udev_device_unref(struct udev_device *udev_device);
39extern struct udev *udev_device_get_udev(struct udev_device *udev_device);
40extern const char *udev_device_get_devpath(struct udev_device *udev_device);
41extern const char *udev_device_get_devname(struct udev_device *udev_device);
42extern const char *udev_device_get_subsystem(struct udev_device *udev_device);
43extern int udev_device_get_devlinks(struct udev_device *udev_device,
44 int (*cb)(struct udev_device *udev_device,
45 const char *value, void *data),
46 void *data);
47extern int udev_device_get_properties(struct udev_device *udev_device,
48 int (*cb)(struct udev_device *udev_device,
49 const char *key, const char *value, void *data),
50 void *data);
51
52extern int udev_devices_enumerate(struct udev *udev, const char *subsystem,
53 int (*cb)(struct udev *udev,
54 const char *devpath, const char *subsystem, const char *name, void *data),
55 void *data);
56
57#endif