gettext.h revision 93139
193139Sru/* Convenience header for conditional use of GNU <libintl.h>.
293139Sru   Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
393139Sru
493139Sru   This program is free software; you can redistribute it and/or modify it
593139Sru   under the terms of the GNU Library General Public License as published
693139Sru   by 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
1193139Sru   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1293139Sru   Library General Public License for more details.
1393139Sru
1493139Sru   You should have received a copy of the GNU Library General Public
1593139Sru   License along with this program; if not, write to the Free Software
1693139Sru   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1793139Sru   USA.  */
1893139Sru
1993139Sru#ifndef _LIBGETTEXT_H
2093139Sru#define _LIBGETTEXT_H 1
2193139Sru
2293139Sru/* NLS can be disabled through the configure --disable-nls option.  */
2393139Sru#if ENABLE_NLS
2493139Sru
2593139Sru/* Get declarations of GNU message catalog functions.  */
2693139Sru# include <libintl.h>
2793139Sru
2893139Sru#else
2993139Sru
3093139Sru/* Disabled NLS.
3193139Sru   The casts to 'const char *' serve the purpose of producing warnings
3293139Sru   for invalid uses of the value returned from these functions.
3393139Sru   On pre-ANSI systems without 'const', the config.h file is supposed to
3493139Sru   contain "#define const".  */
3593139Sru#if 0
3693139Sru/* no thanks, not ready to go const --karl, 26feb02 */
3793139Sru# define gettext(Msgid) ((const char *) (Msgid))
3893139Sru# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
3993139Sru# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
4093139Sru# define ngettext(Msgid1, Msgid2, N) \
4193139Sru    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
4293139Sru# define dngettext(Domainname, Msgid1, Msgid2, N) \
4393139Sru    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
4493139Sru# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
4593139Sru    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
4693139Sru# define textdomain(Domainname) ((const char *) (Domainname))
4793139Sru# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
4893139Sru# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
4993139Sru#else /* not 0 */
5093139Sru# define gettext(Msgid) ((Msgid))
5193139Sru# define dgettext(Domainname, Msgid) (Msgid)
5293139Sru# define dcgettext(Domainname, Msgid, Category) (Msgid)
5393139Sru# define ngettext(Msgid1, Msgid2, N) \
5493139Sru    ((N) == 1 ? (Msgid1) : (Msgid2))
5593139Sru# define dngettext(Domainname, Msgid1, Msgid2, N) \
5693139Sru    ((N) == 1 ? (Msgid1) : (Msgid2))
5793139Sru# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
5893139Sru    ((N) == 1 ? (Msgid1) : (Msgid2))
5993139Sru# define textdomain(Domainname) (Domainname)
6093139Sru# define bindtextdomain(Domainname, Dirname) (Dirname)
6193139Sru# define bind_textdomain_codeset(Domainname, Codeset) (Codeset)
6293139Sru#endif /* 0 */
6393139Sru#endif
6493139Sru
6593139Sru/* A pseudo function call that serves as a marker for the automated
6693139Sru   extraction of messages, but does not call gettext().  The run-time
6793139Sru   translation is done at a different place in the code.
6893139Sru   The argument, String, should be a literal string.  Concatenated strings
6993139Sru   and other string expressions won't work.
7093139Sru   The macro's expansion is not parenthesized, so that it is suitable as
7193139Sru   initializer for static 'char[]' or 'const char[]' variables.  */
7293139Sru#define gettext_noop(String) String
7393139Sru
7493139Sru#endif /* _LIBGETTEXT_H */
75