]>
Commit | Line | Data |
---|---|---|
1e24cc5b AD |
1 | /* Message catalogs for internationalization. |
2 | Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc. | |
3 | ||
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. | |
8 | ||
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. | |
13 | ||
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. */ | |
17 | ||
18 | #ifndef _LIBINTL_H | |
19 | #define _LIBINTL_H 1 | |
20 | ||
21 | #include <locale.h> | |
22 | ||
23 | /* The LC_MESSAGES locale category is the category used by the functions | |
24 | gettext() and dgettext(). It is specified in POSIX, but not in ANSI C. | |
25 | On systems that don't define it, use an arbitrary value instead. | |
26 | On Solaris, <locale.h> defines __LOCALE_H then includes <libintl.h> (i.e. | |
27 | this file!) and then only defines LC_MESSAGES. To avoid a redefinition | |
28 | warning, don't define LC_MESSAGES in this case. */ | |
29 | #if !defined LC_MESSAGES && !defined __LOCALE_H | |
30 | # define LC_MESSAGES 1729 | |
31 | #endif | |
32 | ||
33 | /* We define an additional symbol to signal that we use the GNU | |
34 | implementation of gettext. */ | |
35 | #define __USE_GNU_GETTEXT 1 | |
36 | ||
37 | /* Resolve a platform specific conflict on DJGPP. GNU gettext takes | |
38 | precedence over _conio_gettext. */ | |
39 | #ifdef __DJGPP__ | |
40 | # undef gettext | |
41 | # define gettext gettext | |
42 | #endif | |
43 | ||
44 | #ifndef PARAMS | |
45 | # if __STDC__ || defined __cplusplus | |
46 | # define PARAMS(args) args | |
47 | # else | |
48 | # define PARAMS(args) () | |
49 | # endif | |
50 | #endif | |
51 | ||
52 | #ifdef __cplusplus | |
53 | extern "C" { | |
54 | #endif | |
55 | ||
56 | /* Look up MSGID in the current default message catalog for the current | |
57 | LC_MESSAGES locale. If not found, returns MSGID itself (the default | |
58 | text). */ | |
59 | extern char *gettext PARAMS ((const char *__msgid)); | |
60 | ||
61 | /* Look up MSGID in the DOMAINNAME message catalog for the current | |
62 | LC_MESSAGES locale. */ | |
63 | extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid)); | |
64 | ||
65 | /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY | |
66 | locale. */ | |
67 | extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid, | |
68 | int __category)); | |
69 | ||
70 | ||
71 | /* Similar to `gettext' but select the plural form corresponding to the | |
72 | number N. */ | |
73 | extern char *ngettext PARAMS ((const char *__msgid1, const char *__msgid2, | |
74 | unsigned long int __n)); | |
75 | ||
76 | /* Similar to `dgettext' but select the plural form corresponding to the | |
77 | number N. */ | |
78 | extern char *dngettext PARAMS ((const char *__domainname, const char *__msgid1, | |
79 | const char *__msgid2, unsigned long int __n)); | |
80 | ||
81 | /* Similar to `dcgettext' but select the plural form corresponding to the | |
82 | number N. */ | |
83 | extern char *dcngettext PARAMS ((const char *__domainname, const char *__msgid1, | |
84 | const char *__msgid2, unsigned long int __n, | |
85 | int __category)); | |
86 | ||
87 | ||
88 | /* Set the current default message catalog to DOMAINNAME. | |
89 | If DOMAINNAME is null, return the current default. | |
90 | If DOMAINNAME is "", reset to the default of "messages". */ | |
91 | extern char *textdomain PARAMS ((const char *__domainname)); | |
92 | ||
93 | /* Specify that the DOMAINNAME message catalog will be found | |
94 | in DIRNAME rather than in the system locale data base. */ | |
95 | extern char *bindtextdomain PARAMS ((const char *__domainname, | |
96 | const char *__dirname)); | |
97 | ||
98 | /* Specify the character encoding in which the messages from the | |
99 | DOMAINNAME message catalog will be returned. */ | |
100 | extern char *bind_textdomain_codeset PARAMS ((const char *__domainname, | |
101 | const char *__codeset)); | |
102 | ||
103 | ||
104 | /* Optimized version of the functions above. */ | |
105 | #if defined __OPTIMIZED | |
106 | /* These are macros, but could also be inline functions. */ | |
107 | ||
108 | # define gettext(msgid) \ | |
109 | dgettext (NULL, msgid) | |
110 | ||
111 | # define dgettext(domainname, msgid) \ | |
112 | dcgettext (domainname, msgid, LC_MESSAGES) | |
113 | ||
114 | # define ngettext(msgid1, msgid2, n) \ | |
115 | dngettext (NULL, msgid1, msgid2, n) | |
116 | ||
117 | # define dngettext(domainname, msgid1, msgid2, n) \ | |
118 | dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES) | |
119 | ||
120 | #endif /* Optimizing. */ | |
121 | ||
122 | ||
123 | #ifdef __cplusplus | |
124 | } | |
125 | #endif | |
126 | ||
127 | #endif /* libintl.h */ |