This is patch 1 of 4 implementing support for SMTPUTF8 (RFC 6531).

Change mutt_idna.c to be always compiled.  Remove the stub functions in
mutt_idna.h.  Instead, put #ifdefs around the idna function calls.  The
conversion functions will be fixed up in the next patch.

Rename the conversion functions to mutt_addrlist_to_intl() and
mutt_env_to_intl().  Rename the ADDRESS idna status bits to "intl"
status bits.

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
http://www.8t8.us/configs/gpg-key-transition-statement.txt
# HG changeset patch
# User Kevin McCarthy <[email protected]>
# Date 1447713231 28800
#      Mon Nov 16 14:33:51 2015 -0800
# Node ID 0e8ba26d119f75f1aa0d4fd590f077000d8ea1ba
# Parent  c799162691b257669ae1621df73920969ee0f52d
Rename idna functions and bits for smtputf8 changes.

This is patch 1 of 4 implementing support for SMTPUTF8 (RFC 6531).

Change mutt_idna.c to be always compiled.  Remove the stub functions in
mutt_idna.h.  Instead, put #ifdefs around the idna function calls.  The
conversion functions will be fixed up in the next patch.

Rename the conversion functions to mutt_addrlist_to_intl() and
mutt_env_to_intl().  Rename the ADDRESS idna status bits to "intl"
status bits.

diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,17 +28,17 @@
        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 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 \
-       muttlib.c editmsg.c mbyte.c \
+       muttlib.c editmsg.c mbyte.c mutt_idna.c \
        url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c
 
 nodist_mutt_SOURCES = $(BUILT_SOURCES)
 
 mutt_LDADD = $(MUTT_LIB_OBJECTS) $(LIBOBJS) $(LIBIMAP) $(MUTTLIBS) \
        $(INTLLIBS) $(LIBICONV)  $(GPGME_LIBS)
 
 mutt_DEPENDENCIES = $(MUTT_LIB_OBJECTS) $(LIBOBJS) $(LIBIMAPDEPS) \
@@ -48,17 +48,17 @@
        -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \
        -DHAVE_CONFIG_H=1
 
 AM_CPPFLAGS=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(GPGME_CFLAGS) -Iintl
 
 EXTRA_mutt_SOURCES = account.c bcache.c crypt-gpgme.c crypt-mod-pgp-classic.c \
        crypt-mod-pgp-gpgme.c crypt-mod-smime-classic.c \
        crypt-mod-smime-gpgme.c dotlock.c gnupgparse.c hcache.c md5.c \
-       mutt_idna.c mutt_sasl.c mutt_socket.c mutt_ssl.c mutt_ssl_gnutls.c \
+       mutt_sasl.c mutt_socket.c mutt_ssl.c mutt_ssl_gnutls.c \
        mutt_tunnel.c pgp.c pgpinvoke.c pgpkey.c pgplib.c pgpmicalg.c \
        pgppacket.c pop.c pop_auth.c pop_lib.c remailer.c resize.c sha1.c \
        smime.c smtp.c utf8.c wcwidth.c \
        bcache.h browser.h hcache.h mbyte.h mutt_idna.h remailer.h url.h
 
 EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \
        configure account.h \
        attach.h buffy.h charset.h copy.h crypthash.h dotlock.h functions.h 
gen_defs \
diff --git a/alias.c b/alias.c
--- a/alias.c
+++ b/alias.c
@@ -285,29 +285,29 @@
 
   mutt_addrlist_to_local (adr);
   
   if (adr)
     strfcpy (buf, adr->mailbox, sizeof (buf));
   else
     buf[0] = 0;
 
