]>
Commit | Line | Data |
---|---|---|
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 | ||
23 | struct udev; | |
24 | struct udev_device; | |
ba6929f6 | 25 | struct udev_monitor; |
33a5cc29 KS |
26 | |
27 | extern struct udev *udev_new(void); | |
28 | extern struct udev *udev_ref(struct udev *udev); | |
29 | extern void udev_unref(struct udev *udev); | |
30 | extern void udev_set_log_fn(struct udev *udev, | |
31 | void (*log_fn)(struct udev *udev, | |
32 | int priority, const char *file, int line, const char *fn, | |
33 | const char *format, va_list args)); | |
34 | extern const char *udev_get_sys_path(struct udev *udev); | |
35 | extern const char *udev_get_dev_path(struct udev *udev); | |
36 | ||
37 | extern struct udev_device *udev_device_new_from_devpath(struct udev *udev, const char *devpath); | |
38 | extern struct udev_device *udev_device_ref(struct udev_device *udev_device); | |
39 | extern void udev_device_unref(struct udev_device *udev_device); | |
40 | extern struct udev *udev_device_get_udev(struct udev_device *udev_device); | |
41 | extern const char *udev_device_get_devpath(struct udev_device *udev_device); | |
42 | extern const char *udev_device_get_devname(struct udev_device *udev_device); | |
43 | extern const char *udev_device_get_subsystem(struct udev_device *udev_device); | |
44 | extern int udev_device_get_devlinks(struct udev_device *udev_device, | |
45 | int (*cb)(struct udev_device *udev_device, | |
46 | const char *value, void *data), | |
47 | void *data); | |
48 | extern int udev_device_get_properties(struct udev_device *udev_device, | |
49 | int (*cb)(struct udev_device *udev_device, | |
50 | const char *key, const char *value, void *data), | |
51 | void *data); | |
52 | ||
53 | extern int udev_devices_enumerate(struct udev *udev, const char *subsystem, | |
54 | int (*cb)(struct udev *udev, | |
55 | const char *devpath, const char *subsystem, const char *name, void *data), | |
56 | void *data); | |
57 | ||
ba6929f6 KS |
58 | extern struct udev_monitor *udev_monitor_new_from_socket(struct udev *udev, const char *socket_path); |
59 | extern struct udev_monitor *udev_monitor_ref(struct udev_monitor *udev_monitor); | |
60 | extern void udev_monitor_unref(struct udev_monitor *udev_monitor); | |
61 | extern struct udev *udev_monitor_get_udev(struct udev_monitor *udev_monitor); | |
62 | extern int udev_monitor_get_fd(struct udev_monitor *udev_monitor); | |
63 | extern struct udev_device *udev_monitor_get_device(struct udev_monitor *udev_monitor); | |
64 | ||
33a5cc29 | 65 | #endif |