2N/A/* Substitute for and wrapper around <langinfo.h>.
2N/A Copyright (C) 2009, 2010 Free Software Foundation, Inc.
2N/A
2N/A This program is free software; you can redistribute it and/or modify
2N/A it under the terms of the GNU General Public License as published by
2N/A the Free Software Foundation; either version 3, or (at your option)
2N/A any later version.
2N/A
2N/A This program is distributed in the hope that it will be useful,
2N/A but WITHOUT ANY WARRANTY; without even the implied warranty of
2N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2N/A GNU General Public License for more details.
2N/A
2N/A You should have received a copy of the GNU General Public License
2N/A along with this program; if not, write to the Free Software Foundation,
2N/A Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
2N/A
2N/A/*
2N/A * POSIX <langinfo.h> for platforms that lack it or have an incomplete one.
2N/A * <http://www.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html>
2N/A */
2N/A
2N/A#ifndef _GL_LANGINFO_H
2N/A
2N/A#if __GNUC__ >= 3
2N/A@PRAGMA_SYSTEM_HEADER@
2N/A#endif
2N/A
2N/A/* The include_next requires a split double-inclusion guard. */
2N/A#if @HAVE_LANGINFO_H@
2N/A# @INCLUDE_NEXT@ @NEXT_LANGINFO_H@
2N/A#endif
2N/A
2N/A#ifndef _GL_LANGINFO_H
2N/A#define _GL_LANGINFO_H
2N/A
2N/A
2N/A#if !@HAVE_LANGINFO_H@
2N/A
2N/A/* A platform that lacks <langinfo.h>. */
2N/A
2N/A/* Assume that it also lacks <nl_types.h> and the nl_item type. */
2N/Atypedef int nl_item;
2N/A
2N/A/* nl_langinfo items of the LC_CTYPE category */
2N/A# define CODESET 10000
2N/A/* nl_langinfo items of the LC_NUMERIC category */
2N/A# define RADIXCHAR 10001
2N/A# define THOUSEP 10002
2N/A/* nl_langinfo items of the LC_TIME category */
2N/A# define D_T_FMT 10003
2N/A# define D_FMT 10004
2N/A# define T_FMT 10005
2N/A# define T_FMT_AMPM 10006
2N/A# define AM_STR 10007
2N/A# define PM_STR 10008
2N/A# define DAY_1 10009
2N/A# define DAY_2 (DAY_1 + 1)
2N/A# define DAY_3 (DAY_1 + 2)
2N/A# define DAY_4 (DAY_1 + 3)
2N/A# define DAY_5 (DAY_1 + 4)
2N/A# define DAY_6 (DAY_1 + 5)
2N/A# define DAY_7 (DAY_1 + 6)
2N/A# define ABDAY_1 10016
2N/A# define ABDAY_2 (ABDAY_1 + 1)
2N/A# define ABDAY_3 (ABDAY_1 + 2)
2N/A# define ABDAY_4 (ABDAY_1 + 3)
2N/A# define ABDAY_5 (ABDAY_1 + 4)
2N/A# define ABDAY_6 (ABDAY_1 + 5)
2N/A# define ABDAY_7 (ABDAY_1 + 6)
2N/A# define MON_1 10023
2N/A# define MON_2 (MON_1 + 1)
2N/A# define MON_3 (MON_1 + 2)
2N/A# define MON_4 (MON_1 + 3)
2N/A# define MON_5 (MON_1 + 4)
2N/A# define MON_6 (MON_1 + 5)
2N/A# define MON_7 (MON_1 + 6)
2N/A# define MON_8 (MON_1 + 7)
2N/A# define MON_9 (MON_1 + 8)
2N/A# define MON_10 (MON_1 + 9)
2N/A# define MON_11 (MON_1 + 10)
2N/A# define MON_12 (MON_1 + 11)
2N/A# define ABMON_1 10035
2N/A# define ABMON_2 (ABMON_1 + 1)
2N/A# define ABMON_3 (ABMON_1 + 2)
2N/A# define ABMON_4 (ABMON_1 + 3)
2N/A# define ABMON_5 (ABMON_1 + 4)
2N/A# define ABMON_6 (ABMON_1 + 5)
2N/A# define ABMON_7 (ABMON_1 + 6)
2N/A# define ABMON_8 (ABMON_1 + 7)
2N/A# define ABMON_9 (ABMON_1 + 8)
2N/A# define ABMON_10 (ABMON_1 + 9)
2N/A# define ABMON_11 (ABMON_1 + 10)
2N/A# define ABMON_12 (ABMON_1 + 11)
2N/A# define ERA 10047
2N/A# define ERA_D_FMT 10048
2N/A# define ERA_D_T_FMT 10049
2N/A# define ERA_T_FMT 10050
2N/A# define ALT_DIGITS 10051
2N/A/* nl_langinfo items of the LC_MONETARY category */
2N/A# define CRNCYSTR 10052
2N/A/* nl_langinfo items of the LC_MESSAGES category */
2N/A# define YESEXPR 10053
2N/A# define NOEXPR 10054
2N/A
2N/A#else
2N/A
2N/A/* A platform that has <langinfo.h>. */
2N/A
2N/A# if !@HAVE_LANGINFO_CODESET@
2N/A# define CODESET 10000
2N/A# define GNULIB_defined_CODESET 1
2N/A# endif
2N/A
2N/A# if !@HAVE_LANGINFO_T_FMT_AMPM@
2N/A# define T_FMT_AMPM 10006
2N/A# define GNULIB_defined_T_FMT_AMPM 1
2N/A# endif
2N/A
2N/A# if !@HAVE_LANGINFO_ERA@
2N/A# define ERA 10047
2N/A# define ERA_D_FMT 10048
2N/A# define ERA_D_T_FMT 10049
2N/A# define ERA_T_FMT 10050
2N/A# define ALT_DIGITS 10051
2N/A# define GNULIB_defined_ERA 1
2N/A# endif
2N/A
2N/A# if !@HAVE_LANGINFO_YESEXPR@
2N/A# define YESEXPR 10053
2N/A# define NOEXPR 10054
2N/A# define GNULIB_defined_YESEXPR 1
2N/A# endif
2N/A
2N/A#endif
2N/A
2N/A/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
2N/A
2N/A/* The definition of _GL_WARN_ON_USE is copied here. */
2N/A
2N/A/* Declare overridden functions. */
2N/A
2N/A
2N/A/* Return a piece of locale dependent information.
2N/A Note: The difference between nl_langinfo (CODESET) and locale_charset ()
2N/A is that the latter normalizes the encoding names to GNU conventions. */
2N/A
2N/A#if @GNULIB_NL_LANGINFO@
2N/A# if @REPLACE_NL_LANGINFO@
2N/A# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2N/A# undef nl_langinfo
2N/A# define nl_langinfo rpl_nl_langinfo
2N/A# endif
2N/A_GL_FUNCDECL_RPL (nl_langinfo, char *, (nl_item item));
2N/A_GL_CXXALIAS_RPL (nl_langinfo, char *, (nl_item item));
2N/A# else
2N/A# if !@HAVE_NL_LANGINFO@
2N/A_GL_FUNCDECL_SYS (nl_langinfo, char *, (nl_item item));
2N/A# endif
2N/A_GL_CXXALIAS_SYS (nl_langinfo, char *, (nl_item item));
2N/A# endif
2N/A_GL_CXXALIASWARN (nl_langinfo);
2N/A#elif defined GNULIB_POSIXCHECK
2N/A# undef nl_langinfo
2N/A# if HAVE_RAW_DECL_NL_LANGINFO
2N/A_GL_WARN_ON_USE (nl_langinfo, "nl_langinfo is not portable - "
2N/A "use gnulib module nl_langinfo for portability");
2N/A# endif
2N/A#endif
2N/A
2N/A
2N/A#endif /* _GL_LANGINFO_H */
2N/A#endif /* _GL_LANGINFO_H */