Blame winbuild/iconv.h

Packit Service 50c9f2
/* Copyright (C) 1999-2003 Free Software Foundation, Inc.
Packit Service 50c9f2
   This file is part of the GNU LIBICONV Library.
Packit Service 50c9f2
Packit Service 50c9f2
   The GNU LIBICONV Library is free software; you can redistribute it
Packit Service 50c9f2
   and/or modify it under the terms of the GNU Library General Public
Packit Service 50c9f2
   License as published by the Free Software Foundation; either version 2
Packit Service 50c9f2
   of the License, or (at your option) any later version.
Packit Service 50c9f2
Packit Service 50c9f2
   The GNU LIBICONV Library is distributed in the hope that it will be
Packit Service 50c9f2
   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 50c9f2
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 50c9f2
   Library General Public License for more details.
Packit Service 50c9f2
Packit Service 50c9f2
   You should have received a copy of the GNU Library General Public
Packit Service 50c9f2
   License along with the GNU LIBICONV Library; see the file COPYING.LIB.
Packit Service 50c9f2
   If not, write to the Free Software Foundation, Inc., 59 Temple Place -
Packit Service 50c9f2
   Suite 330, Boston, MA 02111-1307, USA.  */
Packit Service 50c9f2
Packit Service 50c9f2
/* When installed, this file is called "iconv.h". */
Packit Service 50c9f2
Packit Service 50c9f2
#ifndef _LIBICONV_H
Packit Service 50c9f2
#define _LIBICONV_H
Packit Service 50c9f2
Packit Service 50c9f2
#define _LIBICONV_VERSION 0x0109    /* version number: (major<<8) + minor */
Packit Service 50c9f2
Packit Service 50c9f2
#ifdef LIBICONV_STATIC
Packit Service 50c9f2
#define LIBICONV_DLL_EXPORTED
Packit Service 50c9f2
#else /* LIBICONV_STATIC */
Packit Service 50c9f2
#ifdef BUILDING_LIBICONV
Packit Service 50c9f2
#define LIBICONV_DLL_EXPORTED __declspec(dllexport)
Packit Service 50c9f2
#else
Packit Service 50c9f2
#define LIBICONV_DLL_EXPORTED __declspec(dllimport)
Packit Service 50c9f2
#endif
Packit Service 50c9f2
#endif /* LIBICONV_STATIC */ 
Packit Service 50c9f2
extern LIBICONV_DLL_EXPORTED int _libiconv_version;       /* Likewise */
Packit Service 50c9f2
Packit Service 50c9f2
/* We would like to #include any system header file which could define
Packit Service 50c9f2
   iconv_t, 1. in order to eliminate the risk that the user gets compilation
Packit Service 50c9f2
   errors because some other system header file includes /usr/include/iconv.h
Packit Service 50c9f2
   which defines iconv_t or declares iconv after this file, 2. when compiling
Packit Service 50c9f2
   for LIBICONV_PLUG, we need the proper iconv_t type in order to produce
Packit Service 50c9f2
   binary compatible code.
Packit Service 50c9f2
   But gcc's #include_next is not portable. Thus, once libiconv's iconv.h
Packit Service 50c9f2
   has been installed in /usr/local/include, there is no way any more to
Packit Service 50c9f2
   include the original /usr/include/iconv.h. We simply have to get away
Packit Service 50c9f2
   without it.
Packit Service 50c9f2
   Ad 1. The risk that a system header file does
Packit Service 50c9f2
   #include "iconv.h"  or  #include_next "iconv.h"
Packit Service 50c9f2
   is small. They all do #include <iconv.h>.
Packit Service 50c9f2
   Ad 2. The iconv_t type is a pointer type in all cases I have seen. (It
Packit Service 50c9f2
   has to be a scalar type because (iconv_t)(-1) is a possible return value
Packit Service 50c9f2
   from iconv_open().) */
Packit Service 50c9f2
Packit Service 50c9f2
/* Define iconv_t ourselves. */
Packit Service 50c9f2
#undef iconv_t
Packit Service 50c9f2
#define iconv_t libiconv_t
Packit Service 50c9f2
typedef void* iconv_t;
Packit Service 50c9f2
Packit Service 50c9f2
/* Get size_t declaration. */
Packit Service 50c9f2
#include <stddef.h>
Packit Service 50c9f2
Packit Service 50c9f2
/* Get errno declaration and values. */
Packit Service 50c9f2
#include <errno.h>
Packit Service 50c9f2
/* Some systems, like SunOS 4, don't have EILSEQ. Some systems, like BSD/OS,
Packit Service 50c9f2
   have EILSEQ in a different header.  On these systems, define EILSEQ
Packit Service 50c9f2
   ourselves. */
