libintl.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Copyright (C) 2008 Tor Lillqvist
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library 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 GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; see the file COPYING.LIB.txt. If
  16. * not, write to the Free Software Foundation, Inc., 51 Franklin
  17. * Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef _LIBINTL_H
  20. #define _LIBINTL_H 1
  21. #include <locale.h>
  22. #ifndef LC_MESSAGES
  23. # define LC_MESSAGES 1729 /* Use same value as in GNU gettext */
  24. #endif
  25. /* Define this to make configure checks successfully find gettext in libintl.
  26. * This will cause the AM_GNU_GETTEXT([external]) macro to successfully detect
  27. * that gettext is in -lintl, not in libc, and needs #include <libintl.h> */
  28. #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
  29. # define __GNU_GETTEXT_SUPPORTED_REVISION
  30. #endif
  31. #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
  32. # define PROXY_LIBINTL_GNUC_FORMAT(arg_idx) __attribute__((__format_arg__(arg_idx)))
  33. #else
  34. # define PROXY_LIBINTL_GNUC_FORMAT(arg_idx)
  35. #endif
  36. #define gettext libintl_gettext
  37. #define dgettext libintl_dgettext
  38. #define dcgettext libintl_dcgettext
  39. #define ngettext libintl_ngettext
  40. #define dngettext libintl_dngettext
  41. #define dcngettext libintl_dcngettext
  42. #define textdomain libintl_textdomain
  43. #define bindtextdomain libintl_bindtextdomain
  44. #define bind_textdomain_codeset libintl_bind_textdomain_codeset
  45. /* Define G_INTL_STATIC_COMPILATION to link statically */
  46. #if defined(_WIN32) && !defined(G_INTL_STATIC_COMPILATION)
  47. /* Export when producing library, import when linking against library */
  48. # ifdef G_INTL_COMPILATION
  49. # define G_INTL_EXPORT __declspec(dllexport)
  50. # else
  51. # define G_INTL_EXPORT __declspec(dllimport)
  52. # endif
  53. #else
  54. # define G_INTL_EXPORT extern
  55. #endif
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59. G_INTL_EXPORT char *libintl_gettext (const char *msgid) PROXY_LIBINTL_GNUC_FORMAT (1);
  60. G_INTL_EXPORT char *libintl_dgettext (const char *domainname,
  61. const char *msgid) PROXY_LIBINTL_GNUC_FORMAT (2);
  62. G_INTL_EXPORT char *libintl_dcgettext (const char *domainname,
  63. const char *msgid,
  64. int category) PROXY_LIBINTL_GNUC_FORMAT (2);
  65. G_INTL_EXPORT char *libintl_ngettext (const char *msgid1,
  66. const char *msgid2,
  67. unsigned long int n) PROXY_LIBINTL_GNUC_FORMAT (1) PROXY_LIBINTL_GNUC_FORMAT (2);
  68. G_INTL_EXPORT char *libintl_dngettext (const char *domainname,
  69. const char *msgid1,
  70. const char *msgid2,
  71. unsigned long int n) PROXY_LIBINTL_GNUC_FORMAT (2) PROXY_LIBINTL_GNUC_FORMAT (3);
  72. G_INTL_EXPORT char *libintl_dcngettext (const char *domainname,
  73. const char *msgid1,
  74. const char *msgid2,
  75. unsigned long int n,
  76. int category) PROXY_LIBINTL_GNUC_FORMAT (2) PROXY_LIBINTL_GNUC_FORMAT (3);
  77. G_INTL_EXPORT char *libintl_textdomain (const char *domainname);
  78. G_INTL_EXPORT char *libintl_bindtextdomain (const char *domainname,
  79. const char *dirname);
  80. G_INTL_EXPORT char *libintl_bind_textdomain_codeset (const char *domainname,
  81. const char *codeset);
  82. #ifdef __cplusplus
  83. }
  84. #endif
  85. #endif /* _LIBINTL_H */