langinfo.xs

来自「source of perl for linux application,」· XS 代码 · 共 36 行

XS
36
字号
#include "EXTERN.h"#include "perl.h"#include "XSUB.h"#ifdef I_LANGINFO#   define __USE_GNU 1 /* Enables YESSTR, otherwise only __YESSTR. */#   include <langinfo.h>#endif#include "const-c.inc"MODULE = I18N::Langinfo	PACKAGE = I18N::LanginfoPROTOTYPES: ENABLEINCLUDE: const-xs.incSV*langinfo(code)	int	code  CODE:#ifdef HAS_NL_LANGINFO	{	  char *s;	  if ((s = nl_langinfo(code)))	      RETVAL = newSVpvn(s, strlen(s));	  else	      RETVAL = &PL_sv_undef;	}#else	croak("nl_langinfo() not implemented on this architecture");#endif  OUTPUT:	RETVAL

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?