2 * Copyright (C) 1999-2003 Thomas Roessler <roessler@does-not-exist.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 #ifndef HAVE_ICONV_T_DEF
27 typedef void *iconv_t;
31 #define ICONV_CONST /**/
32 iconv_t iconv_open (const char *, const char *);
33 size_t iconv (iconv_t, ICONV_CONST char **, size_t *, char **, size_t *);
34 int iconv_close (iconv_t);
37 int mutt_convert_string (char **, const char *, const char *, int);
39 iconv_t mutt_iconv_open (const char *, const char *, int);
40 size_t mutt_iconv (iconv_t, ICONV_CONST char **, size_t *, char **, size_t *, ICONV_CONST char **, const char *);
42 typedef void * FGETCONV;
44 FGETCONV *fgetconv_open (FILE *, const char *, const char *, int);
45 int fgetconv (FGETCONV *);
46 char * fgetconvs (char *, size_t, FGETCONV *);
47 void fgetconv_close (FGETCONV **);
49 void mutt_set_langinfo_charset (void);
50 char *mutt_get_default_charset ();
52 /* flags for charset.c:mutt_convert_string(), fgetconv_open(), and
53 * mutt_iconv_open(). Note that applying charset-hooks to tocode is
54 * never needed, and sometimes hurts: Hence there is no M_ICONV_HOOK_TO
57 #define M_ICONV_HOOK_FROM 1 /* apply charset-hooks to fromcode */
59 /* Check if given character set is valid (either officially assigned or
60 * known to local iconv implementation). If strict is non-zero, check
61 * against iconv only. Returns 0 if known and negative otherwise.
63 int mutt_check_charset (const char *s, int strict);
65 #endif /* _CHARSET_H */