const-c.inc

filter: Statementstmt 80.4% 70 / 87 Branchbran 57.1% 16 / 28 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 74.7% 86 / 115 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« const-xs.inc ↑ Summary Epoll.xs »
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 9 constant_8 (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 EPOLLERR EPOLLHUP EPOLLMSG EPOLLOUT EPOLLPRI */
28 /* Offset 5 gives the best switch position. */
29 9 switch (name[5]) {
30 2 case 'E':
31 2 ▶ if (memEQ(name, "EPOLLERR", 8)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EPOLLERR", 8)) { 2 0 2
32 /* ^ */
33 #ifdef EPOLLERR
34 2 *iv_return = EPOLLERR;
35 2 return PERL_constant_ISIV;
36 #else
37 return PERL_constant_NOTDEF;
38 #endif
39 }
40 0 break;
41 2 case 'H':
42 2 ▶ if (memEQ(name, "EPOLLHUP", 8)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EPOLLHUP", 8)) { 2 0 2
43 /* ^ */
44 #ifdef EPOLLHUP
45 2 *iv_return = EPOLLHUP;
46 2 return PERL_constant_ISIV;
47 #else
48 return PERL_constant_NOTDEF;
49 #endif
50 }
51 0 break;
52 1 case 'M':
53 1 ▶ if (memEQ(name, "EPOLLMSG", 8)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EPOLLMSG", 8)) { 1 0 1
54 /* ^ */
55 #ifdef EPOLLMSG
56 1 *iv_return = EPOLLMSG;
57 1 return PERL_constant_ISIV;
58 #else
59 return PERL_constant_NOTDEF;
60 #endif
61 }
62 0 break;
63 2 case 'O':
64 2 ▶ if (memEQ(name, "EPOLLOUT", 8)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EPOLLOUT", 8)) { 2 0 2
65 /* ^ */
66 #ifdef EPOLLOUT
67 2 *iv_return = EPOLLOUT;
68 2 return PERL_constant_ISIV;
69 #else
70 return PERL_constant_NOTDEF;
71 #endif
72 }
73 0 break;
74 2 case 'P':
75 2 ▶ if (memEQ(name, "EPOLLPRI", 8)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EPOLLPRI", 8)) { 2 0 2
76 /* ^ */
77 #ifdef EPOLLPRI
78 2 *iv_return = EPOLLPRI;
79 2 return PERL_constant_ISIV;
80 #else
81 return PERL_constant_NOTDEF;
82 #endif
83 }
84 0 break;
85 }
86 0 return PERL_constant_NOTFOUND;
87 }
88  
89 static int
90 4 constant_11 (pTHX_ const char *name, IV *iv_return) {
91 /* When generated this function returned values for the list of names given
92 here. However, subsequent manual editing may have added or removed some.
93 EPOLLRDBAND EPOLLRDNORM EPOLLWRBAND EPOLLWRNORM */
94 /* Offset 9 gives the best switch position. */
95 4 switch (name[9]) {
96 2 case 'N':
97 2 ▶ if (memEQ(name, "EPOLLRDBAND", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EPOLLRDBAND", 11)) { 1 1 2
98 /* ^ */
99 #ifdef EPOLLRDBAND
100 1 *iv_return = EPOLLRDBAND;
101 1 return PERL_constant_ISIV;
102 #else
103 return PERL_constant_NOTDEF;
104 #endif
105 }
106 1 ▶ if (memEQ(name, "EPOLLWRBAND", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EPOLLWRBAND", 11)) { 1 0 1
107 /* ^ */
108 #ifdef EPOLLWRBAND
109 1 *iv_return = EPOLLWRBAND;
110 1 return PERL_constant_ISIV;
111 #else
112 return PERL_constant_NOTDEF;
113 #endif
114 }
115 0 break;
116 2 case 'R':
117 2 ▶ if (memEQ(name, "EPOLLRDNORM", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EPOLLRDNORM", 11)) { 1 1 2
118 /* ^ */
119 #ifdef EPOLLRDNORM
120 1 *iv_return = EPOLLRDNORM;
121 1 return PERL_constant_ISIV;
122 #else
123 return PERL_constant_NOTDEF;
124 #endif
125 }
126 1 ▶ if (memEQ(name, "EPOLLWRNORM", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EPOLLWRNORM", 11)) { 1 0 1
127 /* ^ */
128 #ifdef EPOLLWRNORM
129 1 *iv_return = EPOLLWRNORM;
130 1 return PERL_constant_ISIV;
131 #else
132 return PERL_constant_NOTDEF;
133 #endif
134 }
135 0 break;
136 }
137 0 return PERL_constant_NOTFOUND;
138 }
139  
140 static int
141 6 constant_13 (pTHX_ const char *name, IV *iv_return) {
142 /* When generated this function returned values for the list of names given
143 here. However, subsequent manual editing may have added or removed some.
144 EPOLL_CTL_ADD EPOLL_CTL_DEL EPOLL_CTL_MOD */
145 /* Offset 11 gives the best switch position. */
146 6 switch (name[11]) {
147 2 case 'D':
148 2 ▶ if (memEQ(name, "EPOLL_CTL_ADD", 13)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EPOLL_CTL_ADD", 13)) { 2 0 2
149 /* ^ */
150 #ifdef EPOLL_CTL_ADD
151 2 *iv_return = EPOLL_CTL_ADD;
152 2 return PERL_constant_ISIV;
153 #else
154 return PERL_constant_NOTDEF;
155 #endif
156 }
157 0 break;
158 2 case 'E':
159 2 ▶ if (memEQ(name, "EPOLL_CTL_DEL", 13)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EPOLL_CTL_DEL", 13)) { 2 0 2
160 /* ^ */
161 #ifdef EPOLL_CTL_DEL
162 2 *iv_return = EPOLL_CTL_DEL;
163 2 return PERL_constant_ISIV;
164 #else
165 return PERL_constant_NOTDEF;
166 #endif
167 }
168 0 break;
169 2 case 'O':
170 2 ▶ if (memEQ(name, "EPOLL_CTL_MOD", 13)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EPOLL_CTL_MOD", 13)) { 2 0 2
171 /* ^ */
172 #ifdef EPOLL_CTL_MOD
173 2 *iv_return = EPOLL_CTL_MOD;
174 2 return PERL_constant_ISIV;
175 #else
176 return PERL_constant_NOTDEF;
177 #endif
178 }
179 0 break;
180 }
181 0 return PERL_constant_NOTFOUND;
182 }
183  
184 static int
185 22 constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
186 /* Initially switch on the length of the name. */
187 /* When generated this function returned values for the list of names given
188 in this section of perl code. Rather than manually editing these functions
189 to add or remove constants, which would result in this comment and section
190 of code becoming inaccurate, we recommend that you edit this section of
191 code, and use it to regenerate a new set of constant functions which you
192 then use to replace the originals.
193  
194 Regenerate these constant functions by feeding this entire source file to
195 perl -x
196  
197 #!/usr/local/bin/perl -w
198 use ExtUtils::Constant qw (constant_types C_constant XS_constant);
199  
200 my $types = {map {($_, 1)} qw(IV)};
201 my @names = (qw(EPOLLERR EPOLLET EPOLLHUP EPOLLIN EPOLLMSG EPOLLOUT EPOLLPRI
202 EPOLLRDBAND EPOLLRDNORM EPOLLWRBAND EPOLLWRNORM EPOLL_CTL_ADD
203 EPOLL_CTL_DEL EPOLL_CTL_MOD));
204  
205 print constant_types(), "\n"; # macro defs
206 foreach (C_constant ("IO::Epoll", 'constant', 'IV', $types, undef, 3, @names) ) {
207 print $_, "\n"; # C constant subs
208 }
209 print "\n#### XS Section:\n";
210 print XS_constant ("IO::Epoll", $types);
211 __END__
« const-xs.inc ↑ Summary Epoll.xs »