2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or (at
5 * your option) any later version.
7 * This program is distributed in the hope that it will be useful, but
8 * WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * Copyright © 2006 Pierre Habouzit
20 * Copyright notice from original mutt:
21 * Copyright (C) 1999-2000 Thomas Roessler <roessler@does-not-exist.org>
23 * This file is part of mutt-ng, see http://www.muttng.org/.
24 * It's licensed under the GNU General Public License,
25 * please see the file GPL in the top level source directory.
35 /****************************************************************************/
36 /* charset functions */
37 /****************************************************************************/
40 extern int Charset_is_utf8;
41 extern wchar_t CharsetReplacement;
43 void charset_initialize(void);
44 void charset_canonicalize(char *, ssize_t, const char *);
45 int charset_is_utf8(const char *s);
46 int charset_is_us_ascii(const char *s);
48 const char *charset_getfirst(const char *);
51 /****************************************************************************/
52 /* iconv-line functions */
53 /****************************************************************************/
55 #define MUTT_ICONV_ERROR ((iconv_t)(-1))
61 my_iconv(iconv_t ict, const char **in, ssize_t *il, char **out, ssize_t *ol) {
62 return iconv(ict, (char **)in, (size_t*)il, out, (size_t*)ol);
66 # define iconv_t void*
67 # define iconv_open(a, b) MUTT_ICONV_ERROR
68 # define my_iconv(a,b,c,d,e) 0
69 # define iconv_close(a) 0
72 #define M_ICONV_HOOK_FROM 1
73 #define M_ICONV_HOOK_TO 2
75 iconv_t mutt_iconv_open(const char *, const char *, int);
76 ssize_t mutt_iconv(iconv_t, const char **, ssize_t *, char **, ssize_t *,
77 const char **, const char *);
79 int mutt_convert_string(char **, const char *, const char *, int);
80 int mutt_convert_nonmime_string (char **);
83 /****************************************************************************/
84 /* fgetconv functions */
85 /****************************************************************************/
87 typedef struct fgetconv_t fgetconv_t;
89 fgetconv_t *fgetconv_open(FILE *, const char *, const char *, int);
90 void fgetconv_close(fgetconv_t **);
92 int fgetconv(fgetconv_t *);
93 char *fgetconvs(char *, ssize_t, fgetconv_t *);
95 #endif /* _CHARSET_H */