You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

intl-compat.c 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /* intl-compat.c - Stub functions to call gettext functions from GNU gettext
  2. Library.
  3. Copyright (C) 1995, 2000-2003 Software Foundation, Inc.
  4. This program is free software; you can redistribute it and/or modify it
  5. under the terms of the GNU Library General Public License as published
  6. by the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public
  13. License along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  15. USA. */
  16. #ifdef HAVE_CONFIG_H
  17. # include <config.h>
  18. #endif
  19. #include "gettextP.h"
  20. /* @@ end of prolog @@ */
  21. /* This file redirects the gettext functions (without prefix) to those
  22. defined in the included GNU libintl library (with "libintl_" prefix).
  23. It is compiled into libintl in order to make the AM_GNU_GETTEXT test
  24. of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which
  25. has the redirections primarily in the <libintl.h> include file.
  26. It is also compiled into libgnuintl so that libgnuintl.so can be used
  27. as LD_PRELOADable library on glibc systems, to provide the extra
  28. features that the functions in the libc don't have (namely, logging). */
  29. #undef gettext
  30. #undef dgettext
  31. #undef dcgettext
  32. #undef ngettext
  33. #undef dngettext
  34. #undef dcngettext
  35. #undef textdomain
  36. #undef bindtextdomain
  37. #undef bind_textdomain_codeset
  38. /* When building a DLL, we must export some functions. Note that because
  39. the functions are only defined for binary backward compatibility, we
  40. don't need to use __declspec(dllimport) in any case. */
  41. #if defined _MSC_VER && BUILDING_DLL
  42. # define DLL_EXPORTED __declspec(dllexport)
  43. #else
  44. # define DLL_EXPORTED
  45. #endif
  46. DLL_EXPORTED
  47. char *
  48. gettext (const char *msgid)
  49. {
  50. return libintl_gettext (msgid);
  51. }
  52. DLL_EXPORTED
  53. char *
  54. dgettext (const char *domainname, const char *msgid)
  55. {
  56. return libintl_dgettext (domainname, msgid);
  57. }
  58. DLL_EXPORTED
  59. char *
  60. dcgettext (const char *domainname, const char *msgid, int category)
  61. {
  62. return libintl_dcgettext (domainname, msgid, category);
  63. }
  64. DLL_EXPORTED
  65. char *
  66. ngettext (const char *msgid1, const char *msgid2, unsigned long int n)
  67. {
  68. return libintl_ngettext (msgid1, msgid2, n);
  69. }
  70. DLL_EXPORTED
  71. char *
  72. dngettext (const char *domainname,
  73. const char *msgid1, const char *msgid2, unsigned long int n)
  74. {
  75. return libintl_dngettext (domainname, msgid1, msgid2, n);
  76. }
  77. DLL_EXPORTED
  78. char *
  79. dcngettext (const char *domainname,
  80. const char *msgid1, const char *msgid2, unsigned long int n,
  81. int category)
  82. {
  83. return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
  84. }
  85. DLL_EXPORTED
  86. char *
  87. textdomain (const char *domainname)
  88. {
  89. return libintl_textdomain (domainname);
  90. }
  91. DLL_EXPORTED
  92. char *
  93. bindtextdomain (const char *domainname, const char *dirname)
  94. {
  95. return libintl_bindtextdomain (domainname, dirname);
  96. }
  97. DLL_EXPORTED
  98. char *
  99. bind_textdomain_codeset (const char *domainname, const char *codeset)
  100. {
  101. return libintl_bind_textdomain_codeset (domainname, codeset);
  102. }