const-c-error.inc

filter: Statementstmt 75.6% 124 / 164 Branchbran 48.2% 27 / 56 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 68.6% 151 / 220 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« deps/libgit2/src/libgit2/iterator.c ↑ Summary deps/libgit2/src/libgit2/blame.c »
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 7 _error_constant_5 (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 EAUTH EBUFS EPEEL ERROR USAGE */
28 /* Offset 4 gives the best switch position. */
29 7 switch (name[4]) {
30 2 case 'E':
31 2 ▶ if (memEQ(name, "USAG", 4)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "USAG", 4)) { 2 0 2
32 /* E */
33 #ifdef USAGE
34 2 *iv_return = USAGE;
35 2 return PERL_constant_ISIV;
36 #else
37 return PERL_constant_NOTDEF;
38 #endif
39 }
40 0 break;
41 1 case 'H':
42 1 ▶ if (memEQ(name, "EAUT", 4)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EAUT", 4)) { 1 0 1
43 /* H */
44 #ifdef EAUTH
45 1 *iv_return = EAUTH;
46 1 return PERL_constant_ISIV;
47 #else
48 return PERL_constant_NOTDEF;
49 #endif
50 }
51 0 break;
52 1 case 'L':
53 1 ▶ if (memEQ(name, "EPEE", 4)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EPEE", 4)) { 1 0 1
54 /* L */
55 #ifdef EPEEL
56 1 *iv_return = EPEEL;
57 1 return PERL_constant_ISIV;
58 #else
59 return PERL_constant_NOTDEF;
60 #endif
61 }
62 0 break;
63 2 case 'R':
64 2 ▶ if (memEQ(name, "ERRO", 4)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "ERRO", 4)) { 2 0 2
65 /* R */
66 #ifdef ERROR
67 2 *iv_return = ERROR;
68 2 return PERL_constant_ISIV;
69 #else
70 return PERL_constant_NOTDEF;
71 #endif
72 }
73 0 break;
74 1 case 'S':
75 1 ▶ if (memEQ(name, "EBUF", 4)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EBUF", 4)) { 1 0 1
76 /* S */
77 #ifdef EBUFS
78 1 *iv_return = EBUFS;
79 1 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 2 _error_constant_7 (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 EEXISTS ELOCKED RESOLVE */
94 /* Offset 4 gives the best switch position. */
95 2 switch (name[4]) {
96 1 case 'K':
97 1 ▶ if (memEQ(name, "ELOCKED", 7)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "ELOCKED", 7)) { 1 0 1
98 /* ^ */
99 #ifdef ELOCKED
100 1 *iv_return = ELOCKED;
101 1 return PERL_constant_ISIV;
102 #else
103 return PERL_constant_NOTDEF;
104 #endif
105 }
106 0 break;
107 0 case 'L':
108 0 ▶ if (memEQ(name, "RESOLVE", 7)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "RESOLVE", 7)) { 0 0 0
109 /* ^ */
110 #ifdef RESOLVE
111 0 *iv_return = RESOLVE;
112 0 return PERL_constant_ISIV;
113 #else
114 return PERL_constant_NOTDEF;
115 #endif
116 }
117 0 break;
118 1 case 'S':
119 1 ▶ if (memEQ(name, "EEXISTS", 7)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EEXISTS", 7)) { 1 0 1
120 /* ^ */
121 #ifdef EEXISTS
122 1 *iv_return = EEXISTS;
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 _error_constant_9 (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 EBAREREPO ECONFLICT EMODIFIED ENOTFOUND EUNMERGED */
138 /* Offset 3 gives the best switch position. */
139 5 switch (name[3]) {
140 1 case 'D':
141 1 ▶ if (memEQ(name, "EMODIFIED", 9)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EMODIFIED", 9)) { 1 0 1
142 /* ^ */
143 #ifdef EMODIFIED
144 1 *iv_return = EMODIFIED;
145 1 return PERL_constant_ISIV;
146 #else
147 return PERL_constant_NOTDEF;
148 #endif
149 }
150 0 break;
151 1 case 'M':
152 1 ▶ if (memEQ(name, "EUNMERGED", 9)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EUNMERGED", 9)) { 1 0 1
153 /* ^ */
154 #ifdef EUNMERGED
155 1 *iv_return = EUNMERGED;
156 1 return PERL_constant_ISIV;
157 #else
158 return PERL_constant_NOTDEF;
159 #endif
160 }
161 0 break;
162 1 case 'N':
163 1 ▶ if (memEQ(name, "ECONFLICT", 9)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "ECONFLICT", 9)) { 1 0 1
164 /* ^ */
165 #ifdef ECONFLICT
166 1 *iv_return = ECONFLICT;
167 1 return PERL_constant_ISIV;
168 #else
169 return PERL_constant_NOTDEF;
170 #endif
171 }
172 0 break;
173 1 case 'R':
174 1 ▶ if (memEQ(name, "EBAREREPO", 9)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EBAREREPO", 9)) { 1 0 1
175 /* ^ */
176 #ifdef EBAREREPO
177 1 *iv_return = EBAREREPO;
178 1 return PERL_constant_ISIV;
179 #else
180 return PERL_constant_NOTDEF;
181 #endif
182 }
183 0 break;
184 1 case 'T':
185 1 ▶ if (memEQ(name, "ENOTFOUND", 9)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "ENOTFOUND", 9)) { 1 0 1
186 /* ^ */
187 #ifdef ENOTFOUND
188 1 *iv_return = ENOTFOUND;
189 1 return PERL_constant_ISIV;
190 #else
191 return PERL_constant_NOTDEF;
192 #endif
193 }
194 0 break;
195 }
196 0 return PERL_constant_NOTFOUND;
197 }
198  
199 static int
200 3 _error_constant_12 (pTHX_ const char *name, IV *iv_return) {
201 /* When generated this function returned values for the list of names given
202 here. However, subsequent manual editing may have added or removed some.
203 ECERTIFICATE EINVALIDSPEC EUNCOMMITTED */
204 /* Offset 11 gives the best switch position. */
205 3 switch (name[11]) {
206 1 case 'C':
207 1 ▶ if (memEQ(name, "EINVALIDSPE", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EINVALIDSPE", 11)) { 1 0 1
208 /* C */
209 #ifdef EINVALIDSPEC
210 1 *iv_return = EINVALIDSPEC;
211 1 return PERL_constant_ISIV;
212 #else
213 return PERL_constant_NOTDEF;
214 #endif
215 }
216 0 break;
217 1 case 'D':
218 1 ▶ if (memEQ(name, "EUNCOMMITTE", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "EUNCOMMITTE", 11)) { 1 0 1
219 /* D */
220 #ifdef EUNCOMMITTED
221 1 *iv_return = EUNCOMMITTED;
222 1 return PERL_constant_ISIV;
223 #else
224 return PERL_constant_NOTDEF;
225 #endif
226 }
227 0 break;
228 1 case 'E':
229 1 ▶ if (memEQ(name, "ECERTIFICAT", 11)) {
Branch: 1 branch
BranchTrueFalseTotal
if (memEQ(name, "ECERTIFICAT", 11)) { 1 0 1
230 /* E */
231 #ifdef ECERTIFICATE
232 1 *iv_return = ECERTIFICATE;
233 1 return PERL_constant_ISIV;
234 #else
235 return PERL_constant_NOTDEF;
236 #endif
237 }
238 0 break;
239 }
240 0 return PERL_constant_NOTFOUND;
241 }
242  
243 static int
244 30 _error_constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
245 /* Initially switch on the length of the name. */
246 /* When generated this function returned values for the list of names given
247 in this section of perl code. Rather than manually editing these functions
248 to add or remove constants, which would result in this comment and section
249 of code becoming inaccurate, we recommend that you edit this section of
250 code, and use it to regenerate a new set of constant functions which you
251 then use to replace the originals.
252  
253 Regenerate these constant functions by feeding this entire source file to
254 perl -x
255  
256 #!/usr/local/bin/perl -w
257 use ExtUtils::Constant qw (constant_types C_constant XS_constant);
258  
259 my $types = {map {($_, 1)} qw(IV)};
260 my @names = (qw(ASSERT EAMBIGUOUS EAPPLIED EAUTH EBAREREPO EBUFS ECERTIFICATE
261 ECONFLICT EDIRECTORY EEOF EEXISTS EINVALID EINVALIDSPEC ELOCKED
262 EMERGECONFLICT EMODIFIED ENONFASTFORWARD ENOTFOUND EPEEL ERROR
263 EUNBORNBRANCH EUNCOMMITTED EUNMERGED OK PASSTHROUGH RESOLVE
264 USAGE));
265  
266 print constant_types(), "\n"; # macro defs
267 foreach (C_constant ("Git::Raw::Error", '_error_constant', 'IV', $types, undef, 3, @names) ) {
268 print $_, "\n"; # C constant subs
269 }
270 print "\n#### XS Section:\n";
271 print XS_constant ("Git::Raw::Error", $types);
272 __END__
« deps/libgit2/src/libgit2/iterator.c ↑ Summary deps/libgit2/src/libgit2/blame.c »