OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [intl/] [libgettext.h] - Diff between revs 578 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 578 Rev 1765
/* Message catalogs for internationalization.
/* Message catalogs for internationalization.
   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 
 
   This program is free software; you can redistribute it and/or modify
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   the Free Software Foundation; either version 2, or (at your option)
   any later version.
   any later version.
 
 
   This program is distributed in the hope that it will be useful,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software Foundation,
   along with this program; if not, write to the Free Software Foundation,
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 
/* Because on some systems (e.g. Solaris) we sometimes have to include
/* Because on some systems (e.g. Solaris) we sometimes have to include
   the systems libintl.h as well as this file we have more complex
   the systems libintl.h as well as this file we have more complex
   include protection above.  But the systems header might perhaps also
   include protection above.  But the systems header might perhaps also
   define _LIBINTL_H and therefore we have to protect the definition here.  */
   define _LIBINTL_H and therefore we have to protect the definition here.  */
 
 
#if !defined (_LIBINTL_H) || !defined (_LIBGETTEXT_H)
#if !defined (_LIBINTL_H) || !defined (_LIBGETTEXT_H)
#if !defined (_LIBINTL_H)
#if !defined (_LIBINTL_H)
# define _LIBINTL_H     1
# define _LIBINTL_H     1
#endif
#endif
#define _LIBGETTEXT_H   1
#define _LIBGETTEXT_H   1
 
 
/* We define an additional symbol to signal that we use the GNU
/* We define an additional symbol to signal that we use the GNU
   implementation of gettext.  */
   implementation of gettext.  */
#define __USE_GNU_GETTEXT 1
#define __USE_GNU_GETTEXT 1
 
 
#include <sys/types.h>
#include <sys/types.h>
 
 
#if HAVE_LOCALE_H
#if HAVE_LOCALE_H
# include <locale.h>
# include <locale.h>
#endif
#endif
 
 
 
 
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
#endif
 
 
/* @@ end of prolog @@ */
/* @@ end of prolog @@ */
 
 
#ifndef PARAMS
#ifndef PARAMS
# if __STDC__
# if __STDC__
#  define PARAMS(args) args
#  define PARAMS(args) args
# else
# else
#  define PARAMS(args) ()
#  define PARAMS(args) ()
# endif
# endif
#endif
#endif
 
 
#ifndef NULL
#ifndef NULL
# if !defined __cplusplus || defined __GNUC__
# if !defined __cplusplus || defined __GNUC__
#  define NULL ((void *) 0)
#  define NULL ((void *) 0)
# else
# else
#  define NULL (0)
#  define NULL (0)
# endif
# endif
#endif
#endif
 
 
#if !HAVE_LC_MESSAGES
#if !HAVE_LC_MESSAGES
/* This value determines the behaviour of the gettext() and dgettext()
/* This value determines the behaviour of the gettext() and dgettext()
   function.  But some system does not have this defined.  Define it
   function.  But some system does not have this defined.  Define it
   to a default value.  */
   to a default value.  */
# define LC_MESSAGES (-1)
# define LC_MESSAGES (-1)
#endif
#endif
 
 
 
 
/* Declarations for gettext-using-catgets interface.  Derived from
/* Declarations for gettext-using-catgets interface.  Derived from
   Jim Meyering's libintl.h.  */
   Jim Meyering's libintl.h.  */
