Blame intl/libgnuintl.h.in

Packit 8a864e
/* Message catalogs for internationalization.
Packit 8a864e
   Copyright (C) 1995-1997, 2000-2004 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
#ifndef _LIBINTL_H
Packit 8a864e
#define _LIBINTL_H	1
Packit 8a864e
Packit 8a864e
#include <locale.h>
Packit 8a864e
Packit 8a864e
/* The LC_MESSAGES locale category is the category used by the functions
Packit 8a864e
   gettext() and dgettext().  It is specified in POSIX, but not in ANSI C.
Packit 8a864e
   On systems that don't define it, use an arbitrary value instead.
Packit 8a864e
   On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
Packit 8a864e
   then includes <libintl.h> (i.e. this file!) and then only defines
Packit 8a864e
   LC_MESSAGES.  To avoid a redefinition warning, don't define LC_MESSAGES
Packit 8a864e
   in this case.  */
Packit 8a864e
#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
Packit 8a864e
# define LC_MESSAGES 1729
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
/* We define an additional symbol to signal that we use the GNU
Packit 8a864e
   implementation of gettext.  */
Packit 8a864e
#define __USE_GNU_GETTEXT 1
Packit 8a864e
Packit 8a864e
/* Provide information about the supported file formats.  Returns the
Packit 8a864e
   maximum minor revision number supported for a given major revision.  */
Packit 8a864e
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
Packit 8a864e
  ((major) == 0 || (major) == 1 ? 1 : -1)
Packit 8a864e
Packit 8a864e
/* Resolve a platform specific conflict on DJGPP.  GNU gettext takes
Packit 8a864e
   precedence over _conio_gettext.  */
Packit 8a864e
#ifdef __DJGPP__
Packit 8a864e
# undef gettext
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#ifdef __cplusplus
Packit 8a864e
extern "C" {
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
Packit 8a864e
/* We redirect the functions to those prefixed with "libintl_".  This is
Packit 8a864e
   necessary, because some systems define gettext/textdomain/... in the C
Packit 8a864e
   library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
Packit 8a864e
   If we used the unprefixed names, there would be cases where the
Packit 8a864e
   definition in the C library would override the one in the libintl.so
Packit 8a864e
   shared library.  Recall that on ELF systems, the symbols are looked
Packit 8a864e
   up in the following order:
Packit 8a864e
     1. in the executable,
Packit 8a864e
     2. in the shared libraries specified on the link command line, in order,
Packit 8a864e
     3. in the dependencies of the shared libraries specified on the link
Packit 8a864e
        command line,
Packit 8a864e
     4. in the dlopen()ed shared libraries, in the order in which they were
Packit 8a864e
        dlopen()ed.
Packit 8a864e
   The definition in the C library would override the one in libintl.so if
Packit 8a864e
   either
Packit 8a864e
     * -lc is given on the link command line and -lintl isn't, or
Packit 8a864e
     * -lc is given on the link command line before -lintl, or
Packit 8a864e
     * libintl.so is a dependency of a dlopen()ed shared library but not
Packit 8a864e
       linked to the executable at link time.
Packit 8a864e
   Since Solaris gettext() behaves differently than GNU gettext(), this
Packit 8a864e
   would be unacceptable.
Packit 8a864e
Packit 8a864e
   The redirection happens by default through macros in C, so that &gettext
Packit 8a864e
   is independent of the compilation unit, but through inline functions in
Packit 8a864e
   C++, in order not to interfere with the name mangling of class fields or
Packit 8a864e
   class methods called 'gettext'.  */
Packit 8a864e
Packit 8a864e
/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
Packit 8a864e
   If he doesn't, we choose the method.  A third possible method is
Packit 8a864e
   _INTL_REDIRECT_ASM, supported only by GCC.  */
Packit 8a864e
#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
Packit 8a864e
# if __GNUC__ >= 2 && !defined __APPLE_CC__ && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
Packit 8a864e
#  define _INTL_REDIRECT_ASM
Packit 8a864e
# else
Packit 8a864e
#  ifdef __cplusplus
Packit 8a864e
#   define _INTL_REDIRECT_INLINE
Packit 8a864e
#  else
Packit 8a864e
#   define _INTL_REDIRECT_MACROS
Packit 8a864e
#  endif
Packit 8a864e
# endif
Packit 8a864e
#endif
Packit 8a864e
/* Auxiliary macros.  */
Packit 8a864e
#ifdef _INTL_REDIRECT_ASM
Packit 8a864e
# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))
Packit 8a864e
# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring
Packit 8a864e
# define _INTL_STRINGIFY(prefix) #prefix
Packit 8a864e
#else
Packit 8a864e
# define _INTL_ASM(cname)
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
#ifdef _INTL_REDIRECT_INLINE
Packit 8a864e
extern char *libintl_gettext (const char *__msgid);
Packit 8a864e
static inline char *gettext (const char *__msgid)
Packit 8a864e
{
Packit 8a864e
  return libintl_gettext (__msgid);
Packit 8a864e
}
Packit 8a864e
#else
Packit 8a864e
#ifdef _INTL_REDIRECT_MACROS
Packit 8a864e
# define gettext libintl_gettext
Packit 8a864e
#endif
Packit 8a864e
extern char *gettext (const char *__msgid)
Packit 8a864e
       _INTL_ASM (libintl_gettext);
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
/* Look up MSGID in the DOMAINNAME message catalog for the current
Packit 8a864e
   LC_MESSAGES locale.  */
Packit 8a864e
#ifdef _INTL_REDIRECT_INLINE
Packit 8a864e
extern char *libintl_dgettext (const char *__domainname, const char *__msgid);
Packit 8a864e
static inline char *dgettext (const char *__domainname, const char *__msgid)
Packit 8a864e
{
Packit 8a864e
  return libintl_dgettext (__domainname, __msgid);
Packit 8a864e
}
Packit 8a864e
#else
Packit 8a864e
#ifdef _INTL_REDIRECT_MACROS
Packit 8a864e
# define dgettext libintl_dgettext
Packit 8a864e
#endif
Packit 8a864e
extern char *dgettext (const char *__domainname, const char *__msgid)
Packit 8a864e
       _INTL_ASM (libintl_dgettext);
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
Packit 8a864e
   locale.  */
Packit 8a864e
#ifdef _INTL_REDIRECT_INLINE
Packit 8a864e
extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
Packit 8a864e
				int __category);
