lib/Linux/RTC/const-c.inc

filter: Statementstmt 81.4% 132 / 162 Branchbran 55.3% 31 / 56 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 74.7% 163 / 218 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« lib/Linux/RTC/const-xs.inc ↑ Summary
1 #define PERL_constant_NOTFOUND 1
2 #define PERL_constant_NOTDEF 2
3 #define PERL_constant_ISIV 3
4 #define PERL_constant_ISNO 4
5 #define PERL_constant_ISNV 5
6 #define PERL_constant_ISPV 6
7 #define PERL_constant_ISPVN 7
8 #define PERL_constant_ISSV 8
9 #define PERL_constant_ISUNDEF 9
10 #define PERL_constant_ISUV 10
11 #define PERL_constant_ISYES 11
12  
13 #ifndef NVTYPE
14 typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */
15 #endif
16 #ifndef aTHX_
17 #define aTHX_ /* 5.6 or later define this for threading support. */
18 #endif
19 #ifndef pTHX_
20 #define pTHX_ /* 5.6 or later define this for threading support. */
21 #endif
22  
23 static int
24 3 constant_6 (pTHX_ const char *name, IV *iv_return) {
25 /* When generated this function returned values for the list of names given
26 here. However, subsequent manual editing may have added or removed some.
27 RTC_AF RTC_PF RTC_UF */
28 /* Offset 4 gives the best switch position. */
29 3 switch (name[4]) {
30 1 case 'A':
31 1 ▶ if (memEQ(name, "RTC_AF", 6)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_AF", 6)) { 1 0 1
32 /* ^ */
33 #ifdef RTC_AF
34 1 *iv_return = (IV)RTC_AF;
35 1 return PERL_constant_ISUV;
36 #else
37 return PERL_constant_NOTDEF;
38 #endif
39 }
40 0 break;
41 1 case 'P':
42 1 ▶ if (memEQ(name, "RTC_PF", 6)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_PF", 6)) { 1 0 1
43 /* ^ */
44 #ifdef RTC_PF
45 1 *iv_return = (IV)RTC_PF;
46 1 return PERL_constant_ISUV;
47 #else
48 return PERL_constant_NOTDEF;
49 #endif
50 }
51 0 break;
52 1 case 'U':
53 1 ▶ if (memEQ(name, "RTC_UF", 6)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_UF", 6)) { 1 0 1
54 /* ^ */
55 #ifdef RTC_UF
56 1 *iv_return = (IV)RTC_UF;
57 1 return PERL_constant_ISUV;
58 #else
59 return PERL_constant_NOTDEF;
60 #endif
61 }
62 0 break;
63 }
64 0 return PERL_constant_NOTFOUND;
65 }
66  
67 static int
68 5 constant_10 (pTHX_ const char *name, IV *iv_return) {
69 /* When generated this function returned values for the list of names given
70 here. However, subsequent manual editing may have added or removed some.
71 RTC_AIE_ON RTC_PIE_ON RTC_UIE_ON RTC_VL_CLR RTC_WIE_ON */
72 /* Offset 4 gives the best switch position. */
73 5 switch (name[4]) {
74 1 case 'A':
75 1 ▶ if (memEQ(name, "RTC_AIE_ON", 10)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_AIE_ON", 10)) { 1 0 1
76 /* ^ */
77 #ifdef RTC_AIE_ON
78 1 *iv_return = (IV)RTC_AIE_ON;
79 1 return PERL_constant_ISUV;
80 #else
81 return PERL_constant_NOTDEF;
82 #endif
83 }
84 0 break;
85 1 case 'P':
86 1 ▶ if (memEQ(name, "RTC_PIE_ON", 10)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_PIE_ON", 10)) { 1 0 1
87 /* ^ */
88 #ifdef RTC_PIE_ON
89 1 *iv_return = (IV)RTC_PIE_ON;
90 1 return PERL_constant_ISUV;
91 #else
92 return PERL_constant_NOTDEF;
93 #endif
94 }
95 0 break;
96 1 case 'U':
97 1 ▶ if (memEQ(name, "RTC_UIE_ON", 10)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_UIE_ON", 10)) { 1 0 1
98 /* ^ */
99 #ifdef RTC_UIE_ON
100 1 *iv_return = (IV)RTC_UIE_ON;
101 1 return PERL_constant_ISUV;
102 #else
103 return PERL_constant_NOTDEF;
104 #endif
105 }
106 0 break;
107 1 case 'V':
108 1 ▶ if (memEQ(name, "RTC_VL_CLR", 10)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_VL_CLR", 10)) { 1 0 1
109 /* ^ */
110 #ifdef RTC_VL_CLR
111 1 *iv_return = (IV)RTC_VL_CLR;
112 1 return PERL_constant_ISUV;
113 #else
114 return PERL_constant_NOTDEF;
115 #endif
116 }
117 0 break;
118 1 case 'W':
119 1 ▶ if (memEQ(name, "RTC_WIE_ON", 10)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_WIE_ON", 10)) { 1 0 1
120 /* ^ */
121 #ifdef RTC_WIE_ON
122 1 *iv_return = (IV)RTC_WIE_ON;
123 1 return PERL_constant_ISUV;
124 #else
125 return PERL_constant_NOTDEF;
126 #endif
127 }
128 0 break;
129 }
130 0 return PERL_constant_NOTFOUND;
131 }
132  
133 static int
134 9 constant_11 (pTHX_ const char *name, IV *iv_return) {
135 /* When generated this function returned values for the list of names given
136 here. However, subsequent manual editing may have added or removed some.
137 RTC_AIE_OFF RTC_ALM_SET RTC_PIE_OFF RTC_PLL_GET RTC_PLL_SET RTC_RD_TIME
138 RTC_UIE_OFF RTC_VL_READ RTC_WIE_OFF */
139 /* Offset 4 gives the best switch position. */
140 9 switch (name[4]) {
141 2 case 'A':
142 2 ▶ if (memEQ(name, "RTC_AIE_OFF", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_AIE_OFF", 11)) { 1 1 2
143 /* ^ */
144 #ifdef RTC_AIE_OFF
145 1 *iv_return = (IV)RTC_AIE_OFF;
146 1 return PERL_constant_ISUV;
147 #else
148 return PERL_constant_NOTDEF;
149 #endif
150 }
151 1 ▶ if (memEQ(name, "RTC_ALM_SET", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_ALM_SET", 11)) { 1 0 1
152 /* ^ */
153 #ifdef RTC_ALM_SET
154 1 *iv_return = (IV)RTC_ALM_SET;
155 1 return PERL_constant_ISUV;
156 #else
157 return PERL_constant_NOTDEF;
158 #endif
159 }
160 0 break;
161 3 case 'P':
162 3 ▶ if (memEQ(name, "RTC_PIE_OFF", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_PIE_OFF", 11)) { 1 2 3
163 /* ^ */
164 #ifdef RTC_PIE_OFF
165 1 *iv_return = (IV)RTC_PIE_OFF;
166 1 return PERL_constant_ISUV;
167 #else
168 return PERL_constant_NOTDEF;
169 #endif
170 }
171 2 ▶ if (memEQ(name, "RTC_PLL_GET", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_PLL_GET", 11)) { 1 1 2
172 /* ^ */
173 #ifdef RTC_PLL_GET
174 1 *iv_return = (IV)RTC_PLL_GET;
175 1 return PERL_constant_ISUV;
176 #else
177 return PERL_constant_NOTDEF;
178 #endif
179 }
180 1 ▶ if (memEQ(name, "RTC_PLL_SET", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_PLL_SET", 11)) { 1 0 1
181 /* ^ */
182 #ifdef RTC_PLL_SET
183 1 *iv_return = (IV)RTC_PLL_SET;
184 1 return PERL_constant_ISUV;
185 #else
186 return PERL_constant_NOTDEF;
187 #endif
188 }
189 0 break;
190 1 case 'R':
191 1 ▶ if (memEQ(name, "RTC_RD_TIME", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_RD_TIME", 11)) { 1 0 1
192 /* ^ */
193 #ifdef RTC_RD_TIME
194 1 *iv_return = (IV)RTC_RD_TIME;
195 1 return PERL_constant_ISUV;
196 #else
197 return PERL_constant_NOTDEF;
198 #endif
199 }
200 0 break;
201 1 case 'U':
202 1 ▶ if (memEQ(name, "RTC_UIE_OFF", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_UIE_OFF", 11)) { 1 0 1
203 /* ^ */
204 #ifdef RTC_UIE_OFF
205 1 *iv_return = (IV)RTC_UIE_OFF;
206 1 return PERL_constant_ISUV;
207 #else
208 return PERL_constant_NOTDEF;
209 #endif
210 }
211 0 break;
212 1 case 'V':
213 1 ▶ if (memEQ(name, "RTC_VL_READ", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_VL_READ", 11)) { 1 0 1
214 /* ^ */
215 #ifdef RTC_VL_READ
216 1 *iv_return = (IV)RTC_VL_READ;
217 1 return PERL_constant_ISUV;
218 #else
219 return PERL_constant_NOTDEF;
220 #endif
221 }
222 0 break;
223 1 case 'W':
224 1 ▶ if (memEQ(name, "RTC_WIE_OFF", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_WIE_OFF", 11)) { 1 0 1
225 /* ^ */
226 #ifdef RTC_WIE_OFF
227 1 *iv_return = (IV)RTC_WIE_OFF;
228 1 return PERL_constant_ISUV;
229 #else
230 return PERL_constant_NOTDEF;
231 #endif
232 }
233 0 break;
234 }
235 0 return PERL_constant_NOTFOUND;
236 }
237  
238 static int
239 5 constant_12 (pTHX_ const char *name, IV *iv_return) {
240 /* When generated this function returned values for the list of names given
241 here. However, subsequent manual editing may have added or removed some.
242 RTC_ALM_READ RTC_IRQP_SET RTC_MAX_FREQ RTC_SET_TIME RTC_WKALM_RD */
243 /* Offset 5 gives the best switch position. */
244 5 switch (name[5]) {
245 1 case 'A':
246 1 ▶ if (memEQ(name, "RTC_MAX_FREQ", 12)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_MAX_FREQ", 12)) { 1 0 1
247 /* ^ */
248 #ifdef RTC_MAX_FREQ
249 1 *iv_return = (IV)RTC_MAX_FREQ;
250 1 return PERL_constant_ISUV;
251 #else
252 return PERL_constant_NOTDEF;
253 #endif
254 }
255 0 break;
256 1 case 'E':
257 1 ▶ if (memEQ(name, "RTC_SET_TIME", 12)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_SET_TIME", 12)) { 1 0 1
258 /* ^ */
259 #ifdef RTC_SET_TIME
260 1 *iv_return = (IV)RTC_SET_TIME;
261 1 return PERL_constant_ISUV;
262 #else
263 return PERL_constant_NOTDEF;
264 #endif
265 }
266 0 break;
267 1 case 'K':
268 1 ▶ if (memEQ(name, "RTC_WKALM_RD", 12)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_WKALM_RD", 12)) { 1 0 1
269 /* ^ */
270 #ifdef RTC_WKALM_RD
271 1 *iv_return = (IV)RTC_WKALM_RD;
272 1 return PERL_constant_ISUV;
273 #else
274 return PERL_constant_NOTDEF;
275 #endif
276 }
277 0 break;
278 1 case 'L':
279 1 ▶ if (memEQ(name, "RTC_ALM_READ", 12)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_ALM_READ", 12)) { 1 0 1
280 /* ^ */
281 #ifdef RTC_ALM_READ
282 1 *iv_return = (IV)RTC_ALM_READ;
283 1 return PERL_constant_ISUV;
284 #else
285 return PERL_constant_NOTDEF;
286 #endif
287 }
288 0 break;
289 1 case 'R':
290 1 ▶ if (memEQ(name, "RTC_IRQP_SET", 12)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_IRQP_SET", 12)) { 1 0 1
291 /* ^ */
292 #ifdef RTC_IRQP_SET
293 1 *iv_return = (IV)RTC_IRQP_SET;
294 1 return PERL_constant_ISUV;
295 #else
296 return PERL_constant_NOTDEF;
297 #endif
298 }
299 0 break;
300 }
301 0 return PERL_constant_NOTFOUND;
302 }
303  
304 static int
305 3 constant_13 (pTHX_ const char *name, IV *iv_return) {
306 /* When generated this function returned values for the list of names given
307 here. However, subsequent manual editing may have added or removed some.
308 RTC_EPOCH_SET RTC_IRQP_READ RTC_WKALM_SET */
309 /* Offset 5 gives the best switch position. */
310 3 switch (name[5]) {
311 1 case 'K':
312 1 ▶ if (memEQ(name, "RTC_WKALM_SET", 13)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_WKALM_SET", 13)) { 1 0 1
313 /* ^ */
314 #ifdef RTC_WKALM_SET
315 1 *iv_return = (IV)RTC_WKALM_SET;
316 1 return PERL_constant_ISUV;
317 #else
318 return PERL_constant_NOTDEF;
319 #endif
320 }
321 0 break;
322 1 case 'P':
323 1 ▶ if (memEQ(name, "RTC_EPOCH_SET", 13)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_EPOCH_SET", 13)) { 1 0 1
324 /* ^ */
325 #ifdef RTC_EPOCH_SET
326 1 *iv_return = (IV)RTC_EPOCH_SET;
327 1 return PERL_constant_ISUV;
328 #else
329 return PERL_constant_NOTDEF;
330 #endif
331 }
332 0 break;
333 1 case 'R':
334 1 ▶ if (memEQ(name, "RTC_IRQP_READ", 13)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RTC_IRQP_READ", 13)) { 1 0 1
335 /* ^ */
336 #ifdef RTC_IRQP_READ
337 1 *iv_return = (IV)RTC_IRQP_READ;
338 1 return PERL_constant_ISUV;
339 #else
340 return PERL_constant_NOTDEF;
341 #endif
342 }
343 0 break;
344 }
345 0 return PERL_constant_NOTFOUND;
346 }
347  
348 static int
349 33 constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
350 /* Initially switch on the length of the name. */
351 /* When generated this function returned values for the list of names given
352 in this section of perl code. Rather than manually editing these functions
353 to add or remove constants, which would result in this comment and section
354 of code becoming inaccurate, we recommend that you edit this section of
355 code, and use it to regenerate a new set of constant functions which you
356 then use to replace the originals.
357  
358 Regenerate these constant functions by feeding this entire source file to
359 perl -x
360  
361 #!/usr/bin/perl5.22.2 -w
362 use ExtUtils::Constant qw (constant_types C_constant XS_constant);
363  
364 my $types = {map {($_, 1)} qw(UV)};
365 my @names = (qw(RTC_AF RTC_AIE_OFF RTC_AIE_ON RTC_ALM_READ RTC_ALM_SET
366 RTC_EPOCH_READ RTC_EPOCH_SET RTC_IRQF RTC_IRQP_READ RTC_IRQP_SET
367 RTC_MAX_FREQ RTC_PF RTC_PIE_OFF RTC_PIE_ON RTC_PLL_GET
368 RTC_PLL_SET RTC_RD_TIME RTC_SET_TIME RTC_UF RTC_UIE_OFF
369 RTC_UIE_ON RTC_VL_CLR RTC_VL_READ RTC_WIE_OFF RTC_WIE_ON
370 RTC_WKALM_RD RTC_WKALM_SET));
371  
372 print constant_types(), "\n"; # macro defs
373 foreach (C_constant ("Linux::RTC::Ioctl", 'constant', 'UV', $types, undef, 3, @names) ) {
374 print $_, "\n"; # C constant subs
375 }
376 print "\n#### XS Section:\n";
377 print XS_constant ("Linux::RTC::Ioctl", $types);
378 __END__
« lib/Linux/RTC/const-xs.inc ↑ Summary