struct _msg_ent
struct _msg_ent
{
{
  const char *_msg;
  const char *_msg;
  int _msg_number;
  int _msg_number;
};
};
 
 
 
 
#if HAVE_CATGETS
#if HAVE_CATGETS
/* These two variables are defined in the automatically by po-to-tbl.sed
/* These two variables are defined in the automatically by po-to-tbl.sed
   generated file `cat-id-tbl.c'.  */
   generated file `cat-id-tbl.c'.  */
extern const struct _msg_ent _msg_tbl[];
extern const struct _msg_ent _msg_tbl[];
extern int _msg_tbl_length;
extern int _msg_tbl_length;
#endif
#endif
 
 
 
 
/* For automatical extraction of messages sometimes no real
/* For automatical extraction of messages sometimes no real
   translation is needed.  Instead the string itself is the result.  */
   translation is needed.  Instead the string itself is the result.  */
#define gettext_noop(Str) (Str)
#define gettext_noop(Str) (Str)
 
 
/* Look up MSGID in the current default message catalog for the current
/* Look up MSGID in the current default message catalog for the current
   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
   text).  */
   text).  */
extern char *gettext PARAMS ((const char *__msgid));
extern char *gettext PARAMS ((const char *__msgid));
extern char *gettext__ PARAMS ((const char *__msgid));
extern char *gettext__ PARAMS ((const char *__msgid));
 
 
/* Look up MSGID in the DOMAINNAME message catalog for the current
/* Look up MSGID in the DOMAINNAME message catalog for the current
   LC_MESSAGES locale.  */
   LC_MESSAGES locale.  */
extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
extern char *dgettext__ PARAMS ((const char *__domainname,
extern char *dgettext__ PARAMS ((const char *__domainname,
                                 const char *__msgid));
                                 const char *__msgid));
 
 
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
   locale.  */
   locale.  */
extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
                                int __category));
                                int __category));
extern char *dcgettext__ PARAMS ((const char *__domainname,
extern char *dcgettext__ PARAMS ((const char *__domainname,
                                  const char *__msgid, int __category));
                                  const char *__msgid, int __category));
 
 
 
 
/* Set the current default message catalog to DOMAINNAME.
/* Set the current default message catalog to DOMAINNAME.
   If DOMAINNAME is null, return the current default.
   If DOMAINNAME is null, return the current default.
   If DOMAINNAME is "", reset to the default of "messages".  */
   If DOMAINNAME is "", reset to the default of "messages".  */
extern char *textdomain PARAMS ((const char *__domainname));
extern char *textdomain PARAMS ((const char *__domainname));
extern char *textdomain__ PARAMS ((const char *__domainname));
extern char *textdomain__ PARAMS ((const char *__domainname));
 
 
/* Specify that the DOMAINNAME message catalog will be found
/* Specify that the DOMAINNAME message catalog will be found
   in DIRNAME rather than in the system locale data base.  */
   in DIRNAME rather than in the system locale data base.  */
extern char *bindtextdomain PARAMS ((const char *__domainname,
extern char *bindtextdomain PARAMS ((const char *__domainname,
                                  const char *__dirname));
                                  const char *__dirname));
extern char *bindtextdomain__ PARAMS ((const char *__domainname,
extern char *bindtextdomain__ PARAMS ((const char *__domainname,
                                    const char *__dirname));
                                    const char *__dirname));
 
 
#if ENABLE_NLS
#if ENABLE_NLS
 
 
/* Solaris 2.3 has the gettext function but dcgettext is missing.
/* Solaris 2.3 has the gettext function but dcgettext is missing.
   So we omit this optimization for Solaris 2.3.  BTW, Solaris 2.4
   So we omit this optimization for Solaris 2.3.  BTW, Solaris 2.4
   has dcgettext.  */
   has dcgettext.  */
# if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT)
# if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT)
 
 
#  define gettext(Msgid)                                                      \
#  define gettext(Msgid)                                                      \
     dgettext (NULL, Msgid)
     dgettext (NULL, Msgid)
 
 
#  define dgettext(Domainname, Msgid)                                         \
#  define dgettext(Domainname, Msgid)                                         \
     dcgettext (Domainname, Msgid, LC_MESSAGES)
     dcgettext (Domainname, Msgid, LC_MESSAGES)
 
 
#  if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7
#  if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7
/* This global variable is defined in loadmsgcat.c.  We need a sign,
/* This global variable is defined in loadmsgcat.c.  We need a sign,
   whether a new catalog was loaded, which can be associated with all
   whether a new catalog was loaded, which can be associated with all
   translations.  */
   translations.  */
extern int _nl_msg_cat_cntr;
extern int _nl_msg_cat_cntr;
 
 
#   define dcgettext(Domainname, Msgid, Category)                             \
#   define dcgettext(Domainname, Msgid, Category)                             \
  (__extension__                                                              \
  (__extension__                                                              \
   ({                                                                         \
   ({                                                                         \
     char *__result;                                                          \
     char *__result;                                                          \
     if (__builtin_constant_p (Msgid))                                        \
     if (__builtin_constant_p (Msgid))                                        \
       {                                                                      \
       {                                                                      \
         static char *__translation__;                                        \
         static char *__translation__;                                        \
         static int __catalog_counter__;                                      \
         static int __catalog_counter__;                                      \
         if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr)    \
         if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr)    \
           {                                                                  \
           {                                                                  \
             __translation__ =                                                \
             __translation__ =                                                \
               dcgettext__ (Domainname, Msgid, Category);                     \
               dcgettext__ (Domainname, Msgid, Category);                     \
             __catalog_counter__ = _nl_msg_cat_cntr;                          \
             __catalog_counter__ = _nl_msg_cat_cntr;                          \
           }                                                                  \
           }                                                                  \
         __result = __translation__;                                          \
         __result = __translation__;                                          \
       }                                                                      \
       }                                                                      \
     else                                                                     \
     else                                                                     \
       __result = dcgettext__ (Domainname, Msgid, Category);                  \
       __result = dcgettext__ (Domainname, Msgid, Category);                  \
     __result;                                                                \
     __result;                                                                \
    }))
    }))
#  endif
#  endif
# endif
# endif
 
 
#else
#else
 
 
# define gettext(Msgid) (Msgid)
# define gettext(Msgid) (Msgid)
# define dgettext(Domainname, Msgid) (Msgid)
# define dgettext(Domainname, Msgid) (Msgid)
# define dcgettext(Domainname, Msgid, Category) (Msgid)
# define dcgettext(Domainname, Msgid, Category) (Msgid)
# define textdomain(Domainname) while (0) /* nothing */
# define textdomain(Domainname) while (0) /* nothing */
# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
 
 
#endif
#endif
 
 
/* @@ begin of epilog @@ */
/* @@ begin of epilog @@ */
 
 
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
 
 
#endif
#endif
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.