Commit | Line | Data |
---|---|---|
8f85282b MHM |
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 | 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 | IPC_M IPC_R IPC_W MSG_R MSG_W SEM_A SEM_R SHM_A SHM_R SHM_W */ | |
28 | /* Offset 1 gives the best switch position. */ | |
29 | switch (name[1]) { | |
30 | case 'E': | |
31 | if (memEQ(name, "SEM_A", 5)) { | |
32 | /* ^ */ | |
33 | #ifdef SEM_A | |
34 | *iv_return = SEM_A; | |
35 | return PERL_constant_ISIV; | |
36 | #else | |
37 | return PERL_constant_NOTDEF; | |
38 | #endif | |
39 | } | |
40 | if (memEQ(name, "SEM_R", 5)) { | |
41 | /* ^ */ | |
42 | #ifdef SEM_R | |
43 | *iv_return = SEM_R; | |
44 | return PERL_constant_ISIV; | |
45 | #else | |
46 | return PERL_constant_NOTDEF; | |
47 | #endif | |
48 | } | |
49 | break; | |
50 | case 'H': | |
51 | if (memEQ(name, "SHM_A", 5)) { | |
52 | /* ^ */ | |
53 | #ifdef SHM_A | |
54 | *iv_return = SHM_A; | |
55 | return PERL_constant_ISIV; | |
56 | #else | |
57 | return PERL_constant_NOTDEF; | |
58 | #endif | |
59 | } | |
60 | if (memEQ(name, "SHM_R", 5)) { | |
61 | /* ^ */ | |
62 | #ifdef SHM_R | |
63 | *iv_return = SHM_R; | |
64 | return PERL_constant_ISIV; | |
65 | #else | |
66 | return PERL_constant_NOTDEF; | |
67 | #endif | |
68 | } | |
69 | if (memEQ(name, "SHM_W", 5)) { | |
70 | /* ^ */ | |
71 | #ifdef SHM_W | |
72 | *iv_return = SHM_W; | |
73 | return PERL_constant_ISIV; | |
74 | #else | |
75 | return PERL_constant_NOTDEF; | |
76 | #endif | |
77 | } | |
78 | break; | |
79 | case 'P': | |
80 | if (memEQ(name, "IPC_M", 5)) { | |
81 | /* ^ */ | |
82 | #ifdef IPC_M | |
83 | *iv_return = IPC_M; | |
84 | return PERL_constant_ISIV; | |
85 | #else | |
86 | return PERL_constant_NOTDEF; | |
87 | #endif | |
88 | } | |
89 | if (memEQ(name, "IPC_R", 5)) { | |
90 | /* ^ */ | |
91 | #ifdef IPC_R | |
92 | *iv_return = IPC_R; | |
93 | return PERL_constant_ISIV; | |
94 | #else | |
95 | return PERL_constant_NOTDEF; | |
96 | #endif | |
97 | } | |
98 | if (memEQ(name, "IPC_W", 5)) { | |
99 | /* ^ */ | |
100 | #ifdef IPC_W | |
101 | *iv_return = IPC_W; | |
102 | return PERL_constant_ISIV; | |
103 | #else | |
104 | return PERL_constant_NOTDEF; | |
105 | #endif | |
106 | } | |
107 | break; | |
108 | case 'S': | |
109 | if (memEQ(name, "MSG_R", 5)) { | |
110 | /* ^ */ | |
111 | #ifdef MSG_R | |
112 | *iv_return = MSG_R; | |
113 | return PERL_constant_ISIV; | |
114 | #else | |
115 | return PERL_constant_NOTDEF; | |
116 | #endif | |
117 | } | |
118 | if (memEQ(name, "MSG_W", 5)) { | |
119 | /* ^ */ | |
120 | #ifdef MSG_W | |
121 | *iv_return = MSG_W; | |
122 | return PERL_constant_ISIV; | |
123 | #else | |
124 | return PERL_constant_NOTDEF; | |
125 | #endif | |
126 | } | |
127 | break; | |
128 | } | |
129 | return PERL_constant_NOTFOUND; | |
130 | } | |
131 | ||
132 | static int | |
133 | constant_6 (pTHX_ const char *name, IV *iv_return) { | |
134 | /* When generated this function returned values for the list of names given | |
135 | here. However, subsequent manual editing may have added or removed some. | |
136 | ENOSPC ENOSYS GETALL GETPID GETVAL SETALL SETVAL SHMLBA */ | |
137 | /* Offset 4 gives the best switch position. */ | |
138 | switch (name[4]) { | |
139 | case 'A': | |
140 | if (memEQ(name, "GETVAL", 6)) { | |
141 | /* ^ */ | |
142 | #ifdef GETVAL | |
143 | *iv_return = GETVAL; | |
144 | return PERL_constant_ISIV; | |
145 | #else | |
146 | return PERL_constant_NOTDEF; | |
147 | #endif | |
148 | } | |
149 | if (memEQ(name, "SETVAL", 6)) { | |
150 | /* ^ */ | |
151 | #ifdef SETVAL | |
152 | *iv_return = SETVAL; | |
153 | return PERL_constant_ISIV; | |
154 | #else | |
155 | return PERL_constant_NOTDEF; | |
156 | #endif | |
157 | } | |
158 | break; | |
159 | case 'B': | |
160 | if (memEQ(name, "SHMLBA", 6)) { | |
161 | /* ^ */ | |
162 | #ifdef SHMLBA | |
163 | *iv_return = SHMLBA; | |
164 | return PERL_constant_ISIV; | |
165 | #else | |
166 | return PERL_constant_NOTDEF; | |
167 | #endif | |
168 | } | |
169 | break; | |
170 | case 'I': | |
171 | if (memEQ(name, "GETPID", 6)) { | |
172 | /* ^ */ | |
173 | #ifdef GETPID | |
174 | *iv_return = GETPID; | |
175 | return PERL_constant_ISIV; | |
176 | #else | |
177 | return PERL_constant_NOTDEF; | |
178 | #endif | |
179 | } | |
180 | break; | |
181 | case 'L': | |
182 | if (memEQ(name, "GETALL", 6)) { | |
183 | /* ^ */ | |
184 | #ifdef GETALL | |
185 | *iv_return = GETALL; | |
186 | return PERL_constant_ISIV; | |
187 | #else | |
188 | return PERL_constant_NOTDEF; | |
189 | #endif | |
190 | } | |
191 | if (memEQ(name, "SETALL", 6)) { | |
192 | /* ^ */ | |
193 | #ifdef SETALL | |
194 | *iv_return = SETALL; | |
195 | return PERL_constant_ISIV; | |
196 | #else | |
197 | return PERL_constant_NOTDEF; | |
198 | #endif | |
199 | } | |
200 | break; | |
201 | case 'P': | |
202 | if (memEQ(name, "ENOSPC", 6)) { | |
203 | /* ^ */ | |
204 | #ifdef ENOSPC | |
205 | *iv_return = ENOSPC; | |
206 | return PERL_constant_ISIV; | |
207 | #else | |
208 | return PERL_constant_NOTDEF; | |
209 | #endif | |
210 | } | |
211 | break; | |
212 | case 'Y': | |
213 | if (memEQ(name, "ENOSYS", 6)) { | |
214 | /* ^ */ | |
215 | #ifdef ENOSYS | |
216 | *iv_return = ENOSYS; | |
217 | return PERL_constant_ISIV; | |
218 | #else | |
219 | return PERL_constant_NOTDEF; | |
220 | #endif | |
221 | } | |
222 | break; | |
223 | } | |
224 | return PERL_constant_NOTFOUND; | |
225 | } | |
226 | ||
227 | static int | |
228 | constant_7 (pTHX_ const char *name, IV *iv_return) { | |
229 | /* When generated this function returned values for the list of names given | |
230 | here. However, subsequent manual editing may have added or removed some. | |
231 | GETNCNT GETZCNT IPC_SET SEM_ERR SHM_MAP SHM_RND S_IRGRP S_IROTH S_IRUSR | |
232 | S_IRWXG S_IRWXO S_IRWXU S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR */ | |
233 | /* Offset 4 gives the best switch position. */ | |
234 | switch (name[4]) { | |
235 | case 'C': | |
236 | if (memEQ(name, "GETNCNT", 7)) { | |
237 | /* ^ */ | |
238 | #ifdef GETNCNT | |
239 | *iv_return = GETNCNT; | |
240 | return PERL_constant_ISIV; | |
241 | #else | |
242 | return PERL_constant_NOTDEF; | |
243 | #endif | |
244 | } | |
245 | if (memEQ(name, "GETZCNT", 7)) { | |
246 | /* ^ */ | |
247 | #ifdef GETZCNT | |
248 | *iv_return = GETZCNT; | |
249 | return PERL_constant_ISIV; | |
250 | #else | |
251 | return PERL_constant_NOTDEF; | |
252 | #endif | |
253 | } | |
254 | break; | |
255 | case 'E': | |
256 | if (memEQ(name, "SEM_ERR", 7)) { | |
257 | /* ^ */ | |
258 | #ifdef SEM_ERR | |
259 | *iv_return = SEM_ERR; | |
260 | return PERL_constant_ISIV; | |
261 | #else | |
262 | return PERL_constant_NOTDEF; | |
263 | #endif | |
264 | } | |
265 | break; | |
266 | case 'G': | |
267 | if (memEQ(name, "S_IRGRP", 7)) { | |
268 | /* ^ */ | |
269 | #ifdef S_IRGRP | |
270 | *iv_return = S_IRGRP; | |
271 | return PERL_constant_ISIV; | |
272 | #else | |
273 | return PERL_constant_NOTDEF; | |
274 | #endif | |
275 | } | |
276 | if (memEQ(name, "S_IWGRP", 7)) { | |
277 | /* ^ */ | |
278 | #ifdef S_IWGRP | |
279 | *iv_return = S_IWGRP; | |
280 | return PERL_constant_ISIV; | |
281 | #else | |
282 | return PERL_constant_NOTDEF; | |
283 | #endif | |
284 | } | |
285 | if (memEQ(name, "S_IXGRP", 7)) { | |
286 | /* ^ */ | |
287 | #ifdef S_IXGRP | |
288 | *iv_return = S_IXGRP; | |
289 | return PERL_constant_ISIV; | |
290 | #else | |
291 | return PERL_constant_NOTDEF; | |
292 | #endif | |
293 | } | |
294 | break; | |
295 | case 'M': | |
296 | if (memEQ(name, "SHM_MAP", 7)) { | |
297 | /* ^ */ | |
298 | #ifdef SHM_MAP | |
299 | *iv_return = SHM_MAP; | |
300 | return PERL_constant_ISIV; | |
301 | #else | |
302 | return PERL_constant_NOTDEF; | |
303 | #endif | |
304 | } | |
305 | break; | |
306 | case 'O': | |
307 | if (memEQ(name, "S_IROTH", 7)) { | |
308 | /* ^ */ | |
309 | #ifdef S_IROTH | |
310 | *iv_return = S_IROTH; | |
311 | return PERL_constant_ISIV; | |
312 | #else | |
313 | return PERL_constant_NOTDEF; | |
314 | #endif | |
315 | } | |
316 | if (memEQ(name, "S_IWOTH", 7)) { | |
317 | /* ^ */ | |
318 | #ifdef S_IWOTH | |
319 | *iv_return = S_IWOTH; | |
320 | return PERL_constant_ISIV; | |
321 | #else | |
322 | return PERL_constant_NOTDEF; | |
323 | #endif | |
324 | } | |
325 | if (memEQ(name, "S_IXOTH", 7)) { | |
326 | /* ^ */ | |
327 | #ifdef S_IXOTH | |
328 | *iv_return = S_IXOTH; | |
329 | return PERL_constant_ISIV; | |
330 | #else | |
331 | return PERL_constant_NOTDEF; | |
332 | #endif | |
333 | } | |
334 | break; | |
335 | case 'R': | |
336 | if (memEQ(name, "SHM_RND", 7)) { | |
337 | /* ^ */ | |
338 | #ifdef SHM_RND | |
339 | *iv_return = SHM_RND; | |
340 | return PERL_constant_ISIV; | |
341 | #else | |
342 | return PERL_constant_NOTDEF; | |
343 | #endif | |
344 | } | |
345 | break; | |
346 | case 'S': | |
347 | if (memEQ(name, "IPC_SET", 7)) { | |
348 | /* ^ */ | |
349 | #ifdef IPC_SET | |
350 | *iv_return = IPC_SET; | |
351 | return PERL_constant_ISIV; | |
352 | #else | |
353 | return PERL_constant_NOTDEF; | |
354 | #endif | |
355 | } | |
356 | break; | |
357 | case 'U': | |
358 | if (memEQ(name, "S_IRUSR", 7)) { | |
359 | /* ^ */ | |
360 | #ifdef S_IRUSR | |
361 | *iv_return = S_IRUSR; | |
362 | return PERL_constant_ISIV; | |
363 | #else | |
364 | return PERL_constant_NOTDEF; | |
365 | #endif | |
366 | } | |
367 | if (memEQ(name, "S_IWUSR", 7)) { | |
368 | /* ^ */ | |
369 | #ifdef S_IWUSR | |
370 | *iv_return = S_IWUSR; | |
371 | return PERL_constant_ISIV; | |
372 | #else | |
373 | return PERL_constant_NOTDEF; | |
374 | #endif | |
375 | } | |
376 | if (memEQ(name, "S_IXUSR", 7)) { | |
377 | /* ^ */ | |
378 | #ifdef S_IXUSR | |
379 | *iv_return = S_IXUSR; | |
380 | return PERL_constant_ISIV; | |
381 | #else | |
382 | return PERL_constant_NOTDEF; | |
383 | #endif | |
384 | } | |
385 | break; | |
386 | case 'W': | |
387 | if (memEQ(name, "S_IRWXG", 7)) { | |
388 | /* ^ */ | |
389 | #ifdef S_IRWXG | |
390 | *iv_return = S_IRWXG; | |
391 | return PERL_constant_ISIV; | |
392 | #else | |
393 | return PERL_constant_NOTDEF; | |
394 | #endif | |
395 | } | |
396 | if (memEQ(name, "S_IRWXO", 7)) { | |
397 | /* ^ */ | |
398 | #ifdef S_IRWXO | |
399 | *iv_return = S_IRWXO; | |
400 | return PERL_constant_ISIV; | |
401 | #else | |
402 | return PERL_constant_NOTDEF; | |
403 | #endif | |
404 | } | |
405 | if (memEQ(name, "S_IRWXU", 7)) { | |
406 | /* ^ */ | |
407 | #ifdef S_IRWXU | |
408 | *iv_return = S_IRWXU; | |
409 | return PERL_constant_ISIV; | |
410 | #else | |
411 | return PERL_constant_NOTDEF; | |
412 | #endif | |
413 | } | |
414 | break; | |
415 | } | |
416 | return PERL_constant_NOTFOUND; | |
417 | } | |
418 | ||
419 | static int | |
420 | constant_8 (pTHX_ const char *name, IV *iv_return) { | |
421 | /* When generated this function returned values for the list of names given | |
422 | here. However, subsequent manual editing may have added or removed some. | |
423 | IPC_EXCL IPC_INFO IPC_RMID IPC_STAT MSG_INFO MSG_STAT MSG_WAIT SEM_DEST | |
424 | SEM_INFO SEM_STAT SEM_UNDO SHM_COPY SHM_DEST SHM_FMAP SHM_INFO SHM_INIT | |
425 | SHM_LOCK SHM_SIZE SHM_STAT */ | |
426 | /* Offset 4 gives the best switch position. */ | |
427 | switch (name[4]) { | |
428 | case 'C': | |
429 | if (memEQ(name, "SHM_COPY", 8)) { | |
430 | /* ^ */ | |
431 | #ifdef SHM_COPY | |
432 | *iv_return = SHM_COPY; | |
433 | return PERL_constant_ISIV; | |
434 | #else | |
435 | return PERL_constant_NOTDEF; | |
436 | #endif | |
437 | } | |
438 | break; | |
439 | case 'D': | |
440 | if (memEQ(name, "SEM_DEST", 8)) { | |
441 | /* ^ */ | |
442 | #ifdef SEM_DEST | |
443 | *iv_return = SEM_DEST; | |
444 | return PERL_constant_ISIV; | |
445 | #else | |
446 | return PERL_constant_NOTDEF; | |
447 | #endif | |
448 | } | |
449 | if (memEQ(name, "SHM_DEST", 8)) { | |
450 | /* ^ */ | |
451 | #ifdef SHM_DEST | |
452 | *iv_return = SHM_DEST; | |
453 | return PERL_constant_ISIV; | |
454 | #else | |
455 | return PERL_constant_NOTDEF; | |
456 | #endif | |
457 | } | |
458 | break; | |
459 | case 'E': | |
460 | if (memEQ(name, "IPC_EXCL", 8)) { | |
461 | /* ^ */ | |
462 | #ifdef IPC_EXCL | |
463 | *iv_return = IPC_EXCL; | |
464 | return PERL_constant_ISIV; | |
465 | #else | |
466 | return PERL_constant_NOTDEF; | |
467 | #endif | |
468 | } | |
469 | break; | |
470 | case 'F': | |
471 | if (memEQ(name, "SHM_FMAP", 8)) { | |
472 | /* ^ */ | |
473 | #ifdef SHM_FMAP | |
474 | *iv_return = SHM_FMAP; | |
475 | return PERL_constant_ISIV; | |
476 | #else | |
477 | return PERL_constant_NOTDEF; | |
478 | #endif | |
479 | } | |
480 | break; | |
481 | case 'I': | |
482 | if (memEQ(name, "IPC_INFO", 8)) { | |
483 | /* ^ */ | |
484 | #ifdef IPC_INFO | |
485 | *iv_return = IPC_INFO; | |
486 | return PERL_constant_ISIV; | |
487 | #else | |
488 | return PERL_constant_NOTDEF; | |
489 | #endif | |
490 | } | |
491 | if (memEQ(name, "MSG_INFO", 8)) { | |
492 | /* ^ */ | |
493 | #ifdef MSG_INFO | |
494 | *iv_return = MSG_INFO; | |
495 | return PERL_constant_ISIV; | |
496 | #else | |
497 | return PERL_constant_NOTDEF; | |
498 | #endif | |
499 | } | |
500 | if (memEQ(name, "SEM_INFO", 8)) { | |
501 | /* ^ */ | |
502 | #ifdef SEM_INFO | |
503 | *iv_return = SEM_INFO; | |
504 | return PERL_constant_ISIV; | |
505 | #else | |
506 | return PERL_constant_NOTDEF; | |
507 | #endif | |
508 | } | |
509 | if (memEQ(name, "SHM_INFO", 8)) { | |
510 | /* ^ */ | |
511 | #ifdef SHM_INFO | |
512 | *iv_return = SHM_INFO; | |
513 | return PERL_constant_ISIV; | |
514 | #else | |
515 | return PERL_constant_NOTDEF; | |
516 | #endif | |
517 | } | |
518 | if (memEQ(name, "SHM_INIT", 8)) { | |
519 | /* ^ */ | |
520 | #ifdef SHM_INIT | |
521 | *iv_return = SHM_INIT; | |
522 | return PERL_constant_ISIV; | |
523 | #else | |
524 | return PERL_constant_NOTDEF; | |
525 | #endif | |
526 | } | |
527 | break; | |
528 | case 'L': | |
529 | if (memEQ(name, "SHM_LOCK", 8)) { | |
530 | /* ^ */ | |
531 | #ifdef SHM_LOCK | |
532 | *iv_return = SHM_LOCK; | |
533 | return PERL_constant_ISIV; | |
534 | #else | |
535 | return PERL_constant_NOTDEF; | |
536 | #endif | |
537 | } | |
538 | break; | |
539 | case 'R': | |
540 | if (memEQ(name, "IPC_RMID", 8)) { | |
541 | /* ^ */ | |
542 | #ifdef IPC_RMID | |
543 | *iv_return = IPC_RMID; | |
544 | return PERL_constant_ISIV; | |
545 | #else | |
546 | return PERL_constant_NOTDEF; | |
547 | #endif | |
548 | } | |
549 | break; | |
550 | case 'S': | |
551 | if (memEQ(name, "IPC_STAT", 8)) { | |
552 | /* ^ */ | |
553 | #ifdef IPC_STAT | |
554 | *iv_return = IPC_STAT; | |
555 | return PERL_constant_ISIV; | |
556 | #else | |
557 | return PERL_constant_NOTDEF; | |
558 | #endif | |
559 | } | |
560 | if (memEQ(name, "MSG_STAT", 8)) { | |
561 | /* ^ */ | |
562 | #ifdef MSG_STAT | |
563 | *iv_return = MSG_STAT; | |
564 | return PERL_constant_ISIV; | |
565 | #else | |
566 | return PERL_constant_NOTDEF; | |
567 | #endif | |
568 | } | |
569 | if (memEQ(name, "SEM_STAT", 8)) { | |
570 | /* ^ */ | |
571 | #ifdef SEM_STAT | |
572 | *iv_return = SEM_STAT; | |
573 | return PERL_constant_ISIV; | |
574 | #else | |
575 | return PERL_constant_NOTDEF; | |
576 | #endif | |
577 | } | |
578 | if (memEQ(name, "SHM_SIZE", 8)) { | |
579 | /* ^ */ | |
580 | #ifdef SHM_SIZE | |
581 | *iv_return = SHM_SIZE; | |
582 | return PERL_constant_ISIV; | |
583 | #else | |
584 | return PERL_constant_NOTDEF; | |
585 | #endif | |
586 | } | |
587 | if (memEQ(name, "SHM_STAT", 8)) { | |
588 | /* ^ */ | |
589 | #ifdef SHM_STAT | |
590 | *iv_return = SHM_STAT; | |
591 | return PERL_constant_ISIV; | |
592 | #else | |
593 | return PERL_constant_NOTDEF; | |
594 | #endif | |
595 | } | |
596 | break; | |
597 | case 'U': | |
598 | if (memEQ(name, "SEM_UNDO", 8)) { | |
599 | /* ^ */ | |
600 | #ifdef SEM_UNDO | |
601 | *iv_return = SEM_UNDO; | |
602 | return PERL_constant_ISIV; | |
603 | #else | |
604 | return PERL_constant_NOTDEF; | |
605 | #endif | |
606 | } | |
607 | break; | |
608 | case 'W': | |
609 | if (memEQ(name, "MSG_WAIT", 8)) { | |
610 | /* ^ */ | |
611 | #ifdef MSG_WAIT | |
612 | *iv_return = MSG_WAIT; | |
613 | return PERL_constant_ISIV; | |
614 | #else | |
615 | return PERL_constant_NOTDEF; | |
616 | #endif | |
617 | } | |
618 | break; | |
619 | } | |
620 | return PERL_constant_NOTFOUND; | |
621 | } | |
622 | ||
623 | static int | |
624 | constant_9 (pTHX_ const char *name, IV *iv_return) { | |
625 | /* When generated this function returned values for the list of names given | |
626 | here. However, subsequent manual editing may have added or removed some. | |
627 | IPC_ALLOC IPC_CREAT MSG_FWAIT MSG_MWAIT MSG_QWAIT MSG_RWAIT MSG_WWAIT | |
628 | SEM_ALLOC SEM_ORDER SHM_CLEAR SHM_REMAP */ | |
629 | /* Offset 4 gives the best switch position. */ | |
630 | switch (name[4]) { | |
631 | case 'A': | |
632 | if (memEQ(name, "IPC_ALLOC", 9)) { | |
633 | /* ^ */ | |
634 | #ifdef IPC_ALLOC | |
635 | *iv_return = IPC_ALLOC; | |
636 | return PERL_constant_ISIV; | |
637 | #else | |
638 | return PERL_constant_NOTDEF; | |
639 | #endif | |
640 | } | |
641 | if (memEQ(name, "SEM_ALLOC", 9)) { | |
642 | /* ^ */ | |
643 | #ifdef SEM_ALLOC | |
644 | *iv_return = SEM_ALLOC; | |
645 | return PERL_constant_ISIV; | |
646 | #else | |
647 | return PERL_constant_NOTDEF; | |
648 | #endif | |
649 | } | |
650 | break; | |
651 | case 'C': | |
652 | if (memEQ(name, "IPC_CREAT", 9)) { | |
653 | /* ^ */ | |
654 | #ifdef IPC_CREAT | |
655 | *iv_return = IPC_CREAT; | |
656 | return PERL_constant_ISIV; | |
657 | #else | |
658 | return PERL_constant_NOTDEF; | |
659 | #endif | |
660 | } | |
661 | if (memEQ(name, "SHM_CLEAR", 9)) { | |
662 | /* ^ */ | |
663 | #ifdef SHM_CLEAR | |
664 | *iv_return = SHM_CLEAR; | |
665 | return PERL_constant_ISIV; | |
666 | #else | |
667 | return PERL_constant_NOTDEF; | |
668 | #endif | |
669 | } | |
670 | break; | |
671 | case 'F': | |
672 | if (memEQ(name, "MSG_FWAIT", 9)) { | |
673 | /* ^ */ | |
674 | #ifdef MSG_FWAIT | |
675 | *iv_return = MSG_FWAIT; | |
676 | return PERL_constant_ISIV; | |
677 | #else | |
678 | return PERL_constant_NOTDEF; | |
679 | #endif | |
680 | } | |
681 | break; | |
682 | case 'M': | |
683 | if (memEQ(name, "MSG_MWAIT", 9)) { | |
684 | /* ^ */ | |
685 | #ifdef MSG_MWAIT | |
686 | *iv_return = MSG_MWAIT; | |
687 | return PERL_constant_ISIV; | |
688 | #else | |
689 | return PERL_constant_NOTDEF; | |
690 | #endif | |
691 | } | |
692 | break; | |
693 | case 'O': | |
694 | if (memEQ(name, "SEM_ORDER", 9)) { | |
695 | /* ^ */ | |
696 | #ifdef SEM_ORDER | |
697 | *iv_return = SEM_ORDER; | |
698 | return PERL_constant_ISIV; | |
699 | #else | |
700 | return PERL_constant_NOTDEF; | |
701 | #endif | |
702 | } | |
703 | break; | |
704 | case 'Q': | |
705 | if (memEQ(name, "MSG_QWAIT", 9)) { | |
706 | /* ^ */ | |
707 | #ifdef MSG_QWAIT | |
708 | *iv_return = MSG_QWAIT; | |
709 | return PERL_constant_ISIV; | |
710 | #else | |
711 | return PERL_constant_NOTDEF; | |
712 | #endif | |
713 | } | |
714 | break; | |
715 | case 'R': | |
716 | if (memEQ(name, "MSG_RWAIT", 9)) { | |
717 | /* ^ */ | |
718 | #ifdef MSG_RWAIT | |
719 | *iv_return = MSG_RWAIT; | |
720 | return PERL_constant_ISIV; | |
721 | #else | |
722 | return PERL_constant_NOTDEF; | |
723 | #endif | |
724 | } | |
725 | if (memEQ(name, "SHM_REMAP", 9)) { | |
726 | /* ^ */ | |
727 | #ifdef SHM_REMAP | |
728 | *iv_return = SHM_REMAP; | |
729 | return PERL_constant_ISIV; | |
730 | #else | |
731 | return PERL_constant_NOTDEF; | |
732 | #endif | |
733 | } | |
734 | break; | |
735 | case 'W': | |
736 | if (memEQ(name, "MSG_WWAIT", 9)) { | |
737 | /* ^ */ | |
738 | #ifdef MSG_WWAIT | |
739 | *iv_return = MSG_WWAIT; | |
740 | return PERL_constant_ISIV; | |
741 | #else | |
742 | return PERL_constant_NOTDEF; | |
743 | #endif | |
744 | } | |
745 | break; | |
746 | } | |
747 | return PERL_constant_NOTFOUND; | |
748 | } | |
749 | ||
750 | static int | |
751 | constant_10 (pTHX_ const char *name, IV *iv_return) { | |
752 | /* When generated this function returned values for the list of names given | |
753 | here. However, subsequent manual editing may have added or removed some. | |
754 | IPC_GETACL IPC_LOCKED IPC_NOWAIT IPC_SETACL IPC_WANTED MSG_EXCEPT | |
755 | MSG_LOCKED SHM_DCACHE SHM_ECACHE SHM_ICACHE SHM_LOCKED SHM_NOSWAP | |
756 | SHM_RDONLY SHM_SHATTR SHM_UNLOCK */ | |
757 | /* Offset 4 gives the best switch position. */ | |
758 | switch (name[4]) { | |
759 | case 'D': | |
760 | if (memEQ(name, "SHM_DCACHE", 10)) { | |
761 | /* ^ */ | |
762 | #ifdef SHM_DCACHE | |
763 | *iv_return = SHM_DCACHE; | |
764 | return PERL_constant_ISIV; | |
765 | #else | |
766 | return PERL_constant_NOTDEF; | |
767 | #endif | |
768 | } | |
769 | break; | |
770 | case 'E': | |
771 | if (memEQ(name, "MSG_EXCEPT", 10)) { | |
772 | /* ^ */ | |
773 | #ifdef MSG_EXCEPT | |
774 | *iv_return = MSG_EXCEPT; | |
775 | return PERL_constant_ISIV; | |
776 | #else | |
777 | return PERL_constant_NOTDEF; | |
778 | #endif | |
779 | } | |
780 | if (memEQ(name, "SHM_ECACHE", 10)) { | |
781 | /* ^ */ | |
782 | #ifdef SHM_ECACHE | |
783 | *iv_return = SHM_ECACHE; | |
784 | return PERL_constant_ISIV; | |
785 | #else | |
786 | return PERL_constant_NOTDEF; | |
787 | #endif | |
788 | } | |
789 | break; | |
790 | case 'G': | |
791 | if (memEQ(name, "IPC_GETACL", 10)) { | |
792 | /* ^ */ | |
793 | #ifdef IPC_GETACL | |
794 | *iv_return = IPC_GETACL; | |
795 | return PERL_constant_ISIV; | |
796 | #else | |
797 | return PERL_constant_NOTDEF; | |
798 | #endif | |
799 | } | |
800 | break; | |
801 | case 'I': | |
802 | if (memEQ(name, "SHM_ICACHE", 10)) { | |
803 | /* ^ */ | |
804 | #ifdef SHM_ICACHE | |
805 | *iv_return = SHM_ICACHE; | |
806 | return PERL_constant_ISIV; | |
807 | #else | |
808 | return PERL_constant_NOTDEF; | |
809 | #endif | |
810 | } | |
811 | break; | |
812 | case 'L': | |
813 | if (memEQ(name, "IPC_LOCKED", 10)) { | |
814 | /* ^ */ | |
815 | #ifdef IPC_LOCKED | |
816 | *iv_return = IPC_LOCKED; | |
817 | return PERL_constant_ISIV; | |
818 | #else | |
819 | return PERL_constant_NOTDEF; | |
820 | #endif | |
821 | } | |
822 | if (memEQ(name, "MSG_LOCKED", 10)) { | |
823 | /* ^ */ | |
824 | #ifdef MSG_LOCKED | |
825 | *iv_return = MSG_LOCKED; | |
826 | return PERL_constant_ISIV; | |
827 | #else | |
828 | return PERL_constant_NOTDEF; | |
829 | #endif | |
830 | } | |
831 | if (memEQ(name, "SHM_LOCKED", 10)) { | |
832 | /* ^ */ | |
833 | #ifdef SHM_LOCKED | |
834 | *iv_return = SHM_LOCKED; | |
835 | return PERL_constant_ISIV; | |
836 | #else | |
837 | return PERL_constant_NOTDEF; | |
838 | #endif | |
839 | } | |
840 | break; | |
841 | case 'N': | |
842 | if (memEQ(name, "IPC_NOWAIT", 10)) { | |
843 | /* ^ */ | |
844 | #ifdef IPC_NOWAIT | |
845 | *iv_return = IPC_NOWAIT; | |
846 | return PERL_constant_ISIV; | |
847 | #else | |
848 | return PERL_constant_NOTDEF; | |
849 | #endif | |
850 | } | |
851 | if (memEQ(name, "SHM_NOSWAP", 10)) { | |
852 | /* ^ */ | |
853 | #ifdef SHM_NOSWAP | |
854 | *iv_return = SHM_NOSWAP; | |
855 | return PERL_constant_ISIV; | |
856 | #else | |
857 | return PERL_constant_NOTDEF; | |
858 | #endif | |
859 | } | |
860 | break; | |
861 | case 'R': | |
862 | if (memEQ(name, "SHM_RDONLY", 10)) { | |
863 | /* ^ */ | |
864 | #ifdef SHM_RDONLY | |
865 | *iv_return = SHM_RDONLY; | |
866 | return PERL_constant_ISIV; | |
867 | #else | |
868 | return PERL_constant_NOTDEF; | |
869 | #endif | |
870 | } | |
871 | break; | |
872 | case 'S': | |
873 | if (memEQ(name, "IPC_SETACL", 10)) { | |
874 | /* ^ */ | |
875 | #ifdef IPC_SETACL | |
876 | *iv_return = IPC_SETACL; | |
877 | return PERL_constant_ISIV; | |
878 | #else | |
879 | return PERL_constant_NOTDEF; | |
880 | #endif | |
881 | } | |
882 | if (memEQ(name, "SHM_SHATTR", 10)) { | |
883 | /* ^ */ | |
884 | #ifdef SHM_SHATTR | |
885 | *iv_return = SHM_SHATTR; | |
886 | return PERL_constant_ISIV; | |
887 | #else | |
888 | return PERL_constant_NOTDEF; | |
889 | #endif | |
890 | } | |
891 | break; | |
892 | case 'U': | |
893 | if (memEQ(name, "SHM_UNLOCK", 10)) { | |
894 | /* ^ */ | |
895 | #ifdef SHM_UNLOCK | |
896 | *iv_return = SHM_UNLOCK; | |
897 | return PERL_constant_ISIV; | |
898 | #else | |
899 | return PERL_constant_NOTDEF; | |
900 | #endif | |
901 | } | |
902 | break; | |
903 | case 'W': | |
904 | if (memEQ(name, "IPC_WANTED", 10)) { | |
905 | /* ^ */ | |
906 | #ifdef IPC_WANTED | |
907 | *iv_return = IPC_WANTED; | |
908 | return PERL_constant_ISIV; | |
909 | #else | |
910 | return PERL_constant_NOTDEF; | |
911 | #endif | |
912 | } | |
913 | break; | |
914 | } | |
915 | return PERL_constant_NOTFOUND; | |
916 | } | |
917 | ||
918 | static int | |
919 | constant_11 (pTHX_ const char *name, IV *iv_return) { | |
920 | /* When generated this function returned values for the list of names given | |
921 | here. However, subsequent manual editing may have added or removed some. | |
922 | IPC_NOERROR IPC_PRIVATE MSG_NOERROR SHM_HUGETLB SHM_REMOVED */ | |
923 | /* Offset 6 gives the best switch position. */ | |
924 | switch (name[6]) { | |
925 | case 'E': | |
926 | if (memEQ(name, "IPC_NOERROR", 11)) { | |
927 | /* ^ */ | |
928 | #ifdef IPC_NOERROR | |
929 | *iv_return = IPC_NOERROR; | |
930 | return PERL_constant_ISIV; | |
931 | #else | |
932 | return PERL_constant_NOTDEF; | |
933 | #endif | |
934 | } | |
935 | if (memEQ(name, "MSG_NOERROR", 11)) { | |
936 | /* ^ */ | |
937 | #ifdef MSG_NOERROR | |
938 | *iv_return = MSG_NOERROR; | |
939 | return PERL_constant_ISIV; | |
940 | #else | |
941 | return PERL_constant_NOTDEF; | |
942 | #endif | |
943 | } | |
944 | break; | |
945 | case 'G': | |
946 | if (memEQ(name, "SHM_HUGETLB", 11)) { | |
947 | /* ^ */ | |
948 | #ifdef SHM_HUGETLB | |
949 | *iv_return = SHM_HUGETLB; | |
950 | return PERL_constant_ISIV; | |
951 | #else | |
952 | return PERL_constant_NOTDEF; | |
953 | #endif | |
954 | } | |
955 | break; | |
956 | case 'I': | |
957 | if (memEQ(name, "IPC_PRIVATE", 11)) { | |
958 | /* ^ */ | |
959 | #ifdef IPC_PRIVATE | |
960 | *iv_return = IPC_PRIVATE; | |
961 | return PERL_constant_ISIV; | |
962 | #else | |
963 | return PERL_constant_NOTDEF; | |
964 | #endif | |
965 | } | |
966 | break; | |
967 | case 'M': | |
968 | if (memEQ(name, "SHM_REMOVED", 11)) { | |
969 | /* ^ */ | |
970 | #ifdef SHM_REMOVED | |
971 | *iv_return = SHM_REMOVED; | |
972 | return PERL_constant_ISIV; | |
973 | #else | |
974 | return PERL_constant_NOTDEF; | |
975 | #endif | |
976 | } | |
977 | break; | |
978 | } | |
979 | return PERL_constant_NOTFOUND; | |
980 | } | |
981 | ||
982 | static int | |
983 | constant (pTHX_ const char *name, STRLEN len, IV *iv_return) { | |
984 | /* Initially switch on the length of the name. */ | |
985 | /* When generated this function returned values for the list of names given | |
986 | in this section of perl code. Rather than manually editing these functions | |
987 | to add or remove constants, which would result in this comment and section | |
988 | of code becoming inaccurate, we recommend that you edit this section of | |
989 | code, and use it to regenerate a new set of constant functions which you | |
990 | then use to replace the originals. | |
991 | ||
992 | Regenerate these constant functions by feeding this entire source file to | |
993 | perl -x | |
994 | ||
995 | #!/home/mhx/perl/blead-debug/bin/perl -w | |
996 | use ExtUtils::Constant qw (constant_types C_constant XS_constant); | |
997 | ||
998 | my $types = {map {($_, 1)} qw(IV)}; | |
999 | my @names = (qw(ENOSPC ENOSYS GETALL GETNCNT GETPID GETVAL GETZCNT IPC_ALLOC | |
1000 | IPC_CREAT IPC_EXCL IPC_GETACL IPC_INFO IPC_LOCKED IPC_M | |
1001 | IPC_NOERROR IPC_NOWAIT IPC_PRIVATE IPC_R IPC_RMID IPC_SET | |
1002 | IPC_SETACL IPC_SETLABEL IPC_STAT IPC_W IPC_WANTED MSG_EXCEPT | |
1003 | MSG_FWAIT MSG_INFO MSG_LOCKED MSG_MWAIT MSG_NOERROR MSG_QWAIT | |
1004 | MSG_R MSG_RWAIT MSG_STAT MSG_W MSG_WAIT MSG_WWAIT SEM_A | |
1005 | SEM_ALLOC SEM_DEST SEM_ERR SEM_INFO SEM_ORDER SEM_R SEM_STAT | |
1006 | SEM_UNDO SETALL SETVAL SHMLBA SHM_A SHM_CLEAR SHM_COPY | |
1007 | SHM_DCACHE SHM_DEST SHM_ECACHE SHM_FMAP SHM_HUGETLB SHM_ICACHE | |
1008 | SHM_INFO SHM_INIT SHM_LOCK SHM_LOCKED SHM_MAP SHM_NORESERVE | |
1009 | SHM_NOSWAP SHM_R SHM_RDONLY SHM_REMAP SHM_REMOVED SHM_RND | |
1010 | SHM_SHARE_MMU SHM_SHATTR SHM_SIZE SHM_STAT SHM_UNLOCK SHM_W | |
1011 | S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_IWGRP S_IWOTH | |
1012 | S_IWUSR S_IXGRP S_IXOTH S_IXUSR)); | |
1013 | ||
1014 | print constant_types(), "\n"; # macro defs | |
1015 | foreach (C_constant ("IPC::SysV", 'constant', 'IV', $types, undef, 3, @names) ) { | |
1016 | print $_, "\n"; # C constant subs | |
1017 | } | |
1018 | print "\n#### XS Section:\n"; | |
1019 | print XS_constant ("IPC::SysV", $types); | |
1020 | __END__ | |
1021 | */ | |
1022 | ||
1023 | switch (len) { | |
1024 | case 5: | |
1025 | return constant_5 (aTHX_ name, iv_return); | |
1026 | break; | |
1027 | case 6: | |
1028 | return constant_6 (aTHX_ name, iv_return); | |
1029 | break; | |
1030 | case 7: | |
1031 | return constant_7 (aTHX_ name, iv_return); | |
1032 | break; | |
1033 | case 8: | |
1034 | return constant_8 (aTHX_ name, iv_return); | |
1035 | break; | |
1036 | case 9: | |
1037 | return constant_9 (aTHX_ name, iv_return); | |
1038 | break; | |
1039 | case 10: | |
1040 | return constant_10 (aTHX_ name, iv_return); | |
1041 | break; | |
1042 | case 11: | |
1043 | return constant_11 (aTHX_ name, iv_return); | |
1044 | break; | |
1045 | case 12: | |
1046 | if (memEQ(name, "IPC_SETLABEL", 12)) { | |
1047 | #ifdef IPC_SETLABEL | |
1048 | *iv_return = IPC_SETLABEL; | |
1049 | return PERL_constant_ISIV; | |
1050 | #else | |
1051 | return PERL_constant_NOTDEF; | |
1052 | #endif | |
1053 | } | |
1054 | break; | |
1055 | case 13: | |
1056 | /* Names all of length 13. */ | |
1057 | /* SHM_NORESERVE SHM_SHARE_MMU */ | |
1058 | /* Offset 4 gives the best switch position. */ | |
1059 | switch (name[4]) { | |
1060 | case 'N': | |
1061 | if (memEQ(name, "SHM_NORESERVE", 13)) { | |
1062 | /* ^ */ | |
1063 | #ifdef SHM_NORESERVE | |
1064 | *iv_return = SHM_NORESERVE; | |
1065 | return PERL_constant_ISIV; | |
1066 | #else | |
1067 | return PERL_constant_NOTDEF; | |
1068 | #endif | |
1069 | } | |
1070 | break; | |
1071 | case 'S': | |
1072 | if (memEQ(name, "SHM_SHARE_MMU", 13)) { | |
1073 | /* ^ */ | |
1074 | #ifdef SHM_SHARE_MMU | |
1075 | *iv_return = SHM_SHARE_MMU; | |
1076 | return PERL_constant_ISIV; | |
1077 | #else | |
1078 | return PERL_constant_NOTDEF; | |
1079 | #endif | |
1080 | } | |
1081 | break; | |
1082 | } | |
1083 | break; | |
1084 | } | |
1085 | return PERL_constant_NOTFOUND; | |
1086 | } | |
1087 |