iconv.in.h 3.5 KB

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