dcgettext.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* Implementation of the dcgettext(3) function.
  2. Copyright (C) 1995-2019 Free Software Foundation, Inc.
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 2.1 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. #ifdef HAVE_CONFIG_H
  14. # include <config.h>
  15. #endif
  16. #include "gettextP.h"
  17. #ifdef _LIBC
  18. # include <libintl.h>
  19. #else
  20. # include "libgnuintl.h"
  21. #endif
  22. /* @@ end of prolog @@ */
  23. /* Names for the libintl functions are a problem. They must not clash
  24. with existing names and they should follow ANSI C. But this source
  25. code is also used in GNU C Library where the names have a __
  26. prefix. So we have to make a difference here. */
  27. #ifdef _LIBC
  28. # define DCGETTEXT __dcgettext
  29. # define DCIGETTEXT __dcigettext
  30. #else
  31. # define DCGETTEXT libintl_dcgettext
  32. # define DCIGETTEXT libintl_dcigettext
  33. #endif
  34. /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
  35. locale. */
  36. char *
  37. DCGETTEXT (const char *domainname, const char *msgid, int category)
  38. {
  39. return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category);
  40. }
  41. #ifdef _LIBC
  42. /* Alias for function name in GNU C Library. */
  43. weak_alias (__dcgettext, dcgettext);
  44. libc_hidden_def (__dcgettext)
  45. #endif