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
00052
00053 #ifndef HAVE_BUILTIN_EXPECT
00054 # define __builtin_expect(expr, val) (expr)
00055 #endif
00056
00057 #ifndef W
00058 # define W(flag, data) ((flag) ? SWAP (data) : (data))
00059 #endif
00060
00061
00062 #ifdef _LIBC
00063 # include <byteswap.h>
00064 # define SWAP(i) bswap_32 (i)
00065 #else
00066 static inline nls_uint32
00067 SWAP (i)
00068 nls_uint32 i;
00069 {
00070 return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
00071 }
00072 #endif
00073
00074
00075
00076 struct loaded_domain
00077 {
00078 const char *data;
00079 int use_mmap;
00080 size_t mmap_size;
00081 int must_swap;
00082 nls_uint32 nstrings;
00083 struct string_desc *orig_tab;
00084 struct string_desc *trans_tab;
00085 nls_uint32 hash_size;
00086 nls_uint32 *hash_tab;
00087 int codeset_cntr;
00088 #ifdef _LIBC
00089 __gconv_t conv;
00090 #else
00091 # if HAVE_ICONV
00092 iconv_t conv;
00093 # endif
00094 #endif
00095 char **conv_tab;
00096
00097 struct expression *plural;
00098 unsigned long int nplurals;
00099 };
00100
00101
00102
00103 #ifdef __GNUC__
00104 # define ZERO 0
00105 #else
00106 # define ZERO 1
00107 #endif
00108
00109
00110
00111 struct binding
00112 {
00113 struct binding *next;
00114 char *dirname;
00115 int codeset_cntr;
00116 char *codeset;
00117 char domainname[ZERO];
00118 };
00119
00120
00121
00122
00123 extern int _nl_msg_cat_cntr;
00124
00125 #ifndef _LIBC
00126 const char *_nl_locale_name PARAMS ((int category, const char *categoryname));
00127 #endif
00128
00129 struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
00130 char *__locale,
00131 const char *__domainname,
00132 struct binding *__domainbinding))
00133 internal_function;
00134 void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain,
00135 struct binding *__domainbinding))
00136 internal_function;
00137 void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
00138 internal_function;
00139 const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file,
00140 struct loaded_domain *__domain,
00141 struct binding *__domainbinding))
00142 internal_function;
00143 void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain))
00144 internal_function;
00145
00146 char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file,
00147 struct binding *domainbinding,
00148 const char *msgid, size_t *lengthp))
00149 internal_function;
00150
00151 #ifdef _LIBC
00152 extern char *__gettext PARAMS ((const char *__msgid));
00153 extern char *__dgettext PARAMS ((const char *__domainname,
00154 const char *__msgid));
00155 extern char *__dcgettext PARAMS ((const char *__domainname,
00156 const char *__msgid, int __category));
00157 extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
00158 unsigned long int __n));
00159 extern char *__dngettext PARAMS ((const char *__domainname,
00160 const char *__msgid1, const char *__msgid2,
00161 unsigned long int n));
00162 extern char *__dcngettext PARAMS ((const char *__domainname,
00163 const char *__msgid1, const char *__msgid2,
00164 unsigned long int __n, int __category));
00165 extern char *__dcigettext PARAMS ((const char *__domainname,
00166 const char *__msgid1, const char *__msgid2,
00167 int __plural, unsigned long int __n,
00168 int __category));
00169 extern char *__textdomain PARAMS ((const char *__domainname));
00170 extern char *__bindtextdomain PARAMS ((const char *__domainname,
00171 const char *__dirname));
00172 extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname,
00173 const char *__codeset));
00174 #else
00175 extern char *gettext__ PARAMS ((const char *__msgid));
00176 extern char *dgettext__ PARAMS ((const char *__domainname,
00177 const char *__msgid));
00178 extern char *dcgettext__ PARAMS ((const char *__domainname,
00179 const char *__msgid, int __category));
00180 extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2,
00181 unsigned long int __n));
00182 extern char *dngettext__ PARAMS ((const char *__domainname,
00183 const char *__msgid1, const char *__msgid2,
00184 unsigned long int __n));
00185 extern char *dcngettext__ PARAMS ((const char *__domainname,
00186 const char *__msgid1, const char *__msgid2,
00187 unsigned long int __n, int __category));
00188 extern char *dcigettext__ PARAMS ((const char *__domainname,
00189 const char *__msgid1, const char *__msgid2,
00190 int __plural, unsigned long int __n,
00191 int __category));
00192 extern char *textdomain__ PARAMS ((const char *__domainname));
00193 extern char *bindtextdomain__ PARAMS ((const char *__domainname,
00194 const char *__dirname));
00195 extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
00196 const char *__codeset));
00197 #endif
00198
00199
00200
00201 #endif