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