This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add more -DL debugging info
[perl5.git] / ext / I18N-Langinfo / Langinfo.xs
CommitLineData
810ec442
NC
1#define PERL_NO_GET_CONTEXT
2
4bbcc6e8
JH
3#include "EXTERN.h"
4#include "perl.h"
5#include "XSUB.h"
6
7#ifdef I_LANGINFO
f53b541b 8# define __USE_GNU 1 /* Enables YESSTR, otherwise only __YESSTR. */
4bbcc6e8
JH
9# include <langinfo.h>
10#endif
11
1cb0fb50 12#include "const-c.inc"
4bbcc6e8
JH
13
14MODULE = I18N::Langinfo PACKAGE = I18N::Langinfo
15
16PROTOTYPES: ENABLE
17
1cb0fb50 18INCLUDE: const-xs.inc
4bbcc6e8
JH
19
20SV*
d16d4b10 21langinfo(code)
4bbcc6e8 22 int code
d16d4b10 23 PROTOTYPE: _
4bbcc6e8 24 CODE:
8b26484b 25#ifdef HAS_NL_LANGINFO
0c82d9ae
JH
26 if (code < 0) {
27 SETERRNO(EINVAL, LIB_INVARG);
28 RETVAL = &PL_sv_undef;
29 } else {
30 RETVAL = newSVpv(nl_langinfo(code), 0);
31 }
8b26484b
JH
32#else
33 croak("nl_langinfo() not implemented on this architecture");
34#endif
4bbcc6e8
JH
35 OUTPUT:
36 RETVAL