OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "device/udev_linux/udev1_loader.h" |
| 6 |
| 7 #include "library_loaders/libudev1.h" |
| 8 |
| 9 namespace device { |
| 10 |
| 11 Udev1Loader::Udev1Loader() { |
| 12 } |
| 13 |
| 14 Udev1Loader::~Udev1Loader() { |
| 15 } |
| 16 |
| 17 bool Udev1Loader::Init() { |
| 18 if (lib_loader_) |
| 19 return lib_loader_->loaded(); |
| 20 lib_loader_.reset(new LibUdev1Loader); |
| 21 return lib_loader_->Load("libudev.so.1"); |
| 22 } |
| 23 |
| 24 const char* Udev1Loader::udev_device_get_action(udev_device* udev_device) { |
| 25 return lib_loader_->udev_device_get_action(udev_device); |
| 26 } |
| 27 |
| 28 const char* Udev1Loader::udev_device_get_devnode(udev_device* udev_device) { |
| 29 return lib_loader_->udev_device_get_devnode(udev_device); |
| 30 } |
| 31 |
| 32 udev_device* Udev1Loader::udev_device_get_parent(udev_device* udev_device) { |
| 33 return lib_loader_->udev_device_get_parent(udev_device); |
| 34 } |
| 35 |
| 36 udev_device* Udev1Loader::udev_device_get_parent_with_subsystem_devtype( |
| 37 udev_device* udev_device, |
| 38 const char* subsystem, |
| 39 const char* devtype) { |
| 40 return lib_loader_->udev_device_get_parent_with_subsystem_devtype( |
| 41 udev_device, subsystem, devtype); |
| 42 } |
| 43 |
| 44 const char* Udev1Loader::udev_device_get_property_value( |
| 45 udev_device* udev_device, |
| 46 const char* key) { |
| 47 return lib_loader_->udev_device_get_property_value(udev_device, key); |
| 48 } |
| 49 |
| 50 const char* Udev1Loader::udev_device_get_subsystem(udev_device* udev_device) { |
| 51 return lib_loader_->udev_device_get_subsystem(udev_device); |
| 52 } |
| 53 |
| 54 const char* Udev1Loader::udev_device_get_sysattr_value(udev_device* udev_device, |
| 55 const char* sysattr) { |
| 56 return lib_loader_->udev_device_get_sysattr_value(udev_device, sysattr); |
| 57 } |
| 58 |
| 59 const char* Udev1Loader::udev_device_get_sysname(udev_device* udev_device) { |
| 60 return lib_loader_->udev_device_get_sysname(udev_device); |
| 61 } |
| 62 |
| 63 const char* Udev1Loader::udev_device_get_syspath(udev_device* udev_device) { |
| 64 return lib_loader_->udev_device_get_syspath(udev_device); |
| 65 } |
| 66 |
| 67 udev_device* Udev1Loader::udev_device_new_from_devnum(udev* udev, |
| 68 char type, |
| 69 dev_t devnum) { |
| 70 return lib_loader_->udev_device_new_from_devnum(udev, type, devnum); |
| 71 } |
| 72 |
| 73 udev_device* Udev1Loader::udev_device_new_from_syspath(udev* udev, |
| 74 const char* syspath) { |
| 75 return lib_loader_->udev_device_new_from_syspath(udev, syspath); |
| 76 } |
| 77 |
| 78 void Udev1Loader::udev_device_unref(udev_device* udev_device) { |
| 79 lib_loader_->udev_device_unref(udev_device); |
| 80 } |
| 81 |
| 82 int Udev1Loader::udev_enumerate_add_match_subsystem( |
| 83 udev_enumerate* udev_enumerate, |
| 84 const char* subsystem) { |
| 85 return lib_loader_->udev_enumerate_add_match_subsystem(udev_enumerate, |
| 86 subsystem); |
| 87 } |
| 88 |
| 89 udev_list_entry* Udev1Loader::udev_enumerate_get_list_entry( |
| 90 udev_enumerate* udev_enumerate) { |
| 91 return lib_loader_->udev_enumerate_get_list_entry(udev_enumerate); |
| 92 } |
| 93 |
| 94 udev_enumerate* Udev1Loader::udev_enumerate_new(udev* udev) { |
| 95 return lib_loader_->udev_enumerate_new(udev); |
| 96 } |
| 97 |
| 98 int Udev1Loader::udev_enumerate_scan_devices(udev_enumerate* udev_enumerate) { |
| 99 return lib_loader_->udev_enumerate_scan_devices(udev_enumerate); |
| 100 } |
| 101 |
| 102 void Udev1Loader::udev_enumerate_unref(udev_enumerate* udev_enumerate) { |
| 103 lib_loader_->udev_enumerate_unref(udev_enumerate); |
| 104 } |
| 105 |
| 106 udev_list_entry* Udev1Loader::udev_list_entry_get_next( |
| 107 udev_list_entry* list_entry) { |
| 108 return lib_loader_->udev_list_entry_get_next(list_entry); |
| 109 } |
| 110 |
| 111 const char* Udev1Loader::udev_list_entry_get_name(udev_list_entry* list_entry) { |
| 112 return lib_loader_->udev_list_entry_get_name(list_entry); |
| 113 } |
| 114 |
| 115 int Udev1Loader::udev_monitor_enable_receiving(udev_monitor* udev_monitor) { |
| 116 return lib_loader_->udev_monitor_enable_receiving(udev_monitor); |
| 117 } |
| 118 |
| 119 int Udev1Loader::udev_monitor_filter_add_match_subsystem_devtype( |
| 120 udev_monitor* udev_monitor, |
| 121 const char* subsystem, |
| 122 const char* devtype) { |
| 123 return lib_loader_->udev_monitor_filter_add_match_subsystem_devtype( |
| 124 udev_monitor, subsystem, devtype); |
| 125 } |
| 126 |
| 127 int Udev1Loader::udev_monitor_get_fd(udev_monitor* udev_monitor) { |
| 128 return lib_loader_->udev_monitor_get_fd(udev_monitor); |
| 129 } |
| 130 |
| 131 udev_monitor* Udev1Loader::udev_monitor_new_from_netlink(udev* udev, |
| 132 const char* name) { |
| 133 return lib_loader_->udev_monitor_new_from_netlink(udev, name); |
| 134 } |
| 135 |
| 136 udev_device* Udev1Loader::udev_monitor_receive_device( |
| 137 udev_monitor* udev_monitor) { |
| 138 return lib_loader_->udev_monitor_receive_device(udev_monitor); |
| 139 } |
| 140 |
| 141 void Udev1Loader::udev_monitor_unref(udev_monitor* udev_monitor) { |
| 142 lib_loader_->udev_monitor_unref(udev_monitor); |
| 143 } |
| 144 |
| 145 udev* Udev1Loader::udev_new() { |
| 146 return lib_loader_->udev_new(); |
| 147 } |
| 148 |
| 149 void Udev1Loader::udev_set_log_fn( |
| 150 struct udev* udev, |
| 151 void (*log_fn)(struct udev* udev, int priority, |
| 152 const char* file, int line, |
| 153 const char* fn, const char* format, va_list args)) { |
| 154 return lib_loader_->udev_set_log_fn(udev, log_fn); |
| 155 } |
| 156 |
| 157 void Udev1Loader::udev_set_log_priority(struct udev* udev, int priority) { |
| 158 return lib_loader_->udev_set_log_priority(udev, priority); |
| 159 } |
| 160 |
| 161 void Udev1Loader::udev_unref(udev* udev) { |
| 162 lib_loader_->udev_unref(udev); |
| 163 } |
| 164 |
| 165 } // namespace device |
OLD | NEW |