xref: /netbsd-src/external/gpl2/texinfo/dist/intl/gettext.c (revision 29619d2afe564e54d657b83e5a3ae89584f83720)
1*29619d2aSchristos /*	$NetBSD: gettext.c,v 1.1.1.1 2016/01/14 00:11:28 christos Exp $	*/
2*29619d2aSchristos 
3*29619d2aSchristos /* Implementation of gettext(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 #ifdef _LIBC
26*29619d2aSchristos # define __need_NULL
27*29619d2aSchristos # include <stddef.h>
28*29619d2aSchristos #else
29*29619d2aSchristos # include <stdlib.h>		/* Just for NULL.  */
30*29619d2aSchristos #endif
31*29619d2aSchristos 
32*29619d2aSchristos #include "gettextP.h"
33*29619d2aSchristos #ifdef _LIBC
34*29619d2aSchristos # include <libintl.h>
35*29619d2aSchristos #else
36*29619d2aSchristos # include "libgnuintl.h"
37*29619d2aSchristos #endif
38*29619d2aSchristos 
39*29619d2aSchristos /* @@ end of prolog @@ */
40*29619d2aSchristos 
41*29619d2aSchristos /* Names for the libintl functions are a problem.  They must not clash
42*29619d2aSchristos    with existing names and they should follow ANSI C.  But this source
43*29619d2aSchristos    code is also used in GNU C Library where the names have a __
44*29619d2aSchristos    prefix.  So we have to make a difference here.  */
45*29619d2aSchristos #ifdef _LIBC
46*29619d2aSchristos # define GETTEXT __gettext
47*29619d2aSchristos # define DCGETTEXT INTUSE(__dcgettext)
48*29619d2aSchristos #else
49*29619d2aSchristos # define GETTEXT libintl_gettext
50*29619d2aSchristos # define DCGETTEXT libintl_dcgettext
51*29619d2aSchristos #endif
52*29619d2aSchristos 
53*29619d2aSchristos /* Look up MSGID in the current default message catalog for the current
54*29619d2aSchristos    LC_MESSAGES locale.  If not found, returns MSGID itself (the default
55*29619d2aSchristos    text).  */
56*29619d2aSchristos char *
GETTEXT(const char * msgid)57*29619d2aSchristos GETTEXT (const char *msgid)
58*29619d2aSchristos {
59*29619d2aSchristos   return DCGETTEXT (NULL, msgid, LC_MESSAGES);
60*29619d2aSchristos }
61*29619d2aSchristos 
62*29619d2aSchristos #ifdef _LIBC
63*29619d2aSchristos /* Alias for function name in GNU C Library.  */
64*29619d2aSchristos weak_alias (__gettext, gettext);
65*29619d2aSchristos #endif
66