-  mutt_addrlist_to_idna (adr, NULL);
+  mutt_addrlist_to_intl (adr, NULL);
   
   do
   {
     if (mutt_get_field (_("Address: "), buf, sizeof (buf), 0) != 0 || !buf[0])
     {
       mutt_free_alias (&new);
       return;
     }
     
     if((new->addr = rfc822_parse_adrlist (new->addr, buf)) == NULL)
       BEEP ();
-    if (mutt_addrlist_to_idna (new->addr, &err))
+    if (mutt_addrlist_to_intl (new->addr, &err))
     {
       mutt_error (_("Error: '%s' is a bad IDN."), err);
       mutt_sleep (2);
       continue;
     }
   }
   while(new->addr == NULL);
   
diff --git a/commands.c b/commands.c
--- a/commands.c
+++ b/commands.c
@@ -289,17 +289,17 @@
   if (!(adr = mutt_parse_adrlist (adr, buf)))
   {
     mutt_error _("Error parsing address!");
     return;
   }
 
   adr = mutt_expand_aliases (adr);
 
-  if (mutt_addrlist_to_idna (adr, &err) < 0)
+  if (mutt_addrlist_to_intl (adr, &err) < 0)
   {
     mutt_error (_("Bad IDN: '%s'"), err);
     FREE (&err);
     rfc822_free_address (&adr);
     return;
   }
 
   buf[0] = 0;
diff --git a/compose.c b/compose.c
--- a/compose.c
+++ b/compose.c
@@ -287,17 +287,17 @@
   }
 
   if (option (OPTNEEDREDRAW))
   {
     unset_option (OPTNEEDREDRAW);
     return (REDRAW_FULL);
   }
 
-  if (mutt_addrlist_to_idna (*addr, &err) != 0)
+  if (mutt_addrlist_to_intl (*addr, &err) != 0)
   {
     mutt_error (_("Warning: '%s' is a bad IDN."), err);
     mutt_refresh();
     FREE (&err);
   }
 
   /* redraw the expanded list so the user can see the result */
   buf[0] = 0;
@@ -601,17 +601,17 @@
        if (mutt_strcmp ("builtin", Editor) != 0 &&
            (op == OP_COMPOSE_EDIT_HEADERS ||
            (op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS))))
        {
          char *tag = NULL, *err = NULL;
          mutt_env_to_local (msg->env);
          mutt_edit_headers (NONULL (Editor), msg->content->filename, msg,
                             fcc, fcclen);
-         if (mutt_env_to_idna (msg->env, &tag, &err))
+         if (mutt_env_to_intl (msg->env, &tag, &err))
          {
            mutt_error (_("Bad IDN in \"%s\": '%s'"), tag, err);
            FREE (&err);
          }
          if (option (OPTCRYPTOPPORTUNISTICENCRYPT))
            crypt_opportunistic_encrypt (msg);
        }
        else
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1191,17 +1191,16 @@
                      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])
-      MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_idna.o"
       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)
     ])
 
