Commit | Line | Data |
8ce86de8 |
1 | #include "EXTERN.h" |
2 | #include "perl.h" |
3 | #include "XSUB.h" |
4 | |
d76d5647 |
5 | #ifdef I_SYSLOG |
6 | #include <syslog.h> |
7 | #endif |
8ce86de8 |
8 | |
9 | static double |
b193a46a |
10 | constant_LOG_NO(char *name, int len) |
8ce86de8 |
11 | { |
12 | switch (name[6 + 0]) { |
13 | case 'T': |
b64ef0c1 |
14 | if (strEQ(name + 6, "TICE")) { /* "LOG_NO" removed */ |
8ce86de8 |
15 | #ifdef LOG_NOTICE |
16 | return LOG_NOTICE; |
17 | #else |
18 | goto not_there; |
19 | #endif |
20 | } |
21 | case 'W': |
b64ef0c1 |
22 | if (strEQ(name + 6, "WAIT")) { /* "LOG_NO" removed */ |
8ce86de8 |
23 | #ifdef LOG_NOWAIT |
24 | return LOG_NOWAIT; |
25 | #else |
26 | goto not_there; |
27 | #endif |
28 | } |
29 | } |
30 | errno = EINVAL; |
31 | return 0; |
32 | |
8fa7f367 |
33 | #if !defined(LOG_NOTICE) || !defined(LOG_NOWAIT) |
8ce86de8 |
34 | not_there: |
35 | errno = ENOENT; |
36 | return 0; |
8fa7f367 |
37 | #endif |
8ce86de8 |
38 | } |
39 | |
40 | static double |
b193a46a |
41 | constant_LOG_N(char *name, int len) |
8ce86de8 |
42 | { |
43 | switch (name[5 + 0]) { |
44 | case 'D': |
b64ef0c1 |
45 | if (strEQ(name + 5, "DELAY")) { /* "LOG_N" removed */ |
8ce86de8 |
46 | #ifdef LOG_NDELAY |
47 | return LOG_NDELAY; |
48 | #else |
49 | goto not_there; |
50 | #endif |
51 | } |
52 | case 'E': |
b64ef0c1 |
53 | if (strEQ(name + 5, "EWS")) { /* "LOG_N" removed */ |
8ce86de8 |
54 | #ifdef LOG_NEWS |
55 | return LOG_NEWS; |
56 | #else |
57 | goto not_there; |
58 | #endif |
59 | } |
60 | case 'F': |
b64ef0c1 |
61 | if (strEQ(name + 5, "FACILITIES")) { /* "LOG_N" removed */ |
8ce86de8 |
62 | #ifdef LOG_NFACILITIES |
63 | return LOG_NFACILITIES; |
64 | #else |
65 | goto not_there; |
66 | #endif |
67 | } |
68 | case 'O': |
b193a46a |
69 | return constant_LOG_NO(name, len); |
8ce86de8 |
70 | } |
71 | errno = EINVAL; |
72 | return 0; |
73 | |
8fa7f367 |
74 | #if !defined(LOG_NDELAY) || !defined(LOG_NEWS) || !defined(LOG_NFACILITIES) |
8ce86de8 |
75 | not_there: |
76 | errno = ENOENT; |
77 | return 0; |
8fa7f367 |
78 | #endif |
8ce86de8 |
79 | } |
80 | |
81 | static double |
b193a46a |
82 | constant_LOG_P(char *name, int len) |
8ce86de8 |
83 | { |
84 | switch (name[5 + 0]) { |
b64ef0c1 |
85 | case 'E': |
86 | if (strEQ(name + 5, "ERROR")) { /* "LOG_P" removed */ |
87 | #ifdef LOG_PERROR |
88 | return LOG_PERROR; |
89 | #else |
90 | goto not_there; |
91 | #endif |
92 | } |
8ce86de8 |
93 | case 'I': |
b64ef0c1 |
94 | if (strEQ(name + 5, "ID")) { /* "LOG_P" removed */ |
8ce86de8 |
95 | #ifdef LOG_PID |
96 | return LOG_PID; |
97 | #else |
98 | goto not_there; |
99 | #endif |
100 | } |
101 | case 'R': |
b64ef0c1 |
102 | if (strEQ(name + 5, "RIMASK")) { /* "LOG_P" removed */ |
8ce86de8 |
103 | #ifdef LOG_PRIMASK |
104 | return LOG_PRIMASK; |
105 | #else |
106 | goto not_there; |
107 | #endif |
108 | } |
109 | } |
110 | errno = EINVAL; |
111 | return 0; |
112 | |
8fa7f367 |
113 | #if !defined(LOG_PERROR) || !defined(LOG_PID) || !defined(LOG_PRIMASK) |
8ce86de8 |
114 | not_there: |
115 | errno = ENOENT; |
116 | return 0; |
8fa7f367 |
117 | #endif |
8ce86de8 |
118 | } |
119 | |
120 | static double |
b193a46a |
121 | constant_LOG_AU(char *name, int len) |
8ce86de8 |
122 | { |
996f7592 |
123 | if (6 + 2 > len ) { |
8ce86de8 |
124 | errno = EINVAL; |
125 | return 0; |
126 | } |
127 | switch (name[6 + 2]) { |
128 | case '\0': |
b64ef0c1 |
129 | if (strEQ(name + 6, "TH")) { /* "LOG_AU" removed */ |
8ce86de8 |
130 | #ifdef LOG_AUTH |
131 | return LOG_AUTH; |
132 | #else |
133 | goto not_there; |
134 | #endif |
135 | } |
136 | case 'P': |
b64ef0c1 |
137 | if (strEQ(name + 6, "THPRIV")) { /* "LOG_AU" removed */ |
8ce86de8 |
138 | #ifdef LOG_AUTHPRIV |
139 | return LOG_AUTHPRIV; |
140 | #else |
141 | goto not_there; |
142 | #endif |
143 | } |
144 | } |
145 | errno = EINVAL; |
146 | return 0; |
147 | |
8fa7f367 |
148 | #if !defined(LOG_AUTH) || !defined(LOG_AUTHPRIV) |
8ce86de8 |
149 | not_there: |
150 | errno = ENOENT; |
151 | return 0; |
8fa7f367 |
152 | #endif |
8ce86de8 |
153 | } |
154 | |
155 | static double |
b193a46a |
156 | constant_LOG_A(char *name, int len) |
8ce86de8 |
157 | { |
158 | switch (name[5 + 0]) { |
159 | case 'L': |
b64ef0c1 |
160 | if (strEQ(name + 5, "LERT")) { /* "LOG_A" removed */ |
8ce86de8 |
161 | #ifdef LOG_ALERT |
162 | return LOG_ALERT; |
163 | #else |
164 | goto not_there; |
165 | #endif |
166 | } |
167 | case 'U': |
b193a46a |
168 | return constant_LOG_AU(name, len); |
8ce86de8 |
169 | } |
170 | errno = EINVAL; |
171 | return 0; |
172 | |
8fa7f367 |
173 | #if !defined(LOG_ALERT) |
8ce86de8 |
174 | not_there: |
175 | errno = ENOENT; |
176 | return 0; |
8fa7f367 |
177 | #endif |
8ce86de8 |
178 | } |
179 | |
180 | static double |
b193a46a |
181 | constant_LOG_CR(char *name, int len) |
8ce86de8 |
182 | { |
183 | switch (name[6 + 0]) { |
184 | case 'I': |
b64ef0c1 |
185 | if (strEQ(name + 6, "IT")) { /* "LOG_CR" removed */ |
8ce86de8 |
186 | #ifdef LOG_CRIT |
187 | return LOG_CRIT; |
188 | #else |
189 | goto not_there; |
190 | #endif |
191 | } |
192 | case 'O': |
b64ef0c1 |
193 | if (strEQ(name + 6, "ON")) { /* "LOG_CR" removed */ |
8ce86de8 |
194 | #ifdef LOG_CRON |
195 | return LOG_CRON; |
196 | #else |
197 | goto not_there; |
198 | #endif |
199 | } |
200 | } |
201 | errno = EINVAL; |
202 | return 0; |
203 | |
8fa7f367 |
204 | #if !defined(LOG_CRIT) || !defined(LOG_CRON) |
8ce86de8 |
205 | not_there: |
206 | errno = ENOENT; |
207 | return 0; |
8fa7f367 |
208 | #endif |
8ce86de8 |
209 | } |
210 | |
211 | static double |
b193a46a |
212 | constant_LOG_C(char *name, int len) |
8ce86de8 |
213 | { |
214 | switch (name[5 + 0]) { |
215 | case 'O': |
b64ef0c1 |
216 | if (strEQ(name + 5, "ONS")) { /* "LOG_C" removed */ |
8ce86de8 |
217 | #ifdef LOG_CONS |
218 | return LOG_CONS; |
219 | #else |
220 | goto not_there; |
221 | #endif |
222 | } |
223 | case 'R': |
b193a46a |
224 | return constant_LOG_CR(name, len); |
8ce86de8 |
225 | } |
226 | errno = EINVAL; |
227 | return 0; |
228 | |
8fa7f367 |
229 | #if !defined(LOG_CONS) |
8ce86de8 |
230 | not_there: |
231 | errno = ENOENT; |
232 | return 0; |
8fa7f367 |
233 | #endif |
8ce86de8 |
234 | } |
235 | |
236 | static double |
b193a46a |
237 | constant_LOG_D(char *name, int len) |
8ce86de8 |
238 | { |
239 | switch (name[5 + 0]) { |
240 | case 'A': |
b64ef0c1 |
241 | if (strEQ(name + 5, "AEMON")) { /* "LOG_D" removed */ |
8ce86de8 |
242 | #ifdef LOG_DAEMON |
243 | return LOG_DAEMON; |
244 | #else |
245 | goto not_there; |
246 | #endif |
247 | } |
248 | case 'E': |
b64ef0c1 |
249 | if (strEQ(name + 5, "EBUG")) { /* "LOG_D" removed */ |
8ce86de8 |
250 | #ifdef LOG_DEBUG |
251 | return LOG_DEBUG; |
252 | #else |
253 | goto not_there; |
254 | #endif |
255 | } |
256 | } |
257 | errno = EINVAL; |
258 | return 0; |
259 | |
8fa7f367 |
260 | #if !defined(LOG_DAEMON) || !defined(LOG_DEBUG) |
8ce86de8 |
261 | not_there: |
262 | errno = ENOENT; |
263 | return 0; |
8fa7f367 |
264 | #endif |
8ce86de8 |
265 | } |
266 | |
267 | static double |
b193a46a |
268 | constant_LOG_U(char *name, int len) |
8ce86de8 |
269 | { |
270 | switch (name[5 + 0]) { |
271 | case 'S': |
b64ef0c1 |
272 | if (strEQ(name + 5, "SER")) { /* "LOG_U" removed */ |
8ce86de8 |
273 | #ifdef LOG_USER |
274 | return LOG_USER; |
275 | #else |
276 | goto not_there; |
277 | #endif |
278 | } |
279 | case 'U': |
b64ef0c1 |
280 | if (strEQ(name + 5, "UCP")) { /* "LOG_U" removed */ |
8ce86de8 |
281 | #ifdef LOG_UUCP |
282 | return LOG_UUCP; |
283 | #else |
284 | goto not_there; |
285 | #endif |
286 | } |
287 | } |
288 | errno = EINVAL; |
289 | return 0; |
290 | |
8fa7f367 |
291 | #if !defined(LOG_USER) || !defined(LOG_UUCP) |
8ce86de8 |
292 | not_there: |
293 | errno = ENOENT; |
294 | return 0; |
8fa7f367 |
295 | #endif |
8ce86de8 |
296 | } |
297 | |
298 | static double |
b193a46a |
299 | constant_LOG_E(char *name, int len) |
8ce86de8 |
300 | { |
301 | switch (name[5 + 0]) { |
302 | case 'M': |
b64ef0c1 |
303 | if (strEQ(name + 5, "MERG")) { /* "LOG_E" removed */ |
8ce86de8 |
304 | #ifdef LOG_EMERG |
305 | return LOG_EMERG; |
306 | #else |
307 | goto not_there; |
308 | #endif |
309 | } |
310 | case 'R': |
b64ef0c1 |
311 | if (strEQ(name + 5, "RR")) { /* "LOG_E" removed */ |
8ce86de8 |
312 | #ifdef LOG_ERR |
313 | return LOG_ERR; |
314 | #else |
315 | goto not_there; |
316 | #endif |
317 | } |
318 | } |
319 | errno = EINVAL; |
320 | return 0; |
321 | |
8fa7f367 |
322 | #if !defined(LOG_EMERG) || !defined(LOG_ERR) |
8ce86de8 |
323 | not_there: |
324 | errno = ENOENT; |
325 | return 0; |
8fa7f367 |
326 | #endif |
8ce86de8 |
327 | } |
328 | |
329 | static double |
b193a46a |
330 | constant_LOG_F(char *name, int len) |
8ce86de8 |
331 | { |
332 | switch (name[5 + 0]) { |
333 | case 'A': |
b64ef0c1 |
334 | if (strEQ(name + 5, "ACMASK")) { /* "LOG_F" removed */ |
8ce86de8 |
335 | #ifdef LOG_FACMASK |
336 | return LOG_FACMASK; |
337 | #else |
338 | goto not_there; |
339 | #endif |
340 | } |
341 | case 'T': |
b64ef0c1 |
342 | if (strEQ(name + 5, "TP")) { /* "LOG_F" removed */ |
8ce86de8 |
343 | #ifdef LOG_FTP |
344 | return LOG_FTP; |
345 | #else |
346 | goto not_there; |
347 | #endif |
348 | } |
349 | } |
350 | errno = EINVAL; |
351 | return 0; |
352 | |
8fa7f367 |
353 | #if !defined(LOG_FACMASK) || !defined(LOG_FTP) |
8ce86de8 |
354 | not_there: |
355 | errno = ENOENT; |
356 | return 0; |
8fa7f367 |
357 | #endif |
8ce86de8 |
358 | } |
359 | |
360 | static double |
b193a46a |
361 | constant_LOG_LO(char *name, int len) |
8ce86de8 |
362 | { |
363 | if (6 + 3 >= len ) { |
364 | errno = EINVAL; |
365 | return 0; |
366 | } |
367 | switch (name[6 + 3]) { |
368 | case '0': |
b64ef0c1 |
369 | if (strEQ(name + 6, "CAL0")) { /* "LOG_LO" removed */ |
8ce86de8 |
370 | #ifdef LOG_LOCAL0 |
371 | return LOG_LOCAL0; |
372 | #else |
373 | goto not_there; |
374 | #endif |
375 | } |
376 | case '1': |
b64ef0c1 |
377 | if (strEQ(name + 6, "CAL1")) { /* "LOG_LO" removed */ |
8ce86de8 |
378 | #ifdef LOG_LOCAL1 |
379 | return LOG_LOCAL1; |
380 | #else |
381 | goto not_there; |
382 | #endif |
383 | } |
384 | case '2': |
b64ef0c1 |
385 | if (strEQ(name + 6, "CAL2")) { /* "LOG_LO" removed */ |
8ce86de8 |
386 | #ifdef LOG_LOCAL2 |
387 | return LOG_LOCAL2; |
388 | #else |
389 | goto not_there; |
390 | #endif |
391 | } |
392 | case '3': |
b64ef0c1 |
393 | if (strEQ(name + 6, "CAL3")) { /* "LOG_LO" removed */ |
8ce86de8 |
394 | #ifdef LOG_LOCAL3 |
395 | return LOG_LOCAL3; |
396 | #else |
397 | goto not_there; |
398 | #endif |
399 | } |
400 | case '4': |
b64ef0c1 |
401 | if (strEQ(name + 6, "CAL4")) { /* "LOG_LO" removed */ |
8ce86de8 |
402 | #ifdef LOG_LOCAL4 |
403 | return LOG_LOCAL4; |
404 | #else |
405 | goto not_there; |
406 | #endif |
407 | } |
408 | case '5': |
b64ef0c1 |
409 | if (strEQ(name + 6, "CAL5")) { /* "LOG_LO" removed */ |
8ce86de8 |
410 | #ifdef LOG_LOCAL5 |
411 | return LOG_LOCAL5; |
412 | #else |
413 | goto not_there; |
414 | #endif |
415 | } |
416 | case '6': |
b64ef0c1 |
417 | if (strEQ(name + 6, "CAL6")) { /* "LOG_LO" removed */ |
8ce86de8 |
418 | #ifdef LOG_LOCAL6 |
419 | return LOG_LOCAL6; |
420 | #else |
421 | goto not_there; |
422 | #endif |
423 | } |
424 | case '7': |
b64ef0c1 |
425 | if (strEQ(name + 6, "CAL7")) { /* "LOG_LO" removed */ |
8ce86de8 |
426 | #ifdef LOG_LOCAL7 |
427 | return LOG_LOCAL7; |
428 | #else |
429 | goto not_there; |
430 | #endif |
431 | } |
432 | } |
433 | errno = EINVAL; |
434 | return 0; |
435 | |
8fa7f367 |
436 | #if !defined(LOG_LOCAL0) || !defined(LOG_LOCAL1) || !defined(LOG_LOCAL2) || !defined(LOG_LOCAL3) || !defined(LOG_LOCAL4) || !defined(LOG_LOCAL5) || !defined(LOG_LOCAL6) || !defined(LOG_LOCAL7) |
8ce86de8 |
437 | not_there: |
438 | errno = ENOENT; |
439 | return 0; |
8fa7f367 |
440 | #endif |
8ce86de8 |
441 | } |
442 | |
443 | static double |
b193a46a |
444 | constant_LOG_L(char *name, int len) |
8ce86de8 |
445 | { |
446 | switch (name[5 + 0]) { |
447 | case 'F': |
b64ef0c1 |
448 | if (strEQ(name + 5, "FMT")) { /* "LOG_L" removed */ |
8ce86de8 |
449 | #ifdef LOG_LFMT |
450 | return LOG_LFMT; |
451 | #else |
452 | goto not_there; |
453 | #endif |
454 | } |
455 | case 'O': |
b193a46a |
456 | return constant_LOG_LO(name, len); |
8ce86de8 |
457 | case 'P': |
b64ef0c1 |
458 | if (strEQ(name + 5, "PR")) { /* "LOG_L" removed */ |
8ce86de8 |
459 | #ifdef LOG_LPR |
460 | return LOG_LPR; |
461 | #else |
462 | goto not_there; |
463 | #endif |
464 | } |
465 | } |
466 | errno = EINVAL; |
467 | return 0; |
468 | |
8fa7f367 |
469 | #if !defined(LOG_LFMT) || !defined(LOG_LPR) |
8ce86de8 |
470 | not_there: |
471 | errno = ENOENT; |
472 | return 0; |
8fa7f367 |
473 | #endif |
8ce86de8 |
474 | } |
475 | |
476 | static double |
b193a46a |
477 | constant(char *name, int len) |
8ce86de8 |
478 | { |
479 | errno = 0; |
480 | if (0 + 4 >= len ) { |
481 | errno = EINVAL; |
482 | return 0; |
483 | } |
484 | switch (name[0 + 4]) { |
485 | case 'A': |
486 | if (!strnEQ(name + 0,"LOG_", 4)) |
487 | break; |
b193a46a |
488 | return constant_LOG_A(name, len); |
8ce86de8 |
489 | case 'C': |
490 | if (!strnEQ(name + 0,"LOG_", 4)) |
491 | break; |
b193a46a |
492 | return constant_LOG_C(name, len); |
8ce86de8 |
493 | case 'D': |
494 | if (!strnEQ(name + 0,"LOG_", 4)) |
495 | break; |
b193a46a |
496 | return constant_LOG_D(name, len); |
8ce86de8 |
497 | case 'E': |
498 | if (!strnEQ(name + 0,"LOG_", 4)) |
499 | break; |
b193a46a |
500 | return constant_LOG_E(name, len); |
8ce86de8 |
501 | case 'F': |
502 | if (!strnEQ(name + 0,"LOG_", 4)) |
503 | break; |
b193a46a |
504 | return constant_LOG_F(name, len); |
8ce86de8 |
505 | case 'I': |
b64ef0c1 |
506 | if (strEQ(name + 0, "LOG_INFO")) { /* "" removed */ |
8ce86de8 |
507 | #ifdef LOG_INFO |
508 | return LOG_INFO; |
509 | #else |
510 | goto not_there; |
511 | #endif |
512 | } |
513 | case 'K': |
b64ef0c1 |
514 | if (strEQ(name + 0, "LOG_KERN")) { /* "" removed */ |
8ce86de8 |
515 | #ifdef LOG_KERN |
516 | return LOG_KERN; |
517 | #else |
518 | goto not_there; |
519 | #endif |
520 | } |
521 | case 'L': |
522 | if (!strnEQ(name + 0,"LOG_", 4)) |
523 | break; |
b193a46a |
524 | return constant_LOG_L(name, len); |
8ce86de8 |
525 | case 'M': |
b64ef0c1 |
526 | if (strEQ(name + 0, "LOG_MAIL")) { /* "" removed */ |
8ce86de8 |
527 | #ifdef LOG_MAIL |
528 | return LOG_MAIL; |
529 | #else |
530 | goto not_there; |
531 | #endif |
532 | } |
533 | case 'N': |
534 | if (!strnEQ(name + 0,"LOG_", 4)) |
535 | break; |
b193a46a |
536 | return constant_LOG_N(name, len); |
8ce86de8 |
537 | case 'O': |
b64ef0c1 |
538 | if (strEQ(name + 0, "LOG_ODELAY")) { /* "" removed */ |
8ce86de8 |
539 | #ifdef LOG_ODELAY |
540 | return LOG_ODELAY; |
541 | #else |
542 | goto not_there; |
543 | #endif |
544 | } |
545 | case 'P': |
546 | if (!strnEQ(name + 0,"LOG_", 4)) |
547 | break; |
b193a46a |
548 | return constant_LOG_P(name, len); |
8ce86de8 |
549 | case 'S': |
b64ef0c1 |
550 | if (strEQ(name + 0, "LOG_SYSLOG")) { /* "" removed */ |
8ce86de8 |
551 | #ifdef LOG_SYSLOG |
552 | return LOG_SYSLOG; |
553 | #else |
554 | goto not_there; |
555 | #endif |
556 | } |
557 | case 'U': |
558 | if (!strnEQ(name + 0,"LOG_", 4)) |
559 | break; |
b193a46a |
560 | return constant_LOG_U(name, len); |
8ce86de8 |
561 | case 'W': |
b64ef0c1 |
562 | if (strEQ(name + 0, "LOG_WARNING")) { /* "" removed */ |
8ce86de8 |
563 | #ifdef LOG_WARNING |
564 | return LOG_WARNING; |
565 | #else |
566 | goto not_there; |
567 | #endif |
568 | } |
569 | } |
570 | errno = EINVAL; |
571 | return 0; |
572 | |
8fa7f367 |
573 | #if !defined(LOG_INFO) || !defined(LOG_KERN) || !defined(LOG_MAIL) || !defined(LOG_ODELAY) || !defined(LOG_SYSLOG) || !defined(LOG_WARNING) |
8ce86de8 |
574 | not_there: |
575 | errno = ENOENT; |
576 | return 0; |
8fa7f367 |
577 | #endif |
8ce86de8 |
578 | } |
579 | |
580 | |
581 | MODULE = Sys::Syslog PACKAGE = Sys::Syslog |
582 | |
583 | char * |
584 | _PATH_LOG() |
585 | CODE: |
586 | #ifdef _PATH_LOG |
587 | RETVAL = _PATH_LOG; |
588 | #else |
150b260b |
589 | RETVAL = ""; |
8ce86de8 |
590 | #endif |
591 | OUTPUT: |
592 | RETVAL |
593 | |
594 | int |
595 | LOG_FAC(p) |
596 | INPUT: |
597 | int p |
598 | CODE: |
599 | #ifdef LOG_FAC |
600 | RETVAL = LOG_FAC(p); |
601 | #else |
602 | croak("Your vendor has not defined the Sys::Syslog macro LOG_FAC"); |
b621ec8a |
603 | RETVAL = -1; |
8ce86de8 |
604 | #endif |
605 | OUTPUT: |
606 | RETVAL |
607 | |
608 | int |
609 | LOG_PRI(p) |
610 | INPUT: |
611 | int p |
612 | CODE: |
613 | #ifdef LOG_PRI |
614 | RETVAL = LOG_PRI(p); |
615 | #else |
616 | croak("Your vendor has not defined the Sys::Syslog macro LOG_PRI"); |
b621ec8a |
617 | RETVAL = -1; |
8ce86de8 |
618 | #endif |
619 | OUTPUT: |
620 | RETVAL |
621 | |
622 | int |
623 | LOG_MAKEPRI(fac,pri) |
624 | INPUT: |
625 | int fac |
626 | int pri |
627 | CODE: |
628 | #ifdef LOG_MAKEPRI |
629 | RETVAL = LOG_MAKEPRI(fac,pri); |
630 | #else |
631 | croak("Your vendor has not defined the Sys::Syslog macro LOG_MAKEPRI"); |
b621ec8a |
632 | RETVAL = -1; |
8ce86de8 |
633 | #endif |
634 | OUTPUT: |
635 | RETVAL |
636 | |
637 | int |
638 | LOG_MASK(pri) |
639 | INPUT: |
640 | int pri |
641 | CODE: |
642 | #ifdef LOG_MASK |
643 | RETVAL = LOG_MASK(pri); |
644 | #else |
645 | croak("Your vendor has not defined the Sys::Syslog macro LOG_MASK"); |
b621ec8a |
646 | RETVAL = -1; |
8ce86de8 |
647 | #endif |
648 | OUTPUT: |
649 | RETVAL |
650 | |
651 | int |
652 | LOG_UPTO(pri) |
653 | INPUT: |
654 | int pri |
655 | CODE: |
656 | #ifdef LOG_UPTO |
657 | RETVAL = LOG_UPTO(pri); |
658 | #else |
659 | croak("Your vendor has not defined the Sys::Syslog macro LOG_UPTO"); |
b621ec8a |
660 | RETVAL = -1; |
8ce86de8 |
661 | #endif |
662 | OUTPUT: |
663 | RETVAL |
664 | |
665 | |
666 | double |
b193a46a |
667 | constant(sv) |
8ce86de8 |
668 | PREINIT: |
669 | STRLEN len; |
670 | INPUT: |
671 | SV * sv |
672 | char * s = SvPV(sv, len); |
8ce86de8 |
673 | CODE: |
b193a46a |
674 | RETVAL = constant(s,len); |
8ce86de8 |
675 | OUTPUT: |
676 | RETVAL |
677 | |