edit.c enter.c flags.c init.c filter.c from.c \
getdomain.c group.c \
handler.c hash.c hdrline.c headers.c help.c hook.c keymap.c \
- main.c mbox.c menu.c mh.c mutt_sasl_plain.c mx.c pager.c parse.c pattern.c \
- postpone.c query.c recvattach.c recvcmd.c \
+ main.c mbox.c menu.c mh.c mutt_idna.c mutt_sasl_plain.c mx.c pager.c \
+ parse.c pattern.c postpone.c query.c recvattach.c recvcmd.c \
rfc822.c rfc1524.c rfc2047.c rfc2231.c rfc3676.c \
score.c send.c sendlib.c signal.c sort.c \
status.c system.c thread.c charset.c history.c lib.c \
return strcpy (fcharset, "us-ascii"); /* __STRCPY_CHECKED__ */
}
-#ifndef HAVE_ICONV
-
-iconv_t iconv_open (const char *tocode, const char *fromcode)
-{
- return (iconv_t)(-1);
-}
-
-size_t iconv (iconv_t cd, ICONV_CONST char **inbuf, size_t *inbytesleft,
- char **outbuf, size_t *outbytesleft)
-{
- return 0;
-}
-
-int iconv_close (iconv_t cd)
-{
- return 0;
-}
-
-#endif /* !HAVE_ICONV */
-
-
/*
* Like iconv_open, but canonicalises the charsets, applies charset-hooks,
* recanonicalises, and finally applies iconv-hooks. Parameter flags=0 skips
#ifndef _CHARSET_H
#define _CHARSET_H
-#ifdef HAVE_ICONV_H
#include <iconv.h>
-#endif
-
-#ifndef HAVE_ICONV_T_DEF
-typedef void *iconv_t;
-#endif
-
-#ifndef HAVE_ICONV
-#define ICONV_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);
-#endif
int mutt_convert_string (char **, const char *, const char *, int);
dnl -- iconv/gettext --
-AC_ARG_ENABLE(iconv, AS_HELP_STRING([--disable-iconv],[Disable iconv support]),
- [if test x$enableval = xno; then
- am_cv_func_iconv=no
- fi
-])
-
AM_GNU_GETTEXT_VERSION([0.18])
AM_GNU_GETTEXT([external])
AC_CHECK_HEADERS([locale.h])
-if test "$am_cv_func_iconv" = "no"; then
- AC_MSG_WARN([Configuring without iconv support. See INSTALL for details])
-else
-
AM_ICONV
-
-AC_CHECK_HEADERS(iconv.h,
- [AC_MSG_CHECKING(whether iconv.h defines iconv_t)
- AC_EGREP_HEADER([typedef.*iconv_t],iconv.h,
- [AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ICONV_T_DEF, 1,
- [Define if <iconv.h> defines iconv_t.])],
- AC_MSG_RESULT(no))])
+if test "$am_cv_func_iconv" != yes; then
+ AC_MSG_ERROR([An iconv implementation is required])
+fi
dnl (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
dnl (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
AC_DEFINE(ICONV_NONTRANS, 0)
fi
-fi # libiconv
-
-dnl -- IDN depends on iconv
-
-dnl mutt_idna.c will perform charset transformations (for smtputf8
-dnl support) as long as at least iconv is installed. If there is no
-dnl iconv, then it doesn't need to be included in the build.
-if test "$am_cv_func_iconv" = yes; then
- MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_idna.o"
-fi
-
AC_ARG_WITH(idn, AS_HELP_STRING([--with-idn=@<:@PFX@:>@],[Use GNU libidn for internationalized domain names]),
[
if test "$with_idn" != "no"; then
[with_idn=auto])
if test "x$with_idn" != "xno"; then
- if test "$am_cv_func_iconv" != "yes"; then
- if test "$with_idn" != "auto"; then
- AC_MSG_ERROR([IDN requested but iconv is disabled or unavailable])
- fi
- else
- dnl Solaris 11 has /usr/include/idn
- have_stringprep_h=no
- AC_CHECK_HEADERS([stringprep.h idn/stringprep.h], [
- have_stringprep_h=yes
- break])
- have_idna_h=no
- AC_CHECK_HEADERS([idna.h idn/idna.h], [
- have_idna_h=yes
- break])
-
- mutt_save_LIBS="$LIBS"
- LIBS=
-
- AC_SEARCH_LIBS([stringprep_check_version], [idn], [
- AC_DEFINE([HAVE_LIBIDN], 1, [Define to 1 if you have the GNU idn library])
- MUTTLIBS="$MUTTLIBS $LIBS"
-
- LIBS="$LIBS $LIBICONV"
- AC_CHECK_FUNCS(idna_to_unicode_utf8_from_utf8 idna_to_unicode_8z8z)
- AC_CHECK_FUNCS(idna_to_ascii_from_utf8 idna_to_ascii_8z)
- AC_CHECK_FUNCS(idna_to_ascii_lz idna_to_ascii_from_locale)
- ])
-
- LIBS="$mutt_save_LIBS"
-
- if test "$with_idn" != auto; then
- if test $have_stringprep_h = no || test $have_idna_h = no || test $ac_cv_search_stringprep_check_version = no; then
- AC_MSG_ERROR([IDN was requested, but libidn was not usable on this system])
- fi
- fi
+ dnl Solaris 11 has /usr/include/idn
+ have_stringprep_h=no
+ AC_CHECK_HEADERS([stringprep.h idn/stringprep.h], [
+ have_stringprep_h=yes
+ break])
+ have_idna_h=no
+ AC_CHECK_HEADERS([idna.h idn/idna.h], [
+ have_idna_h=yes
+ break])
+
+ mutt_save_LIBS="$LIBS"
+ LIBS=
+
+ AC_SEARCH_LIBS([stringprep_check_version], [idn], [
+ AC_DEFINE([HAVE_LIBIDN], 1, [Define to 1 if you have the GNU idn library])
+ MUTTLIBS="$MUTTLIBS $LIBS"
+
+ LIBS="$LIBS $LIBICONV"
+ AC_CHECK_FUNCS(idna_to_unicode_utf8_from_utf8 idna_to_unicode_8z8z)
+ AC_CHECK_FUNCS(idna_to_ascii_from_utf8 idna_to_ascii_8z)
+ AC_CHECK_FUNCS(idna_to_ascii_lz idna_to_ascii_from_locale)
+ ])
+
+ LIBS="$mutt_save_LIBS"
+
+ if test "$with_idn" != auto; then
+ if test $have_stringprep_h = no || test $have_idna_h = no || test $ac_cv_search_stringprep_check_version = no; then
+ AC_MSG_ERROR([IDN was requested, but libidn was not usable on this system])
+ fi
fi
fi
int ret = stat(path, &sb);
int slash = (path[plen - 1] == '/');
-#ifndef HAVE_ICONV
- snprintf(suffix, sizeof(suffix), "-%s",
- Charset && *Charset ? Charset : mutt_get_default_charset());
-#endif
-
if (((ret == 0) && !S_ISDIR(sb.st_mode)) || ((ret == -1) && !slash))
{
/* An existing file or a non-existing path not ending with a slash */
{ "ifdef", parse_ifdef, 0 },
{ "ifndef", parse_ifdef, 1 },
{ "finish", finish_source, 0 },
-#ifdef HAVE_ICONV
{ "iconv-hook", mutt_parse_hook, MUTT_ICONVHOOK },
-#endif
{ "ignore", parse_ignore, 0 },
{ "lists", parse_lists, 0 },
#ifdef USE_LUA
#endif /* HAVE_LIBIDN */
-#ifdef HAVE_ICONV
int mutt_addrlist_to_intl (ADDRESS *, char **);
int mutt_addrlist_to_local (ADDRESS *);
int mutt_env_to_intl (ENVELOPE *, char **, char **);
const char *mutt_addr_for_display (ADDRESS *a);
-#else
-static inline int mutt_addrlist_to_intl (ADDRESS *addr, char **err)
-{
- return 0;
-}
-
-static inline int mutt_addrlist_to_local (ADDRESS *addr)
-{
- return 0;
-}
-
-static inline void mutt_env_to_local (ENVELOPE *env)
-{
- return;
-}
-
-static inline int mutt_env_to_intl (ENVELOPE *env, char **tag, char **err)
-{
- return 0;
-}
-
-static inline const char *mutt_addr_for_display (ADDRESS *a)
-{
- return a->mailbox;
-}
-#endif /* HAVE_LIBICONV */
-
#endif
int ncodes, const char **tocodes,
int *tocode, CONTENT *info)
{
-#ifdef HAVE_ICONV
iconv_t cd1, *cd;
char bufi[256], bufu[512], bufo[4 * sizeof (bufi)];
ICONV_CONST char *ib, *ub;
FREE (&states);
return ret;
-#else
- return -1;
-#endif /* !HAVE_ICONV */
}
/*
#else
{ "HAVE_GETSID", 0 },
#endif
-#ifdef HAVE_ICONV
- { "HAVE_ICONV", 1 },
-#else
- { "HAVE_ICONV", 0 },
-#endif
#ifdef HAVE_LANGINFO_CODESET
{ "HAVE_LANGINFO_CODESET", 1 },
#else