Back to index

courier  0.68.2
gettext.c
Go to the documentation of this file.
00001 /* Implementation of gettext(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 /* @@ end of prolog @@ */
00038 
00039 /* Names for the libintl functions are a problem.  They must not clash
00040    with existing names and they should follow ANSI C.  But this source
00041    code is also used in GNU C Library where the names have a __
00042    prefix.  So we have to make a difference here.  */
00043 #ifdef _LIBC
00044 # define GETTEXT __gettext
00045 # define DCGETTEXT INTUSE(__dcgettext)
00046 #else
00047 # define GETTEXT libintl_gettext
00048 # define DCGETTEXT libintl_dcgettext
00049 #endif
00050 
00051 /* Look up MSGID in the current default message catalog for the current
00052    LC_MESSAGES locale.  If not found, returns MSGID itself (the default
00053    text).  */
00054 char *
00055 GETTEXT (const char *msgid)
00056 {
00057   return DCGETTEXT (NULL, msgid, LC_MESSAGES);
00058 }
00059 
00060 #ifdef _LIBC
00061 /* Alias for function name in GNU C Library.  */
00062 weak_alias (__gettext, gettext);
00063 #endif