line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Udev::FFI::FFIFunctions; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
47
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
221
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our (@ISA, @EXPORT); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
require Exporter; |
10
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
@EXPORT = qw( |
13
|
|
|
|
|
|
|
udev_new |
14
|
|
|
|
|
|
|
udev_ref |
15
|
|
|
|
|
|
|
udev_unref |
16
|
|
|
|
|
|
|
udev_list_entry_get_next |
17
|
|
|
|
|
|
|
udev_list_entry_get_by_name |
18
|
|
|
|
|
|
|
udev_list_entry_get_name |
19
|
|
|
|
|
|
|
udev_list_entry_get_value |
20
|
|
|
|
|
|
|
udev_device_ref |
21
|
|
|
|
|
|
|
udev_device_unref |
22
|
|
|
|
|
|
|
udev_device_get_udev |
23
|
|
|
|
|
|
|
udev_device_new_from_syspath |
24
|
|
|
|
|
|
|
udev_device_new_from_devnum |
25
|
|
|
|
|
|
|
udev_device_new_from_subsystem_sysname |
26
|
|
|
|
|
|
|
udev_device_new_from_device_id |
27
|
|
|
|
|
|
|
udev_device_new_from_environment |
28
|
|
|
|
|
|
|
udev_device_get_parent |
29
|
|
|
|
|
|
|
udev_device_get_parent_with_subsystem_devtype |
30
|
|
|
|
|
|
|
udev_device_get_devpath |
31
|
|
|
|
|
|
|
udev_device_get_subsystem |
32
|
|
|
|
|
|
|
udev_device_get_devtype |
33
|
|
|
|
|
|
|
udev_device_get_syspath |
34
|
|
|
|
|
|
|
udev_device_get_sysname |
35
|
|
|
|
|
|
|
udev_device_get_sysnum |
36
|
|
|
|
|
|
|
udev_device_get_devnode |
37
|
|
|
|
|
|
|
udev_device_get_is_initialized |
38
|
|
|
|
|
|
|
udev_device_get_devlinks_list_entry |
39
|
|
|
|
|
|
|
udev_device_get_properties_list_entry |
40
|
|
|
|
|
|
|
udev_device_get_tags_list_entry |
41
|
|
|
|
|
|
|
udev_device_get_sysattr_list_entry |
42
|
|
|
|
|
|
|
udev_device_get_property_value |
43
|
|
|
|
|
|
|
udev_device_get_driver |
44
|
|
|
|
|
|
|
udev_device_get_devnum |
45
|
|
|
|
|
|
|
udev_device_get_action |
46
|
|
|
|
|
|
|
udev_device_get_seqnum |
47
|
|
|
|
|
|
|
udev_device_get_usec_since_initialized |
48
|
|
|
|
|
|
|
udev_device_get_sysattr_value |
49
|
|
|
|
|
|
|
udev_device_set_sysattr_value |
50
|
|
|
|
|
|
|
udev_device_has_tag |
51
|
|
|
|
|
|
|
udev_monitor_ref |
52
|
|
|
|
|
|
|
udev_monitor_unref |
53
|
|
|
|
|
|
|
udev_monitor_get_udev |
54
|
|
|
|
|
|
|
udev_monitor_new_from_netlink |
55
|
|
|
|
|
|
|
udev_monitor_enable_receiving |
56
|
|
|
|
|
|
|
udev_monitor_set_receive_buffer_size |
57
|
|
|
|
|
|
|
udev_monitor_get_fd |
58
|
|
|
|
|
|
|
udev_monitor_receive_device |
59
|
|
|
|
|
|
|
udev_monitor_filter_add_match_subsystem_devtype |
60
|
|
|
|
|
|
|
udev_monitor_filter_add_match_tag |
61
|
|
|
|
|
|
|
udev_monitor_filter_update |
62
|
|
|
|
|
|
|
udev_monitor_filter_remove |
63
|
|
|
|
|
|
|
udev_enumerate_ref |
64
|
|
|
|
|
|
|
udev_enumerate_unref |
65
|
|
|
|
|
|
|
udev_enumerate_get_udev |
66
|
|
|
|
|
|
|
udev_enumerate_new |
67
|
|
|
|
|
|
|
udev_enumerate_add_match_subsystem |
68
|
|
|
|
|
|
|
udev_enumerate_add_nomatch_subsystem |
69
|
|
|
|
|
|
|
udev_enumerate_add_match_sysattr |
70
|
|
|
|
|
|
|
udev_enumerate_add_nomatch_sysattr |
71
|
|
|
|
|
|
|
udev_enumerate_add_match_property |
72
|
|
|
|
|
|
|
udev_enumerate_add_match_sysname |
73
|
|
|
|
|
|
|
udev_enumerate_add_match_tag |
74
|
|
|
|
|
|
|
udev_enumerate_add_match_parent |
75
|
|
|
|
|
|
|
udev_enumerate_add_match_is_initialized |
76
|
|
|
|
|
|
|
udev_enumerate_add_syspath |
77
|
|
|
|
|
|
|
udev_enumerate_scan_devices |
78
|
|
|
|
|
|
|
udev_enumerate_scan_subsystems |
79
|
|
|
|
|
|
|
udev_enumerate_get_list_entry |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
get_entries |
82
|
|
|
|
|
|
|
); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
2
|
|
|
2
|
|
915
|
use FFI::Platypus; |
|
2
|
|
|
|
|
11713
|
|
|
2
|
|
|
|
|
66
|
|
86
|
2
|
|
|
2
|
|
725
|
use FFI::CheckLib; |
|
2
|
|
|
|
|
3297
|
|
|
2
|
|
|
|
|
1666
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
my $ffi; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub get_entries { |
95
|
0
|
|
|
0
|
0
|
0
|
my $entry = shift; |
96
|
|
|
|
|
|
|
|
97
|
0
|
0
|
|
|
|
0
|
if(wantarray) { |
98
|
0
|
|
|
|
|
0
|
my @a = (); |
99
|
|
|
|
|
|
|
|
100
|
0
|
0
|
|
|
|
0
|
if(defined($entry)) { |
101
|
0
|
|
|
|
|
0
|
push @a, udev_list_entry_get_name($entry) |
102
|
|
|
|
|
|
|
while defined($entry = udev_list_entry_get_next($entry)); |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
0
|
|
|
|
|
0
|
return @a; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
0
|
|
|
|
|
0
|
my %h = (); |
110
|
|
|
|
|
|
|
|
111
|
0
|
0
|
|
|
|
0
|
if(defined($entry)) { |
112
|
0
|
|
|
|
|
0
|
$h{ udev_list_entry_get_name($entry) } = udev_list_entry_get_value($entry) |
113
|
|
|
|
|
|
|
while defined($entry = udev_list_entry_get_next($entry)); |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
0
|
return \%h; |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub load_lib { |
122
|
1
|
50
|
|
1
|
0
|
5
|
unless(defined($ffi)) { |
123
|
1
|
|
|
|
|
7
|
my $libudev = find_lib( |
124
|
|
|
|
|
|
|
lib => 'udev' |
125
|
|
|
|
|
|
|
); |
126
|
1
|
50
|
|
|
|
5632
|
if(!$libudev) { |
127
|
0
|
|
|
|
|
0
|
return 0; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
1
|
|
|
|
|
11
|
$ffi = FFI::Platypus->new; |
131
|
1
|
|
|
|
|
23
|
$ffi->lib($libudev); |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
|
134
|
1
|
50
|
|
|
|
24
|
if(8 != $ffi->sizeof('dev_t')) { |
135
|
|
|
|
|
|
|
#TODO only 2 dev_t funct return undef and set $@ |
136
|
0
|
|
|
|
|
0
|
return 0; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
# struct udev *udev_new(void); |
141
|
1
|
|
|
|
|
1123234
|
$ffi->attach('udev_new' => [] => 'opaque'); |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
# struct udev *udev_ref(struct udev *udev); |
144
|
1
|
|
|
|
|
461
|
$ffi->attach('udev_ref' => ['opaque'] => 'opaque'); |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
# struct udev *udev_unref(struct udev *udev); |
147
|
1
|
|
|
|
|
77
|
$ffi->attach('udev_unref' => ['opaque'] => 'opaque'); |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
# access to libudev generated lists ==================================== |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
# struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *list_entry); |
153
|
1
|
|
|
|
|
66
|
$ffi->attach('udev_list_entry_get_next' => ['opaque'] => 'opaque'); |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
# struct udev_list_entry *udev_list_entry_get_by_name(struct udev_list_entry *list_entry, const char *name); |
156
|
1
|
|
|
|
|
97
|
$ffi->attach('udev_list_entry_get_by_name' => ['opaque', 'string'] => 'opaque'); |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
# const char *udev_list_entry_get_name(struct udev_list_entry *list_entry); |
159
|
1
|
|
|
|
|
127
|
$ffi->attach('udev_list_entry_get_name' => ['opaque'] => 'string'); |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
# const char *udev_list_entry_get_value(struct udev_list_entry *list_entry); |
162
|
1
|
|
|
|
|
65
|
$ffi->attach('udev_list_entry_get_value' => ['opaque'] => 'string'); |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
# udev_device ========================================================== |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
# struct udev_device *udev_device_ref(struct udev_device *udev_device); |
168
|
1
|
|
|
|
|
64
|
$ffi->attach('udev_device_ref' => ['opaque'] => 'opaque'); |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
# struct udev_device *udev_device_unref(struct udev_device *udev_device); |
171
|
1
|
|
|
|
|
63
|
$ffi->attach('udev_device_unref' => ['opaque'] => 'opaque'); |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
# struct udev *udev_device_get_udev(struct udev_device *udev_device); |
174
|
1
|
|
|
|
|
64
|
$ffi->attach('udev_device_get_udev' => ['opaque'] => 'opaque'); |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
# struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char *syspath); |
177
|
1
|
|
|
|
|
84
|
$ffi->attach('udev_device_new_from_syspath' => ['opaque', 'string'] => 'opaque'); |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
# struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum); |
180
|
1
|
|
|
|
|
74
|
$ffi->attach('udev_device_new_from_devnum' => ['opaque', 'signed char', 'uint64_t'] => 'opaque'); |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
# struct udev_device *udev_device_new_from_subsystem_sysname(struct udev *udev, const char *subsystem, const char *sysname); |
183
|
1
|
|
|
|
|
138
|
$ffi->attach('udev_device_new_from_subsystem_sysname' => ['opaque', 'string', 'string'] => 'opaque'); |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
# libudev >= 189 |
186
|
|
|
|
|
|
|
# struct udev_device *udev_device_new_from_device_id(struct udev *udev, const char *id); |
187
|
1
|
|
|
|
|
76
|
$ffi->attach('udev_device_new_from_device_id' => ['opaque', 'string'] => 'opaque'); |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
# struct udev_device *udev_device_new_from_environment(struct udev *udev); |
190
|
1
|
|
|
|
|
69
|
$ffi->attach('udev_device_new_from_environment' => ['opaque'] => 'opaque'); |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
# struct udev_device *udev_device_get_parent(struct udev_device *udev_device); |
193
|
1
|
|
|
|
|
63
|
$ffi->attach('udev_device_get_parent' => ['opaque'] => 'opaque'); |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
# struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, |
196
|
|
|
|
|
|
|
# const char *subsystem, const char *devtype); |
197
|
1
|
|
|
|
|
71
|
$ffi->attach('udev_device_get_parent_with_subsystem_devtype' => ['opaque', 'string', 'string'] => 'opaque'); |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
# retrieve device properties |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
# const char *udev_device_get_devpath(struct udev_device *udev_device); |
202
|
1
|
|
|
|
|
123
|
$ffi->attach('udev_device_get_devpath' => ['opaque'] => 'string'); |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
# const char *udev_device_get_subsystem(struct udev_device *udev_device); |
205
|
1
|
|
|
|
|
67
|
$ffi->attach('udev_device_get_subsystem' => ['opaque'] => 'string'); |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
# const char *udev_device_get_devtype(struct udev_device *udev_device); |
208
|
1
|
|
|
|
|
68
|
$ffi->attach('udev_device_get_devtype' => ['opaque'] => 'string'); |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
# const char *udev_device_get_syspath(struct udev_device *udev_device); |
211
|
1
|
|
|
|
|
65
|
$ffi->attach('udev_device_get_syspath' => ['opaque'] => 'string'); |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
# const char *udev_device_get_sysname(struct udev_device *udev_device); |
214
|
1
|
|
|
|
|
64
|
$ffi->attach('udev_device_get_sysname' => ['opaque'] => 'string'); |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
# const char *udev_device_get_sysnum(struct udev_device *udev_device); |
217
|
1
|
|
|
|
|
63
|
$ffi->attach('udev_device_get_sysnum' => ['opaque'] => 'string'); |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
# const char *udev_device_get_devnode(struct udev_device *udev_device); |
220
|
1
|
|
|
|
|
88
|
$ffi->attach('udev_device_get_devnode' => ['opaque'] => 'string'); |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
#int udev_device_get_is_initialized(struct udev_device *udev_device); |
223
|
1
|
|
|
|
|
66
|
$ffi->attach('udev_device_get_is_initialized' => ['opaque'] => 'int'); |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
# struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device); |
226
|
1
|
|
|
|
|
105
|
$ffi->attach('udev_device_get_devlinks_list_entry' => ['opaque'] => 'opaque'); |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
# struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device); |
229
|
1
|
|
|
|
|
65
|
$ffi->attach('udev_device_get_properties_list_entry' => ['opaque'] => 'opaque'); |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
# struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device); |
232
|
1
|
|
|
|
|
64
|
$ffi->attach('udev_device_get_tags_list_entry' => ['opaque'] => 'opaque'); |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
# struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device *udev_device); |
235
|
1
|
|
|
|
|
63
|
$ffi->attach('udev_device_get_sysattr_list_entry' => ['opaque'] => 'opaque'); |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
#const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key); |
238
|
1
|
|
|
|
|
64
|
$ffi->attach('udev_device_get_property_value' => ['opaque', 'string'] => 'string'); |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
#const char *udev_device_get_driver(struct udev_device *udev_device); |
241
|
1
|
|
|
|
|
96
|
$ffi->attach('udev_device_get_driver' => ['opaque'] => 'string'); |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
# dev_t udev_device_get_devnum(struct udev_device *udev_device); |
244
|
1
|
|
|
|
|
72
|
$ffi->attach('udev_device_get_devnum' => ['opaque'] => 'uint64_t'); |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
#const char *udev_device_get_action(struct udev_device *udev_device); |
247
|
1
|
|
|
|
|
66
|
$ffi->attach('udev_device_get_action' => ['opaque'] => 'string'); |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
#unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device); |
250
|
1
|
|
|
|
|
91
|
$ffi->attach('udev_device_get_seqnum' => ['opaque'] => 'unsigned long long'); |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
#unsigned long long int udev_device_get_usec_since_initialized(struct udev_device *udev_device); |
253
|
1
|
|
|
|
|
93
|
$ffi->attach('udev_device_get_usec_since_initialized' => ['opaque'] => 'unsigned long long'); |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
#const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr); |
256
|
1
|
|
|
|
|
65
|
$ffi->attach('udev_device_get_sysattr_value' => ['opaque', 'string'] => 'string'); |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
#int udev_device_set_sysattr_value(struct udev_device *udev_device, const char *sysattr, char *value); |
259
|
1
|
|
|
|
|
93
|
$ffi->attach('udev_device_set_sysattr_value' => ['opaque', 'string', 'string'] => 'int'); |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
#int udev_device_has_tag(struct udev_device *udev_device, const char *tag); |
262
|
1
|
|
|
|
|
76
|
$ffi->attach('udev_device_has_tag' => ['opaque', 'string'] => 'int'); |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
# udev_monitor ========================================================= |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
# access to kernel uevents and udev events |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
# struct udev_monitor *udev_monitor_ref(struct udev_monitor *udev_monitor); |
270
|
1
|
|
|
|
|
68
|
$ffi->attach('udev_monitor_ref' => ['opaque'] => 'opaque'); |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
# struct udev_monitor *udev_monitor_unref(struct udev_monitor *udev_monitor); |
273
|
1
|
|
|
|
|
65
|
$ffi->attach('udev_monitor_unref' => ['opaque'] => 'opaque'); |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
# struct udev *udev_monitor_get_udev(struct udev_monitor *udev_monitor); |
276
|
1
|
|
|
|
|
64
|
$ffi->attach('udev_monitor_get_udev' => ['opaque'] => 'opaque'); |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
#kernel and udev generated events over netlink |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
# struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, const char *name); |
281
|
1
|
|
|
|
|
64
|
$ffi->attach('udev_monitor_new_from_netlink' => ['opaque', 'string'] => 'opaque'); |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
# bind socket |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
# int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor); |
286
|
1
|
|
|
|
|
68
|
$ffi->attach('udev_monitor_enable_receiving' => ['opaque'] => 'int'); |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
# int udev_monitor_set_receive_buffer_size(struct udev_monitor *udev_monitor, int size); |
289
|
1
|
|
|
|
|
63
|
$ffi->attach('udev_monitor_set_receive_buffer_size' => ['opaque', 'int'] => 'int'); |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
# int udev_monitor_get_fd(struct udev_monitor *udev_monitor); |
292
|
1
|
|
|
|
|
102
|
$ffi->attach('udev_monitor_get_fd' => ['opaque'] => 'int'); |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
# struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monitor); |
295
|
1
|
|
|
|
|
65
|
$ffi->attach('udev_monitor_receive_device' => ['opaque'] => 'opaque'); |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
# n-kernel socket filters to select messages that get delivered to a listener |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
# int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor, |
300
|
|
|
|
|
|
|
# const char *subsystem, const char *devtype); |
301
|
1
|
|
|
|
|
64
|
$ffi->attach('udev_monitor_filter_add_match_subsystem_devtype' => ['opaque', 'string', 'string'] => 'int'); |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
# int udev_monitor_filter_add_match_tag(struct udev_monitor *udev_monitor, const char *tag); |
304
|
1
|
|
|
|
|
73
|
$ffi->attach('udev_monitor_filter_add_match_tag' => ['opaque', 'string'] => 'int'); |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
# int udev_monitor_filter_update(struct udev_monitor *udev_monitor); |
307
|
1
|
|
|
|
|
68
|
$ffi->attach('udev_monitor_filter_update' => ['opaque'] => 'int'); |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
# int udev_monitor_filter_remove(struct udev_monitor *udev_monitor); |
310
|
1
|
|
|
|
|
64
|
$ffi->attach('udev_monitor_filter_remove' => ['opaque'] => 'int'); |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
# udev_enumerate ======================================================= |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
# search sysfs for specific devices and provide a sorted list |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
# struct udev_enumerate *udev_enumerate_ref(struct udev_enumerate *udev_enumerate); |
318
|
1
|
|
|
|
|
85
|
$ffi->attach('udev_enumerate_ref' => ['opaque'] => 'opaque'); |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
# struct udev_enumerate *udev_enumerate_unref(struct udev_enumerate *udev_enumerate); |
321
|
1
|
|
|
|
|
66
|
$ffi->attach('udev_enumerate_unref' => ['opaque'] => 'opaque'); |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
# struct udev *udev_enumerate_get_udev(struct udev_enumerate *udev_enumerate); |
324
|
1
|
|
|
|
|
64
|
$ffi->attach('udev_enumerate_get_udev' => ['opaque'] => 'opaque'); |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
# struct udev_enumerate *udev_enumerate_new(struct udev *udev); |
327
|
1
|
|
|
|
|
71
|
$ffi->attach('udev_enumerate_new' => ['opaque'] => 'opaque'); |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
# device properties filter */ |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
# int udev_enumerate_add_match_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem); |
332
|
1
|
|
|
|
|
66
|
$ffi->attach('udev_enumerate_add_match_subsystem' => ['opaque', 'string'] => 'int'); |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
# int udev_enumerate_add_nomatch_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem); |
335
|
1
|
|
|
|
|
98
|
$ffi->attach('udev_enumerate_add_nomatch_subsystem' => ['opaque', 'string'] => 'int'); |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
# int udev_enumerate_add_match_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value); |
338
|
1
|
|
|
|
|
76
|
$ffi->attach('udev_enumerate_add_match_sysattr' => ['opaque', 'string', 'string'] => 'int'); |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
# int udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value); |
341
|
1
|
|
|
|
|
76
|
$ffi->attach('udev_enumerate_add_nomatch_sysattr' => ['opaque', 'string', 'string'] => 'int'); |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
# int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, const char *property, const char *value); |
344
|
1
|
|
|
|
|
129
|
$ffi->attach('udev_enumerate_add_match_property' => ['opaque', 'string', 'string'] => 'int'); |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
# int udev_enumerate_add_match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname); |
347
|
1
|
|
|
|
|
77
|
$ffi->attach('udev_enumerate_add_match_sysname' => ['opaque', 'string'] => 'int'); |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
# int udev_enumerate_add_match_tag(struct udev_enumerate *udev_enumerate, const char *tag); |
350
|
1
|
|
|
|
|
76
|
$ffi->attach('udev_enumerate_add_match_tag' => ['opaque', 'string'] => 'int'); |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
# int udev_enumerate_add_match_parent(struct udev_enumerate *udev_enumerate, struct udev_device *parent); |
353
|
1
|
|
|
|
|
69
|
$ffi->attach('udev_enumerate_add_match_parent' => ['opaque', 'opaque'] => 'int'); |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
# int udev_enumerate_add_match_is_initialized(struct udev_enumerate *udev_enumerate); |
356
|
1
|
|
|
|
|
71
|
$ffi->attach('udev_enumerate_add_match_is_initialized' => ['opaque'] => 'int'); |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
# int udev_enumerate_add_syspath(struct udev_enumerate *udev_enumerate, const char *syspath); |
359
|
1
|
|
|
|
|
86
|
$ffi->attach('udev_enumerate_add_syspath' => ['opaque', 'string'] => 'int'); |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
# run enumeration with active filters */ |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
# int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate); |
364
|
1
|
|
|
|
|
69
|
$ffi->attach('udev_enumerate_scan_devices' => ['opaque'] => 'int'); |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
# int udev_enumerate_scan_subsystems(struct udev_enumerate *udev_enumerate); |
367
|
1
|
|
|
|
|
63
|
$ffi->attach('udev_enumerate_scan_subsystems' => ['opaque'] => 'int'); |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
# return device list */ |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
# struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *udev_enumerate); |
372
|
1
|
|
|
|
|
62
|
$ffi->attach('udev_enumerate_get_list_entry' => ['opaque'] => 'opaque'); |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
|
376
|
1
|
|
|
|
|
67
|
return 1; |
377
|
|
|
|
|
|
|
} |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
1; |