diff --git a/edit.c b/edit.c
--- a/edit.c
+++ b/edit.c
@@ -242,25 +242,25 @@
   rfc822_write_address (tmp, sizeof (tmp), e->to, 0);
   if (!e->to || force)
   {
     if (mutt_enter_string (tmp, sizeof (tmp), LINES-1, 4, 0) == 0)
     {
       rfc822_free_address (&e->to);
       e->to = mutt_parse_adrlist (e->to, tmp);
       e->to = mutt_expand_aliases (e->to);
-      mutt_addrlist_to_idna (e->to, NULL);     /* XXX - IDNA error reporting? 
*/
+      mutt_addrlist_to_intl (e->to, NULL);     /* XXX - IDNA error reporting? 
*/
       tmp[0] = 0;
       rfc822_write_address (tmp, sizeof (tmp), e->to, 1);
       mvaddstr (LINES - 1, 4, tmp);
     }
   }
   else
   {
-    mutt_addrlist_to_idna (e->to, NULL);       /* XXX - IDNA error reporting? 
*/
+    mutt_addrlist_to_intl (e->to, NULL);       /* XXX - IDNA error reporting? 
*/
     addstr (tmp);
   }
   addch ('\n');
 
   if (!e->subject || force)
   {
     addstr ("Subject: ");
     strfcpy (tmp, e->subject ? e->subject: "", sizeof (tmp));
@@ -276,43 +276,43 @@
     mutt_addrlist_to_local (e->cc);
     rfc822_write_address (tmp, sizeof (tmp), e->cc, 0);
     if (mutt_enter_string (tmp, sizeof (tmp), LINES-1, 4, 0) == 0)
     {
       rfc822_free_address (&e->cc);
       e->cc = mutt_parse_adrlist (e->cc, tmp);
       e->cc = mutt_expand_aliases (e->cc);
       tmp[0] = 0;
-      mutt_addrlist_to_idna (e->cc, NULL);
+      mutt_addrlist_to_intl (e->cc, NULL);
       rfc822_write_address (tmp, sizeof (tmp), e->cc, 1);
       mvaddstr (LINES - 1, 4, tmp);
     }
     else
-      mutt_addrlist_to_idna (e->cc, NULL);
+      mutt_addrlist_to_intl (e->cc, NULL);
     addch ('\n');
   }
 
   if (option (OPTASKBCC) || force)
   {
     addstr ("Bcc: ");
     tmp[0] = 0;
     mutt_addrlist_to_local (e->bcc);
     rfc822_write_address (tmp, sizeof (tmp), e->bcc, 0);
     if (mutt_enter_string (tmp, sizeof (tmp), LINES-1, 5, 0) == 0)
     {
       rfc822_free_address (&e->bcc);
       e->bcc = mutt_parse_adrlist (e->bcc, tmp);
       e->bcc = mutt_expand_aliases (e->bcc);
-      mutt_addrlist_to_idna (e->bcc, NULL);
+      mutt_addrlist_to_intl (e->bcc, NULL);
       tmp[0] = 0;
       rfc822_write_address (tmp, sizeof (tmp), e->bcc, 1);
       mvaddstr (LINES - 1, 5, tmp);
     }
     else
-      mutt_addrlist_to_idna (e->bcc, NULL);
+      mutt_addrlist_to_intl (e->bcc, NULL);
     addch ('\n');
   }
 }
 
 int mutt_builtin_editor (const char *path, HEADER *msg, HEADER *cur)
 {
   char **buf = NULL;
   int bufmax = 0, buflen = 0;
@@ -442,17 +442,17 @@
            be_free_memory (buf, buflen);
            buf = NULL;
            bufmax = buflen = 0;
 
            if (option (OPTEDITHDRS))
            {
              mutt_env_to_local (msg->env);
              mutt_edit_headers (NONULL(Visual), path, msg, NULL, 0);
-             if (mutt_env_to_idna (msg->env, &tag, &err))
+             if (mutt_env_to_intl (msg->env, &tag, &err))
                printw (_("Bad IDN in %s: '%s'\n"), tag, err);
            }
            else
              mutt_edit_file (NONULL(Visual), path);
 
            buf = be_snarf_file (path, buf, &bufmax, &buflen, 0);
 
            addstr (_("(continue)\n"));
diff --git a/init.c b/init.c
--- a/init.c
+++ b/init.c
@@ -869,17 +869,17 @@
          else if (data == M_UNGROUP &&
                   mutt_group_context_remove_rx (gc, buf->data) < 0)
            goto bail;
          break;
 
        case ADDR:
          if ((addr = mutt_parse_adrlist (NULL, buf->data)) == NULL)
            goto bail;
-         if (mutt_addrlist_to_idna (addr, &estr))
+         if (mutt_addrlist_to_intl (addr, &estr))
          { 
            snprintf (err->data, err->dsize, _("%sgroup: warning: bad IDN 
'%s'.\n"),
                      data == 1 ? "un" : "", estr);
            goto bail;
          }
          if (data == M_GROUP)
            mutt_group_context_add_adrlist (gc, addr);
          else if (data == M_UNGROUP)
@@ -1334,17 +1334,17 @@
              buf->data));
 
   tmp->addr = mutt_parse_adrlist (tmp->addr, buf->data);
 
   if (last)
     last->next = tmp;
   else
     Aliases = tmp;
