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