libintl.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef _LIBINTL_H
  2. #include <intl/libintl.h>
  3. # ifndef _ISOMAC
  4. #include <locale.h>
  5. /* Now define the internal interfaces. */
  6. extern char *__gettext (const char *__msgid)
  7. __attribute_format_arg__ (1);
  8. extern char *__dgettext (const char *__domainname,
  9. const char *__msgid)
  10. __attribute_format_arg__ (2);
  11. extern char *__dcgettext (const char *__domainname,
  12. const char *__msgid, int __category)
  13. __attribute_format_arg__ (2);
  14. libc_hidden_proto (__dcgettext)
  15. extern char *__ngettext (const char *__msgid1, const char *__msgid2,
  16. unsigned long int __n)
  17. __attribute_format_arg__ (1) __attribute_format_arg__ (2);
  18. extern char *__dngettext (const char *__domainname,
  19. const char *__msgid1, const char *__msgid2,
  20. unsigned long int __n)
  21. __attribute_format_arg__ (2) __attribute_format_arg__ (3);
  22. extern char *__dcngettext (const char *__domainname,
  23. const char *__msgid1, const char *__msgid2,
  24. unsigned long int __n, int __category)
  25. __attribute_format_arg__ (2) __attribute_format_arg__ (3);
  26. extern char *__textdomain (const char *__domainname);
  27. extern char *__bindtextdomain (const char *__domainname,
  28. const char *__dirname);
  29. extern char *__bind_textdomain_codeset (const char *__domainname,
  30. const char *__codeset);
  31. extern const char _libc_intl_domainname[];
  32. libc_hidden_proto (_libc_intl_domainname)
  33. /* _ marks its argument, a string literal, for translation, and
  34. performs translation at run time if the LC_MESSAGES locale category
  35. has been set. The MSGID argument is extracted, added to the
  36. translation database, and eventually submitted to the translation
  37. team for processing. New translations are periodically
  38. incorporated into the glibc source tree as part of translation
  39. updates. */
  40. # undef _
  41. # define _(msgid) __dcgettext (_libc_intl_domainname, msgid, LC_MESSAGES)
  42. /* N_ marks its argument, a string literal, for translation, so that
  43. it is extracted and added to the translation database (similar to
  44. the _ macro above). It does not translate the string at run time.
  45. The first, primary use case for N_ is a context in which a string
  46. literal is required, such as an initializer. Translation will
  47. happen later, for example using the __gettext function.
  48. The second, historic, use case involves strings which may be
  49. translated in a future version of the library, but cannot be
  50. translated in current releases due to some technical limitation
  51. (e.g., gettext not being available in the dynamic loader). No
  52. translation at run time happens in such cases. In the future, this
  53. historic usage of N_ may become deprecated. Strings which are not
  54. translated create unnecessary work for the translation team. We
  55. continue to use N_ because it helps mark translatable strings. */
  56. # undef N_
  57. # define N_(msgid) msgid
  58. # endif /* !_ISOMAC */
  59. #endif