1*66e63ce3Schristos /* Implementation of the dgettext(3) function.
2*66e63ce3Schristos Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
3*66e63ce3Schristos
4*66e63ce3Schristos This program is free software; you can redistribute it and/or modify it
5*66e63ce3Schristos under the terms of the GNU Library General Public License as published
6*66e63ce3Schristos by the Free Software Foundation; either version 2, or (at your option)
7*66e63ce3Schristos any later version.
8*66e63ce3Schristos
9*66e63ce3Schristos This program is distributed in the hope that it will be useful,
10*66e63ce3Schristos but WITHOUT ANY WARRANTY; without even the implied warranty of
11*66e63ce3Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12*66e63ce3Schristos Library General Public License for more details.
13*66e63ce3Schristos
14*66e63ce3Schristos You should have received a copy of the GNU Library General Public
15*66e63ce3Schristos License along with this program; if not, write to the Free Software
16*66e63ce3Schristos Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301,
17*66e63ce3Schristos USA. */
18*66e63ce3Schristos
19*66e63ce3Schristos #ifdef HAVE_CONFIG_H
20*66e63ce3Schristos # include <config.h>
21*66e63ce3Schristos #endif
22*66e63ce3Schristos
23*66e63ce3Schristos #include "gettextP.h"
24*66e63ce3Schristos
25*66e63ce3Schristos #include <locale.h>
26*66e63ce3Schristos
27*66e63ce3Schristos #ifdef _LIBC
28*66e63ce3Schristos # include <libintl.h>
29*66e63ce3Schristos #else
30*66e63ce3Schristos # include "libgnuintl.h"
31*66e63ce3Schristos #endif
32*66e63ce3Schristos
33*66e63ce3Schristos /* @@ end of prolog @@ */
34*66e63ce3Schristos
35*66e63ce3Schristos /* Names for the libintl functions are a problem. They must not clash
36*66e63ce3Schristos with existing names and they should follow ANSI C. But this source
37*66e63ce3Schristos code is also used in GNU C Library where the names have a __
38*66e63ce3Schristos prefix. So we have to make a difference here. */
39*66e63ce3Schristos #ifdef _LIBC
40*66e63ce3Schristos # define DGETTEXT __dgettext
41*66e63ce3Schristos # define DCGETTEXT INTUSE(__dcgettext)
42*66e63ce3Schristos #else
43*66e63ce3Schristos # define DGETTEXT libintl_dgettext
44*66e63ce3Schristos # define DCGETTEXT libintl_dcgettext
45*66e63ce3Schristos #endif
46*66e63ce3Schristos
47*66e63ce3Schristos /* Look up MSGID in the DOMAINNAME message catalog of the current
48*66e63ce3Schristos LC_MESSAGES locale. */
49*66e63ce3Schristos char *
DGETTEXT(domainname,msgid)50*66e63ce3Schristos DGETTEXT (domainname, msgid)
51*66e63ce3Schristos const char *domainname;
52*66e63ce3Schristos const char *msgid;
53*66e63ce3Schristos {
54*66e63ce3Schristos return DCGETTEXT (domainname, msgid, LC_MESSAGES);
55*66e63ce3Schristos }
56*66e63ce3Schristos
57*66e63ce3Schristos #ifdef _LIBC
58*66e63ce3Schristos /* Alias for function name in GNU C Library. */
59*66e63ce3Schristos weak_alias (__dgettext, dgettext);
60*66e63ce3Schristos #endif
61