line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Udev::FFI::Enumerate; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
46
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
49
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
8
|
use Udev::FFI::FFIFunctions; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1286
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
my $self = { |
14
|
|
|
|
|
|
|
_enumerate => shift |
15
|
|
|
|
|
|
|
}; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
bless $self, $class; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
return $self; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub get_udev { |
25
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
return udev_enumerate_get_udev($self->{_enumerate}); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub add_match_subsystem { |
33
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
34
|
0
|
|
|
|
|
|
my $subsystem = shift; |
35
|
|
|
|
|
|
|
|
36
|
0
|
0
|
|
|
|
|
if(0 != udev_enumerate_add_match_subsystem($self->{_enumerate}, $subsystem)) { |
37
|
0
|
|
|
|
|
|
return 0; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return 1; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub add_nomatch_subsystem { |
45
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
46
|
0
|
|
|
|
|
|
my $subsystem = shift; |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
if(0 != udev_enumerate_add_nomatch_subsystem($self->{_enumerate}, $subsystem)) { |
49
|
0
|
|
|
|
|
|
return 0; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
return 1; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub add_match_sysattr { |
57
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
58
|
0
|
|
|
|
|
|
my $sysattr = shift; |
59
|
0
|
|
|
|
|
|
my $value = shift; |
60
|
|
|
|
|
|
|
|
61
|
0
|
0
|
|
|
|
|
if(0 != udev_enumerate_add_match_sysattr($self->{_enumerate}, $sysattr, $value)) { |
62
|
0
|
|
|
|
|
|
return 0; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
return 1; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub add_nomatch_sysattr { |
70
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
71
|
0
|
|
|
|
|
|
my $sysattr = shift; |
72
|
0
|
|
|
|
|
|
my $value = shift; |
73
|
|
|
|
|
|
|
|
74
|
0
|
0
|
|
|
|
|
if(0 != udev_enumerate_add_nomatch_sysattr($self->{_enumerate}, $sysattr, $value)) { |
75
|
0
|
|
|
|
|
|
return 0; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
return 1; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub add_match_property { |
83
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
84
|
0
|
|
|
|
|
|
my $property = shift; |
85
|
0
|
|
|
|
|
|
my $value = shift; |
86
|
|
|
|
|
|
|
|
87
|
0
|
0
|
|
|
|
|
if(0 != udev_enumerate_add_match_property($self->{_enumerate}, $property, $value)) { |
88
|
0
|
|
|
|
|
|
return 0; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
0
|
|
|
|
|
|
return 1; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub add_match_sysname { |
96
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
97
|
0
|
|
|
|
|
|
my $sysname = shift; |
98
|
|
|
|
|
|
|
|
99
|
0
|
0
|
|
|
|
|
if(0 != udev_enumerate_add_match_sysname($self->{_enumerate}, $sysname)) { |
100
|
0
|
|
|
|
|
|
return 0; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
0
|
|
|
|
|
|
return 1; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub add_match_tag { |
108
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
109
|
0
|
|
|
|
|
|
my $tag = shift; |
110
|
|
|
|
|
|
|
|
111
|
0
|
0
|
|
|
|
|
if(0 != udev_enumerate_add_match_tag($self->{_enumerate}, $tag)) { |
112
|
0
|
|
|
|
|
|
return 0; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
return 1; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub add_match_parent { |
120
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
121
|
0
|
|
|
|
|
|
my $parent = shift; |
122
|
|
|
|
|
|
|
|
123
|
0
|
0
|
|
|
|
|
if(0 != udev_enumerate_add_match_parent($self->{_enumerate}, $parent)) { |
124
|
0
|
|
|
|
|
|
return 0; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
0
|
|
|
|
|
|
return 1; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub add_match_is_initialized { |
132
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
133
|
|
|
|
|
|
|
|
134
|
0
|
0
|
|
|
|
|
if(0 != udev_enumerate_add_match_is_initialized($self->{_enumerate})) { |
135
|
0
|
|
|
|
|
|
return 0; |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
0
|
|
|
|
|
|
return 1; |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub add_syspath { |
143
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
144
|
0
|
|
|
|
|
|
my $syspath = shift; |
145
|
|
|
|
|
|
|
|
146
|
0
|
0
|
|
|
|
|
if(0 != udev_enumerate_add_syspath($self->{_enumerate}, $syspath)) { |
147
|
0
|
|
|
|
|
|
return 0; |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
|
150
|
0
|
|
|
|
|
|
return 1; |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
sub scan_devices { |
156
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
157
|
|
|
|
|
|
|
|
158
|
0
|
0
|
|
|
|
|
if(0 != udev_enumerate_scan_devices($self->{_enumerate})) { |
159
|
0
|
|
|
|
|
|
return 0; |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
|
162
|
0
|
|
|
|
|
|
return 1; |
163
|
|
|
|
|
|
|
} |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
sub scan_subsystems { |
167
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
168
|
|
|
|
|
|
|
|
169
|
0
|
0
|
|
|
|
|
if(0 != udev_enumerate_scan_subsystems($self->{_enumerate})) { |
170
|
0
|
|
|
|
|
|
return 0; |
171
|
|
|
|
|
|
|
} |
172
|
|
|
|
|
|
|
|
173
|
0
|
|
|
|
|
|
return 1; |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
sub get_list_entries { |
179
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
180
|
|
|
|
|
|
|
|
181
|
0
|
|
|
|
|
|
return get_entries( udev_enumerate_get_list_entry($self->{_enumerate}) ); |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
sub DESTROY { |
187
|
0
|
|
|
0
|
|
|
my $self = shift; |
188
|
|
|
|
|
|
|
|
189
|
0
|
|
|
|
|
|
udev_enumerate_unref( $self->{_device} ); |
190
|
|
|
|
|
|
|
} |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
1; |