Packit 8a864e
static inline char *dcgettext (const char *__domainname, const char *__msgid,
Packit 8a864e
			       int __category)
Packit 8a864e
{
Packit 8a864e
  return libintl_dcgettext (__domainname, __msgid, __category);
Packit 8a864e
}
Packit 8a864e
#else
Packit 8a864e
#ifdef _INTL_REDIRECT_MACROS
Packit 8a864e
# define dcgettext libintl_dcgettext
Packit 8a864e
#endif
Packit 8a864e
extern char *dcgettext (const char *__domainname, const char *__msgid,
Packit 8a864e
			int __category)
Packit 8a864e
       _INTL_ASM (libintl_dcgettext);
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
Packit 8a864e
/* Similar to `gettext' but select the plural form corresponding to the
Packit 8a864e
   number N.  */
Packit 8a864e
#ifdef _INTL_REDIRECT_INLINE
Packit 8a864e
extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
Packit 8a864e
			       unsigned long int __n);
Packit 8a864e
static inline char *ngettext (const char *__msgid1, const char *__msgid2,
Packit 8a864e
			      unsigned long int __n)
Packit 8a864e
{
Packit 8a864e
  return libintl_ngettext (__msgid1, __msgid2, __n);
Packit 8a864e
}
Packit 8a864e
#else
Packit 8a864e
#ifdef _INTL_REDIRECT_MACROS
Packit 8a864e
# define ngettext libintl_ngettext
Packit 8a864e
#endif
Packit 8a864e
extern char *ngettext (const char *__msgid1, const char *__msgid2,
Packit 8a864e
		       unsigned long int __n)
Packit 8a864e
       _INTL_ASM (libintl_ngettext);
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
/* Similar to `dgettext' but select the plural form corresponding to the
Packit 8a864e
   number N.  */
Packit 8a864e
#ifdef _INTL_REDIRECT_INLINE
Packit 8a864e
extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
Packit 8a864e
				const char *__msgid2, unsigned long int __n);
Packit 8a864e
static inline char *dngettext (const char *__domainname, const char *__msgid1,
Packit 8a864e
			       const char *__msgid2, unsigned long int __n)
Packit 8a864e
{
Packit 8a864e
  return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);
Packit 8a864e
}
Packit 8a864e
#else
Packit 8a864e
#ifdef _INTL_REDIRECT_MACROS
Packit 8a864e
# define dngettext libintl_dngettext
Packit 8a864e
#endif
Packit 8a864e
extern char *dngettext (const char *__domainname,
Packit 8a864e
			const char *__msgid1, const char *__msgid2,
Packit 8a864e
			unsigned long int __n)
Packit 8a864e
       _INTL_ASM (libintl_dngettext);
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
/* Similar to `dcgettext' but select the plural form corresponding to the
Packit 8a864e
   number N.  */
