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