-  if (mutt_addrlist_to_idna (tmp->addr, &estr))
+  if (mutt_addrlist_to_intl (tmp->addr, &estr))
   {
     snprintf (err->data, err->dsize, _("Warning: Bad IDN '%s' in alias 
'%s'.\n"),
              estr, tmp->name);
     goto bail;
   }
 
   mutt_group_context_add_adrlist (gc, tmp->addr);
   mutt_alias_add_reverse (tmp);
diff --git a/main.c b/main.c
--- a/main.c
+++ b/main.c
@@ -798,17 +798,17 @@
     ADDRESS *a;
     for (; optind < argc; optind++)
       alias_queries = mutt_add_list (alias_queries, argv[optind]);
     for (; alias_queries; alias_queries = alias_queries->next)
     {
       if ((a = mutt_lookup_alias (alias_queries->data)))
       {        
        /* output in machine-readable form */
-       mutt_addrlist_to_idna (a, NULL);
+       mutt_addrlist_to_intl (a, NULL);
        mutt_write_address_list (a, stdout, 0, 0);
       }
       else
       {
        rv = 1;
        printf ("%s\n", alias_queries->data);
       }
     }
diff --git a/mutt_idna.c b/mutt_idna.c
--- a/mutt_idna.c
+++ b/mutt_idna.c
@@ -19,56 +19,56 @@
 #if HAVE_CONFIG_H
 # include "config.h"
 #endif
 
 #include "mutt.h"
 #include "charset.h"
 #include "mutt_idna.h"
 
-/* The low-level interface we use. */
 
-#ifdef HAVE_LIBIDN
 
 /* check whether an address is an IDN */
 
 static int check_idn (ADDRESS *ap)
 {
   char *p = 0;
 
   if (!ap || !ap->mailbox)
     return 0;
 
-  if (!ap->idn_checked)
+  if (!ap->intl_checked)
   {
-    ap->idn_checked = 1;
+    ap->intl_checked = 1;
     for (p = strchr (ap->mailbox, '@'); p && *p; p = strchr (p, '.')) 
       if (ascii_strncasecmp (++p, "xn--", 4) == 0)
       {
-       ap->is_idn = 1;
+       ap->is_intl = 1;
        break;
       }
   }
   
-  return ap->is_idn;
+  return ap->is_intl;
 }
 
-static int mutt_idna_to_local (const char *in, char **out, int flags)
+static int intl_to_local (const char *in, char **out, int flags)
 {
   *out = NULL;
 
   if (!option (OPTUSEIDN))
     goto notrans;
 
   if (!in)
     goto notrans;
 
   /* Is this the right function?  Interesting effects with some bad 
identifiers! */
+#ifdef HAVE_LIBIDN
   if (idna_to_unicode_8z8z (in, out, IDNA_ALLOW_UNASSIGNED) != IDNA_SUCCESS)
     goto notrans;
+#endif /* HAVE_LIBIDN */
 
   /* we don't want charset-hook effects, so we set flags to 0 */
   if (mutt_convert_string (out, "utf-8", Charset, 0) == -1)
     goto notrans;
 
   /* 
    * make sure that we can convert back and come out with the same
    * domain name. 
@@ -78,21 +78,23 @@
   {
     int irrev = 0;
     char *t2 = NULL;
     char *tmp = safe_strdup (*out);
 
     /* we don't want charset-hook effects, so we set flags to 0 */
     if (mutt_convert_string (&tmp, Charset, "utf-8", 0) == -1)
       irrev = 1;
+#ifdef HAVE_LIBIDN
     if (!irrev && idna_to_ascii_8z (tmp, &t2, IDNA_ALLOW_UNASSIGNED) != 
IDNA_SUCCESS)
       irrev = 1;
+#endif /* HAVE_LIBIDN */
     if (!irrev && ascii_strcasecmp (t2, in))
     {
-      dprint (1, (debugfile, "mutt_idna_to_local: Not reversible. in = '%s', 
t2 = '%s'.\n",
+      dprint (1, (debugfile, "intl_to_local: Not reversible. in = '%s', t2 = 
'%s'.\n",
                  in, t2));
       irrev = 1;
     }
     
     FREE (&t2);
     FREE (&tmp);
 
     if (irrev)
@@ -102,33 +104,36 @@
   return 0;
   
  notrans:
   FREE (out);          /* __FREE_CHECKED__ */
   *out = safe_strdup (in);
   return 1;
 }
 
-static int mutt_local_to_idna (const char *in, char **out)
+static int local_to_intl (const char *in, char **out)
 {
   int rv = 0;
   char *tmp = safe_strdup (in);
   *out = NULL;
 
   if (!in)
   {
     *out = NULL;
     return -1;
   }
   
   /* we don't want charset-hook effects, so we set flags to 0 */
   if (mutt_convert_string (&tmp, Charset, "utf-8", 0) == -1)
     rv = -1;
+
+#ifdef HAVE_LIBIDN
   if (!rv && idna_to_ascii_8z (tmp, out, IDNA_ALLOW_UNASSIGNED) != 
IDNA_SUCCESS)
     rv = -2;
+#endif /* HAVE_LIBIDN */
   
   FREE (&tmp);
   if (rv < 0)
   {
     FREE (out);                /* __FREE_CHECKED__ */
     *out = safe_strdup (in);
   }
   return rv;
@@ -147,43 +152,43 @@
   if (!p || !p[1])
     return -1;
   *p = '\0';
   *user = buff;
   *domain  = p + 1;
   return 0;
 }
 
-int mutt_addrlist_to_idna (ADDRESS *a, char **err)
+int mutt_addrlist_to_intl (ADDRESS *a, char **err)
 {
   char *user = NULL, *domain = NULL;
   char *tmp = NULL;
   int e = 0;
   
   if (err)
     *err = NULL;
 
   for (; a; a = a->next)
   {
     if (!a->mailbox)
       continue;
     if (mbox_to_udomain (a->mailbox, &user, &domain) == -1)
       continue;
     
-    if (mutt_local_to_idna (domain, &tmp) < 0)
+    if (local_to_intl (domain, &tmp) < 0)
     {
       e = 1;
       if (err)
        *err = safe_strdup (domain);
     }
     else
     {
       safe_realloc (&a->mailbox, mutt_strlen (user) + mutt_strlen (tmp) + 2);
       sprintf (a->mailbox, "%s@%s", NONULL(user), NONULL(tmp)); /* 
__SPRINTF_CHECKED__ */
-      a->idn_checked = 0;
+      a->intl_checked = 0;
     }
     
     FREE (&tmp);
     
     if (e)
       return -1;
   }
   
@@ -198,21 +203,21 @@
   for (; a; a = a->next)
   {
     if (!a->mailbox)
       continue;
     if (!check_idn (a))
       continue;
     if (mbox_to_udomain (a->mailbox, &user, &domain) == -1)
       continue;
-    if (mutt_idna_to_local (domain, &tmp, 0) == 0)
+    if (intl_to_local (domain, &tmp, 0) == 0)
     {
       safe_realloc (&a->mailbox, mutt_strlen (user) + mutt_strlen (tmp) + 2);
       sprintf (a->mailbox, "%s@%s", NONULL (user), NONULL (tmp)); /* 
__SPRINTF_CHECKED__ */
-      a->idn_checked = 0;
+      a->intl_checked = 0;
     }
     
     FREE (&tmp);
   }
   
   return 0;
 }
 
@@ -227,17 +232,17 @@
   char *user = NULL;
   
   FREE (&buff);
 
   if (!check_idn (a))
     return a->mailbox;
   if (mbox_to_udomain (a->mailbox, &user, &domain) != 0)
     return a->mailbox;
-  if (mutt_idna_to_local (domain, &tmp, MI_MAY_BE_IRREVERSIBLE) != 0)
+  if (intl_to_local (domain, &tmp, MI_MAY_BE_IRREVERSIBLE) != 0)
   {
     FREE (&tmp);
     return a->mailbox;
   }
   
   safe_realloc (&buff, mutt_strlen (tmp) + mutt_strlen (user) + 2);
   sprintf (buff, "%s@%s", NONULL(user), NONULL(tmp)); /* __SPRINTF_CHECKED__ */
   FREE (&tmp);
@@ -256,30 +261,28 @@
   mutt_addrlist_to_local (e->reply_to);
   mutt_addrlist_to_local (e->mail_followup_to);
 }
 
 /* Note that `a' in the `env->a' expression is macro argument, not
  * "real" name of an `env' compound member.  Real name will be substituted
  * by preprocessor at the macro-expansion time.
  */
-#define H_TO_IDNA(a)   \
-  if (mutt_addrlist_to_idna (env->a, err) && !e) \
+#define H_TO_INTL(a)   \
+  if (mutt_addrlist_to_intl (env->a, err) && !e) \
   { \
      if (tag) *tag = #a; e = 1; err = NULL; \
   }
 
-int mutt_env_to_idna (ENVELOPE *env, char **tag, char **err)
+int mutt_env_to_intl (ENVELOPE *env, char **tag, char **err)
 {
   int e = 0;
-  H_TO_IDNA(return_path);
-  H_TO_IDNA(from);
-  H_TO_IDNA(to);
-  H_TO_IDNA(cc);
-  H_TO_IDNA(bcc);
-  H_TO_IDNA(reply_to);
-  H_TO_IDNA(mail_followup_to);
+  H_TO_INTL(return_path);
+  H_TO_INTL(from);
+  H_TO_INTL(to);
+  H_TO_INTL(cc);
+  H_TO_INTL(bcc);
+  H_TO_INTL(reply_to);
+  H_TO_INTL(mail_followup_to);
   return e;
 }
 
-#undef H_TO_IDNA
-
-#endif /* HAVE_LIBIDN */
+#undef H_TO_INTL
diff --git a/mutt_idna.h b/mutt_idna.h
--- a/mutt_idna.h
+++ b/mutt_idna.h
@@ -28,55 +28,30 @@
 #include <idn/idna.h>
 #endif
 
 #define MI_MAY_BE_IRREVERSIBLE         (1 << 0)
 
 /* Work around incompatibilities in the libidn API */
 
 #ifdef HAVE_LIBIDN
-int mutt_addrlist_to_idna (ADDRESS *, char **);
-int mutt_addrlist_to_local (ADDRESS *);
-
-void mutt_env_to_local (ENVELOPE *);
-int mutt_env_to_idna (ENVELOPE *, char **, char **);
-
-const char *mutt_addr_for_display (ADDRESS *a);
-
 # if (!defined(HAVE_IDNA_TO_ASCII_8Z) && defined(HAVE_IDNA_TO_ASCII_FROM_UTF8))
 #  define idna_to_ascii_8z(a,b,c) 
idna_to_ascii_from_utf8(a,b,(c)&1,((c)&2)?1:0)
 # endif
 # if (!defined(HAVE_IDNA_TO_ASCII_LZ) && 
defined(HAVE_IDNA_TO_ASCII_FROM_LOCALE))
 #  define idna_to_ascii_lz(a,b,c) 
idna_to_ascii_from_locale(a,b,(c)&1,((c)&2)?1:0)
 # endif
 # if (!defined(HAVE_IDNA_TO_UNICODE_8Z8Z) && 
defined(HAVE_IDNA_TO_UNICODE_UTF8_FROM_UTF8))
 #  define idna_to_unicode_8z8z(a,b,c) 
