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