iconv.h.msvc
Upload User: yingmei828
Upload Date: 2007-01-01
Package Size: 1646k
Code Size: 4k
Development Platform:

Unix_Linux

  1. /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
  2.    This file is part of the GNU ICONV Library.
  3.    The GNU ICONV Library is free software; you can redistribute it and/or
  4.    modify it under the terms of the GNU Library General Public License as
  5.    published by the Free Software Foundation; either version 2 of the
  6.    License, or (at your option) any later version.
  7.    The GNU ICONV Library 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 the GNU ICONV Library; see the file COPYING.LIB.  If not,
  13.    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14.    Boston, MA 02111-1307, USA.  */
  15. /* When installed, this file is called "iconv.h". */
  16. #ifndef _LIBICONV_H
  17. #define _LIBICONV_H
  18. #define _LIBICONV_VERSION 0x0101    /* version number: (major<<8) + minor */
  19. /* We would like to #include any system header file which could define
  20.    iconv_t, 1. in order to eliminate the risk that the user gets compilation
  21.    errors because some other system header file includes /usr/include/iconv.h
  22.    which defines iconv_t or declares iconv after this file, 2. when compiling
  23.    for LIBICONV_PLUG, we need the proper iconv_t type in order to produce
  24.    binary compatible code.
  25.    But gcc's #include_next is not portable. Thus, once libiconv's iconv.h
  26.    has been installed in /usr/local/include, there is no way any more to
  27.    include the original /usr/include/iconv.h. We simply have to get away
  28.    without it.
  29.    Ad 1. The risk that a system header file does
  30.    #include "iconv.h"  or  #include_next "iconv.h"
  31.    is small. They all do #include <iconv.h>.
  32.    Ad 2. The iconv_t type is a pointer type in all cases I have seen. (It
  33.    has to be a scalar type because (iconv_t)(-1) is a possible return value
  34.    from iconv_open().) */
  35. /* Define iconv_t ourselves. */
  36. #undef iconv_t
  37. #define iconv_t libiconv_t
  38. typedef void* iconv_t;
  39. /* Get size_t declaration. */
  40. #include <stddef.h>
  41. /* Get errno declaration and values. */
  42. #include <errno.h>
  43. #ifndef EILSEQ
  44. #define EILSEQ EINVAL
  45. #endif
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49. /* Allocates descriptor for code conversion from encoding `fromcode' to
  50.    encoding `tocode'. */
  51. #ifndef LIBICONV_PLUG
  52. #define iconv_open libiconv_open
  53. #endif
  54. extern iconv_t iconv_open (const char* tocode, const char* fromcode);
  55. /* Converts, using conversion descriptor `cd', at most `*inbytesleft' bytes
  56.    starting at `*inbuf', writing at most `*outbytesleft' bytes starting at
  57.    `*outbuf'.
  58.    Decrements `*inbytesleft' and increments `*inbuf' by the same amount.
  59.    Decrements `*outbytesleft' and increments `*outbuf' by the same amount. */
  60. #ifndef LIBICONV_PLUG
  61. #define iconv libiconv
  62. #endif
  63. extern size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
  64. /* Frees resources allocated for conversion descriptor `cd'. */
  65. #ifndef LIBICONV_PLUG
  66. #define iconv_close libiconv_close
  67. #endif
  68. extern int iconv_close (iconv_t cd);
  69. #ifndef LIBICONV_PLUG
  70. /* Nonstandard extensions. */
  71. /* Control of attributes. */
  72. #define iconvctl libiconvctl
  73. extern int iconvctl (iconv_t cd, int request, void* argument);
  74. /* Requests for iconvctl. */
  75. #define ICONV_TRIVIALP            0  /* int *argument */
  76. #define ICONV_GET_TRANSLITERATE   1  /* int *argument */
  77. #define ICONV_SET_TRANSLITERATE   2  /* const int *argument */
  78. #endif
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif /* _LIBICONV_H */