iconv: Bail out of the loop when an illegal sequence of bytes occurs.
[elinks/elinks-j605.git] / src / intl / gettext / libgnuintl.h
blob526848814c0fb0a778775208bc955d384ddb9f60
1 /* Message catalogs for internationalization.
2 Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software Foundation,
16 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18 /* Never include system <libintl.h> */
19 #ifndef _LIBINTL_H
20 #define _LIBINTL_H 1
21 #endif
23 #ifndef EL__INTL_GETTEXT_LIBGNUINTL_H
24 #define EL__INTL_GETTEXT_LIBGNUINTL_H 1
26 #include <locale.h>
28 #ifndef LC_MESSAGES
29 #define LC_MESSAGES 1729
30 #endif
32 /* We define an additional symbol to signal that we use the GNU
33 implementation of gettext. */
34 #define __USE_GNU_GETTEXT 1
36 /* Resolve a platform specific conflict on DJGPP. GNU gettext takes
37 precedence over _conio_gettext. */
38 #ifdef __DJGPP__
39 #undef gettext
40 #define gettext gettext
41 #endif
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
47 /* Look up MSGID in the current default message catalog for the current
48 LC_MESSAGES locale. If not found, returns MSGID itself (the default
49 text). */
50 extern unsigned char *gettext(const unsigned char *__msgid);
52 /* Look up MSGID in the DOMAINNAME message catalog for the current
53 LC_MESSAGES locale. */
54 extern unsigned char *dgettext(const unsigned char *__domainname, const unsigned char *__msgid);
56 /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
57 locale. */
58 extern unsigned char *dcgettext(const unsigned char *__domainname, const unsigned char *__msgid,
59 int __category);
61 /* Similar to `gettext' but select the plural form corresponding to the
62 number N. */
63 extern unsigned char *ngettext(const unsigned char *__msgid1, const unsigned char *__msgid2,
64 unsigned long int __n);
66 /* Similar to `dgettext' but select the plural form corresponding to the
67 number N. */
68 extern unsigned char *dngettext(const unsigned char *__domainname, const unsigned char *__msgid1,
69 const unsigned char *__msgid2, unsigned long int __n);
71 /* Similar to `dcgettext' but select the plural form corresponding to the
72 number N. */
73 extern unsigned char *dcngettext(const unsigned char *__domainname, const unsigned char *__msgid1,
74 const unsigned char *__msgid2, unsigned long int __n,
75 int __category);
77 /* Set the current default message catalog to DOMAINNAME.
78 If DOMAINNAME is null, return the current default.
79 If DOMAINNAME is "", reset to the default of "messages". */
80 extern unsigned char *textdomain(const unsigned char *__domainname);
82 /* Specify that the DOMAINNAME message catalog will be found
83 in DIRNAME rather than in the system locale data base. */
84 extern unsigned char *bindtextdomain(const unsigned char *__domainname,
85 const unsigned char *__dirname);
87 /* Specify the character encoding in which the messages from the
88 DOMAINNAME message catalog will be returned. */
89 extern unsigned char *bind_textdomain_codeset(const unsigned char *__domainname,
90 const unsigned char *__codeset);
92 /* Optimized version of the functions above. */
93 #if defined __OPTIMIZED
94 /* These are macros, but could also be inline functions. */
96 #define gettext(msgid) \
97 dgettext(NULL, msgid)
99 #define dgettext(domainname, msgid) \
100 dcgettext(domainname, msgid, LC_MESSAGES)
102 #define ngettext(msgid1, msgid2, n) \
103 dngettext(NULL, msgid1, msgid2, n)
105 #define dngettext(domainname, msgid1, msgid2, n) \
106 dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES)
108 #endif /* Optimizing. */
110 #ifdef __cplusplus
112 #endif
113 #endif /* libintl.h */