libintl.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef LIBINTL_H
  2. #define LIBINTL_H
  3. char *gettext(const char *msgid);
  4. char *dgettext(const char *domainname, const char *msgid);
  5. char *dcgettext(const char *domainname, const char *msgid, int category);
  6. char *ngettext(const char *msgid1, const char *msgid2, unsigned long n);
  7. char *dngettext(const char *domainname, const char *msgid1, const char *msgid2, unsigned long n);
  8. char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2, unsigned long n, int category);
  9. char *textdomain(const char *domainname);
  10. char *bind_textdomain_codeset(const char *domainname, const char *codeset);
  11. char *bindtextdomain(const char *domainname, const char *dirname);
  12. #undef gettext_noop
  13. #define gettext_noop(X) X
  14. #ifndef LIBINTL_NO_MACROS
  15. /* if these macros are defined, configure checks will detect libintl as
  16. * built into the libc because test programs will work without -lintl.
  17. * for example:
  18. * checking for ngettext in libc ... yes
  19. * the consequence is that -lintl will not be added to the LDFLAGS.
  20. * so if for some reason you want that libintl.a gets linked,
  21. * add -DLIBINTL_NO_MACROS=1 to your CPPFLAGS. */
  22. #define gettext(X) ((char*) (X))
  23. #define dgettext(dom, X) ((void)(dom), (char*) (X))
  24. #define dcgettext(dom, X, cat) ((void)(dom), (void)(cat), (char*) (X))
  25. #define ngettext(X, Y, N) \
  26. ((char*) (((N) == 1) ? ((void)(Y), (X)) : ((void)(X), (Y))))
  27. #define dngettext(dom, X, Y, N) \
  28. ((dom), (char*) (((N) == 1) ? ((void)(Y), (X)) : ((void)(X), (Y))))
  29. #define dcngettext(dom, X, Y, N, cat) \
  30. ((dom), (cat), (char*) (((N) == 1) ? ((void)(Y), (X)) : ((void)(X), (Y))))
  31. #define bindtextdomain(X, Y) ((void)(X), (void)(Y), (char*) "/")
  32. #define bind_textdomain_codeset(dom, codeset) \
  33. ((void)(dom), (void)(codeset), (char*) 0)
  34. #define textdomain(X) ((void)(X), (char*) "messages")
  35. #undef ENABLE_NLS
  36. #undef DISABLE_NLS
  37. #define DISABLE_NLS 1
  38. #if __GNUC__ +0 > 3
  39. /* most ppl call bindtextdomain() without using its return value
  40. thus we get tons of warnings about "statement with no effect" */
  41. #pragma GCC diagnostic ignored "-Wunused-value"
  42. #endif
  43. #endif
  44. #include <stdio.h>
  45. #define gettext_printf(args...) printf(args)
  46. /* to supply LC_MESSAGES and other stuff GNU expects to be exported when
  47. including libintl.h */
  48. #include <locale.h>
  49. #endif