xref: /openbsd-src/gnu/usr.bin/texinfo/intl/dgettext.c (revision a1acfa9b69ad64eb720639240c8438f11107dc85)
13fb98d4aSespie /* Implementation of the dgettext(3) function.
2*a1acfa9bSespie    Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
3840175f0Skstailey 
43fb98d4aSespie    This program is free software; you can redistribute it and/or modify it
53fb98d4aSespie    under the terms of the GNU Library General Public License as published
63fb98d4aSespie    by the Free Software Foundation; either version 2, or (at your option)
7840175f0Skstailey    any later version.
8840175f0Skstailey 
9840175f0Skstailey    This program is distributed in the hope that it will be useful,
10840175f0Skstailey    but WITHOUT ANY WARRANTY; without even the implied warranty of
113fb98d4aSespie    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
123fb98d4aSespie    Library General Public License for more details.
13840175f0Skstailey 
143fb98d4aSespie    You should have received a copy of the GNU Library General Public
153fb98d4aSespie    License along with this program; if not, write to the Free Software
163fb98d4aSespie    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
173fb98d4aSespie    USA.  */
18840175f0Skstailey 
19840175f0Skstailey #ifdef HAVE_CONFIG_H
20840175f0Skstailey # include <config.h>
21840175f0Skstailey #endif
22840175f0Skstailey 
23*a1acfa9bSespie #include "gettextP.h"
24*a1acfa9bSespie 
25840175f0Skstailey #include <locale.h>
26840175f0Skstailey 
27840175f0Skstailey #ifdef _LIBC
28840175f0Skstailey # include <libintl.h>
29840175f0Skstailey #else
303fb98d4aSespie # include "libgnuintl.h"
31840175f0Skstailey #endif
32840175f0Skstailey 
33840175f0Skstailey /* @@ end of prolog @@ */
34840175f0Skstailey 
35840175f0Skstailey /* Names for the libintl functions are a problem.  They must not clash
36840175f0Skstailey    with existing names and they should follow ANSI C.  But this source
37840175f0Skstailey    code is also used in GNU C Library where the names have a __
38840175f0Skstailey    prefix.  So we have to make a difference here.  */
39840175f0Skstailey #ifdef _LIBC
40840175f0Skstailey # define DGETTEXT __dgettext
41*a1acfa9bSespie # define DCGETTEXT INTUSE(__dcgettext)
42840175f0Skstailey #else
43*a1acfa9bSespie # define DGETTEXT libintl_dgettext
44*a1acfa9bSespie # define DCGETTEXT libintl_dcgettext
45840175f0Skstailey #endif
46840175f0Skstailey 
47840175f0Skstailey /* Look up MSGID in the DOMAINNAME message catalog of the current
48840175f0Skstailey    LC_MESSAGES locale.  */
49840175f0Skstailey char *
DGETTEXT(const char * domainname,const char * msgid)50*a1acfa9bSespie DGETTEXT (const char *domainname, const char *msgid)
51840175f0Skstailey {
52840175f0Skstailey   return DCGETTEXT (domainname, msgid, LC_MESSAGES);
53840175f0Skstailey }
54840175f0Skstailey 
55840175f0Skstailey #ifdef _LIBC
56840175f0Skstailey /* Alias for function name in GNU C Library.  */
57840175f0Skstailey weak_alias (__dgettext, dgettext);
58840175f0Skstailey #endif
59