Changeset 5541:10a1f06bc8aa
- Timestamp:
- 2008-10-07 19:22:53 (2 months ago)
- Author:
- Brendan Cully <brendan@…>
- Branch:
- HEAD
- Message:
-
Clean up with/without-idn handling
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r5390
|
r5541
|
|
| 30 | 30 | status.c system.c thread.c charset.c history.c lib.c \ |
| 31 | 31 | 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 |
| 33 | 33 | |
| 34 | 34 | nodist_mutt_SOURCES = $(BUILT_SOURCES) |
| … |
… |
|
| 48 | 48 | CPPFLAGS=@CPPFLAGS@ |
| 49 | 49 | |
| 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 |
| | 50 | EXTRA_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 |
| 58 | 58 | |
| 59 | 59 | EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \ |
-
|
r5538
|
r5541
|
|
| 1150 | 1150 | fi |
| 1151 | 1151 | 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 | ]) |
| 1153 | 1156 | AC_CHECK_FUNCS(idna_to_unicode_utf8_from_utf8 idna_to_unicode_8z8z) |
| 1154 | 1157 | AC_CHECK_FUNCS(idna_to_ascii_from_utf8 idna_to_ascii_8z) |
-
|
r5539
|
r5541
|
|
| 27 | 27 | /* The low-level interface we use. */ |
| 28 | 28 | |
| 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 |
| 44 | 30 | |
| 45 | 31 | /* check whether an address is an IDN */ |
-
|
r5539
|
r5541
|
|
| 29 | 29 | #define MI_MAY_BE_IRREVERSIBLE (1 << 0) |
| 30 | 30 | |
| 31 | | int mutt_idna_to_local (const char *, char **, int); |
| 32 | | int mutt_local_to_idna (const char *, char **); |
| 33 | | |
| 34 | 31 | /* Work around incompatibilities in the libidn API */ |
| 35 | 32 | |
| … |
… |
|
| 54 | 51 | #else |
| 55 | 52 | |
| 56 | | #define mutt_addrlist_to_idna(addr, err) 0 |
| 57 | | #define mutt_addrlist_to_local(addr) 0 |
| | 53 | static inline int mutt_addrlist_to_idna (ADDRESS *addr, char **err) |
| | 54 | { |
| | 55 | return 0; |
| | 56 | } |
| 58 | 57 | |
| 59 | | #define mutt_env_to_local(env) |
| 60 | | #define mutt_env_to_idna(env, tag, err) 0 |
| | 58 | static inline int mutt_addrlist_to_local (ADDRESS *addr) |
| | 59 | { |
| | 60 | return 0; |
| | 61 | } |
| 61 | 62 | |
| 62 | | #define mutt_addr_for_display(a) (a->mailbox) |
| | 63 | static inline void mutt_env_to_local (ENVELOPE *env) |
| | 64 | { |
| | 65 | return; |
| | 66 | } |
| | 67 | |
| | 68 | static inline int mutt_env_to_idna (ENVELOPE *env, char **tag, char **err) |
| | 69 | { |
| | 70 | return 0; |
| | 71 | } |
| | 72 | |
| | 73 | static inline const char *mutt_addr_for_display (ADDRESS *a) |
| | 74 | { |
| | 75 | return a->mailbox; |
| | 76 | } |
| 63 | 77 | |
| 64 | 78 | #endif /* HAVE_LIBIDN */ |