Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: device/udev_linux/udev.h

Issue 674703002: Linux: Dynamically load libudev. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scoped_udev
Patch Set: rebase to head, which includes third_party/libudev already Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/udev_linux/scoped_udev.h ('k') | device/udev_linux/udev.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #ifndef DEVICE_UDEV_LINUX_UDEV_H_
6 #define DEVICE_UDEV_LINUX_UDEV_H_
7
8 #include <stdarg.h>
9 #include <sys/types.h>
10 #include <sys/stat.h>
11
12 #if !defined(USE_UDEV)
13 #error "USE_UDEV not defined"
14 #endif
15
16 // Adapted from libudev.h.
17 #define udev_list_entry_foreach(list_entry, first_entry) \
18 for (list_entry = first_entry; list_entry != NULL; \
19 list_entry = ::device::udev_list_entry_get_next(list_entry))
20
21 // Forward declarations of opaque structs.
22 struct udev;
23 struct udev_device;
24 struct udev_enumerate;
25 struct udev_list_entry;
26 struct udev_monitor;
27
28 namespace device {
29
30 const char* udev_device_get_action(udev_device* udev_device);
31 const char* udev_device_get_devnode(udev_device* udev_device);
32 udev_device* udev_device_get_parent(udev_device* udev_device);
33 udev_device* udev_device_get_parent_with_subsystem_devtype(
34 udev_device* udev_device,
35 const char* subsystem,
36 const char* devtype);
37 const char* udev_device_get_property_value(udev_device* udev_device,
38 const char* key);
39 const char* udev_device_get_subsystem(udev_device* udev_device);
40 const char* udev_device_get_sysattr_value(udev_device* udev_device,
41 const char* sysattr);
42 const char* udev_device_get_sysname(udev_device* udev_device);
43 const char* udev_device_get_syspath(udev_device* udev_device);
44 udev_device* udev_device_new_from_devnum(udev* udev, char type, dev_t devnum);
45 udev_device* udev_device_new_from_syspath(udev* udev, const char* syspath);
46 void udev_device_unref(udev_device* udev_device);
47 int udev_enumerate_add_match_subsystem(udev_enumerate* udev_enumerate,
48 const char* subsystem);
49 udev_list_entry* udev_enumerate_get_list_entry(udev_enumerate* udev_enumerate);
50 udev_enumerate* udev_enumerate_new(udev* udev);
51 int udev_enumerate_scan_devices(udev_enumerate* udev_enumerate);
52 void udev_enumerate_unref(udev_enumerate* udev_enumerate);
53 udev_list_entry* udev_list_entry_get_next(udev_list_entry* list_entry);
54 const char* udev_list_entry_get_name(udev_list_entry* list_entry);
55 int udev_monitor_enable_receiving(udev_monitor* udev_monitor);
56 int udev_monitor_filter_add_match_subsystem_devtype(udev_monitor* udev_monitor,
57 const char* subsystem,
58 const char* devtype);
59 int udev_monitor_get_fd(udev_monitor* udev_monitor);
60 udev_monitor* udev_monitor_new_from_netlink(udev* udev, const char* name);
61 udev_device* udev_monitor_receive_device(udev_monitor* udev_monitor);
62 void udev_monitor_unref(udev_monitor* udev_monitor);
63 udev* udev_new();
64 void udev_set_log_fn(
65 struct udev* udev,
66 void (*log_fn)(struct udev* udev, int priority, const char* file, int line,
67 const char* fn, const char* format, va_list args));
68 void udev_set_log_priority(struct udev* udev, int priority);
69 void udev_unref(udev* udev);
70
71 } // namespace device
72
73 #endif // DEVICE_UDEV_LINUX_UDEV_H_
OLDNEW
« no previous file with comments | « device/udev_linux/scoped_udev.h ('k') | device/udev_linux/udev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698