Upgrade to Encode 1.92.
[p5sagit/p5-mst-13.2.git] / ext / I18N / Langinfo / Langinfo.xs
CommitLineData
4bbcc6e8 1#include "EXTERN.h"
2#include "perl.h"
3#include "XSUB.h"
4
5#ifdef I_LANGINFO
6# include <langinfo.h>
7#endif
8
1cb0fb50 9#include "const-c.inc"
4bbcc6e8 10
11MODULE = I18N::Langinfo PACKAGE = I18N::Langinfo
12
13PROTOTYPES: ENABLE
14
1cb0fb50 15INCLUDE: const-xs.inc
4bbcc6e8 16
17SV*
18langinfo(code)
19 int code
20 CODE:
8b26484b 21#ifdef HAS_NL_LANGINFO
e1faa3a0 22 {
23 char *s;
24
25 if ((s = nl_langinfo(code)))
26 RETVAL = newSVpvn(s, strlen(s));
27 else
28 RETVAL = &PL_sv_undef;
b27961e5 29 }
8b26484b 30#else
31 croak("nl_langinfo() not implemented on this architecture");
32#endif
4bbcc6e8 33 OUTPUT:
34 RETVAL