Nico Golde:
[apps/madmutt.git] / charset.h
1 /*
2  * Copyright (C) 1999-2000 Thomas Roessler <roessler@does-not-exist.org>
3  *
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.
8  *
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.
13  *
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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
17  */
18
19 #ifndef _CHARSET_H
20 #define _CHARSET_H
21
22 #ifdef HAVE_ICONV_H
23 #include <iconv.h>
24 #endif
25
26 #ifndef HAVE_ICONV_T_DEF
27 typedef void *iconv_t;
28 #endif
29
30 #ifndef HAVE_ICONV
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);
35 #endif
36
37 int mutt_convert_string (char **, const char *, const char *, int);
38 char *mutt_get_first_charset (const char *);
39 int mutt_convert_nonmime_string (char **);
40
41 iconv_t mutt_iconv_open (const char *, const char *, int);
42 size_t mutt_iconv (iconv_t, ICONV_CONST char **, size_t *, char **, size_t *, ICONV_CONST char **, const char *);
43
44 typedef void * FGETCONV;
45
46 FGETCONV *fgetconv_open (FILE *, const char *, const char *, int);
47 int fgetconv (FGETCONV *);
48 char * fgetconvs (char *, size_t, FGETCONV *);
49 void fgetconv_close (FGETCONV **);
50
51 void mutt_set_langinfo_charset (void);
52
53 #define M_ICONV_HOOK_FROM 1
54 #define M_ICONV_HOOK_TO   2
55
56 #endif /* _CHARSET_H */