Annotation of win32/gnome/libiconv-x.x/include/iconv.h, revision 1.1
1.1 ! paf 1: /* Copyright (C) 1999-2002 Free Software Foundation, Inc.
! 2: This file is part of the GNU LIBICONV Library.
! 3:
! 4: The GNU LIBICONV Library is free software; you can redistribute it
! 5: and/or modify it under the terms of the GNU Library General Public
! 6: License as published by the Free Software Foundation; either version 2
! 7: of the License, or (at your option) any later version.
! 8:
! 9: The GNU LIBICONV Library is distributed in the hope that it will be
! 10: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
! 11: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! 12: Library General Public License for more details.
! 13:
! 14: You should have received a copy of the GNU Library General Public
! 15: License along with the GNU LIBICONV Library; see the file COPYING.LIB.
! 16: If not, write to the Free Software Foundation, Inc., 59 Temple Place -
! 17: Suite 330, Boston, MA 02111-1307, USA. */
! 18:
! 19: /* When installed, this file is called "iconv.h". */
! 20:
! 21: #ifndef _LIBICONV_H
! 22: #define _LIBICONV_H
! 23:
! 24: #define _LIBICONV_VERSION 0x0108 /* version number: (major<<8) + minor */
! 25:
! 26: #ifdef BUILDING_LIBICONV
! 27: #define LIBICONV_DLL_EXPORTED __declspec(dllexport)
! 28: #else
! 29: #define LIBICONV_DLL_EXPORTED __declspec(dllimport)
! 30: #endif
! 31: extern LIBICONV_DLL_EXPORTED int _libiconv_version; /* Likewise */
! 32:
! 33: /* We would like to #include any system header file which could define
! 34: iconv_t, 1. in order to eliminate the risk that the user gets compilation
! 35: errors because some other system header file includes /usr/include/iconv.h
! 36: which defines iconv_t or declares iconv after this file, 2. when compiling
! 37: for LIBICONV_PLUG, we need the proper iconv_t type in order to produce
! 38: binary compatible code.
! 39: But gcc's #include_next is not portable. Thus, once libiconv's iconv.h
! 40: has been installed in /usr/local/include, there is no way any more to
! 41: include the original /usr/include/iconv.h. We simply have to get away
! 42: without it.
! 43: Ad 1. The risk that a system header file does
! 44: #include "iconv.h" or #include_next "iconv.h"
! 45: is small. They all do #include <iconv.h>.
! 46: Ad 2. The iconv_t type is a pointer type in all cases I have seen. (It
! 47: has to be a scalar type because (iconv_t)(-1) is a possible return value
! 48: from iconv_open().) */
! 49:
! 50: /* Define iconv_t ourselves. */
! 51: #undef iconv_t
! 52: #define iconv_t libiconv_t
! 53: typedef void* iconv_t;
! 54:
! 55: /* Get size_t declaration. */
! 56: #include <stddef.h>
! 57:
! 58: /* Get errno declaration and values. */
! 59: #include <errno.h>
! 60: /* Some systems, like SunOS 4, don't have EILSEQ. Some systems, like BSD/OS,
! 61: have EILSEQ in a different header. On these systems, define EILSEQ
! 62: ourselves. */
! 63: #ifndef EILSEQ
! 64: #define EILSEQ @EILSEQ@
! 65: #endif
! 66:
! 67:
! 68: #ifdef __cplusplus
! 69: extern "C" {
! 70: #endif
! 71:
! 72:
! 73: /* Allocates descriptor for code conversion from encoding `fromcode' to
! 74: encoding `tocode'. */
! 75: #ifndef LIBICONV_PLUG
! 76: #define iconv_open libiconv_open
! 77: #endif
! 78: extern LIBICONV_DLL_EXPORTED iconv_t iconv_open (const char* tocode, const char* fromcode);
! 79:
! 80: /* Converts, using conversion descriptor `cd', at most `*inbytesleft' bytes
! 81: starting at `*inbuf', writing at most `*outbytesleft' bytes starting at
! 82: `*outbuf'.
! 83: Decrements `*inbytesleft' and increments `*inbuf' by the same amount.
! 84: Decrements `*outbytesleft' and increments `*outbuf' by the same amount. */
! 85: #ifndef LIBICONV_PLUG
! 86: #define iconv libiconv
! 87: #endif
! 88: extern LIBICONV_DLL_EXPORTED size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
! 89:
! 90: /* Frees resources allocated for conversion descriptor `cd'. */
! 91: #ifndef LIBICONV_PLUG
! 92: #define iconv_close libiconv_close
! 93: #endif
! 94: extern LIBICONV_DLL_EXPORTED int iconv_close (iconv_t cd);
! 95:
! 96:
! 97: #ifndef LIBICONV_PLUG
! 98:
! 99: /* Nonstandard extensions. */
! 100:
! 101: /* Control of attributes. */
! 102: #define iconvctl libiconvctl
! 103: extern LIBICONV_DLL_EXPORTED int iconvctl (iconv_t cd, int request, void* argument);
! 104:
! 105: /* Requests for iconvctl. */
! 106: #define ICONV_TRIVIALP 0 /* int *argument */
! 107: #define ICONV_GET_TRANSLITERATE 1 /* int *argument */
! 108: #define ICONV_SET_TRANSLITERATE 2 /* const int *argument */
! 109: #define ICONV_GET_DISCARD_ILSEQ 3 /* int *argument */
! 110: #define ICONV_SET_DISCARD_ILSEQ 4 /* const int *argument */
! 111:
! 112: /* Listing of locale independent encodings. */
! 113: #define iconvlist libiconvlist
! 114: extern LIBICONV_DLL_EXPORTED void iconvlist (int (*do_one) (unsigned int namescount,
! 115: const char * const * names,
! 116: void* data),
! 117: void* data);
! 118: #endif
! 119:
! 120:
! 121: #ifdef __cplusplus
! 122: }
! 123: #endif
! 124:
! 125:
! 126: #endif /* _LIBICONV_H */
E-mail: