X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=charset.h;h=f8fcc9858c8cee71784b44ae58f69c6ca3537c33;hp=482339b693d33217ab921fd2e3a054fa0a113357;hb=871a94fc21c9d349bb0fe8851e0f2e3a07527ed5;hpb=ea912b20ba2b3b9dfdbbae758ad56263c9aa41b3 diff --git a/charset.h b/charset.h index 482339b..f8fcc98 100644 --- a/charset.h +++ b/charset.h @@ -10,6 +10,12 @@ #ifndef _CHARSET_H #define _CHARSET_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mutt.h" + #ifdef HAVE_ICONV_H #include #endif @@ -19,19 +25,24 @@ typedef void *iconv_t; #endif #ifndef HAVE_ICONV -#define ICONV_CONST const - iconv_t iconv_open (const char *, const char *); -size_t iconv (iconv_t, ICONV_CONST char **, size_t *, char **, size_t *); -int iconv_close (iconv_t); +# define iconv_open(a, b) ((iconv_t)(-1)) +# define my_iconv(a,b,c,d,e) 0 +# define iconv_close(a) 0 +#else +static inline size_t my_iconv(iconv_t ict, const char **inbuf, size_t *ilen, + char **outbuf, size_t *olen) +{ + return iconv(ict, (char **)inbuf, ilen, outbuf, olen); +} #endif int mutt_convert_string (char **, const char *, const char *, int); -char *mutt_get_first_charset (const char *); +const char *mutt_get_first_charset (const char *); int mutt_convert_nonmime_string (char **); iconv_t mutt_iconv_open (const char *, const char *, int); -size_t mutt_iconv (iconv_t, ICONV_CONST char **, size_t *, char **, size_t *, - ICONV_CONST char **, const char *); +size_t mutt_iconv (iconv_t, const char **, size_t *, char **, size_t *, + const char **, const char *); typedef void *FGETCONV;