Back to index

nagios-plugins  1.4.16
langinfo.in.h
Go to the documentation of this file.
00001 /* Substitute for and wrapper around <langinfo.h>.
00002    Copyright (C) 2009, 2010 Free Software Foundation, Inc.
00003 
00004    This program is free software; you can redistribute it and/or modify
00005    it under the terms of the GNU General Public License as published by
00006    the Free Software Foundation; either version 3, or (at your option)
00007    any later version.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012    GNU General Public License for more details.
00013 
00014    You should have received a copy of the GNU General Public License
00015    along with this program; if not, write to the Free Software Foundation,
00016    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
00017 
00018 /*
00019  * POSIX <langinfo.h> for platforms that lack it or have an incomplete one.
00020  * <http://www.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html>
00021  */
00022 
00023 #ifndef _GL_LANGINFO_H
00024 
00025 #if __GNUC__ >= 3
00026 @PRAGMA_SYSTEM_HEADER@
00027 #endif
00028 
00029 /* The include_next requires a split double-inclusion guard.  */
00030 #if @HAVE_LANGINFO_H@
00031 # @INCLUDE_NEXT@ @NEXT_LANGINFO_H@
00032 #endif
00033 
00034 #ifndef _GL_LANGINFO_H
00035 #define _GL_LANGINFO_H
00036 
00037 
00038 #if !@HAVE_LANGINFO_H@
00039 
00040 /* A platform that lacks <langinfo.h>.  */
00041 
00042 /* Assume that it also lacks <nl_types.h> and the nl_item type.  */
00043 typedef int nl_item;
00044 
00045 /* nl_langinfo items of the LC_CTYPE category */
00046 # define CODESET     10000
00047 /* nl_langinfo items of the LC_NUMERIC category */
00048 # define RADIXCHAR   10001
00049 # define THOUSEP     10002
00050 /* nl_langinfo items of the LC_TIME category */
00051 # define D_T_FMT     10003
00052 # define D_FMT       10004
00053 # define T_FMT       10005
00054 # define T_FMT_AMPM  10006
00055 # define AM_STR      10007
00056 # define PM_STR      10008
00057 # define DAY_1       10009
00058 # define DAY_2       (DAY_1 + 1)
00059 # define DAY_3       (DAY_1 + 2)
00060 # define DAY_4       (DAY_1 + 3)
00061 # define DAY_5       (DAY_1 + 4)
00062 # define DAY_6       (DAY_1 + 5)
00063 # define DAY_7       (DAY_1 + 6)
00064 # define ABDAY_1     10016
00065 # define ABDAY_2     (ABDAY_1 + 1)
00066 # define ABDAY_3     (ABDAY_1 + 2)
00067 # define ABDAY_4     (ABDAY_1 + 3)
00068 # define ABDAY_5     (ABDAY_1 + 4)
00069 # define ABDAY_6     (ABDAY_1 + 5)
00070 # define ABDAY_7     (ABDAY_1 + 6)
00071 # define MON_1       10023
00072 # define MON_2       (MON_1 + 1)
00073 # define MON_3       (MON_1 + 2)
00074 # define MON_4       (MON_1 + 3)
00075 # define MON_5       (MON_1 + 4)
00076 # define MON_6       (MON_1 + 5)
00077 # define MON_7       (MON_1 + 6)
00078 # define MON_8       (MON_1 + 7)
00079 # define MON_9       (MON_1 + 8)
00080 # define MON_10      (MON_1 + 9)
00081 # define MON_11      (MON_1 + 10)
00082 # define MON_12      (MON_1 + 11)
00083 # define ABMON_1     10035
00084 # define ABMON_2     (ABMON_1 + 1)
00085 # define ABMON_3     (ABMON_1 + 2)
00086 # define ABMON_4     (ABMON_1 + 3)
00087 # define ABMON_5     (ABMON_1 + 4)
00088 # define ABMON_6     (ABMON_1 + 5)
00089 # define ABMON_7     (ABMON_1 + 6)
00090 # define ABMON_8     (ABMON_1 + 7)
00091 # define ABMON_9     (ABMON_1 + 8)
00092 # define ABMON_10    (ABMON_1 + 9)
00093 # define ABMON_11    (ABMON_1 + 10)
00094 # define ABMON_12    (ABMON_1 + 11)
00095 # define ERA         10047
00096 # define ERA_D_FMT   10048
00097 # define ERA_D_T_FMT 10049
00098 # define ERA_T_FMT   10050
00099 # define ALT_DIGITS  10051
00100 /* nl_langinfo items of the LC_MONETARY category */
00101 # define CRNCYSTR    10052
00102 /* nl_langinfo items of the LC_MESSAGES category */
00103 # define YESEXPR     10053
00104 # define NOEXPR      10054
00105 
00106 #else
00107 
00108 /* A platform that has <langinfo.h>.  */
00109 
00110 # if !@HAVE_LANGINFO_CODESET@
00111 #  define CODESET     10000
00112 #  define GNULIB_defined_CODESET 1
00113 # endif
00114 
00115 # if !@HAVE_LANGINFO_ERA@
00116 #  define ERA         10047
00117 #  define ERA_D_FMT   10048
00118 #  define ERA_D_T_FMT 10049
00119 #  define ERA_T_FMT   10050
00120 #  define ALT_DIGITS  10051
00121 #  define GNULIB_defined_ERA 1
00122 # endif
00123 
00124 #endif
00125 
00126 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
00127 
00128 /* The definition of _GL_WARN_ON_USE is copied here.  */
00129 
00130 /* Declare overridden functions.  */
00131 
00132 
00133 /* Return a piece of locale dependent information.
00134    Note: The difference between nl_langinfo (CODESET) and locale_charset ()
00135    is that the latter normalizes the encoding names to GNU conventions.  */
00136 
00137 #if @GNULIB_NL_LANGINFO@
00138 # if @REPLACE_NL_LANGINFO@
00139 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00140 #   undef nl_langinfo
00141 #   define nl_langinfo rpl_nl_langinfo
00142 #  endif
00143 _GL_FUNCDECL_RPL (nl_langinfo, char *, (nl_item item));
00144 _GL_CXXALIAS_RPL (nl_langinfo, char *, (nl_item item));
00145 # else
00146 #  if !@HAVE_NL_LANGINFO@
00147 _GL_FUNCDECL_SYS (nl_langinfo, char *, (nl_item item));
00148 #  endif
00149 _GL_CXXALIAS_SYS (nl_langinfo, char *, (nl_item item));
00150 # endif
00151 _GL_CXXALIASWARN (nl_langinfo);
00152 #elif defined GNULIB_POSIXCHECK
00153 # undef nl_langinfo
00154 # if HAVE_RAW_DECL_NL_LANGINFO
00155 _GL_WARN_ON_USE (nl_langinfo, "nl_langinfo is not portable - "
00156                  "use gnulib module nl_langinfo for portability");
00157 # endif
00158 #endif
00159 
00160 
00161 #endif /* _GL_LANGINFO_H */
00162 #endif /* _GL_LANGINFO_H */