bba1605bad624b55ec5b208662c31f94f8378d0c
[apps/madmutt.git] / charset.h
1 /*
2  * Copyright notice from original mutt:
3  * Copyright (C) 1999-2000 Thomas Roessler <roessler@does-not-exist.org>
4  *
5  * This file is part of mutt-ng, see http://www.muttng.org/.
6  * It's licensed under the GNU General Public License,
7  * please see the file GPL in the top level source directory.
8  */
9
10 #ifndef _CHARSET_H
11 #define _CHARSET_H
12
13 #ifdef HAVE_ICONV_H
14 #include <iconv.h>
15 #endif
16
17 #ifndef HAVE_ICONV_T_DEF
18 typedef void *iconv_t;
19 #endif
20
21 #ifndef HAVE_ICONV
22   iconv_t iconv_open (const char *, const char *);
23 size_t iconv (iconv_t, const char **, size_t *, char **, size_t *);
24 int iconv_close (iconv_t);
25 #endif
26
27 int mutt_convert_string (char **, const char *, const char *, int);
28 const char *mutt_get_first_charset (const char *);
29 int mutt_convert_nonmime_string (char **);
30
31 iconv_t mutt_iconv_open (const char *, const char *, int);
32 size_t mutt_iconv (iconv_t, const char **, size_t *, char **, size_t *,
33                    const char **, const char *);
34
35 typedef void *FGETCONV;
36
37 FGETCONV *fgetconv_open (FILE *, const char *, const char *, int);
38 int fgetconv (FGETCONV *);
39 char *fgetconvs (char *, size_t, FGETCONV *);
40 void fgetconv_close (FGETCONV **);
41
42 void mutt_set_langinfo_charset (void);
43
44 #define M_ICONV_HOOK_FROM 1
45 #define M_ICONV_HOOK_TO   2
46
47 #endif /* _CHARSET_H */