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