Packit 8a864e
#ifdef _INTL_REDIRECT_INLINE
Packit 8a864e
extern char *libintl_dcngettext (const char *__domainname,
Packit 8a864e
				 const char *__msgid1, const char *__msgid2,
Packit 8a864e
				 unsigned long int __n, int __category);
Packit 8a864e
static inline char *dcngettext (const char *__domainname,
Packit 8a864e
				const char *__msgid1, const char *__msgid2,
Packit 8a864e
				unsigned long int __n, int __category)
Packit 8a864e
{
Packit 8a864e
  return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);
Packit 8a864e
}
Packit 8a864e
#else
Packit 8a864e
#ifdef _INTL_REDIRECT_MACROS
Packit 8a864e
# define dcngettext libintl_dcngettext
Packit 8a864e
#endif
Packit 8a864e
extern char *dcngettext (const char *__domainname,
Packit 8a864e
			 const char *__msgid1, const char *__msgid2,
Packit 8a864e
			 unsigned long int __n, int __category)
Packit 8a864e
       _INTL_ASM (libintl_dcngettext);
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
Packit 8a864e
/* Set the current default message catalog to DOMAINNAME.
Packit 8a864e
   If DOMAINNAME is null, return the current default.
Packit 8a864e
   If DOMAINNAME is "", reset to the default of "messages".  */
Packit 8a864e
#ifdef _INTL_REDIRECT_INLINE
Packit 8a864e
extern char *libintl_textdomain (const char *__domainname);
Packit 8a864e
static inline char *textdomain (const char *__domainname)
Packit 8a864e
{
Packit 8a864e
  return libintl_textdomain (__domainname);
Packit 8a864e
}
Packit 8a864e
#else
Packit 8a864e
#ifdef _INTL_REDIRECT_MACROS
Packit 8a864e
# define textdomain libintl_textdomain
Packit 8a864e
#endif
Packit 8a864e
extern char *textdomain (const char *__domainname)
Packit 8a864e
       _INTL_ASM (libintl_textdomain);
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
/* Specify that the DOMAINNAME message catalog will be found
Packit 8a864e
   in DIRNAME rather than in the system locale data base.  */
Packit 8a864e
#ifdef _INTL_REDIRECT_INLINE
Packit 8a864e
extern char *libintl_bindtextdomain (const char *__domainname,
Packit 8a864e
				     const char *__dirname);
Packit 8a864e
static inline char *bindtextdomain (const char *__domainname,
Packit 8a864e
				    const char *__dirname)
Packit 8a864e
{
Packit 8a864e
  return libintl_bindtextdomain (__domainname, __dirname);
Packit 8a864e
}
Packit 8a864e
#else
Packit 8a864e
#ifdef _INTL_REDIRECT_MACROS
Packit 8a864e
# define bindtextdomain libintl_bindtextdomain
Packit 8a864e
#endif
Packit 8a864e
extern char *bindtextdomain (const char *__domainname, const char *__dirname)
Packit 8a864e
       _INTL_ASM (libintl_bindtextdomain);
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
/* Specify the character encoding in which the messages from the
Packit 8a864e
   DOMAINNAME message catalog will be returned.  */
Packit 8a864e
#ifdef _INTL_REDIRECT_INLINE
Packit 8a864e
extern char *libintl_bind_textdomain_codeset (const char *__domainname,
Packit 8a864e
					      const char *__codeset);
Packit 8a864e
static inline char *bind_textdomain_codeset (const char *__domainname,
Packit 8a864e
					     const char *__codeset)
Packit 8a864e
{
Packit 8a864e
  return libintl_bind_textdomain_codeset (__domainname, __codeset);
Packit 8a864e
}
Packit 8a864e
#else
Packit 8a864e
#ifdef _INTL_REDIRECT_MACROS
Packit 8a864e
# define bind_textdomain_codeset libintl_bind_textdomain_codeset
Packit 8a864e
#endif
Packit 8a864e
extern char *bind_textdomain_codeset (const char *__domainname,
Packit 8a864e
				      const char *__codeset)
Packit 8a864e
       _INTL_ASM (libintl_bind_textdomain_codeset);
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
Packit 8a864e
/* Support for format strings with positions in *printf(), following the
Packit 8a864e
   POSIX/XSI specification.
Packit 8a864e
   Note: These replacements for the *printf() functions are visible only
Packit 8a864e
   in source files that #include <libintl.h> or #include "gettext.h".
Packit 8a864e
   Packages that use *printf() in source files that don't refer to _()
Packit 8a864e
   or gettext() but for which the format string could be the return value
Packit 8a864e
   of _() or gettext() need to add this #include.  Oh well.  */
