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