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