Back to index

plt-scheme  4.2.1
gettext.c
Go to the documentation of this file.
00001 /* gettext.c -- implementation of gettext(3) function
00002    Copyright (C) 1995 Software Foundation, Inc.
00003 
00004 This program is free software; you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 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
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
00017 
00018 #ifdef HAVE_CONFIG_H
00019 # include <config.h>
00020 #endif
00021 
00022 #ifdef _LIBC
00023 # define __need_NULL
00024 # include <stddef.h>
00025 #else
00026 # ifdef STDC_HEADERS
00027 #  include <stdlib.h>              /* Just for NULL.  */
00028 # else
00029 #  ifdef HAVE_STRING_H
00030 #   include <string.h>
00031 #  else
00032 #   define NULL ((void *) 0)
00033 #  endif
00034 # endif
00035 #endif
00036 
00037 #ifdef _LIBC
00038 # include <libintl.h>
00039 #else
00040 # include "libgettext.h"
00041 #endif
00042 
00043 /* @@ end of prolog @@ */
00044 
00045 /* Names for the libintl functions are a problem.  They must not clash
00046    with existing names and they should follow ANSI C.  But this source
00047    code is also used in GNU C Library where the names have a __
00048    prefix.  So we have to make a difference here.  */
00049 #ifdef _LIBC
00050 # define GETTEXT __gettext
00051 # define DGETTEXT __dgettext
00052 #else
00053 # define GETTEXT gettext__
00054 # define DGETTEXT dgettext__
00055 #endif
00056 
00057 /* Look up MSGID in the current default message catalog for the current
00058    LC_MESSAGES locale.  If not found, returns MSGID itself (the default
00059    text).  */
00060 char *
00061 GETTEXT (msgid)
00062      const char *msgid;
00063 {
00064   return DGETTEXT (NULL, msgid);
00065 }
00066 
00067 #ifdef _LIBC
00068 /* Alias for function name in GNU C Library.  */
00069 weak_alias (__gettext, gettext);
00070 #endif