File Coverage

const-c.inc
Criterion Covered Total %
statement 144 194 74.2
branch 40 80 50.0
condition n/a
subroutine n/a
pod n/a
total 184 274 67.1


line stmt bran cond sub pod time code
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 11           constant_7 (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             AF_TIPC PF_TIPC TIPC_OK */
28             /* Offset 0 gives the best switch position. */
29 11           switch (*name++) {
30             case 'A':
31 2 50         if (memEQ(name, "F_TIPC", 6)) {
32             /* A */
33             #ifdef AF_TIPC
34 2           *iv_return = AF_TIPC;
35 2           return PERL_constant_ISIV;
36             #else
37             return PERL_constant_NOTDEF;
38             #endif
39             }
40 0           break;
41             case 'P':
42 8 50         if (memEQ(name, "F_TIPC", 6)) {
43             /* P */
44             #ifdef PF_TIPC
45 8           *iv_return = PF_TIPC;
46 8           return PERL_constant_ISIV;
47             #else
48             return PERL_constant_NOTDEF;
49             #endif
50             }
51 0           break;
52             case 'T':
53 1 50         if (memEQ(name, "IPC_OK", 6)) {
54             /* T */
55             #ifdef TIPC_OK
56 1           *iv_return = TIPC_OK;
57 1           return PERL_constant_ISIV;
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 6           constant_12 (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             TIPC_ADDR_ID TIPC_CFG_SRV TIPC_ERRINFO TIPC_RETDATA TIPC_TOP_SRV */
72             /* Offset 6 gives the best switch position. */
73 6           switch (name[6]) {
74             case 'D':
75 2 50         if (memEQ(name, "TIPC_ADDR_ID", 12)) {
76             /* ^ */
77             #ifdef TIPC_ADDR_ID
78 2           *iv_return = TIPC_ADDR_ID;
79 2           return PERL_constant_ISIV;
80             #else
81             return PERL_constant_NOTDEF;
82             #endif
83             }
84 0           break;
85             case 'E':
86 1 50         if (memEQ(name, "TIPC_RETDATA", 12)) {
87             /* ^ */
88             #ifdef TIPC_RETDATA
89 1           *iv_return = TIPC_RETDATA;
90 1           return PERL_constant_ISIV;
91             #else
92             return PERL_constant_NOTDEF;
93             #endif
94             }
95 0           break;
96             case 'F':
97 1 50         if (memEQ(name, "TIPC_CFG_SRV", 12)) {
98             /* ^ */
99             #ifdef TIPC_CFG_SRV
100 1           *iv_return = TIPC_CFG_SRV;
101 1           return PERL_constant_ISIV;
102             #else
103             return PERL_constant_NOTDEF;
104             #endif
105             }
106 0           break;
107             case 'O':
108 1 50         if (memEQ(name, "TIPC_TOP_SRV", 12)) {
109             /* ^ */
110             #ifdef TIPC_TOP_SRV
111 1           *iv_return = TIPC_TOP_SRV;
112 1           return PERL_constant_ISIV;
113             #else
114             return PERL_constant_NOTDEF;
115             #endif
116             }
117 0           break;
118             case 'R':
119 1 50         if (memEQ(name, "TIPC_ERRINFO", 12)) {
120             /* ^ */
121             #ifdef TIPC_ERRINFO
122 1           *iv_return = TIPC_ERRINFO;
123 1           return PERL_constant_ISIV;
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 5           constant_14 (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             TIPC_ADDR_NAME TIPC_PUBLISHED TIPC_SUB_PORTS TIPC_WITHDRAWN */
138             /* Offset 10 gives the best switch position. */
139 5           switch (name[10]) {
140             case 'N':
141 2 50         if (memEQ(name, "TIPC_ADDR_NAME", 14)) {
142             /* ^ */
143             #ifdef TIPC_ADDR_NAME
144 2           *iv_return = TIPC_ADDR_NAME;
145 2           return PERL_constant_ISIV;
146             #else
147             return PERL_constant_NOTDEF;
148             #endif
149             }
150 0           break;
151             case 'O':
152 1 50         if (memEQ(name, "TIPC_SUB_PORTS", 14)) {
153             /* ^ */
154             #ifdef TIPC_SUB_PORTS
155 1           *iv_return = TIPC_SUB_PORTS;
156 1           return PERL_constant_ISIV;
157             #else
158             return PERL_constant_NOTDEF;
159             #endif
160             }
161 0           break;
162             case 'R':
163 1 50         if (memEQ(name, "TIPC_WITHDRAWN", 14)) {
164             /* ^ */
165             #ifdef TIPC_WITHDRAWN
166 1           *iv_return = TIPC_WITHDRAWN;
167 1           return PERL_constant_ISIV;
168             #else
169             return PERL_constant_NOTDEF;
170             #endif
171             }
172 0           break;
173             case 'S':
174 1 50         if (memEQ(name, "TIPC_PUBLISHED", 14)) {
175             /* ^ */
176             #ifdef TIPC_PUBLISHED
177 1           *iv_return = TIPC_PUBLISHED;
178 1           return PERL_constant_ISIV;
179             #else
180             return PERL_constant_NOTDEF;
181             #endif
182             }
183 0           break;
184             }
185 0           return PERL_constant_NOTFOUND;
186             }
187              
188             static int
189 6           constant_15 (pTHX_ const char *name, IV *iv_return) {
190             /* When generated this function returned values for the list of names given
191             here. However, subsequent manual editing may have added or removed some.
192             TIPC_ADDR_MCAST TIPC_IMPORTANCE TIPC_NODE_SCOPE TIPC_ZONE_SCOPE */
193             /* Offset 5 gives the best switch position. */
194 6           switch (name[5]) {
195             case 'A':
196 1 50         if (memEQ(name, "TIPC_ADDR_MCAST", 15)) {
197             /* ^ */
198             #ifdef TIPC_ADDR_MCAST
199 1           *iv_return = TIPC_ADDR_MCAST;
200 1           return PERL_constant_ISIV;
201             #else
202             return PERL_constant_NOTDEF;
203             #endif
204             }
205 0           break;
206             case 'I':
207 1 50         if (memEQ(name, "TIPC_IMPORTANCE", 15)) {
208             /* ^ */
209             #ifdef TIPC_IMPORTANCE
210 1           *iv_return = TIPC_IMPORTANCE;
211 1           return PERL_constant_ISIV;
212             #else
213             return PERL_constant_NOTDEF;
214             #endif
215             }
216 0           break;
217             case 'N':
218 2 50         if (memEQ(name, "TIPC_NODE_SCOPE", 15)) {
219             /* ^ */
220 2           *iv_return = TIPC_NODE_SCOPE;
221 2           return PERL_constant_ISIV;
222             }
223 0           break;
224             case 'Z':
225 2 50         if (memEQ(name, "TIPC_ZONE_SCOPE", 15)) {
226             /* ^ */
227             #ifdef TIPC_ZONE_SCOPE
228 2           *iv_return = TIPC_ZONE_SCOPE;
229 2           return PERL_constant_ISIV;
230             #else
231             return PERL_constant_NOTDEF;
232             #endif
233             }
234 0           break;
235             }
236 0           return PERL_constant_NOTFOUND;
237             }
238              
239             static int
240 4           constant_16 (pTHX_ const char *name, IV *iv_return) {
241             /* When generated this function returned values for the list of names given
242             here. However, subsequent manual editing may have added or removed some.
243             TIPC_ERR_NO_NAME TIPC_ERR_NO_NODE TIPC_ERR_NO_PORT TIPC_SUB_SERVICE */
244             /* Offset 14 gives the best switch position. */
245 4           switch (name[14]) {
246             case 'C':
247 1 50         if (memEQ(name, "TIPC_SUB_SERVICE", 16)) {
248             /* ^ */
249             #ifdef TIPC_SUB_SERVICE
250 1           *iv_return = TIPC_SUB_SERVICE;
251 1           return PERL_constant_ISIV;
252             #else
253             return PERL_constant_NOTDEF;
254             #endif
255             }
256 0           break;
257             case 'D':
258 1 50         if (memEQ(name, "TIPC_ERR_NO_NODE", 16)) {
259             /* ^ */
260             #ifdef TIPC_ERR_NO_NODE
261 1           *iv_return = TIPC_ERR_NO_NODE;
262 1           return PERL_constant_ISIV;
263             #else
264             return PERL_constant_NOTDEF;
265             #endif
266             }
267 0           break;
268             case 'M':
269 1 50         if (memEQ(name, "TIPC_ERR_NO_NAME", 16)) {
270             /* ^ */
271             #ifdef TIPC_ERR_NO_NAME
272 1           *iv_return = TIPC_ERR_NO_NAME;
273 1           return PERL_constant_ISIV;
274             #else
275             return PERL_constant_NOTDEF;
276             #endif
277             }
278 0           break;
279             case 'R':
280 1 50         if (memEQ(name, "TIPC_ERR_NO_PORT", 16)) {
281             /* ^ */
282             #ifdef TIPC_ERR_NO_PORT
283 1           *iv_return = TIPC_ERR_NO_PORT;
284 1           return PERL_constant_ISIV;
285             #else
286             return PERL_constant_NOTDEF;
287             #endif
288             }
289 0           break;
290             }
291 0           return PERL_constant_NOTFOUND;
292             }
293              
294             static int
295 5           constant_17 (pTHX_ const char *name, IV *iv_return) {
296             /* When generated this function returned values for the list of names given
297             here. However, subsequent manual editing may have added or removed some.
298             TIPC_ADDR_NAMESEQ TIPC_CONN_TIMEOUT TIPC_ERR_OVERLOAD TIPC_WAIT_FOREVER */
299             /* Offset 7 gives the best switch position. */
300 5           switch (name[7]) {
301             case 'D':
302 2 50         if (memEQ(name, "TIPC_ADDR_NAMESEQ", 17)) {
303             /* ^ */
304             #ifdef TIPC_ADDR_NAMESEQ
305 2           *iv_return = TIPC_ADDR_NAMESEQ;
306 2           return PERL_constant_ISIV;
307             #else
308             return PERL_constant_NOTDEF;
309             #endif
310             }
311 0           break;
312             case 'I':
313 1 50         if (memEQ(name, "TIPC_WAIT_FOREVER", 17)) {
314             /* ^ */
315             #ifdef TIPC_WAIT_FOREVER
316 1           *iv_return = TIPC_WAIT_FOREVER;
317 1           return PERL_constant_ISIV;
318             #else
319             return PERL_constant_NOTDEF;
320             #endif
321             }
322 0           break;
323             case 'N':
324 1 50         if (memEQ(name, "TIPC_CONN_TIMEOUT", 17)) {
325             /* ^ */
326             #ifdef TIPC_CONN_TIMEOUT
327 1           *iv_return = TIPC_CONN_TIMEOUT;
328 1           return PERL_constant_ISIV;
329             #else
330             return PERL_constant_NOTDEF;
331             #endif
332             }
333 0           break;
334             case 'R':
335 1 50         if (memEQ(name, "TIPC_ERR_OVERLOAD", 17)) {
336             /* ^ */
337             #ifdef TIPC_ERR_OVERLOAD
338 1           *iv_return = TIPC_ERR_OVERLOAD;
339 1           return PERL_constant_ISIV;
340             #else
341             return PERL_constant_NOTDEF;
342             #endif
343             }
344 0           break;
345             }
346 0           return PERL_constant_NOTFOUND;
347             }
348              
349             static int
350 4           constant_18 (pTHX_ const char *name, IV *iv_return) {
351             /* When generated this function returned values for the list of names given
352             here. However, subsequent manual editing may have added or removed some.
353             TIPC_CLUSTER_SCOPE TIPC_CONN_SHUTDOWN TIPC_SRC_DROPPABLE */
354             /* Offset 14 gives the best switch position. */
355 4           switch (name[14]) {
356             case 'A':
357 1 50         if (memEQ(name, "TIPC_SRC_DROPPABLE", 18)) {
358             /* ^ */
359             #ifdef TIPC_SRC_DROPPABLE
360 1           *iv_return = TIPC_SRC_DROPPABLE;
361 1           return PERL_constant_ISIV;
362             #else
363             return PERL_constant_NOTDEF;
364             #endif
365             }
366 0           break;
367             case 'C':
368 2 50         if (memEQ(name, "TIPC_CLUSTER_SCOPE", 18)) {
369             /* ^ */
370 2           *iv_return = TIPC_CLUSTER_SCOPE;
371 2           return PERL_constant_ISIV;
372             }
373 0           break;
374             case 'D':
375 1 50         if (memEQ(name, "TIPC_CONN_SHUTDOWN", 18)) {
376             /* ^ */
377             #ifdef TIPC_CONN_SHUTDOWN
378 1           *iv_return = TIPC_CONN_SHUTDOWN;
379 1           return PERL_constant_ISIV;
380             #else
381             return PERL_constant_NOTDEF;
382             #endif
383             }
384 0           break;
385             }
386 0           return PERL_constant_NOTFOUND;
387             }
388              
389             static int
390 5           constant_19 (pTHX_ const char *name, IV *iv_return) {
391             /* When generated this function returned values for the list of names given
392             here. However, subsequent manual editing may have added or removed some.
393             TIPC_DEST_DROPPABLE TIPC_LOW_IMPORTANCE TIPC_RESERVED_TYPES
394             TIPC_SUBSCR_TIMEOUT TIPC_SUB_SINGLE_EVT */
395             /* Offset 16 gives the best switch position. */
396 5           switch (name[16]) {
397             case 'B':
398 1 50         if (memEQ(name, "TIPC_DEST_DROPPABLE", 19)) {
399             /* ^ */
400             #ifdef TIPC_DEST_DROPPABLE
401 1           *iv_return = TIPC_DEST_DROPPABLE;
402 1           return PERL_constant_ISIV;
403             #else
404             return PERL_constant_NOTDEF;
405             #endif
406             }
407 0           break;
408             case 'E':
409 1 50         if (memEQ(name, "TIPC_SUB_SINGLE_EVT", 19)) {
410             /* ^ */
411             #ifdef TIPC_SUB_SINGLE_EVT
412             *iv_return = TIPC_SUB_SINGLE_EVT;
413             return PERL_constant_ISIV;
414             #else
415 1           return PERL_constant_NOTDEF;
416             #endif
417             }
418 0           break;
419             case 'N':
420 1 50         if (memEQ(name, "TIPC_LOW_IMPORTANCE", 19)) {
421             /* ^ */
422             #ifdef TIPC_LOW_IMPORTANCE
423 1           *iv_return = TIPC_LOW_IMPORTANCE;
424 1           return PERL_constant_ISIV;
425             #else
426             return PERL_constant_NOTDEF;
427             #endif
428             }
429 0           break;
430             case 'O':
431 1 50         if (memEQ(name, "TIPC_SUBSCR_TIMEOUT", 19)) {
432             /* ^ */
433             #ifdef TIPC_SUBSCR_TIMEOUT
434 1           *iv_return = TIPC_SUBSCR_TIMEOUT;
435 1           return PERL_constant_ISIV;
436             #else
437             return PERL_constant_NOTDEF;
438             #endif
439             }
440 0           break;
441             case 'P':
442 1 50         if (memEQ(name, "TIPC_RESERVED_TYPES", 19)) {
443             /* ^ */
444             #ifdef TIPC_RESERVED_TYPES
445 1           *iv_return = TIPC_RESERVED_TYPES;
446 1           return PERL_constant_ISIV;
447             #else
448             return PERL_constant_NOTDEF;
449             #endif
450             }
451 0           break;
452             }
453 0           return PERL_constant_NOTFOUND;
454             }
455              
456             static int
457 54           constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
458             /* Initially switch on the length of the name. */
459             /* When generated this function returned values for the list of names given
460             in this section of perl code. Rather than manually editing these functions
461             to add or remove constants, which would result in this comment and section
462             of code becoming inaccurate, we recommend that you edit this section of
463             code, and use it to regenerate a new set of constant functions which you
464             then use to replace the originals.
465              
466             Regenerate these constant functions by feeding this entire source file to
467             perl -x
468              
469             #!/usr/local/bin/perl -w
470             use ExtUtils::Constant qw (constant_types C_constant XS_constant);
471              
472             my $types = {map {($_, 1)} qw(IV)};
473             my @names = (qw(AF_TIPC PF_TIPC SOL_TIPC TIPC_ADDR_ID TIPC_ADDR_MCAST
474             TIPC_ADDR_NAME TIPC_ADDR_NAMESEQ TIPC_CFG_SRV TIPC_CONN_SHUTDOWN
475             TIPC_CONN_TIMEOUT TIPC_CRITICAL_IMPORTANCE TIPC_DESTNAME
476             TIPC_DEST_DROPPABLE TIPC_ERRINFO TIPC_ERR_NO_NAME
477             TIPC_ERR_NO_NODE TIPC_ERR_NO_PORT TIPC_ERR_OVERLOAD
478             TIPC_HIGH_IMPORTANCE TIPC_IMPORTANCE TIPC_LOW_IMPORTANCE
479             TIPC_MAX_USER_MSG_SIZE TIPC_MEDIUM_IMPORTANCE TIPC_OK
480             TIPC_PUBLISHED TIPC_RESERVED_TYPES TIPC_RETDATA
481             TIPC_SRC_DROPPABLE TIPC_SUBSCR_TIMEOUT TIPC_SUB_NO_BIND_EVTS
482             TIPC_SUB_NO_UNBIND_EVTS TIPC_SUB_PORTS TIPC_SUB_SERVICE
483             TIPC_SUB_SINGLE_EVT TIPC_TOP_SRV TIPC_WAIT_FOREVER
484             TIPC_WITHDRAWN TIPC_ZONE_SCOPE),
485             {name=>"TIPC_CLUSTER_SCOPE", type=>"IV", macro=>"1"},
486             {name=>"TIPC_NODE_SCOPE", type=>"IV", macro=>"1"});
487              
488             print constant_types(), "\n"; # macro defs
489             foreach (C_constant ("IO::Socket::TIPC", 'constant', 'IV', $types, undef, 3, @names) ) {
490             print $_, "\n"; # C constant subs
491             }
492             print "\n#### XS Section:\n";
493             print XS_constant ("IO::Socket::TIPC", $types);
494             __END__