1193323Sed/* Implementation of the dgettext(3) function.
2193323Sed   Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
3193323Sed
4193323Sed   This program is free software; you can redistribute it and/or modify it
5193323Sed   under the terms of the GNU Library General Public License as published
6193323Sed   by the Free Software Foundation; either version 2, or (at your option)
7193323Sed   any later version.
8193323Sed
9193323Sed   This program is distributed in the hope that it will be useful,
10193323Sed   but WITHOUT ANY WARRANTY; without even the implied warranty of
11193323Sed   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12193323Sed   Library General Public License for more details.
13193323Sed
14193323Sed   You should have received a copy of the GNU Library General Public
15193323Sed   License along with this program; if not, write to the Free Software
16193323Sed   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17199481Srdivacky   USA.  */
18193323Sed
19199481Srdivacky#ifdef HAVE_CONFIG_H
20198090Srdivacky# include <config.h>
21198090Srdivacky#endif
22198090Srdivacky
23198090Srdivacky#include "gettextP.h"
24193323Sed
25210299Sed#include <locale.h>
26198090Srdivacky
27193323Sed#ifdef _LIBC
28193323Sed# include <libintl.h>
29193323Sed#else
30193323Sed# include "libgnuintl.h"
31193323Sed#endif
32199481Srdivacky
33193323Sed/* @@ end of prolog @@ */
34193323Sed
35193323Sed/* Names for the libintl functions are a problem.  They must not clash
36193323Sed   with existing names and they should follow ANSI C.  But this source
37193323Sed   code is also used in GNU C Library where the names have a __
38193323Sed   prefix.  So we have to make a difference here.  */
39193323Sed#ifdef _LIBC
40193323Sed# define DGETTEXT __dgettext
41193323Sed# define DCGETTEXT INTUSE(__dcgettext)
42193323Sed#else
43193323Sed# define DGETTEXT libintl_dgettext
44193323Sed# define DCGETTEXT libintl_dcgettext
45193323Sed#endif
46193323Sed
47193323Sed/* Look up MSGID in the DOMAINNAME message catalog of the current
48193323Sed   LC_MESSAGES locale.  */
49193323Sedchar *
50201360SrdivackyDGETTEXT (const char *domainname, const char *msgid)
51193323Sed{
52193323Sed  return DCGETTEXT (domainname, msgid, LC_MESSAGES);
53193323Sed}
54193323Sed
55193323Sed#ifdef _LIBC
56193323Sed/* Alias for function name in GNU C Library.  */
57193323Sedweak_alias (__dgettext, dgettext);
58193323Sed#endif
59201360Srdivacky