00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _GETTEXTP_H
00021 #define _GETTEXTP_H
00022
00023 #include <stddef.h>
00024
00025 #ifdef _LIBC
00026 # include "../iconv/gconv_int.h"
00027 #else
00028 # if HAVE_ICONV
00029 # include <iconv.h>
00030 # endif
00031 #endif
00032
00033 #include "loadinfo.h"
00034
00035 #include "gmo.h"
00036
00037
00038
00039 #ifndef PARAMS
00040 # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
00041 # define PARAMS(args) args
00042 # else
00043 # define PARAMS(args) ()
00044 # endif
00045 #endif
00046
00047 #ifndef internal_function
00048 # define internal_function
00049 #endif
00050
00051 #ifndef attribute_hidden
00052 # define attribute_hidden
00053 #endif
00054
00055
00056
00057 #ifndef HAVE_BUILTIN_EXPECT
00058 # define __builtin_expect(expr, val) (expr)
00059 #endif
00060
00061 #ifndef W
00062 # define W(flag, data) ((flag) ? SWAP (data) : (data))
00063 #endif
00064
00065
00066 #ifdef _LIBC
00067 # include <byteswap.h>
00068 # define SWAP(i) bswap_32 (i)
00069 #else
00070 static inline nls_uint32
00071 SWAP (i)
00072 nls_uint32 i;
00073 {
00074 return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
00075 }
00076 #endif
00077
00078
00079
00080 struct sysdep_string_desc
00081 {
00082
00083 size_t length;
00084
00085 const char *pointer;
00086 };
00087
00088
00089 struct loaded_domain
00090 {
00091
00092 const char *data;
00093
00094 int use_mmap;
00095
00096 size_t mmap_size;
00097
00098 int must_swap;
00099
00100 void *malloced;
00101
00102
00103 nls_uint32 nstrings;
00104
00105 const struct string_desc *orig_tab;
00106
00107 const struct string_desc *trans_tab;
00108
00109
00110 nls_uint32 n_sysdep_strings;
00111
00112 const struct sysdep_string_desc *orig_sysdep_tab;
00113
00114 const struct sysdep_string_desc *trans_sysdep_tab;
00115
00116
00117 nls_uint32 hash_size;
00118
00119 const nls_uint32 *hash_tab;
00120
00121 int must_swap_hash_tab;
00122
00123 int codeset_cntr;
00124 #ifdef _LIBC
00125 __gconv_t conv;
00126 #else
00127 # if HAVE_ICONV
00128 iconv_t conv;
00129 # endif
00130 #endif
00131 char **conv_tab;
00132
00133 struct expression *plural;
00134 unsigned long int nplurals;
00135 };
00136
00137
00138
00139 #ifdef __GNUC__
00140 # define ZERO 0
00141 #else
00142 # define ZERO 1
00143 #endif
00144
00145
00146
00147 struct binding
00148 {
00149 struct binding *next;
00150 char *dirname;
00151 int codeset_cntr;
00152 char *codeset;
00153 char domainname[ZERO];
00154 };
00155
00156
00157
00158
00159 extern int _nl_msg_cat_cntr;
00160
00161 #ifndef _LIBC
00162 const char *_nl_locale_name PARAMS ((int category, const char *categoryname));
00163 #endif
00164
00165 struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
00166 char *__locale,
00167 const char *__domainname,
00168 struct binding *__domainbinding))
00169 internal_function;
00170 void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain,
00171 struct binding *__domainbinding))
00172 internal_function;
00173 void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
00174 internal_function;
00175 const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file,
00176 struct loaded_domain *__domain,
00177 struct binding *__domainbinding))
00178 internal_function;
00179 void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain))
00180 internal_function;
00181
00182 char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file,
00183 struct binding *domainbinding,
00184 const char *msgid, size_t *lengthp))
00185 internal_function;
00186
00187 #ifdef _LIBC
00188 extern char *__gettext PARAMS ((const char *__msgid));
00189 extern char *__dgettext PARAMS ((const char *__domainname,
00190 const char *__msgid));
00191 extern char *__dcgettext PARAMS ((const char *__domainname,
00192 const char *__msgid, int __category));
00193 extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
00194 unsigned long int __n));
00195 extern char *__dngettext PARAMS ((const char *__domainname,
00196 const char *__msgid1, const char *__msgid2,
00197 unsigned long int n));
00198 extern char *__dcngettext PARAMS ((const char *__domainname,
00199 const char *__msgid1, const char *__msgid2,
00200 unsigned long int __n, int __category));
00201 extern char *__dcigettext PARAMS ((const char *__domainname,
00202 const char *__msgid1, const char *__msgid2,
00203 int __plural, unsigned long int __n,
00204 int __category));
00205 extern char *__textdomain PARAMS ((const char *__domainname));
00206 extern char *__bindtextdomain PARAMS ((const char *__domainname,
00207 const char *__dirname));
00208 extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname,
00209 const char *__codeset));
00210 #else
00211 extern char *libintl_gettext PARAMS ((const char *__msgid));
00212 extern char *libintl_dgettext PARAMS ((const char *__domainname,
00213 const char *__msgid));
00214 extern char *libintl_dcgettext PARAMS ((const char *__domainname,
00215 const char *__msgid, int __category));
00216 extern char *libintl_ngettext PARAMS ((const char *__msgid1,
00217 const char *__msgid2,
00218 unsigned long int __n));
00219 extern char *libintl_dngettext PARAMS ((const char *__domainname,
00220 const char *__msgid1,
00221 const char *__msgid2,
00222 unsigned long int __n));
00223 extern char *libintl_dcngettext PARAMS ((const char *__domainname,
00224 const char *__msgid1,
00225 const char *__msgid2,
00226 unsigned long int __n,
00227 int __category));
00228 extern char *libintl_dcigettext PARAMS ((const char *__domainname,
00229 const char *__msgid1,
00230 const char *__msgid2,
00231 int __plural, unsigned long int __n,
00232 int __category));
00233 extern char *libintl_textdomain PARAMS ((const char *__domainname));
00234 extern char *libintl_bindtextdomain PARAMS ((const char *__domainname,
00235 const char *__dirname));
00236 extern char *libintl_bind_textdomain_codeset PARAMS ((const char *__domainname,
00237 const char *__codeset));
00238 #endif
00239
00240
00241
00242 #endif