/usr/include/gmime-2.6/gmime/gmime-iconv.h is in libgmime-2.6-dev 2.6.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* GMime
* Copyright (C) 2000-2012 Jeffrey Stedfast
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
#ifndef __GMIME_ICONV_H__
#define __GMIME_ICONV_H__
#include <glib.h>
#include <iconv.h>
G_BEGIN_DECLS
void g_mime_iconv_init (void);
void g_mime_iconv_shutdown (void);
iconv_t g_mime_iconv_open (const char *to, const char *from);
/**
* g_mime_iconv:
* @cd: iconv_t conversion descriptor
* @inbuf: input buffer
* @inleft: number of bytes left in @inbuf
* @outbuf: output buffer
* @outleft: number of bytes left in @outbuf
*
* The argument @cd must be a conversion descriptor created using the
* function #g_mime_iconv_open.
*
* The main case is when @inbuf is not %NULL and *inbuf is not
* %NULL. In this case, the #g_mime_iconv function converts the
* multibyte sequence starting at *inbuf to a multibyte sequence
* starting at *outbuf. At most *inleft bytes, starting at *inbuf,
* will be read. At most *outleft bytes, starting at *outbuf, will
* be written.
*
* The #g_mime_iconv function converts one multibyte character at a
* time, and for each character conversion it increments *inbuf and
* decrements *inleft by the number of converted input bytes, it
* increments *outbuf and decrements *outleft by the number of
* converted output bytes, and it updates the conversion state
* contained in @cd. The conversion can stop for four reasons:
*
* 1. An invalid multibyte sequence is encountered in the input. In
* this case it sets errno to %EILSEQ and returns (size_t)(-1).
* *inbuf is left pointing to the beginning of the invalid multibyte
* sequence.
*
* 2. The input byte sequence has been entirely converted, i.e.
* *inleft has gone down to %0. In this case #g_mime_iconv returns
* the number of non-reversible conversions performed during this
* call.
*
* 3. An incomplete multibyte sequence is encountered in the input,
* and the input byte sequence terminates after it. In this case it
* sets errno to %EINVAL and returns (size_t)(-1). *inbuf is left
* pointing to the beginning of the incomplete multibyte sequence.
*
* 4. The output buffer has no more room for the next converted
* character. In this case it sets errno to %E2BIG and returns
* (size_t)(-1).
*
* A different case is when @inbuf is %NULL or *inbuf is %NULL, but
* @outbuf is not %NULL and *outbuf is not %NULL. In this case, the
* #g_mime_iconv function attempts to set @cd's conversion state to
* the initial state and store a corresponding shift sequence at
* *outbuf. At most *outleft bytes, starting at *outbuf, will be
* written. If the output buffer has no more room for this reset
* sequence, it sets errno to %E2BIG and returns (size_t)(-1).
* Otherwise it increments *outbuf and decrements *outleft by the
* number of bytes written.
*
* A third case is when @inbuf is %NULL or *inbuf is %NULL, and
* @outbuf is %NULL or *outbuf is %NULL. In this case, the
* #g_mime_iconv function sets @cd's conversion state to the initial
* state.
*
* Returns: the number of characters converted in a nonreversible way
* during this call; reversible conversions are not counted. In case
* of error, it sets errno and returns (size_t)(-1).
**/
#define g_mime_iconv(cd,inbuf,inleft,outbuf,outleft) iconv (cd, inbuf, inleft, outbuf, outleft)
int g_mime_iconv_close (iconv_t cd);
G_END_DECLS
#endif /* __GMIME_ICONV_H__ */
|