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