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