libintl.h (24328B)
1 /* Message catalogs for internationalization. 2 Copyright (C) 1995-1997, 2000-2016, 2018-2024 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 Lesser General Public License as published by 6 the Free Software Foundation; either version 2.1 of the License, or 7 (at your option) 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 Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General Public License 15 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 16 17 #ifndef _LIBINTL_H 18 #define _LIBINTL_H 1 19 20 #include <locale.h> 21 #if (defined __APPLE__ && defined __MACH__) && 1 22 # include <xlocale.h> 23 #endif 24 25 /* The LC_MESSAGES locale category is the category used by the functions 26 gettext() and dgettext(). It is specified in POSIX, but not in ANSI C. 27 On systems that don't define it, use an arbitrary value instead. 28 On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5) 29 then includes <libintl.h> (i.e. this file!) and then only defines 30 LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES 31 in this case. */ 32 #if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun)) 33 # define LC_MESSAGES 1729 34 #endif 35 36 /* We define an additional symbol to signal that we use the GNU 37 implementation of gettext. */ 38 #define __USE_GNU_GETTEXT 1 39 40 /* Provide information about the supported file formats. Returns the 41 maximum minor revision number supported for a given major revision. */ 42 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) \ 43 ((major) == 0 || (major) == 1 ? 1 : -1) 44 45 /* Resolve a platform specific conflict on DJGPP. GNU gettext takes 46 precedence over _conio_gettext. */ 47 #ifdef __DJGPP__ 48 # undef gettext 49 #endif 50 51 #ifdef __cplusplus 52 extern "C" { 53 #endif 54 55 56 /* Version number: (major<<16) + (minor<<8) + subminor */ 57 #define LIBINTL_VERSION 0x001605 58 extern int libintl_version; 59 60 61 /* We redirect the functions to those prefixed with "libintl_". This is 62 necessary, because some systems define gettext/textdomain/... in the C 63 library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer). 64 If we used the unprefixed names, there would be cases where the 65 definition in the C library would override the one in the libintl.so 66 shared library. Recall that on ELF systems, the symbols are looked 67 up in the following order: 68 1. in the executable, 69 2. in the shared libraries specified on the link command line, in order, 70 3. in the dependencies of the shared libraries specified on the link 71 command line, 72 4. in the dlopen()ed shared libraries, in the order in which they were 73 dlopen()ed. 74 The definition in the C library would override the one in libintl.so if 75 either 76 * -lc is given on the link command line and -lintl isn't, or 77 * -lc is given on the link command line before -lintl, or 78 * libintl.so is a dependency of a dlopen()ed shared library but not 79 linked to the executable at link time. 80 Since Solaris gettext() behaves differently than GNU gettext(), this 81 would be unacceptable. 82 83 The redirection happens by default through macros in C, so that &gettext 84 is independent of the compilation unit, but through inline functions in 85 C++, in order not to interfere with the name mangling of class fields or 86 class methods called 'gettext'. */ 87 88 /* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS. 89 If he doesn't, we choose the method. A third possible method is 90 _INTL_REDIRECT_ASM, supported only by GCC. */ 91 #if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS) 92 # if defined __GNUC__ && __GNUC__ >= 2 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus) 93 # define _INTL_REDIRECT_ASM 94 # else 95 # ifdef __cplusplus 96 # define _INTL_REDIRECT_INLINE 97 # else 98 # define _INTL_REDIRECT_MACROS 99 # endif 100 # endif 101 #endif 102 /* Auxiliary macros. */ 103 #ifdef _INTL_REDIRECT_ASM 104 # define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname)) 105 # define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring 106 # define _INTL_STRINGIFY(prefix) #prefix 107 #else 108 # define _INTL_ASM(cname) 109 #endif 110 111 /* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return 112 its n-th argument literally. This enables GCC to warn for example about 113 printf (gettext ("foo %y")). */ 114 #if defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && !(defined __clang__ && __clang__ && __clang_major__ >= 3) && defined __cplusplus) 115 # define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n))) 116 #else 117 # define _INTL_MAY_RETURN_STRING_ARG(n) 118 #endif 119 120 /* _INTL_ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK)) 121 declares that the STRING-INDEXth function argument is a format string of 122 style ARCHETYPE, which is one of: 123 printf, gnu_printf 124 scanf, gnu_scanf, 125 strftime, gnu_strftime, 126 strfmon, 127 or the same thing prefixed and suffixed with '__'. 128 If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK 129 are suitable for the format string. */ 130 /* Applies to: functions. */ 131 #if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 7) > 2) || defined __clang__ 132 # define _INTL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) 133 #else 134 # define _INTL_ATTRIBUTE_FORMAT(spec) 135 #endif 136 137 /* _INTL_ATTRIBUTE_SPEC_PRINTF_STANDARD 138 An __attribute__ __format__ specifier for a function that takes a format 139 string and arguments, where the format string directives are the ones 140 standardized by ISO C99 and POSIX. */ 141 /* __gnu_printf__ is supported in GCC >= 4.4. */ 142 #if defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 4) > 4 143 # define _INTL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__ 144 #else 145 # define _INTL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__ 146 #endif 147 148 /* _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD 149 indicates to GCC that the function takes a format string and arguments, 150 where the format string directives are the ones standardized by ISO C99 151 and POSIX. */ 152 #define _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(formatstring_parameter, first_argument) \ 153 _INTL_ATTRIBUTE_FORMAT ((_INTL_ATTRIBUTE_SPEC_PRINTF_STANDARD, formatstring_parameter, first_argument)) 154 155 /* Look up MSGID in the current default message catalog for the current 156 LC_MESSAGES locale. If not found, returns MSGID itself (the default 157 text). */ 158 #ifdef _INTL_REDIRECT_INLINE 159 extern char *libintl_gettext (const char *__msgid) 160 _INTL_MAY_RETURN_STRING_ARG (1); 161 static inline 162 _INTL_MAY_RETURN_STRING_ARG (1) 163 char *gettext (const char *__msgid) 164 { 165 return libintl_gettext (__msgid); 166 } 167 #else 168 # ifdef _INTL_REDIRECT_MACROS 169 # define gettext libintl_gettext 170 # endif 171 extern char *gettext (const char *__msgid) 172 _INTL_ASM (libintl_gettext) 173 _INTL_MAY_RETURN_STRING_ARG (1); 174 #endif 175 176 /* Look up MSGID in the DOMAINNAME message catalog for the current 177 LC_MESSAGES locale. */ 178 #ifdef _INTL_REDIRECT_INLINE 179 extern char *libintl_dgettext (const char *__domainname, const char *__msgid) 180 _INTL_MAY_RETURN_STRING_ARG (2); 181 static inline 182 _INTL_MAY_RETURN_STRING_ARG (2) 183 char *dgettext (const char *__domainname, const char *__msgid) 184 { 185 return libintl_dgettext (__domainname, __msgid); 186 } 187 #else 188 # ifdef _INTL_REDIRECT_MACROS 189 # define dgettext libintl_dgettext 190 # endif 191 extern char *dgettext (const char *__domainname, const char *__msgid) 192 _INTL_ASM (libintl_dgettext) 193 _INTL_MAY_RETURN_STRING_ARG (2); 194 #endif 195 196 /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY 197 locale. */ 198 #ifdef _INTL_REDIRECT_INLINE 199 extern char *libintl_dcgettext (const char *__domainname, const char *__msgid, 200 int __category) 201 _INTL_MAY_RETURN_STRING_ARG (2); 202 static inline 203 _INTL_MAY_RETURN_STRING_ARG (2) 204 char *dcgettext (const char *__domainname, const char *__msgid, int __category) 205 { 206 return libintl_dcgettext (__domainname, __msgid, __category); 207 } 208 #else 209 # ifdef _INTL_REDIRECT_MACROS 210 # define dcgettext libintl_dcgettext 211 # endif 212 extern char *dcgettext (const char *__domainname, const char *__msgid, 213 int __category) 214 _INTL_ASM (libintl_dcgettext) 215 _INTL_MAY_RETURN_STRING_ARG (2); 216 #endif 217 218 219 /* Similar to 'gettext' but select the plural form corresponding to the 220 number N. */ 221 #ifdef _INTL_REDIRECT_INLINE 222 extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2, 223 unsigned long int __n) 224 _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2); 225 static inline 226 _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2) 227 char *ngettext (const char *__msgid1, const char *__msgid2, 228 unsigned long int __n) 229 { 230 return libintl_ngettext (__msgid1, __msgid2, __n); 231 } 232 #else 233 # ifdef _INTL_REDIRECT_MACROS 234 # define ngettext libintl_ngettext 235 # endif 236 extern char *ngettext (const char *__msgid1, const char *__msgid2, 237 unsigned long int __n) 238 _INTL_ASM (libintl_ngettext) 239 _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2); 240 #endif 241 242 /* Similar to 'dgettext' but select the plural form corresponding to the 243 number N. */ 244 #ifdef _INTL_REDIRECT_INLINE 245 extern char *libintl_dngettext (const char *__domainname, const char *__msgid1, 246 const char *__msgid2, unsigned long int __n) 247 _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); 248 static inline 249 _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3) 250 char *dngettext (const char *__domainname, const char *__msgid1, 251 const char *__msgid2, unsigned long int __n) 252 { 253 return libintl_dngettext (__domainname, __msgid1, __msgid2, __n); 254 } 255 #else 256 # ifdef _INTL_REDIRECT_MACROS 257 # define dngettext libintl_dngettext 258 # endif 259 extern char *dngettext (const char *__domainname, 260 const char *__msgid1, const char *__msgid2, 261 unsigned long int __n) 262 _INTL_ASM (libintl_dngettext) 263 _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); 264 #endif 265 266 /* Similar to 'dcgettext' but select the plural form corresponding to the 267 number N. */ 268 #ifdef _INTL_REDIRECT_INLINE 269 extern char *libintl_dcngettext (const char *__domainname, 270 const char *__msgid1, const char *__msgid2, 271 unsigned long int __n, int __category) 272 _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); 273 static inline 274 _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3) 275 char *dcngettext (const char *__domainname, 276 const char *__msgid1, const char *__msgid2, 277 unsigned long int __n, int __category) 278 { 279 return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category); 280 } 281 #else 282 # ifdef _INTL_REDIRECT_MACROS 283 # define dcngettext libintl_dcngettext 284 # endif 285 extern char *dcngettext (const char *__domainname, 286 const char *__msgid1, const char *__msgid2, 287 unsigned long int __n, int __category) 288 _INTL_ASM (libintl_dcngettext) 289 _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); 290 #endif 291 292 293 294 /* Set the current default message catalog to DOMAINNAME. 295 If DOMAINNAME is null, return the current default. 296 If DOMAINNAME is "", reset to the default of "messages". */ 297 # ifdef _INTL_REDIRECT_INLINE 298 extern char *libintl_textdomain (const char *__domainname); 299 static inline char *textdomain (const char *__domainname) 300 { 301 return libintl_textdomain (__domainname); 302 } 303 # else 304 # ifdef _INTL_REDIRECT_MACROS 305 # define textdomain libintl_textdomain 306 # endif 307 extern char *textdomain (const char *__domainname) 308 _INTL_ASM (libintl_textdomain); 309 # endif 310 311 /* Specify that the DOMAINNAME message catalog will be found 312 in DIRNAME rather than in the system locale data base. */ 313 # ifdef _INTL_REDIRECT_INLINE 314 extern char *libintl_bindtextdomain (const char *__domainname, 315 const char *__dirname); 316 static inline char *bindtextdomain (const char *__domainname, 317 const char *__dirname) 318 { 319 return libintl_bindtextdomain (__domainname, __dirname); 320 } 321 # else 322 # ifdef _INTL_REDIRECT_MACROS 323 # define bindtextdomain libintl_bindtextdomain 324 # endif 325 extern char *bindtextdomain (const char *__domainname, const char *__dirname) 326 _INTL_ASM (libintl_bindtextdomain); 327 # endif 328 329 # if defined _WIN32 && !defined __CYGWIN__ 330 /* Specify that the DOMAINNAME message catalog will be found 331 in WDIRNAME rather than in the system locale data base. */ 332 # ifdef _INTL_REDIRECT_INLINE 333 extern wchar_t *libintl_wbindtextdomain (const char *__domainname, 334 const wchar_t *__wdirname); 335 static inline wchar_t *wbindtextdomain (const char *__domainname, 336 const wchar_t *__wdirname) 337 { 338 return libintl_wbindtextdomain (__domainname, __wdirname); 339 } 340 # else 341 # ifdef _INTL_REDIRECT_MACROS 342 # define wbindtextdomain libintl_wbindtextdomain 343 # endif 344 extern wchar_t *wbindtextdomain (const char *__domainname, 345 const wchar_t *__wdirname) 346 _INTL_ASM (libintl_wbindtextdomain); 347 # endif 348 # endif 349 350 /* Specify the character encoding in which the messages from the 351 DOMAINNAME message catalog will be returned. */ 352 # ifdef _INTL_REDIRECT_INLINE 353 extern char *libintl_bind_textdomain_codeset (const char *__domainname, 354 const char *__codeset); 355 static inline char *bind_textdomain_codeset (const char *__domainname, 356 const char *__codeset) 357 { 358 return libintl_bind_textdomain_codeset (__domainname, __codeset); 359 } 360 # else 361 # ifdef _INTL_REDIRECT_MACROS 362 # define bind_textdomain_codeset libintl_bind_textdomain_codeset 363 # endif 364 extern char *bind_textdomain_codeset (const char *__domainname, 365 const char *__codeset) 366 _INTL_ASM (libintl_bind_textdomain_codeset); 367 # endif 368 369 370 371 /* Support for format strings with positions in *printf(), following the 372 POSIX/XSI specification. 373 Note: These replacements for the *printf() functions are visible only 374 in source files that #include <libintl.h> or #include "gettext.h". 375 Packages that use *printf() in source files that don't refer to _() 376 or gettext() but for which the format string could be the return value 377 of _() or gettext() need to add this #include. Oh well. */ 378 379 /* Note: In C++ mode, it is not sufficient to redefine a symbol at the 380 preprocessor macro level, such as 381 #define sprintf libintl_sprintf 382 Some programs may reference std::sprintf after including <libintl.h>. 383 Therefore we must make sure that std::libintl_sprintf is defined and 384 identical to ::libintl_sprintf. 385 The user can define _INTL_CXX_NO_CLOBBER_STD_NAMESPACE to avoid this. 386 In such cases, they will not benefit from the overrides when using 387 the 'std' namespace, and they will need to do the references to the 388 'std' namespace *before* including <libintl.h> or "gettext.h". */ 389 390 #if !1 391 392 # include <stdio.h> 393 # include <stddef.h> 394 395 /* Get va_list. */ 396 # if (defined __STDC__ && __STDC__) || defined __cplusplus || defined _MSC_VER 397 # include <stdarg.h> 398 # else 399 # include <varargs.h> 400 # endif 401 402 # if !((defined fprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_fprintf) /* don't override gnulib */ 403 # undef fprintf 404 # define fprintf libintl_fprintf 405 extern int fprintf (FILE *, const char *, ...) 406 _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3); 407 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 408 namespace std { using ::libintl_fprintf; } 409 # endif 410 # endif 411 # if !((defined vfprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_vfprintf) /* don't override gnulib */ 412 # undef vfprintf 413 # define vfprintf libintl_vfprintf 414 extern int vfprintf (FILE *, const char *, va_list) 415 _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0); 416 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 417 namespace std { using ::libintl_vfprintf; } 418 # endif 419 # endif 420 421 # if !((defined printf && defined _GL_STDIO_H) || defined GNULIB_overrides_printf) /* don't override gnulib */ 422 # undef printf 423 # if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__ 424 /* Don't break __attribute__((format(printf,M,N))). 425 This redefinition is only possible because the libc in NetBSD, Cygwin, 426 mingw does not have a function __printf__. 427 Alternatively, we could have done this redirection only when compiling with 428 __GNUC__, together with a symbol redirection: 429 extern int printf (const char *, ...) 430 __asm__ (#__USER_LABEL_PREFIX__ "libintl_printf"); 431 But doing it now would introduce a binary incompatibility with already 432 distributed versions of libintl on these systems. */ 433 # define libintl_printf __printf__ 434 # endif 435 # define printf libintl_printf 436 extern int printf (const char *, ...) 437 _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2); 438 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 439 namespace std { using ::libintl_printf; } 440 # endif 441 # endif 442 # if !((defined vprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_vprintf) /* don't override gnulib */ 443 # undef vprintf 444 # define vprintf libintl_vprintf 445 extern int vprintf (const char *, va_list) 446 _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0); 447 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 448 namespace std { using ::libintl_vprintf; } 449 # endif 450 # endif 451 452 # if !((defined sprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_sprintf) /* don't override gnulib */ 453 # undef sprintf 454 # define sprintf libintl_sprintf 455 extern int sprintf (char *, const char *, ...) 456 _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3); 457 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 458 namespace std { using ::libintl_sprintf; } 459 # endif 460 # endif 461 # if !((defined vsprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_vsprintf) /* don't override gnulib */ 462 # undef vsprintf 463 # define vsprintf libintl_vsprintf 464 extern int vsprintf (char *, const char *, va_list) 465 _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0); 466 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 467 namespace std { using ::libintl_vsprintf; } 468 # endif 469 # endif 470 471 # if 1 472 473 # if !((defined snprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_snprintf) /* don't override gnulib */ 474 # undef snprintf 475 # define snprintf libintl_snprintf 476 extern int snprintf (char *, size_t, const char *, ...) 477 _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4); 478 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 479 namespace std { using ::libintl_snprintf; } 480 # endif 481 # endif 482 # if !((defined vsnprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_vsnprintf) /* don't override gnulib */ 483 # undef vsnprintf 484 # define vsnprintf libintl_vsnprintf 485 extern int vsnprintf (char *, size_t, const char *, va_list) 486 _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0); 487 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 488 namespace std { using ::libintl_vsnprintf; } 489 # endif 490 # endif 491 492 # endif 493 494 # if 1 495 496 # if !((defined asprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_asprintf) /* don't override gnulib */ 497 # undef asprintf 498 # define asprintf libintl_asprintf 499 extern int asprintf (char **, const char *, ...) 500 _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3); 501 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 502 namespace std { using ::libintl_asprintf; } 503 # endif 504 # endif 505 # if !((defined vasprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_vasprintf) /* don't override gnulib */ 506 # undef vasprintf 507 # define vasprintf libintl_vasprintf 508 extern int vasprintf (char **, const char *, va_list) 509 _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0); 510 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 511 namespace std { using ::libintl_vasprintf; } 512 # endif 513 # endif 514 515 # endif 516 517 # if 1 518 519 # undef fwprintf 520 # define fwprintf libintl_fwprintf 521 extern int fwprintf (FILE *, const wchar_t *, ...); 522 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 523 namespace std { using ::libintl_fwprintf; } 524 # endif 525 # undef vfwprintf 526 # define vfwprintf libintl_vfwprintf 527 extern int vfwprintf (FILE *, const wchar_t *, va_list); 528 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 529 namespace std { using ::libintl_vfwprintf; } 530 # endif 531 532 # undef wprintf 533 # define wprintf libintl_wprintf 534 extern int wprintf (const wchar_t *, ...); 535 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 536 namespace std { using ::libintl_wprintf; } 537 # endif 538 # undef vwprintf 539 # define vwprintf libintl_vwprintf 540 extern int vwprintf (const wchar_t *, va_list); 541 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 542 namespace std { using ::libintl_vwprintf; } 543 # endif 544 545 # undef swprintf 546 # define swprintf libintl_swprintf 547 extern int swprintf (wchar_t *, size_t, const wchar_t *, ...); 548 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 549 namespace std { using ::libintl_swprintf; } 550 # endif 551 # undef vswprintf 552 # define vswprintf libintl_vswprintf 553 extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list); 554 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 555 namespace std { using ::libintl_vswprintf; } 556 # endif 557 558 # endif 559 560 #endif 561 562 563 /* Support for retrieving the name of a locale_t object. */ 564 #if 0 565 566 # ifndef GNULIB_defined_newlocale /* don't override gnulib */ 567 # undef newlocale 568 # define newlocale libintl_newlocale 569 extern locale_t newlocale (int, const char *, locale_t); 570 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 571 namespace std { using ::libintl_newlocale; } 572 # endif 573 # endif 574 575 # ifndef GNULIB_defined_duplocale /* don't override gnulib */ 576 # undef duplocale 577 # define duplocale libintl_duplocale 578 extern locale_t duplocale (locale_t); 579 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 580 namespace std { using ::libintl_duplocale; } 581 # endif 582 # endif 583 584 # ifndef GNULIB_defined_freelocale /* don't override gnulib */ 585 # undef freelocale 586 # define freelocale libintl_freelocale 587 extern void freelocale (locale_t); 588 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 589 namespace std { using ::libintl_freelocale; } 590 # endif 591 # endif 592 593 #endif 594 595 596 /* Support for the locale chosen by the user. */ 597 #if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __CYGWIN__ 598 599 # ifndef GNULIB_defined_setlocale /* don't override gnulib */ 600 # undef setlocale 601 # define setlocale libintl_setlocale 602 extern char *setlocale (int, const char *); 603 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 604 namespace std { using ::libintl_setlocale; } 605 # endif 606 # endif 607 608 # if 1 609 610 # undef newlocale 611 # define newlocale libintl_newlocale 612 /* Declare newlocale() only if the system headers define the 'locale_t' type. */ 613 # if !(defined __CYGWIN__ && !defined LC_ALL_MASK) 614 extern locale_t newlocale (int, const char *, locale_t); 615 # if defined __cplusplus && !defined _INTL_CXX_NO_CLOBBER_STD_NAMESPACE 616 namespace std { using ::libintl_newlocale; } 617 # endif 618 # endif 619 620 # endif 621 622 #endif 623 624 625 /* Support for relocatable packages. */ 626 627 /* Sets the original and the current installation prefix of the package. 628 Relocation simply replaces a pathname starting with the original prefix 629 by the corresponding pathname with the current prefix instead. Both 630 prefixes should be directory names without trailing slash (i.e. use "" 631 instead of "/"). */ 632 #define libintl_set_relocation_prefix libintl_set_relocation_prefix 633 extern void 634 libintl_set_relocation_prefix (const char *orig_prefix, 635 const char *curr_prefix); 636 637 638 #ifdef __cplusplus 639 } 640 #endif 641 642 #endif /* libintl.h */