193139Sru/* Convenience header for conditional use of GNU <libintl.h>.
293139Sru   Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
393139Sru
4146515Sru   This program is free software; you can redistribute it and/or modify
5146515Sru   it under the terms of the GNU General Public License as published by
6146515Sru   the Free Software Foundation; either version 2, or (at your option)
793139Sru   any later version.
893139Sru
993139Sru   This program is distributed in the hope that it will be useful,
1093139Sru   but WITHOUT ANY WARRANTY; without even the implied warranty of
11146515Sru   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12146515Sru   GNU General Public License for more details.
1393139Sru
14146515Sru   You should have received a copy of the GNU General Public License along
15146515Sru   with this program; if not, write to the Free Software Foundation,
16146515Sru   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
1793139Sru
1893139Sru#ifndef _LIBGETTEXT_H
1993139Sru#define _LIBGETTEXT_H 1
2093139Sru
2193139Sru/* NLS can be disabled through the configure --disable-nls option.  */
2293139Sru#if ENABLE_NLS
2393139Sru
2493139Sru/* Get declarations of GNU message catalog functions.  */
2593139Sru# include <libintl.h>
2693139Sru
2793139Sru#else
2893139Sru
29114472Sru/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
30114472Sru   chokes if dcgettext is defined as a macro.  So include it now, to make
31114472Sru   later inclusions of <locale.h> a NOP.  We don't include <libintl.h>
32114472Sru   as well because people using "gettext.h" will not include <libintl.h>,
33114472Sru   and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
34114472Sru   is OK.  */
35114472Sru#if defined(__sun)
36114472Sru# include <locale.h>
37114472Sru#endif
38114472Sru
3993139Sru/* Disabled NLS.
4093139Sru   The casts to 'const char *' serve the purpose of producing warnings
4193139Sru   for invalid uses of the value returned from these functions.
4293139Sru   On pre-ANSI systems without 'const', the config.h file is supposed to
4393139Sru   contain "#define const".  */
4493139Sru# define gettext(Msgid) ((const char *) (Msgid))
4593139Sru# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
4693139Sru# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
4793139Sru# define ngettext(Msgid1, Msgid2, N) \
4893139Sru    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
4993139Sru# define dngettext(Domainname, Msgid1, Msgid2, N) \
5093139Sru    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
5193139Sru# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
5293139Sru    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
5393139Sru# define textdomain(Domainname) ((const char *) (Domainname))
5493139Sru# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
5593139Sru# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
56114472Sru
5793139Sru#endif
5893139Sru
5993139Sru/* A pseudo function call that serves as a marker for the automated
6093139Sru   extraction of messages, but does not call gettext().  The run-time
6193139Sru   translation is done at a different place in the code.
6293139Sru   The argument, String, should be a literal string.  Concatenated strings
6393139Sru   and other string expressions won't work.
6493139Sru   The macro's expansion is not parenthesized, so that it is suitable as
6593139Sru   initializer for static 'char[]' or 'const char[]' variables.  */
6693139Sru#define gettext_noop(String) String
6793139Sru
6893139Sru#endif /* _LIBGETTEXT_H */
69