Changeset 5541:10a1f06bc8aa

Show
Ignore:
Timestamp:
2008-10-07 19:22:53 (2 months ago)
Author:
Brendan Cully <brendan@…>
Branch:
HEAD
Message:

Clean up with/without-idn handling

Files:
4 modified

Legend:

Unmodified
Added
Removed
  • Makefile.am

    r5390 r5541  
    3030        status.c system.c thread.c charset.c history.c lib.c \ 
    3131        muttlib.c editmsg.c mbyte.c \ 
    32         url.c ascii.c mutt_idna.c crypt-mod.c crypt-mod.h 
     32        url.c ascii.c crypt-mod.c crypt-mod.h 
    3333 
    3434nodist_mutt_SOURCES = $(BUILT_SOURCES) 
     
    4848CPPFLAGS=@CPPFLAGS@ 
    4949 
    50 EXTRA_mutt_SOURCES = account.c md5.c mutt_sasl.c mutt_socket.c mutt_ssl.c \ 
    51         mutt_tunnel.c pop.c pop_auth.c pop_lib.c smime.c pgp.c pgpinvoke.c pgpkey.c \ 
    52         pgplib.c sha1.c pgpmicalg.c gnupgparse.c resize.c dotlock.c remailer.c \ 
    53         smtp.c browser.h mbyte.h remailer.h url.h \ 
    54         crypt-mod-pgp-classic.c crypt-mod-smime-classic.c \ 
    55         pgppacket.c mutt_idna.h hcache.h hcache.c bcache.c bcache.h mutt_ssl_gnutls.c \ 
    56         crypt-gpgme.c crypt-mod-pgp-gpgme.c crypt-mod-smime-gpgme.c \ 
    57         utf8.c wcwidth.c  
     50EXTRA_mutt_SOURCES = account.c bcache.c crypt-gpgme.c crypt-mod-pgp-classic.c \ 
     51        crypt-mod-pgp-gpgme.c crypt-mod-smime-classic.c \ 
     52        crypt-mod-smime-gpgme.c dotlock.c gnupgparse.c hcache.c md5.c \ 
     53        mutt_idna.c mutt_sasl.c mutt_socket.c mutt_ssl.c mutt_ssl_gnutls.c \ 
     54        mutt_tunnel.c pgp.c pgpinvoke.c pgpkey.c pgplib.c pgpmicalg.c \ 
     55        pgppacket.c pop.c pop_auth.c pop_lib.c remailer.c resize.c sha1.c \ 
     56        smime.c smtp.c utf8.c wcwidth.c \ 
     57        bcache.h browser.h hcache.h mbyte.h mutt_idna.h remailer.h url.h 
    5858 
    5959EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \ 
  • configure.ac

    r5538 r5541  
    11501150    fi 
    11511151  else 
    1152     AC_CHECK_LIB(idn, stringprep_check_version) 
     1152    AC_SEARCH_LIBS([stringprep_check_version], [idn], [ 
     1153      AC_DEFINE([HAVE_LIBIDN], 1, [Define to 1 if you have the `idn' library]) 
     1154      MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_idna.o" 
     1155    ]) 
    11531156    AC_CHECK_FUNCS(idna_to_unicode_utf8_from_utf8 idna_to_unicode_8z8z) 
    11541157    AC_CHECK_FUNCS(idna_to_ascii_from_utf8 idna_to_ascii_8z) 
  • mutt_idna.c

    r5539 r5541  
    2727/* The low-level interface we use. */ 
    2828 
    29 #ifndef HAVE_LIBIDN 
    30  
    31 int mutt_idna_to_local (const char *in, char **out, int flags) 
    32 { 
    33   *out = safe_strdup (in); 
    34   return 1; 
    35 } 
    36  
    37 int mutt_local_to_idna (const char *in, char **out) 
    38 { 
    39   *out = safe_strdup (in); 
    40   return 0; 
    41 } 
    42  
    43 #else 
     29#ifdef HAVE_LIBIDN 
    4430 
    4531/* check whether an address is an IDN */ 
  • mutt_idna.h

    r5539 r5541  
    2929#define MI_MAY_BE_IRREVERSIBLE          (1 << 0) 
    3030 
    31 int mutt_idna_to_local (const char *, char **, int); 
    32 int mutt_local_to_idna (const char *, char **); 
    33  
    3431/* Work around incompatibilities in the libidn API */ 
    3532 
     
    5451#else 
    5552 
    56 #define mutt_addrlist_to_idna(addr, err) 0 
    57 #define mutt_addrlist_to_local(addr) 0 
     53static inline int mutt_addrlist_to_idna (ADDRESS *addr, char **err) 
     54{ 
     55  return 0; 
     56} 
    5857 
    59 #define mutt_env_to_local(env) 
    60 #define mutt_env_to_idna(env, tag, err) 0 
     58static inline int mutt_addrlist_to_local (ADDRESS *addr) 
     59{ 
     60  return 0; 
     61} 
    6162 
    62 #define mutt_addr_for_display(a) (a->mailbox) 
     63static inline void mutt_env_to_local (ENVELOPE *env) 
     64{ 
     65  return; 
     66} 
     67 
     68static inline int mutt_env_to_idna (ENVELOPE *env, char **tag, char **err) 
     69{ 
     70  return 0; 
     71} 
     72 
     73static inline const char *mutt_addr_for_display (ADDRESS *a) 
     74{ 
     75  return a->mailbox; 
     76} 
    6377 
    6478#endif /* HAVE_LIBIDN */