const-c.inc

filter: Statementstmt 41.6% 10 / 24 Branchbran 28.5% 4 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 36.8% 14 / 38 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
↑ Summary Linux.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 void
24 36 constant_add_symbol(pTHX_ HV *hash, const char *name, I32 namelen, SV *value) {
25 36 HE *he = (HE*) hv_common_key_len(hash, name, namelen, HV_FETCH_LVALUE, NULL,
26 0);
27 SV *sv;
28  
29 36 ▶ if (!he) {
Branch: 1 branch
BranchTrueFalseTotal
if (!he) { 0 36 36
30 0 croak("Couldn't add key '%s' to %%Socket::Linux::",
31 name);
32 }
33 36 sv = HeVAL(he);
34 36 ▶ if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) {
Branch: 2 branches
BranchTrueFalseTotal
if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) { 36 0 36
if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) { 0 36 36
35 /* Someone has been here before us - have to make a real sub. */
36 0 newCONSTSUB(hash, name, value);
37 } else {
38 36 ▶ SvUPGRADE(sv, SVt_RV);
Branch: 1 branch
BranchTrueFalseTotal
SvUPGRADE(sv, SVt_RV); 36 0 36
39 36 SvRV_set(sv, value);
40 36 SvROK_on(sv);
41 36 SvREADONLY_on(value);
42 }
43 36 }
44  
45  
46  
47 #ifndef SYMBIAN
48  
49 /* Store a hash of all symbols missing from the package. To avoid trampling on
50 the package namespace (uninvited) put each package's hash in our namespace.
51 To avoid creating lots of typeblogs and symbol tables for sub-packages, put
52 each package's hash into one hash in our namespace. */
53  
54 static HV *
55 0 get_missing_hash(pTHX) {
56 HV *const parent
57 0 = get_hv("ExtUtils::Constant::ProxySubs::Missing", GVf_MULTI);
58 /* We could make a hash of hashes directly, but this would confuse anything
59 at Perl space that looks at us, and as we're visible in Perl space,
60 best to play nice. */
61 SV *const *const ref
62 0 = hv_fetch(parent, "Socket::Linux", 13, TRUE);
63 HV *new_hv;
64  
65 0 ▶ if (!ref)
Branch: 1 branch
BranchTrueFalseTotal
if (!ref) 0 0 0
66 0 return NULL;
67  
68 0 ▶ if (SvROK(*ref))
Branch: 1 branch
BranchTrueFalseTotal
if (SvROK(*ref)) 0 0 0
69 0 return (HV*) SvRV(*ref);
70  
71 0 new_hv = newHV();
72 0 ▶ SvUPGRADE(*ref, SVt_RV);
Branch: 1 branch
BranchTrueFalseTotal
SvUPGRADE(*ref, SVt_RV); 0 0 0
73 0 SvRV_set(*ref, (SV *)new_hv);
74 0 SvROK_on(*ref);
75 0 return new_hv;
76 }
77  
78 #endif
79  
80 struct notfound_s {const char *name; I32 namelen;} ;
81  
82 static const struct notfound_s values_for_notfound[] =
83 {
84 #ifndef TCP_NODELAY
85 { "TCP_NODELAY", 11 },
86 #endif
87 #ifndef TCP_MAXSEG
88 { "TCP_MAXSEG", 10 },
89 #endif
90 #ifndef TCP_CORK
91 { "TCP_CORK", 8 },
92 #endif
93 #ifndef TCP_KEEPIDLE
94 { "TCP_KEEPIDLE", 12 },
95 #endif
96 #ifndef TCP_KEEPINTVL
97 { "TCP_KEEPINTVL", 13 },
98 #endif
99 #ifndef TCP_KEEPCNT
100 { "TCP_KEEPCNT", 11 },
101 #endif
102 #ifndef TCP_SYNCNT
103 { "TCP_SYNCNT", 10 },
104 #endif
105 #ifndef TCP_LINGER2
106 { "TCP_LINGER2", 11 },
107 #endif
108 #ifndef TCP_DEFER_ACCEPT
109 { "TCP_DEFER_ACCEPT", 16 },
110 #endif
111 #ifndef TCP_WINDOW_CLAMP
112 { "TCP_WINDOW_CLAMP", 16 },
113 #endif
114 #ifndef TCP_INFO
115 { "TCP_INFO", 8 },
116 #endif
117 #ifndef TCP_QUICKACK
118 { "TCP_QUICKACK", 12 },
119 #endif
120 #ifndef TCP_CONGESTION
121 { "TCP_CONGESTION", 14 },
122 #endif
123 #ifndef TCP_MD5SIG
124 { "TCP_MD5SIG", 10 },
125 #endif
126 #ifndef TCPOPT_EOL
127 { "TCPOPT_EOL", 10 },
128 #endif
129 #ifndef TCPOPT_NOP
130 { "TCPOPT_NOP", 10 },
131 #endif
132 #ifndef TCPOPT_MAXSEG
133 { "TCPOPT_MAXSEG", 13 },
134 #endif
135 #ifndef TCPOLEN_MAXSEG
136 { "TCPOLEN_MAXSEG", 14 },
137 #endif
138 #ifndef TCPOPT_WINDOW
139 { "TCPOPT_WINDOW", 13 },
140 #endif
141 #ifndef TCPOLEN_WINDOW
142 { "TCPOLEN_WINDOW", 14 },
143 #endif
144 #ifndef TCPOPT_SACK_PERMITTED
145 { "TCPOPT_SACK_PERMITTED", 21 },
146 #endif
147 #ifndef TCPOLEN_SACK_PERMITTED
148 { "TCPOLEN_SACK_PERMITTED", 22 },
149 #endif
150 #ifndef TCPOPT_SACK
151 { "TCPOPT_SACK", 11 },
152 #endif
153 #ifndef TCPOPT_TIMESTAMP
154 { "TCPOPT_TIMESTAMP", 16 },
155 #endif
156 #ifndef TCPOLEN_TIMESTAMP
157 { "TCPOLEN_TIMESTAMP", 17 },
158 #endif
159 #ifndef TCPOLEN_TSTAMP_APPA
160 { "TCPOLEN_TSTAMP_APPA", 19 },
161 #endif
162 #ifndef TCPOPT_TSTAMP_HDR
163 { "TCPOPT_TSTAMP_HDR", 17 },
164 #endif
165 #ifndef TCP_MSS
166 { "TCP_MSS", 7 },
167 #endif
168 #ifndef TCP_MAXWIN
169 { "TCP_MAXWIN", 10 },
170 #endif
171 #ifndef TCP_MAX_WINSHIFT
172 { "TCP_MAX_WINSHIFT", 16 },
173 #endif
174 #ifndef SOL_TCP
175 { "SOL_TCP", 7 },
176 #endif
177 #ifndef TCPI_OPT_TIMESTAMPS
178 { "TCPI_OPT_TIMESTAMPS", 19 },
179 #endif
180 #ifndef TCPI_OPT_SACK
181 { "TCPI_OPT_SACK", 13 },
182 #endif
183 #ifndef TCPI_OPT_WSCALE
184 { "TCPI_OPT_WSCALE", 15 },
185 #endif
186 #ifndef TCPI_OPT_ECN
187 { "TCPI_OPT_ECN", 12 },
188 #endif
189 #ifndef TCP_MD5SIG_MAXKEYLEN
190 { "TCP_MD5SIG_MAXKEYLEN", 20 },
191 #endif
192 { NULL, 0 } };
193 struct iv_s {const char *name; I32 namelen; IV value;};
↑ Summary Linux.c »