Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ngettext.c 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Implementation of ngettext(3) function.
  2. Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify it
  4. under the terms of the GNU Library General Public License as published
  5. by the Free Software Foundation; either version 2, or (at your option)
  6. 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 GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public
  12. License along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  14. USA. */
  15. #ifdef HAVE_CONFIG_H
  16. # include <config.h>
  17. #endif
  18. #ifdef _LIBC
  19. # define __need_NULL
  20. # include <stddef.h>
  21. #else
  22. # include <stdlib.h> /* Just for NULL. */
  23. #endif
  24. #include "gettextP.h"
  25. #ifdef _LIBC
  26. # include <libintl.h>
  27. #else
  28. # include "libgnuintl.h"
  29. #endif
  30. #include <locale.h>
  31. /* @@ end of prolog @@ */
  32. /* Names for the libintl functions are a problem. They must not clash
  33. with existing names and they should follow ANSI C. But this source
  34. code is also used in GNU C Library where the names have a __
  35. prefix. So we have to make a difference here. */
  36. #ifdef _LIBC
  37. # define NGETTEXT __ngettext
  38. # define DCNGETTEXT __dcngettext
  39. #else
  40. # define NGETTEXT libintl_ngettext
  41. # define DCNGETTEXT libintl_dcngettext
  42. #endif
  43. /* Look up MSGID in the current default message catalog for the current
  44. LC_MESSAGES locale. If not found, returns MSGID itself (the default
  45. text). */
  46. char *
  47. NGETTEXT (const char *msgid1, const char *msgid2, unsigned long int n)
  48. {
  49. return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES);
  50. }
  51. #ifdef _LIBC
  52. /* Alias for function name in GNU C Library. */
  53. weak_alias (__ngettext, ngettext);
  54. #endif