1*36ac495dSmrg /* Implementation of ngettext(3) function.
2*36ac495dSmrg Copyright (C) 1995, 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
3*36ac495dSmrg
4*36ac495dSmrg This program is free software; you can redistribute it and/or modify it
5*36ac495dSmrg under the terms of the GNU Library General Public License as published
6*36ac495dSmrg by the Free Software Foundation; either version 2, or (at your option)
7*36ac495dSmrg any later version.
8*36ac495dSmrg
9*36ac495dSmrg This program is distributed in the hope that it will be useful,
10*36ac495dSmrg but WITHOUT ANY WARRANTY; without even the implied warranty of
11*36ac495dSmrg MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12*36ac495dSmrg Library General Public License for more details.
13*36ac495dSmrg
14*36ac495dSmrg You should have received a copy of the GNU Library General Public
15*36ac495dSmrg License along with this program; if not, write to the Free Software
16*36ac495dSmrg Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301,
17*36ac495dSmrg USA. */
18*36ac495dSmrg
19*36ac495dSmrg #ifdef HAVE_CONFIG_H
20*36ac495dSmrg # include <config.h>
21*36ac495dSmrg #endif
22*36ac495dSmrg
23*36ac495dSmrg #ifdef _LIBC
24*36ac495dSmrg # define __need_NULL
25*36ac495dSmrg # include <stddef.h>
26*36ac495dSmrg #else
27*36ac495dSmrg # include <stdlib.h> /* Just for NULL. */
28*36ac495dSmrg #endif
29*36ac495dSmrg
30*36ac495dSmrg #include "gettextP.h"
31*36ac495dSmrg #ifdef _LIBC
32*36ac495dSmrg # include <libintl.h>
33*36ac495dSmrg #else
34*36ac495dSmrg # include "libgnuintl.h"
35*36ac495dSmrg #endif
36*36ac495dSmrg
37*36ac495dSmrg #include <locale.h>
38*36ac495dSmrg
39*36ac495dSmrg /* @@ end of prolog @@ */
40*36ac495dSmrg
41*36ac495dSmrg /* Names for the libintl functions are a problem. They must not clash
42*36ac495dSmrg with existing names and they should follow ANSI C. But this source
43*36ac495dSmrg code is also used in GNU C Library where the names have a __
44*36ac495dSmrg prefix. So we have to make a difference here. */
45*36ac495dSmrg #ifdef _LIBC
46*36ac495dSmrg # define NGETTEXT __ngettext
47*36ac495dSmrg # define DCNGETTEXT __dcngettext
48*36ac495dSmrg #else
49*36ac495dSmrg # define NGETTEXT libintl_ngettext
50*36ac495dSmrg # define DCNGETTEXT libintl_dcngettext
51*36ac495dSmrg #endif
52*36ac495dSmrg
53*36ac495dSmrg /* Look up MSGID in the current default message catalog for the current
54*36ac495dSmrg LC_MESSAGES locale. If not found, returns MSGID itself (the default
55*36ac495dSmrg text). */
56*36ac495dSmrg char *
NGETTEXT(msgid1,msgid2,n)57*36ac495dSmrg NGETTEXT (msgid1, msgid2, n)
58*36ac495dSmrg const char *msgid1;
59*36ac495dSmrg const char *msgid2;
60*36ac495dSmrg unsigned long int n;
61*36ac495dSmrg {
62*36ac495dSmrg return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES);
63*36ac495dSmrg }
64*36ac495dSmrg
65*36ac495dSmrg #ifdef _LIBC
66*36ac495dSmrg /* Alias for function name in GNU C Library. */
67*36ac495dSmrg weak_alias (__ngettext, ngettext);
68*36ac495dSmrg #endif
69