1104640Simp/* $NetBSD: gettext.h,v 1.1.1.1 2016/01/14 00:11:29 christos Exp $ */ 252506Simp 352506Simp/* Convenience header for conditional use of GNU <libintl.h>. 452506Simp Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. 552506Simp 652506Simp This program is free software; you can redistribute it and/or modify 752506Simp it under the terms of the GNU General Public License as published by 852506Simp the Free Software Foundation; either version 2, or (at your option) 952506Simp any later version. 1052506Simp 1152506Simp This program is distributed in the hope that it will be useful, 1252506Simp but WITHOUT ANY WARRANTY; without even the implied warranty of 1352506Simp MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1452506Simp GNU General Public License for more details. 1552506Simp 1652506Simp You should have received a copy of the GNU General Public License along 1752506Simp with this program; if not, write to the Free Software Foundation, 1852506Simp Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 1952506Simp 2052506Simp#ifndef _LIBGETTEXT_H 2152506Simp#define _LIBGETTEXT_H 1 2252506Simp 2352506Simp/* NLS can be disabled through the configure --disable-nls option. */ 2452506Simp#if ENABLE_NLS 2552506Simp 2652506Simp/* Get declarations of GNU message catalog functions. */ 2752506Simp# include <libintl.h> 2852506Simp 2952506Simp#else 3052506Simp 3152506Simp/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which 3252506Simp chokes if dcgettext is defined as a macro. So include it now, to make 3352506Simp later inclusions of <locale.h> a NOP. We don't include <libintl.h> 3452506Simp as well because people using "gettext.h" will not include <libintl.h>, 3552506Simp and also including <libintl.h> would fail on SunOS 4, whereas <locale.h> 3652506Simp is OK. */ 3752506Simp#if defined(__sun) 3852506Simp# include <locale.h> 3952506Simp#endif 4052506Simp 4152506Simp/* Disabled NLS. 4252506Simp The casts to 'const char *' serve the purpose of producing warnings 4352506Simp for invalid uses of the value returned from these functions. 4452506Simp On pre-ANSI systems without 'const', the config.h file is supposed to 4552506Simp contain "#define const". */ 4652506Simp# define gettext(Msgid) ((const char *) (Msgid)) 4752506Simp# define dgettext(Domainname, Msgid) ((const char *) (Msgid)) 4852506Simp# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) 4959193Simp# define ngettext(Msgid1, Msgid2, N) \ 5059193Simp ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) 5191786Simp# define dngettext(Domainname, Msgid1, Msgid2, N) \ 5291786Simp ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) 5359193Simp# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ 5452506Simp ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) 5591786Simp# define textdomain(Domainname) ((const char *) (Domainname)) 5691786Simp# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) 5752506Simp# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) 5852506Simp 5955720Simp#endif 6052506Simp 6152506Simp/* A pseudo function call that serves as a marker for the automated 6252506Simp extraction of messages, but does not call gettext(). The run-time 6352506Simp translation is done at a different place in the code. 6452506Simp The argument, String, should be a literal string. Concatenated strings 6552506Simp and other string expressions won't work. 6652506Simp The macro's expansion is not parenthesized, so that it is suitable as 6752506Simp initializer for static 'char[]' or 'const char[]' variables. */ 6852506Simp#define gettext_noop(String) String 6952506Simp 7052506Simp#endif /* _LIBGETTEXT_H */ 7152506Simp