/*1* SPDX-License-Identifier: ISC2*3* Copyright (c) 2011-2014 Todd C. Miller <[email protected]>4*5* Permission to use, copy, modify, and distribute this software for any6* purpose with or without fee is hereby granted, provided that the above7* copyright notice and this permission notice appear in all copies.8*9* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES10* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF11* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR12* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES13* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN14* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF15* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.16*/1718#ifndef SUDO_GETTEXT_H19#define SUDO_GETTEXT_H2021/*22* Solaris locale.h includes libintl.h which causes problems when we23* redefine the gettext functions. We include it first to avoid this.24*/25#include <locale.h>2627#ifdef HAVE_LIBINTL_H2829# include <libintl.h>3031/*32* If DEFAULT_TEXT_DOMAIN is defined, use its value as the domain for33* gettext() and ngettext() instead of the value set by textdomain().34* This is used by the sudoers plugin as well as the convenience libraries.35*/36# ifdef DEFAULT_TEXT_DOMAIN37# undef gettext38# define gettext(String) \39dgettext(DEFAULT_TEXT_DOMAIN, String)40# undef ngettext41# define ngettext(String, String_Plural, N) \42dngettext(DEFAULT_TEXT_DOMAIN, String, String_Plural, N)43# endif4445/*46* Older versions of Solaris lack ngettext() so we have to kludge it.47*/48# ifndef HAVE_NGETTEXT49# undef ngettext50# define ngettext(String, String_Plural, N) \51((N) == 1 ? gettext(String) : gettext(String_Plural))52# endif5354/* Gettext convenience macros */55# define _(String) gettext(String)56# define gettext_noop(String) String57# define N_(String) gettext_noop(String)58# define U_(String) sudo_warn_gettext(String)5960#else /* !HAVE_LIBINTL_H */6162/*63* Internationalization is either unavailable or has been disabled.64* Define away the gettext functions used by sudo.65*/66# define _(String) String67# define N_(String) String68# define U_(String) String69# define textdomain(Domain)70# define bindtextdomain(Package, Directory)71# define ngettext(String, String_Plural, N) \72((N) == 1 ? (String) : (String_Plural))7374#endif /* HAVE_LIBINTL_H */7576#endif /* SUDO_GETTEXT_H */777879