Packit 8a864e
Packit 8a864e
#if !@HAVE_POSIX_PRINTF@
Packit 8a864e
Packit 8a864e
#include <stdio.h>
Packit 8a864e
#include <stddef.h>
Packit 8a864e
Packit 8a864e
/* Get va_list.  */
Packit 8a864e
#if __STDC__ || defined __cplusplus || defined _MSC_VER
Packit 8a864e
# include <stdarg.h>
Packit 8a864e
#else
Packit 8a864e
# include <varargs.h>
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#undef fprintf
Packit 8a864e
#define fprintf libintl_fprintf
Packit 8a864e
extern int fprintf (FILE *, const char *, ...);
Packit 8a864e
#undef vfprintf
Packit 8a864e
#define vfprintf libintl_vfprintf
Packit 8a864e
extern int vfprintf (FILE *, const char *, va_list);
Packit 8a864e
Packit 8a864e
#undef printf
Packit 8a864e
#define printf libintl_printf
Packit 8a864e
extern int printf (const char *, ...);
Packit 8a864e
#undef vprintf
Packit 8a864e
#define vprintf libintl_vprintf
Packit 8a864e
extern int vprintf (const char *, va_list);
Packit 8a864e
Packit 8a864e
#undef sprintf
Packit 8a864e
#define sprintf libintl_sprintf
Packit 8a864e
extern int sprintf (char *, const char *, ...);
Packit 8a864e
#undef vsprintf
Packit 8a864e
#define vsprintf libintl_vsprintf
Packit 8a864e
extern int vsprintf (char *, const char *, va_list);
Packit 8a864e
Packit 8a864e
#if @HAVE_SNPRINTF@
Packit 8a864e
Packit 8a864e
#undef snprintf
Packit 8a864e
#define snprintf libintl_snprintf
Packit 8a864e
extern int snprintf (char *, size_t, const char *, ...);
Packit 8a864e
#undef vsnprintf
Packit 8a864e
#define vsnprintf libintl_vsnprintf
Packit 8a864e
extern int vsnprintf (char *, size_t, const char *, va_list);
Packit 8a864e
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#if @HAVE_ASPRINTF@
Packit 8a864e
Packit 8a864e
#undef asprintf
Packit 8a864e
#define asprintf libintl_asprintf
Packit 8a864e
extern int asprintf (char **, const char *, ...);
Packit 8a864e
#undef vasprintf
Packit 8a864e
#define vasprintf libintl_vasprintf
Packit 8a864e
extern int vasprintf (char **, const char *, va_list);
Packit 8a864e
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#if @HAVE_WPRINTF@
Packit 8a864e
Packit 8a864e
#undef fwprintf
Packit 8a864e
#define fwprintf libintl_fwprintf
Packit 8a864e
extern int fwprintf (FILE *, const wchar_t *, ...);
Packit 8a864e
#undef vfwprintf
Packit 8a864e
#define vfwprintf libintl_vfwprintf
Packit 8a864e
extern int vfwprintf (FILE *, const wchar_t *, va_list);
Packit 8a864e
Packit 8a864e
#undef wprintf
Packit 8a864e
#define wprintf libintl_wprintf
Packit 8a864e
extern int wprintf (const wchar_t *, ...);
Packit 8a864e
#undef vwprintf
Packit 8a864e
#define vwprintf libintl_vwprintf
Packit 8a864e
extern int vwprintf (const wchar_t *, va_list);
Packit 8a864e
Packit 8a864e
#undef swprintf
Packit 8a864e
#define swprintf libintl_swprintf
Packit 8a864e
extern int swprintf (wchar_t *, size_t, const wchar_t *, ...);
Packit 8a864e
#undef vswprintf
Packit 8a864e
#define vswprintf libintl_vswprintf
Packit 8a864e
extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
Packit 8a864e
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
Packit 8a864e
/* Support for relocatable packages.  */
Packit 8a864e
Packit 8a864e
/* Sets the original and the current installation prefix of the package.
Packit 8a864e
   Relocation simply replaces a pathname starting with the original prefix
Packit 8a864e
   by the corresponding pathname with the current prefix instead.  Both
Packit 8a864e
   prefixes should be directory names without trailing slash (i.e. use ""
Packit 8a864e
   instead of "/").  */
Packit 8a864e
#define libintl_set_relocation_prefix libintl_set_relocation_prefix
Packit 8a864e
extern void
Packit 8a864e
       libintl_set_relocation_prefix (const char *orig_prefix,
Packit 8a864e
				      const char *curr_prefix);
Packit 8a864e
Packit 8a864e
Packit 8a864e
#ifdef __cplusplus
Packit 8a864e
}
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#endif /* libintl.h */