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