]>
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 | ||
7d563a17 KS |
23 | #include <stdarg.h> |
24 | ||
a689165b | 25 | /* this will stay as long as the DeviceKit integration of udev is work in progress */ |
e407720b | 26 | #if !defined _LIBUDEV_COMPILATION && !defined LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE |
a689165b KS |
27 | #error "#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE is needed to use this experimental library version" |
28 | #endif | |
29 | ||
33a5cc29 KS |
30 | struct udev; |
31 | struct udev_device; | |
ba6929f6 | 32 | struct udev_monitor; |
33a5cc29 KS |
33 | |
34 | extern struct udev *udev_new(void); | |
35 | extern struct udev *udev_ref(struct udev *udev); | |
36 | extern void udev_unref(struct udev *udev); | |
37 | extern void udev_set_log_fn(struct udev *udev, | |
38 | void (*log_fn)(struct udev *udev, | |
39 | int priority, const char *file, int line, const char *fn, | |
40 | const char *format, va_list args)); | |
7d563a17 KS |
41 | extern int udev_get_log_priority(struct udev *udev); |
42 | extern void udev_set_log_priority(struct udev *udev, int priority); | |
33a5cc29 KS |
43 | extern const char *udev_get_sys_path(struct udev *udev); |
44 | extern const char *udev_get_dev_path(struct udev *udev); | |
45 | ||
46 | extern struct udev_device *udev_device_new_from_devpath(struct udev *udev, const char *devpath); | |
47 | extern struct udev_device *udev_device_ref(struct udev_device *udev_device); | |
48 | extern void udev_device_unref(struct udev_device *udev_device); | |
49 | extern struct udev *udev_device_get_udev(struct udev_device *udev_device); | |
50 | extern const char *udev_device_get_devpath(struct udev_device *udev_device); | |
33a5cc29 | 51 | extern const char *udev_device_get_subsystem(struct udev_device *udev_device); |
11d543c1 KS |
52 | extern const char *udev_device_get_syspath(struct udev_device *udev_device); |
53 | extern const char *udev_device_get_devname(struct udev_device *udev_device); | |
33a5cc29 KS |
54 | extern int udev_device_get_devlinks(struct udev_device *udev_device, |
55 | int (*cb)(struct udev_device *udev_device, | |
56 | const char *value, void *data), | |
57 | void *data); | |
58 | extern int udev_device_get_properties(struct udev_device *udev_device, | |
59 | int (*cb)(struct udev_device *udev_device, | |
60 | const char *key, const char *value, void *data), | |
61 | void *data); | |
62 | ||
63 | extern int udev_devices_enumerate(struct udev *udev, const char *subsystem, | |
64 | int (*cb)(struct udev *udev, | |
65 | const char *devpath, const char *subsystem, const char *name, void *data), | |
66 | void *data); | |
67 | ||
ba6929f6 KS |
68 | extern struct udev_monitor *udev_monitor_new_from_socket(struct udev *udev, const char *socket_path); |
69 | extern struct udev_monitor *udev_monitor_ref(struct udev_monitor *udev_monitor); | |
70 | extern void udev_monitor_unref(struct udev_monitor *udev_monitor); | |
71 | extern struct udev *udev_monitor_get_udev(struct udev_monitor *udev_monitor); | |
72 | extern int udev_monitor_get_fd(struct udev_monitor *udev_monitor); | |
73 | extern struct udev_device *udev_monitor_get_device(struct udev_monitor *udev_monitor); | |
74 | ||
33a5cc29 | 75 | #endif |