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