1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "device/udev_linux/udev.h"
7 #include "device/udev_linux/udev_loader.h"
11 const char* udev_device_get_action(udev_device
* udev_device
) {
12 return UdevLoader::Get()->udev_device_get_action(udev_device
);
15 const char* udev_device_get_devnode(udev_device
* udev_device
) {
16 return UdevLoader::Get()->udev_device_get_devnode(udev_device
);
19 udev_device
* udev_device_get_parent(udev_device
* udev_device
) {
20 return UdevLoader::Get()->udev_device_get_parent(udev_device
);
23 udev_device
* udev_device_get_parent_with_subsystem_devtype(
24 udev_device
* udev_device
,
25 const char* subsystem
,
26 const char* devtype
) {
27 return UdevLoader::Get()->udev_device_get_parent_with_subsystem_devtype(
28 udev_device
, subsystem
, devtype
);
31 const char* udev_device_get_property_value(udev_device
* udev_device
,
33 return UdevLoader::Get()->udev_device_get_property_value(udev_device
, key
);
36 const char* udev_device_get_subsystem(udev_device
* udev_device
) {
37 return UdevLoader::Get()->udev_device_get_subsystem(udev_device
);
40 const char* udev_device_get_sysattr_value(udev_device
* udev_device
,
41 const char* sysattr
) {
42 return UdevLoader::Get()->udev_device_get_sysattr_value(udev_device
, sysattr
);
45 const char* udev_device_get_sysname(udev_device
* udev_device
) {
46 return UdevLoader::Get()->udev_device_get_sysname(udev_device
);
49 const char* udev_device_get_syspath(udev_device
* udev_device
) {
50 return UdevLoader::Get()->udev_device_get_syspath(udev_device
);
53 udev_device
* udev_device_new_from_devnum(udev
* udev
, char type
, dev_t devnum
) {
54 return UdevLoader::Get()->udev_device_new_from_devnum(udev
, type
, devnum
);
57 udev_device
* udev_device_new_from_syspath(udev
* udev
, const char* syspath
) {
58 return UdevLoader::Get()->udev_device_new_from_syspath(udev
, syspath
);
61 void udev_device_unref(udev_device
* udev_device
) {
62 UdevLoader::Get()->udev_device_unref(udev_device
);
65 int udev_enumerate_add_match_subsystem(udev_enumerate
* udev_enumerate
,
66 const char* subsystem
) {
67 return UdevLoader::Get()->udev_enumerate_add_match_subsystem(udev_enumerate
,
71 udev_list_entry
* udev_enumerate_get_list_entry(udev_enumerate
* udev_enumerate
) {
72 return UdevLoader::Get()->udev_enumerate_get_list_entry(udev_enumerate
);
75 udev_enumerate
* udev_enumerate_new(udev
* udev
) {
76 return UdevLoader::Get()->udev_enumerate_new(udev
);
79 int udev_enumerate_scan_devices(udev_enumerate
* udev_enumerate
) {
80 return UdevLoader::Get()->udev_enumerate_scan_devices(udev_enumerate
);
83 void udev_enumerate_unref(udev_enumerate
* udev_enumerate
) {
84 UdevLoader::Get()->udev_enumerate_unref(udev_enumerate
);
87 udev_list_entry
* udev_list_entry_get_next(udev_list_entry
* list_entry
) {
88 return UdevLoader::Get()->udev_list_entry_get_next(list_entry
);
91 const char* udev_list_entry_get_name(udev_list_entry
* list_entry
) {
92 return UdevLoader::Get()->udev_list_entry_get_name(list_entry
);
95 int udev_monitor_enable_receiving(udev_monitor
* udev_monitor
) {
96 return UdevLoader::Get()->udev_monitor_enable_receiving(udev_monitor
);
99 int udev_monitor_filter_add_match_subsystem_devtype(udev_monitor
* udev_monitor
,
100 const char* subsystem
,
101 const char* devtype
) {
102 return UdevLoader::Get()->udev_monitor_filter_add_match_subsystem_devtype(
103 udev_monitor
, subsystem
, devtype
);
106 int udev_monitor_get_fd(udev_monitor
* udev_monitor
) {
107 return UdevLoader::Get()->udev_monitor_get_fd(udev_monitor
);
110 udev_monitor
* udev_monitor_new_from_netlink(udev
* udev
, const char* name
) {
111 return UdevLoader::Get()->udev_monitor_new_from_netlink(udev
, name
);
114 udev_device
* udev_monitor_receive_device(udev_monitor
* udev_monitor
) {
115 return UdevLoader::Get()->udev_monitor_receive_device(udev_monitor
);
118 void udev_monitor_unref(udev_monitor
* udev_monitor
) {
119 UdevLoader::Get()->udev_monitor_unref(udev_monitor
);
123 return UdevLoader::Get()->udev_new();
126 void udev_set_log_fn(
128 void (*log_fn
)(struct udev
* udev
, int priority
, const char* file
, int line
,
129 const char* fn
, const char* format
, va_list args
)) {
130 return UdevLoader::Get()->udev_set_log_fn(udev
, log_fn
);
133 void udev_set_log_priority(struct udev
* udev
, int priority
) {
134 return UdevLoader::Get()->udev_set_log_priority(udev
, priority
);
137 void udev_unref(udev
* udev
) {
138 UdevLoader::Get()->udev_unref(udev
);
141 } // namespace device