idna_to_unicode_utf8_from_utf8(a,b,(c)&1,((c)&2)?1:0)
 # endif
-#else
-
-static inline int mutt_addrlist_to_idna (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_idna (ENVELOPE *env, char **tag, char **err)
-{
-  return 0;
-}
-
-static inline const char *mutt_addr_for_display (ADDRESS *a)
-{
-  return a->mailbox;
-}
-
 #endif /* HAVE_LIBIDN */
 
+
+int mutt_addrlist_to_intl (ADDRESS *, char **);
+int mutt_addrlist_to_local (ADDRESS *);
+
+void mutt_env_to_local (ENVELOPE *);
+int mutt_env_to_intl (ENVELOPE *, char **, char **);
+
+const char *mutt_addr_for_display (ADDRESS *a);
+
+
 #endif
diff --git a/query.c b/query.c
--- a/query.c
+++ b/query.c
@@ -61,17 +61,17 @@
   static ADDRESS *tmp;
   
   if (!(tmp = rfc822_cpy_adr (r->addr, 0)))
     return NULL;
   
   if(!tmp->next && !tmp->personal)
     tmp->personal = safe_strdup (r->name);
   
-  mutt_addrlist_to_idna (tmp, NULL);
+  mutt_addrlist_to_intl (tmp, NULL);
   return tmp;
 }
 
 static void free_query (QUERY **query)
 {
   QUERY *p;
 
   if (!query)
diff --git a/recvcmd.c b/recvcmd.c
--- a/recvcmd.c
+++ b/recvcmd.c
@@ -180,17 +180,17 @@
   if (!(adr = rfc822_parse_adrlist (adr, buf)))
   {
     mutt_error _("Error parsing address!");
     return;
   }
 
   adr = mutt_expand_aliases (adr);
   
-  if (mutt_addrlist_to_idna (adr, &err) < 0)
+  if (mutt_addrlist_to_intl (adr, &err) < 0)
   {
     mutt_error (_("Bad IDN: '%s'"), err);
     FREE (&err);
     rfc822_free_address (&adr);
     return;
   }
   
   buf[0] = 0;
diff --git a/rfc822.c b/rfc822.c
--- a/rfc822.c
+++ b/rfc822.c
@@ -796,18 +796,18 @@
   ADDRESS *p = rfc822_new_address ();
 
 #ifdef EXACT_ADDRESS
   p->val = safe_strdup (addr->val);
 #endif
   p->personal = safe_strdup (addr->personal);
   p->mailbox = safe_strdup (addr->mailbox);
   p->group = addr->group;
-  p->is_idn = addr->is_idn;
-  p->idn_checked = addr->idn_checked;
+  p->is_intl = addr->is_intl;
+  p->intl_checked = addr->intl_checked;
   return p;
 }
 
 /* this should be rfc822_cpy_adrlist */
 ADDRESS *rfc822_cpy_adr (ADDRESS *addr, int prune)
 {
   ADDRESS *top = NULL, *last = NULL;
   
diff --git a/rfc822.h b/rfc822.h
--- a/rfc822.h
+++ b/rfc822.h
@@ -37,18 +37,18 @@
 {
 #ifdef EXACT_ADDRESS
   char *val;           /* value of address as parsed */
 #endif
   char *personal;      /* real name of address */
   char *mailbox;       /* mailbox and host address */
   int group;           /* group mailbox? */
   struct address_t *next;
-  unsigned is_idn      : 1;
-  unsigned idn_checked : 1;
+  unsigned is_intl      : 1;
+  unsigned intl_checked : 1;
 }
 ADDRESS;
 
 void rfc822_dequote_comment (char *s);
 void rfc822_free_address (ADDRESS **);
 void rfc822_qualify (ADDRESS *, const char *);
 ADDRESS *rfc822_parse_adrlist (ADDRESS *, const char *s);
 ADDRESS *rfc822_cpy_adr (ADDRESS *addr, int);
diff --git a/send.c b/send.c
--- a/send.c
+++ b/send.c
@@ -196,17 +196,17 @@
   {
     buf[0] = 0;
     mutt_addrlist_to_local (*a);
     rfc822_write_address (buf, sizeof (buf), *a, 0);
     if (mutt_get_field (field, buf, sizeof (buf), M_ALIAS) != 0)
       return (-1);
     rfc822_free_address (a);
     *a = mutt_expand_aliases (mutt_parse_adrlist (NULL, buf));
-    if ((idna_ok = mutt_addrlist_to_idna (*a, &err)) != 0)
+    if ((idna_ok = mutt_addrlist_to_intl (*a, &err)) != 0)
     {
       mutt_error (_("Error: '%s' is a bad IDN."), err);
       mutt_refresh ();
       mutt_sleep (2);
       FREE (&err);
     }
   } 
   while (idna_ok != 0);
@@ -1418,17 +1418,17 @@
           goto cleanup;
       }
       else if (!Editor || mutt_strcmp ("builtin", Editor) == 0)
        mutt_builtin_editor (msg->content->filename, msg, cur);
       else if (option (OPTEDITHDRS))
       {
        mutt_env_to_local (msg->env);
        mutt_edit_headers (Editor, msg->content->filename, msg, fcc, sizeof 
(fcc));
-       mutt_env_to_idna (msg->env, NULL, NULL);
+       mutt_env_to_intl (msg->env, NULL, NULL);
       }
       else
       {
        mutt_edit_file (Editor, msg->content->filename);
        if (stat (msg->content->filename, &st) == 0)
        {
          if (mtime != st.st_mtime)
            fix_end_of_file (msg->content->filename);
@@ -1624,17 +1624,17 @@
       /*
        * make sure the message is written to the right part of a maildir 
        * postponed folder.
        */
       msg->read = 0; msg->old = 0;
 
       encode_descriptions (msg->content, 1);
       mutt_prepare_envelope (msg->env, 0);
-      mutt_env_to_idna (msg->env, NULL, NULL); /* Handle bad IDNAs the next 
time. */
+      mutt_env_to_intl (msg->env, NULL, NULL); /* Handle bad IDNAs the next 
time. */
 
       if (!Postponed || mutt_write_fcc (NONULL (Postponed), msg, (cur && 
(flags & SENDREPLY)) ? cur->env->message_id : NULL, 1, fcc) < 0)
       {
        msg->content = mutt_remove_multipart (msg->content);
        decode_descriptions (msg->content);
        mutt_unprepare_envelope (msg->env);
        goto main_loop;
       }
@@ -1654,17 +1654,17 @@
     }
     else
     {
       puts _("No recipients were specified.");
       goto cleanup;
     }
   }
 
-  if (mutt_env_to_idna (msg->env, &tag, &err))
+  if (mutt_env_to_intl (msg->env, &tag, &err))
   {
     mutt_error (_("Bad IDN in \"%s\": '%s'"), tag, err);
     FREE (&err);
     if (!(flags & SENDBATCH))
       goto main_loop;
     else 
       goto cleanup;
   }
diff --git a/sendlib.c b/sendlib.c
--- a/sendlib.c
+++ b/sendlib.c
@@ -2598,17 +2598,17 @@
    */
   if (! from->personal)
     from->personal = safe_strdup(Realname);
 
   if (fqdn)
     rfc822_qualify (from, fqdn);
 
   rfc2047_encode_adrlist (from, "Resent-From");
-  if (mutt_addrlist_to_idna (from, &err))
+  if (mutt_addrlist_to_intl (from, &err))
   {
     mutt_error (_("Bad IDN %s while preparing resent-from."),
                err);
     rfc822_free_address (&from);
     return -1;
   }
   rfc822_write_address (resent_from, sizeof (resent_from), from, 0);
 

Attachment: signature.asc
Description: PGP signature

Reply via email to