Blame gettext-runtime/intl/gettext.c

Packit Bot 06c835
/* Implementation of gettext(3) function.
Packit Bot 06c835
   Copyright (C) 1995-2015 Free Software Foundation, Inc.
Packit Bot 06c835
Packit Bot 06c835
   This program is free software: you can redistribute it and/or modify
Packit Bot 06c835
   it under the terms of the GNU Lesser General Public License as published by
Packit Bot 06c835
   the Free Software Foundation; either version 2.1 of the License, or
Packit Bot 06c835
   (at your option) any later version.
Packit Bot 06c835
Packit Bot 06c835
   This program is distributed in the hope that it will be useful,
Packit Bot 06c835
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Bot 06c835
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Bot 06c835
   GNU Lesser General Public License for more details.
Packit Bot 06c835
Packit Bot 06c835
   You should have received a copy of the GNU Lesser General Public License
Packit Bot 06c835
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit Bot 06c835
Packit Bot 06c835
#ifdef HAVE_CONFIG_H
Packit Bot 06c835
# include <config.h>
Packit Bot 06c835
#endif
Packit Bot 06c835
Packit Bot 06c835
#ifdef _LIBC
Packit Bot 06c835
# define __need_NULL
Packit Bot 06c835
# include <stddef.h>
Packit Bot 06c835
#else
Packit Bot 06c835
# include <stdlib.h>		/* Just for NULL.  */
Packit Bot 06c835
#endif
Packit Bot 06c835
Packit Bot 06c835
#include "gettextP.h"
Packit Bot 06c835
#ifdef _LIBC
Packit Bot 06c835
# include <libintl.h>
Packit Bot 06c835
#else
Packit Bot 06c835
# include "libgnuintl.h"
Packit Bot 06c835
#endif
Packit Bot 06c835
Packit Bot 06c835
/* @@ end of prolog @@ */
Packit Bot 06c835
Packit Bot 06c835
/* Names for the libintl functions are a problem.  They must not clash
Packit Bot 06c835
   with existing names and they should follow ANSI C.  But this source
Packit Bot 06c835
   code is also used in GNU C Library where the names have a __
Packit Bot 06c835
   prefix.  So we have to make a difference here.  */
Packit Bot 06c835
#ifdef _LIBC
Packit Bot 06c835
# define GETTEXT __gettext
Packit Bot 06c835
# define DCGETTEXT __dcgettext
Packit Bot 06c835
#else
Packit Bot 06c835
# define GETTEXT libintl_gettext
Packit Bot 06c835
# define DCGETTEXT libintl_dcgettext
Packit Bot 06c835
#endif
Packit Bot 06c835
Packit Bot 06c835
/* Look up MSGID in the current default message catalog for the current
Packit Bot 06c835
   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
Packit Bot 06c835
   text).  */
Packit Bot 06c835
char *
Packit Bot 06c835
GETTEXT (const char *msgid)
Packit Bot 06c835
{
Packit Bot 06c835
  return DCGETTEXT (NULL, msgid, LC_MESSAGES);
Packit Bot 06c835
}
Packit Bot 06c835
Packit Bot 06c835
#ifdef _LIBC
Packit Bot 06c835
/* Alias for function name in GNU C Library.  */
Packit Bot 06c835
weak_alias (__gettext, gettext);
Packit Bot 06c835
#endif