1*a8fa202aSchristos/* Message catalogs for internationalization. 2*a8fa202aSchristos Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc. 3*a8fa202aSchristos This file is derived from the file libgettext.h in the GNU gettext package. 4*a8fa202aSchristos 5*a8fa202aSchristos The GNU C Library is free software; you can redistribute it and/or 6*a8fa202aSchristos modify it under the terms of the GNU Library General Public License as 7*a8fa202aSchristos published by the Free Software Foundation; either version 2 of the 8*a8fa202aSchristos License, or (at your option) any later version. 9*a8fa202aSchristos 10*a8fa202aSchristos The GNU C Library is distributed in the hope that it will be useful, 11*a8fa202aSchristos but WITHOUT ANY WARRANTY; without even the implied warranty of 12*a8fa202aSchristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13*a8fa202aSchristos Library General Public License for more details. 14*a8fa202aSchristos 15*a8fa202aSchristos You should have received a copy of the GNU Library General Public 16*a8fa202aSchristos License along with the GNU C Library; see the file COPYING.LIB. If not, 17*a8fa202aSchristos write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18*a8fa202aSchristos Boston, MA 02111-1307, USA. */ 19*a8fa202aSchristos 20*a8fa202aSchristos#ifndef _LIBINTL_H 21*a8fa202aSchristos#define _LIBINTL_H 1 22*a8fa202aSchristos 23*a8fa202aSchristos#include <features.h> 24*a8fa202aSchristos 25*a8fa202aSchristos/* We define an additional symbol to signal that we use the GNU 26*a8fa202aSchristos implementation of gettext. */ 27*a8fa202aSchristos#define __USE_GNU_GETTEXT 1 28*a8fa202aSchristos 29*a8fa202aSchristos__BEGIN_DECLS 30*a8fa202aSchristos 31*a8fa202aSchristos/* Look up MSGID in the current default message catalog for the current 32*a8fa202aSchristos LC_MESSAGES locale. If not found, returns MSGID itself (the default 33*a8fa202aSchristos text). */ 34*a8fa202aSchristosextern char *gettext (__const char *__msgid) __THROW; 35*a8fa202aSchristos 36*a8fa202aSchristos/* Look up MSGID in the DOMAINNAME message catalog for the current 37*a8fa202aSchristos LC_MESSAGES locale. */ 38*a8fa202aSchristosextern char *dgettext (__const char *__domainname, __const char *__msgid) 39*a8fa202aSchristos __THROW; 40*a8fa202aSchristosextern char *__dgettext (__const char *__domainname, __const char *__msgid) 41*a8fa202aSchristos __THROW __attribute_format_arg__ (2); 42*a8fa202aSchristos 43*a8fa202aSchristos/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY 44*a8fa202aSchristos locale. */ 45*a8fa202aSchristosextern char *dcgettext (__const char *__domainname, 46*a8fa202aSchristos __const char *__msgid, int __category) __THROW; 47*a8fa202aSchristosextern char *__dcgettext (__const char *__domainname, 48*a8fa202aSchristos __const char *__msgid, int __category) 49*a8fa202aSchristos __THROW __attribute_format_arg__ (2); 50*a8fa202aSchristos 51*a8fa202aSchristos 52*a8fa202aSchristos/* Similar to `gettext' but select the plural form corresponding to the 53*a8fa202aSchristos number N. */ 54*a8fa202aSchristosextern char *ngettext (__const char *__msgid1, __const char *__msgid2, 55*a8fa202aSchristos unsigned long int __n) 56*a8fa202aSchristos __THROW __attribute_format_arg__ (1); 57*a8fa202aSchristos 58*a8fa202aSchristos/* Similar to `dgettext' but select the plural form corresponding to the 59*a8fa202aSchristos number N. */ 60*a8fa202aSchristosextern char *dngettext (__const char *__domainname, __const char *__msgid1, 61*a8fa202aSchristos __const char *__msgid2, unsigned long int __n) 62*a8fa202aSchristos __THROW __attribute_format_arg__ (2); 63*a8fa202aSchristos 64*a8fa202aSchristos/* Similar to `dcgettext' but select the plural form corresponding to the 65*a8fa202aSchristos number N. */ 66*a8fa202aSchristosextern char *dcngettext (__const char *__domainname, __const char *__msgid1, 67*a8fa202aSchristos __const char *__msgid2, unsigned long int __n, 68*a8fa202aSchristos int __category) 69*a8fa202aSchristos __THROW __attribute_format_arg__ (2); 70*a8fa202aSchristos 71*a8fa202aSchristos 72*a8fa202aSchristos/* Set the current default message catalog to DOMAINNAME. 73*a8fa202aSchristos If DOMAINNAME is null, return the current default. 74*a8fa202aSchristos If DOMAINNAME is "", reset to the default of "messages". */ 75*a8fa202aSchristosextern char *textdomain (__const char *__domainname) __THROW; 76*a8fa202aSchristos 77*a8fa202aSchristos/* Specify that the DOMAINNAME message catalog will be found 78*a8fa202aSchristos in DIRNAME rather than in the system locale data base. */ 79*a8fa202aSchristosextern char *bindtextdomain (__const char *__domainname, 80*a8fa202aSchristos __const char *__dirname) __THROW; 81*a8fa202aSchristos 82*a8fa202aSchristos/* Specify the character encoding in which the messages from the 83*a8fa202aSchristos DOMAINNAME message catalog will be returned. */ 84*a8fa202aSchristosextern char *bind_textdomain_codeset (__const char *__domainname, 85*a8fa202aSchristos __const char *__codeset) __THROW; 86*a8fa202aSchristos 87*a8fa202aSchristos 88*a8fa202aSchristos/* Optimized version of the function above. */ 89*a8fa202aSchristos#if defined __OPTIMIZE__ 90*a8fa202aSchristos 91*a8fa202aSchristos/* We need NULL for `gettext'. */ 92*a8fa202aSchristos# define __need_NULL 93*a8fa202aSchristos# include <stddef.h> 94*a8fa202aSchristos 95*a8fa202aSchristos/* We need LC_MESSAGES for `dgettext'. */ 96*a8fa202aSchristos# include <locale.h> 97*a8fa202aSchristos 98*a8fa202aSchristos/* These must be macros. Inlined functions are useless because the 99*a8fa202aSchristos `__builtin_constant_p' predicate in dcgettext would always return 100*a8fa202aSchristos false. */ 101*a8fa202aSchristos 102*a8fa202aSchristos# define gettext(msgid) dgettext (NULL, msgid) 103*a8fa202aSchristos 104*a8fa202aSchristos# define dgettext(domainname, msgid) \ 105*a8fa202aSchristos dcgettext (domainname, msgid, LC_MESSAGES) 106*a8fa202aSchristos 107*a8fa202aSchristos# define ngettext(msgid1, msgid2, n) dngettext (NULL, msgid1, msgid2, n) 108*a8fa202aSchristos 109*a8fa202aSchristos# define dngettext(domainname, msgid1, msgid2, n) \ 110*a8fa202aSchristos dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES) 111*a8fa202aSchristos 112*a8fa202aSchristos#endif /* Optimizing. */ 113*a8fa202aSchristos 114*a8fa202aSchristos__END_DECLS 115*a8fa202aSchristos 116*a8fa202aSchristos#endif /* libintl.h */ 117