iconv.in.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /* A GNU-like <iconv.h>.
  2. Copyright (C) 2007-2012 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, 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
  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, write to the Free Software Foundation,
  13. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
  14. #ifndef _@GUARD_PREFIX@_ICONV_H
  15. #if __GNUC__ >= 3
  16. @PRAGMA_SYSTEM_HEADER@
  17. #endif
  18. @PRAGMA_COLUMNS@
  19. /* The include_next requires a split double-inclusion guard. */
  20. #@INCLUDE_NEXT@ @NEXT_ICONV_H@
  21. #ifndef _@GUARD_PREFIX@_ICONV_H
  22. #define _@GUARD_PREFIX@_ICONV_H
  23. /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
  24. /* The definition of _GL_ARG_NONNULL is copied here. */
  25. /* The definition of _GL_WARN_ON_USE is copied here. */
  26. #if @GNULIB_ICONV@
  27. # if @REPLACE_ICONV_OPEN@
  28. /* An iconv_open wrapper that supports the IANA standardized encoding names
  29. ("ISO-8859-1" etc.) as far as possible. */
  30. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  31. # define iconv_open rpl_iconv_open
  32. # endif
  33. _GL_FUNCDECL_RPL (iconv_open, iconv_t,
  34. (const char *tocode, const char *fromcode)
  35. _GL_ARG_NONNULL ((1, 2)));
  36. _GL_CXXALIAS_RPL (iconv_open, iconv_t,
  37. (const char *tocode, const char *fromcode));
  38. # else
  39. _GL_CXXALIAS_SYS (iconv_open, iconv_t,
  40. (const char *tocode, const char *fromcode));
  41. # endif
  42. _GL_CXXALIASWARN (iconv_open);
  43. #endif
  44. #if @REPLACE_ICONV_UTF@
  45. /* Special constants for supporting UTF-{16,32}{BE,LE} encodings.
  46. Not public. */
  47. # define _ICONV_UTF8_UTF16BE (iconv_t)(-161)
  48. # define _ICONV_UTF8_UTF16LE (iconv_t)(-162)
  49. # define _ICONV_UTF8_UTF32BE (iconv_t)(-163)
  50. # define _ICONV_UTF8_UTF32LE (iconv_t)(-164)
  51. # define _ICONV_UTF16BE_UTF8 (iconv_t)(-165)
  52. # define _ICONV_UTF16LE_UTF8 (iconv_t)(-166)
  53. # define _ICONV_UTF32BE_UTF8 (iconv_t)(-167)
  54. # define _ICONV_UTF32LE_UTF8 (iconv_t)(-168)
  55. #endif
  56. #if @GNULIB_ICONV@
  57. # if @REPLACE_ICONV@
  58. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  59. # define iconv rpl_iconv
  60. # endif
  61. _GL_FUNCDECL_RPL (iconv, size_t,
  62. (iconv_t cd,
  63. @ICONV_CONST@ char **inbuf, size_t *inbytesleft,
  64. char **outbuf, size_t *outbytesleft));
  65. _GL_CXXALIAS_RPL (iconv, size_t,
  66. (iconv_t cd,
  67. @ICONV_CONST@ char **inbuf, size_t *inbytesleft,
  68. char **outbuf, size_t *outbytesleft));
  69. # else
  70. _GL_CXXALIAS_SYS (iconv, size_t,
  71. (iconv_t cd,
  72. @ICONV_CONST@ char **inbuf, size_t *inbytesleft,
  73. char **outbuf, size_t *outbytesleft));
  74. # endif
  75. _GL_CXXALIASWARN (iconv);
  76. # ifndef ICONV_CONST
  77. # define ICONV_CONST @ICONV_CONST@
  78. # endif
  79. #endif
  80. #if @GNULIB_ICONV@
  81. # if @REPLACE_ICONV@
  82. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  83. # define iconv_close rpl_iconv_close
  84. # endif
  85. _GL_FUNCDECL_RPL (iconv_close, int, (iconv_t cd));
  86. _GL_CXXALIAS_RPL (iconv_close, int, (iconv_t cd));
  87. # else
  88. _GL_CXXALIAS_SYS (iconv_close, int, (iconv_t cd));
  89. # endif
  90. _GL_CXXALIASWARN (iconv_close);
  91. #endif
  92. #endif /* _@GUARD_PREFIX@_ICONV_H */
  93. #endif /* _@GUARD_PREFIX@_ICONV_H */