Packit Service 50c9f2
#ifndef EILSEQ
Packit Service 50c9f2
#define EILSEQ 
Packit Service 50c9f2
#endif
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
#ifdef __cplusplus
Packit Service 50c9f2
extern "C" {
Packit Service 50c9f2
#endif
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
/* Allocates descriptor for code conversion from encoding `fromcode' to
Packit Service 50c9f2
   encoding `tocode'. */
Packit Service 50c9f2
#ifndef LIBICONV_PLUG
Packit Service 50c9f2
#define iconv_open libiconv_open
Packit Service 50c9f2
#endif
Packit Service 50c9f2
extern LIBICONV_DLL_EXPORTED iconv_t iconv_open (const char* tocode, const char* fromcode);
Packit Service 50c9f2
Packit Service 50c9f2
/* Converts, using conversion descriptor `cd', at most `*inbytesleft' bytes
Packit Service 50c9f2
   starting at `*inbuf', writing at most `*outbytesleft' bytes starting at
Packit Service 50c9f2
   `*outbuf'.
Packit Service 50c9f2
   Decrements `*inbytesleft' and increments `*inbuf' by the same amount.
Packit Service 50c9f2
   Decrements `*outbytesleft' and increments `*outbuf' by the same amount. */
Packit Service 50c9f2
#ifndef LIBICONV_PLUG
Packit Service 50c9f2
#define iconv libiconv
Packit Service 50c9f2
#endif
Packit Service 50c9f2
extern LIBICONV_DLL_EXPORTED size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
Packit Service 50c9f2
Packit Service 50c9f2
/* Frees resources allocated for conversion descriptor `cd'. */
Packit Service 50c9f2
#ifndef LIBICONV_PLUG
Packit Service 50c9f2
#define iconv_close libiconv_close
Packit Service 50c9f2
#endif
Packit Service 50c9f2
extern LIBICONV_DLL_EXPORTED int iconv_close (iconv_t cd);
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
#ifndef LIBICONV_PLUG
Packit Service 50c9f2
Packit Service 50c9f2
/* Nonstandard extensions. */
Packit Service 50c9f2
Packit Service 50c9f2
/* Control of attributes. */
Packit Service 50c9f2
#define iconvctl libiconvctl
Packit Service 50c9f2
extern LIBICONV_DLL_EXPORTED int iconvctl (iconv_t cd, int request, void* argument);
Packit Service 50c9f2
Packit Service 50c9f2
/* Requests for iconvctl. */
Packit Service 50c9f2
#define ICONV_TRIVIALP            0  /* int *argument */
Packit Service 50c9f2
#define ICONV_GET_TRANSLITERATE   1  /* int *argument */
Packit Service 50c9f2
#define ICONV_SET_TRANSLITERATE   2  /* const int *argument */
Packit Service 50c9f2
#define ICONV_GET_DISCARD_ILSEQ   3  /* int *argument */
Packit Service 50c9f2
#define ICONV_SET_DISCARD_ILSEQ   4  /* const int *argument */
Packit Service 50c9f2
Packit Service 50c9f2
/* Listing of locale independent encodings. */
Packit Service 50c9f2
#define iconvlist libiconvlist
Packit Service 50c9f2
extern LIBICONV_DLL_EXPORTED void iconvlist (int (*do_one) (unsigned int namescount,
Packit Service 50c9f2
                                      const char * const * names,
Packit Service 50c9f2
                                      void* data),
Packit Service 50c9f2
                       void* data);
Packit Service 50c9f2
Packit Service 50c9f2
/* Support for relocatable packages.  */
Packit Service 50c9f2
Packit Service 50c9f2
/* Sets the original and the current installation prefix of the package.
Packit Service 50c9f2
   Relocation simply replaces a pathname starting with the original prefix
Packit Service 50c9f2
   by the corresponding pathname with the current prefix instead.  Both
Packit Service 50c9f2
   prefixes should be directory names without trailing slash (i.e. use ""
Packit Service 50c9f2
   instead of "/").  */
Packit Service 50c9f2
extern LIBICONV_DLL_EXPORTED void libiconv_set_relocation_prefix (const char *orig_prefix,
Packit Service 50c9f2
					    const char *curr_prefix);
Packit Service 50c9f2
Packit Service 50c9f2
#endif
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
#ifdef __cplusplus
Packit Service 50c9f2
}
Packit Service 50c9f2
#endif
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
#endif /* _LIBICONV_H */