Back to index

courier  0.68.2
ngettext.c
Go to the documentation of this file.
00001 /* Implementation of ngettext(3) function.
00002    Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
00003 
00004    This program is free software; you can redistribute it and/or modify it
00005    under the terms of the GNU Library General Public License as published
00006    by the Free Software Foundation; either version 2, or (at your option)
00007    any later version.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public
00015    License along with this program; if not, write to the Free Software
00016    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
00017    USA.  */
00018 
00019 #ifdef HAVE_CONFIG_H
00020 # include <config.h>
00021 #endif
00022 
00023 #ifdef _LIBC
00024 # define __need_NULL
00025 # include <stddef.h>
00026 #else
00027 # include <stdlib.h>        /* Just for NULL.  */
00028 #endif
00029 
00030 #include "gettextP.h"
00031 #ifdef _LIBC
00032 # include <libintl.h>
00033 #else
00034 # include "libgnuintl.h"
00035 #endif
00036 
00037 #include <locale.h>
00038 
00039 /* @@ end of prolog @@ */
00040 
00041 /* Names for the libintl functions are a problem.  They must not clash
00042    with existing names and they should follow ANSI C.  But this source
00043    code is also used in GNU C Library where the names have a __
00044    prefix.  So we have to make a difference here.  */
00045 #ifdef _LIBC
00046 # define NGETTEXT __ngettext
00047 # define DCNGETTEXT __dcngettext
00048 #else
00049 # define NGETTEXT libintl_ngettext
00050 # define DCNGETTEXT libintl_dcngettext
00051 #endif
00052 
00053 /* Look up MSGID in the current default message catalog for the current
00054    LC_MESSAGES locale.  If not found, returns MSGID itself (the default
00055    text).  */
00056 char *
00057 NGETTEXT (const char *msgid1, const char *msgid2, unsigned long int n)
00058 {
00059   return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES);
00060 }
00061 
00062 #ifdef _LIBC
00063 /* Alias for function name in GNU C Library.  */
00064 weak_alias (__ngettext, ngettext);
00065 #endif