Blame intl/gettext.c

Packit 8a864e
/* Implementation of gettext(3) function.
Packit 8a864e
   Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
Packit 8a864e
Packit 8a864e
   This program is free software; you can redistribute it and/or modify it
Packit 8a864e
   under the terms of the GNU Library General Public License as published
Packit 8a864e
   by the Free Software Foundation; either version 2, or (at your option)
Packit 8a864e
   any later version.
Packit 8a864e
Packit 8a864e
   This program is distributed in the hope that it will be useful,
Packit 8a864e
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 8a864e
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 8a864e
   Library General Public License for more details.
Packit 8a864e
Packit 8a864e
   You should have received a copy of the GNU Library General Public
Packit 8a864e
   License along with this program; if not, write to the Free Software
Packit 8a864e
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
Packit 8a864e
   USA.  */
Packit 8a864e
Packit 8a864e
#ifdef HAVE_CONFIG_H
Packit 8a864e
# include <config.h>
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#ifdef _LIBC
Packit 8a864e
# define __need_NULL
Packit 8a864e
# include <stddef.h>
Packit 8a864e
#else
Packit 8a864e
# include <stdlib.h>		/* Just for NULL.  */
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#include "gettextP.h"
Packit 8a864e
#ifdef _LIBC
Packit 8a864e
# include <libintl.h>
Packit 8a864e
#else
Packit 8a864e
# include "libgnuintl.h"
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
/* @@ end of prolog @@ */
Packit 8a864e
Packit 8a864e
/* Names for the libintl functions are a problem.  They must not clash
Packit 8a864e
   with existing names and they should follow ANSI C.  But this source
Packit 8a864e
   code is also used in GNU C Library where the names have a __
Packit 8a864e
   prefix.  So we have to make a difference here.  */
Packit 8a864e
#ifdef _LIBC
Packit 8a864e
# define GETTEXT __gettext
Packit 8a864e
# define DCGETTEXT INTUSE(__dcgettext)
Packit 8a864e
#else
Packit 8a864e
# define GETTEXT libintl_gettext
Packit 8a864e
# define DCGETTEXT libintl_dcgettext
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
/* Look up MSGID in the current default message catalog for the current
Packit 8a864e
   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
Packit 8a864e
   text).  */
Packit 8a864e
char *
Packit 8a864e
GETTEXT (const char *msgid)
Packit 8a864e
{
Packit 8a864e
  return DCGETTEXT (NULL, msgid, LC_MESSAGES);
Packit 8a864e
}
Packit 8a864e
Packit 8a864e
#ifdef _LIBC
Packit 8a864e
/* Alias for function name in GNU C Library.  */
Packit 8a864e
weak_alias (__gettext, gettext);
Packit 8a864e
#endif