-
Notifications
You must be signed in to change notification settings - Fork 2
/
const-c.inc
307 lines (296 loc) · 8.46 KB
/
const-c.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
#define PERL_constant_NOTFOUND 1
#define PERL_constant_NOTDEF 2
#define PERL_constant_ISIV 3
#define PERL_constant_ISNO 4
#define PERL_constant_ISNV 5
#define PERL_constant_ISPV 6
#define PERL_constant_ISPVN 7
#define PERL_constant_ISSV 8
#define PERL_constant_ISUNDEF 9
#define PERL_constant_ISUV 10
#define PERL_constant_ISYES 11
#ifndef NVTYPE
typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */
#endif
#ifndef aTHX_
#define aTHX_ /* 5.6 or later define this for threading support. */
#endif
#ifndef pTHX_
#define pTHX_ /* 5.6 or later define this for threading support. */
#endif
static int
constant_17 (pTHX_ const char *name, IV *iv_return) {
/* When generated this function returned values for the list of names given
here. However, subsequent manual editing may have added or removed some.
CEPH_OSD_TMAP_HDR CEPH_OSD_TMAP_SET LIBRADOS_SNAP_DIR */
/* Offset 15 gives the best switch position. */
switch (name[15]) {
case 'D':
if (memEQ(name, "CEPH_OSD_TMAP_HDR", 17)) {
/* ^ */
#ifdef CEPH_OSD_TMAP_HDR
*iv_return = CEPH_OSD_TMAP_HDR;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'E':
if (memEQ(name, "CEPH_OSD_TMAP_SET", 17)) {
/* ^ */
#ifdef CEPH_OSD_TMAP_SET
*iv_return = CEPH_OSD_TMAP_SET;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'I':
if (memEQ(name, "LIBRADOS_SNAP_DIR", 17)) {
/* ^ */
#ifdef LIBRADOS_SNAP_DIR
*iv_return = LIBRADOS_SNAP_DIR;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
return PERL_constant_NOTFOUND;
}
static int
constant_18 (pTHX_ const char *name, IV *iv_return) {
/* When generated this function returned values for the list of names given
here. However, subsequent manual editing may have added or removed some.
LIBRADOS_SNAP_HEAD LIBRADOS_VER_EXTRA LIBRADOS_VER_MAJOR
LIBRADOS_VER_MINOR */
/* Offset 15 gives the best switch position. */
switch (name[15]) {
case 'E':
if (memEQ(name, "LIBRADOS_SNAP_HEAD", 18)) {
/* ^ */
#ifdef LIBRADOS_SNAP_HEAD
*iv_return = LIBRADOS_SNAP_HEAD;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'J':
if (memEQ(name, "LIBRADOS_VER_MAJOR", 18)) {
/* ^ */
#ifdef LIBRADOS_VER_MAJOR
*iv_return = LIBRADOS_VER_MAJOR;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'N':
if (memEQ(name, "LIBRADOS_VER_MINOR", 18)) {
/* ^ */
#ifdef LIBRADOS_VER_MINOR
*iv_return = LIBRADOS_VER_MINOR;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'T':
if (memEQ(name, "LIBRADOS_VER_EXTRA", 18)) {
/* ^ */
#ifdef LIBRADOS_VER_EXTRA
*iv_return = LIBRADOS_VER_EXTRA;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
return PERL_constant_NOTFOUND;
}
static int
constant_26 (pTHX_ const char *name, IV *iv_return) {
/* When generated this function returned values for the list of names given
here. However, subsequent manual editing may have added or removed some.
LIBRADOS_CREATE_IDEMPOTENT LIBRADOS_SUPPORTS_GETADDRS
LIBRADOS_SUPPORTS_SERVICES */
/* Offset 23 gives the best switch position. */
switch (name[23]) {
case 'C':
if (memEQ(name, "LIBRADOS_SUPPORTS_SERVICES", 26)) {
/* ^ */
#ifdef LIBRADOS_SUPPORTS_SERVICES
*iv_return = LIBRADOS_SUPPORTS_SERVICES;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'D':
if (memEQ(name, "LIBRADOS_SUPPORTS_GETADDRS", 26)) {
/* ^ */
#ifdef LIBRADOS_SUPPORTS_GETADDRS
*iv_return = LIBRADOS_SUPPORTS_GETADDRS;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'E':
if (memEQ(name, "LIBRADOS_CREATE_IDEMPOTENT", 26)) {
/* ^ */
#ifdef LIBRADOS_CREATE_IDEMPOTENT
*iv_return = LIBRADOS_CREATE_IDEMPOTENT;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
return PERL_constant_NOTFOUND;
}
static int
constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
/* Initially switch on the length of the name. */
/* When generated this function returned values for the list of names given
in this section of perl code. Rather than manually editing these functions
to add or remove constants, which would result in this comment and section
of code becoming inaccurate, we recommend that you edit this section of
code, and use it to regenerate a new set of constant functions which you
then use to replace the originals.
Regenerate these constant functions by feeding this entire source file to
perl -x
#!/usr/bin/perl -w
use ExtUtils::Constant qw (constant_types C_constant XS_constant);
my $types = {map {($_, 1)} qw(IV)};
my @names = (qw(CEPH_OSD_TMAP_CREATE CEPH_OSD_TMAP_HDR CEPH_OSD_TMAP_RM
CEPH_OSD_TMAP_SET LIBRADOS_CREATE_EXCLUSIVE
LIBRADOS_CREATE_IDEMPOTENT LIBRADOS_LOCK_FLAG_MAY_RENEW
LIBRADOS_LOCK_FLAG_MUST_RENEW LIBRADOS_LOCK_FLAG_RENEW
LIBRADOS_SNAP_DIR LIBRADOS_SNAP_HEAD
LIBRADOS_SUPPORTS_APP_METADATA LIBRADOS_SUPPORTS_GETADDRS
LIBRADOS_SUPPORTS_SERVICES LIBRADOS_SUPPORTS_WATCH
LIBRADOS_VERSION_CODE LIBRADOS_VER_EXTRA LIBRADOS_VER_MAJOR
LIBRADOS_VER_MINOR));
print constant_types(), "\n"; # macro defs
foreach (C_constant ("Ceph::Rados", 'constant', 'IV', $types, undef, 3, @names) ) {
print $_, "\n"; # C constant subs
}
print "\n#### XS Section:\n";
print XS_constant ("Ceph::Rados", $types);
__END__
*/
switch (len) {
case 16:
if (memEQ(name, "CEPH_OSD_TMAP_RM", 16)) {
#ifdef CEPH_OSD_TMAP_RM
*iv_return = CEPH_OSD_TMAP_RM;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 17:
return constant_17 (aTHX_ name, iv_return);
break;
case 18:
return constant_18 (aTHX_ name, iv_return);
break;
case 20:
if (memEQ(name, "CEPH_OSD_TMAP_CREATE", 20)) {
#ifdef CEPH_OSD_TMAP_CREATE
*iv_return = CEPH_OSD_TMAP_CREATE;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 21:
if (memEQ(name, "LIBRADOS_VERSION_CODE", 21)) {
#ifdef LIBRADOS_VERSION_CODE
*iv_return = LIBRADOS_VERSION_CODE;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 23:
if (memEQ(name, "LIBRADOS_SUPPORTS_WATCH", 23)) {
#ifdef LIBRADOS_SUPPORTS_WATCH
*iv_return = LIBRADOS_SUPPORTS_WATCH;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 24:
if (memEQ(name, "LIBRADOS_LOCK_FLAG_RENEW", 24)) {
#ifdef LIBRADOS_LOCK_FLAG_RENEW
*iv_return = LIBRADOS_LOCK_FLAG_RENEW;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 25:
if (memEQ(name, "LIBRADOS_CREATE_EXCLUSIVE", 25)) {
#ifdef LIBRADOS_CREATE_EXCLUSIVE
*iv_return = LIBRADOS_CREATE_EXCLUSIVE;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 26:
return constant_26 (aTHX_ name, iv_return);
break;
case 28:
if (memEQ(name, "LIBRADOS_LOCK_FLAG_MAY_RENEW", 28)) {
#ifdef LIBRADOS_LOCK_FLAG_MAY_RENEW
*iv_return = LIBRADOS_LOCK_FLAG_MAY_RENEW;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 29:
if (memEQ(name, "LIBRADOS_LOCK_FLAG_MUST_RENEW", 29)) {
#ifdef LIBRADOS_LOCK_FLAG_MUST_RENEW
*iv_return = LIBRADOS_LOCK_FLAG_MUST_RENEW;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 30:
if (memEQ(name, "LIBRADOS_SUPPORTS_APP_METADATA", 30)) {
#ifdef LIBRADOS_SUPPORTS_APP_METADATA
*iv_return = LIBRADOS_SUPPORTS_APP_METADATA;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
return PERL_constant_NOTFOUND;
}