xref: /openbsd-src/gnu/usr.bin/texinfo/lib/gettext.h (revision a1acfa9b69ad64eb720639240c8438f11107dc85)
1f8dd34f6Sespie /* Convenience header for conditional use of GNU <libintl.h>.
2f8dd34f6Sespie    Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
3f8dd34f6Sespie 
4*a1acfa9bSespie    This program is free software; you can redistribute it and/or modify
5*a1acfa9bSespie    it under the terms of the GNU General Public License as published by
6*a1acfa9bSespie    the Free Software Foundation; either version 2, or (at your option)
7f8dd34f6Sespie    any later version.
8f8dd34f6Sespie 
9f8dd34f6Sespie    This program is distributed in the hope that it will be useful,
10f8dd34f6Sespie    but WITHOUT ANY WARRANTY; without even the implied warranty of
11*a1acfa9bSespie    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12*a1acfa9bSespie    GNU General Public License for more details.
13f8dd34f6Sespie 
14*a1acfa9bSespie    You should have received a copy of the GNU General Public License along
15*a1acfa9bSespie    with this program; if not, write to the Free Software Foundation,
16*a1acfa9bSespie    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
17f8dd34f6Sespie 
18f8dd34f6Sespie #ifndef _LIBGETTEXT_H
19f8dd34f6Sespie #define _LIBGETTEXT_H 1
20f8dd34f6Sespie 
21f8dd34f6Sespie /* NLS can be disabled through the configure --disable-nls option.  */
22f8dd34f6Sespie #if ENABLE_NLS
23f8dd34f6Sespie 
24f8dd34f6Sespie /* Get declarations of GNU message catalog functions.  */
25f8dd34f6Sespie # include <libintl.h>
26f8dd34f6Sespie 
27f8dd34f6Sespie #else
28f8dd34f6Sespie 
29*a1acfa9bSespie /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
30*a1acfa9bSespie    chokes if dcgettext is defined as a macro.  So include it now, to make
31*a1acfa9bSespie    later inclusions of <locale.h> a NOP.  We don't include <libintl.h>
32*a1acfa9bSespie    as well because people using "gettext.h" will not include <libintl.h>,
33*a1acfa9bSespie    and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
34*a1acfa9bSespie    is OK.  */
35*a1acfa9bSespie #if defined(__sun)
36*a1acfa9bSespie # include <locale.h>
37*a1acfa9bSespie #endif
38*a1acfa9bSespie 
39f8dd34f6Sespie /* Disabled NLS.
40f8dd34f6Sespie    The casts to 'const char *' serve the purpose of producing warnings
41f8dd34f6Sespie    for invalid uses of the value returned from these functions.
42f8dd34f6Sespie    On pre-ANSI systems without 'const', the config.h file is supposed to
43f8dd34f6Sespie    contain "#define const".  */
44f8dd34f6Sespie # define gettext(Msgid) ((const char *) (Msgid))
45f8dd34f6Sespie # define dgettext(Domainname, Msgid) ((const char *) (Msgid))
46f8dd34f6Sespie # define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
47f8dd34f6Sespie # define ngettext(Msgid1, Msgid2, N) \
48f8dd34f6Sespie     ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
49f8dd34f6Sespie # define dngettext(Domainname, Msgid1, Msgid2, N) \
50f8dd34f6Sespie     ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
51f8dd34f6Sespie # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
52f8dd34f6Sespie     ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
53f8dd34f6Sespie # define textdomain(Domainname) ((const char *) (Domainname))
54f8dd34f6Sespie # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
55f8dd34f6Sespie # define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
56*a1acfa9bSespie 
57f8dd34f6Sespie #endif
58f8dd34f6Sespie 
59f8dd34f6Sespie /* A pseudo function call that serves as a marker for the automated
60f8dd34f6Sespie    extraction of messages, but does not call gettext().  The run-time
61f8dd34f6Sespie    translation is done at a different place in the code.
62f8dd34f6Sespie    The argument, String, should be a literal string.  Concatenated strings
63f8dd34f6Sespie    and other string expressions won't work.
64f8dd34f6Sespie    The macro's expansion is not parenthesized, so that it is suitable as
65f8dd34f6Sespie    initializer for static 'char[]' or 'const char[]' variables.  */
66f8dd34f6Sespie #define gettext_noop(String) String
67f8dd34f6Sespie 
68f8dd34f6Sespie #endif /* _LIBGETTEXT_H */
69