From: Richard Russon Date: Sat, 14 Jul 2018 10:43:36 +0000 (+0100) Subject: move email functions to libemail X-Git-Tag: 2019-10-25~756^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ee5876d5009cbf1653786bee862520479285ad0;p=neomutt move email functions to libemail --- diff --git a/.gitignore b/.gitignore index 0429f6e14..8e0b57eac 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ test/neomutt-test *.o *.Po *.Tpo +html lib*.a po/*.mo po/neomutt.pot diff --git a/Makefile.autosetup b/Makefile.autosetup index fd1400d8f..526345e4d 100644 --- a/Makefile.autosetup +++ b/Makefile.autosetup @@ -90,7 +90,7 @@ ALLOBJS+= $(NEOMUTTOBJS) # libemail LIBEMAIL= libemail.a LIBEMAILOBJS= email/address.o email/attach.o email/body.o email/envelope.o \ - email/from.o email/header.o email/parameter.o email/tags.o email/thread.o email/url.o + email/from.o email/header.o email/idna.o email/mime.o email/parameter.o email/rfc2047.o email/tags.o email/thread.o email/url.o CLEANFILES+= $(LIBEMAIL) $(LIBEMAILOBJS) MUTTLIBS+= $(LIBEMAIL) ALLOBJS+= $(LIBEMAILOBJS) @@ -142,9 +142,9 @@ ALLOBJS+= $(LIBMAILDIROBJS) LIBMUTT= libmutt.a LIBMUTTOBJS= mutt/base64.o mutt/buffer.o mutt/charset.o mutt/date.o \ mutt/envlist.o mutt/exit.o mutt/file.o mutt/hash.o mutt/history.o \ - mutt/idna.o mutt/list.o mutt/logging.o mutt/mapping.o \ - mutt/mbyte.o mutt/md5.o mutt/memory.o mutt/mime.o mutt/regex.o \ - mutt/rfc2047.o mutt/sha1.o mutt/signal.o mutt/string.o + mutt/list.o mutt/logging.o mutt/mapping.o \ + mutt/mbyte.o mutt/md5.o mutt/memory.o mutt/regex.o \ + mutt/sha1.o mutt/signal.o mutt/string.o CLEANFILES+= $(LIBMUTT) $(LIBMUTTOBJS) MUTTLIBS+= $(LIBMUTT) ALLOBJS+= $(LIBMUTTOBJS) diff --git a/conn/conn_raw.c b/conn/conn_raw.c index cc1b8a5c6..14d497444 100644 --- a/conn/conn_raw.c +++ b/conn/conn_raw.c @@ -42,6 +42,7 @@ #include #include #include +#include "email/email.h" #include "conn_globals.h" #include "connection.h" #include "curs_lib.h" diff --git a/conn/ssl.c b/conn/ssl.c index 6294625cf..d79223238 100644 --- a/conn/ssl.c +++ b/conn/ssl.c @@ -51,6 +51,7 @@ #include "mutt/memory.h" #include "mutt/message.h" #include "mutt/string2.h" +#include "email/idna2.h" #include "mutt.h" #include "ssl.h" #include "account.h" diff --git a/email/address.c b/email/address.c index 9cab3d0a9..2d7c944d1 100644 --- a/email/address.c +++ b/email/address.c @@ -33,6 +33,7 @@ #include #include "mutt/mutt.h" #include "address.h" +#include "idna2.h" /** * AddressSpecials - Characters with special meaning for email addresses diff --git a/email/body.c b/email/body.c index af672db26..842857778 100644 --- a/email/body.c +++ b/email/body.c @@ -32,6 +32,7 @@ #include "mutt/mutt.h" #include "body.h" #include "header.h" +#include "mime.h" /** * mutt_body_new - Create a new Body diff --git a/email/email.h b/email/email.h index ff9dbd08c..6b3068122 100644 --- a/email/email.h +++ b/email/email.h @@ -33,7 +33,10 @@ * | email/envelope.c | @subpage email_envelope | * | email/from.c | @subpage email_from | * | email/header.c | @subpage email_header | + * | email/idna.c | @subpage email_idna | * | email/parameter.c | @subpage email_parameter | + * | email/mime.c | @subpage email_mime | + * | email/rfc2047.c | @subpage email_rfc2047 | * | email/tags.c | @subpage email_tags | * | email/thread.c | @subpage email_thread | * | email/url.c | @subpage email_url | @@ -49,7 +52,10 @@ #include "envelope.h" #include "from.h" #include "header.h" +#include "idna2.h" +#include "mime.h" #include "parameter.h" +#include "rfc2047.h" #include "tags.h" #include "thread.h" #include "url.h" diff --git a/mutt/idna.c b/email/idna.c similarity index 98% rename from mutt/idna.c rename to email/idna.c index f39822ec3..159eb47f6 100644 --- a/mutt/idna.c +++ b/email/idna.c @@ -21,7 +21,7 @@ */ /** - * @page idna Handling of international domain names + * @page email_idna Handling of international domain names * * Handling of international domain names */ @@ -30,11 +30,8 @@ #include #include #include -#include "charset.h" +#include "mutt/mutt.h" #include "idna2.h" -#include "logging.h" -#include "memory.h" -#include "string2.h" #ifdef HAVE_STRINGPREP_H #include #elif defined(HAVE_IDN_STRINGPREP_H) diff --git a/mutt/idna2.h b/email/idna2.h similarity index 94% rename from mutt/idna2.h rename to email/idna2.h index 972a6bc8e..50645d9fb 100644 --- a/mutt/idna2.h +++ b/email/idna2.h @@ -20,8 +20,8 @@ * this program. If not, see . */ -#ifndef _MUTT_IDNA_H -#define _MUTT_IDNA_H +#ifndef _EMAIL_IDNA_H +#define _EMAIL_IDNA_H #include @@ -37,4 +37,4 @@ const char *mutt_idna_print_version(void); int mutt_idna_to_ascii_lz(const char *input, char **output, int flags); -#endif /* _MUTT_IDNA_H */ +#endif /* _EMAIL_IDNA_H */ diff --git a/mutt/mime.c b/email/mime.c similarity index 96% rename from mutt/mime.c rename to email/mime.c index fb99cb7ce..526243c14 100644 --- a/mutt/mime.c +++ b/email/mime.c @@ -21,7 +21,7 @@ */ /** - * @page mime Constants and macros for managing MIME encoding + * @page email_mime Constants and macros for managing MIME encoding * * Constants and macros for managing MIME encoding. */ diff --git a/mutt/mime.h b/email/mime.h similarity index 96% rename from mutt/mime.h rename to email/mime.h index 12e2aa1bd..a8d37e423 100644 --- a/mutt/mime.h +++ b/email/mime.h @@ -20,8 +20,8 @@ * this program. If not, see . */ -#ifndef _MUTT_MIME_H -#define _MUTT_MIME_H +#ifndef _EMAIL_MIME_H +#define _EMAIL_MIME_H /** * enum ContentType - Content-Type @@ -83,4 +83,4 @@ extern const char MimeSpecials[]; ((X->type == TYPEOTHER) && (X->xtype != NULL) ? X->xtype : BodyTypes[(X->type)]) #define ENCODING(X) BodyEncodings[(X)] -#endif /* _MUTT_MIME_H */ +#endif /* _EMAIL_MIME_H */ diff --git a/mutt/rfc2047.c b/email/rfc2047.c similarity index 99% rename from mutt/rfc2047.c rename to email/rfc2047.c index 3cc8f5867..98467a631 100644 --- a/mutt/rfc2047.c +++ b/email/rfc2047.c @@ -23,7 +23,7 @@ */ /** - * @page rfc2047 RFC2047 encoding / decoding functions + * @page email_rfc2047 RFC2047 encoding / decoding functions * * RFC2047 MIME extensions encoding / decoding routines. */ @@ -36,14 +36,8 @@ #include #include #include "rfc2047.h" -#include "base64.h" -#include "buffer.h" -#include "charset.h" -#include "mbyte.h" -#include "memory.h" +#include "mutt/mutt.h" #include "mime.h" -#include "regex3.h" -#include "string2.h" #define ENCWORD_LEN_MAX 75 #define ENCWORD_LEN_MIN 9 /* strlen ("=?.?.?.?=") */ diff --git a/mutt/rfc2047.h b/email/rfc2047.h similarity index 93% rename from mutt/rfc2047.h rename to email/rfc2047.h index af0046eb9..38c2ce6e3 100644 --- a/mutt/rfc2047.h +++ b/email/rfc2047.h @@ -22,10 +22,10 @@ * this program. If not, see . */ -#ifndef _MUTT_RFC2047_H -#define _MUTT_RFC2047_H +#ifndef _EMAIL_RFC2047_H +#define _EMAIL_RFC2047_H void mutt_rfc2047_decode(char **pd); void mutt_rfc2047_encode(char **pd, const char *specials, int col, const char *charsets); -#endif /* _MUTT_RFC2047_H */ +#endif /* _EMAIL_RFC2047_H */ diff --git a/email/url.c b/email/url.c index 00cc985c3..7b1917156 100644 --- a/email/url.c +++ b/email/url.c @@ -20,12 +20,19 @@ * this program. If not, see . */ +/** + * @page email_url Parse and identify different URL schemes + * + * Parse and identify different URL schemes + */ + #include "config.h" #include #include #include #include "mutt/mutt.h" #include "url.h" +#include "mime.h" static const struct Mapping UrlMap[] = { { "file", U_FILE }, { "imap", U_IMAP }, { "imaps", U_IMAPS }, diff --git a/mutt/mutt.h b/mutt/mutt.h index 0b4ba11d8..cdc31d4b3 100644 --- a/mutt/mutt.h +++ b/mutt/mutt.h @@ -36,24 +36,19 @@ * | mutt/file.c | @subpage file | * | mutt/hash.c | @subpage hash | * | mutt/history.c | @subpage history | - * | mutt/idna.c | @subpage idna | * | mutt/list.c | @subpage list | * | mutt/logging.c | @subpage logging | * | mutt/mapping.c | @subpage mapping | * | mutt/mbyte.c | @subpage mbyte | * | mutt/md5.c | @subpage md5 | * | mutt/memory.c | @subpage memory | - * | mutt/mime.c | @subpage mime | * | mutt/regex.c | @subpage regex | - * | mutt/rfc2047.c | @subpage rfc2047 | * | mutt/sha1.c | @subpage sha1 | * | mutt/signal.c | @subpage signal | * | mutt/string.c | @subpage string | * * @note The library is self-contained -- some files may depend on others in * the library, but none depends on source from outside. - * - * @image html libmutt.svg */ #ifndef _MUTT_MUTT_H @@ -68,7 +63,6 @@ #include "file.h" #include "hash.h" #include "history.h" -#include "idna2.h" #include "list.h" #include "logging.h" #include "mapping.h" @@ -76,10 +70,8 @@ #include "md5.h" #include "memory.h" #include "message.h" -#include "mime.h" #include "queue.h" #include "regex3.h" -#include "rfc2047.h" #include "sha1.h" #include "signal2.h" #include "string2.h" diff --git a/ncrypt/gnupgparse.c b/ncrypt/gnupgparse.c index f15104b93..f9ef8b537 100644 --- a/ncrypt/gnupgparse.c +++ b/ncrypt/gnupgparse.c @@ -42,6 +42,7 @@ #include #include #include "mutt/mutt.h" +#include "email/email.h" #include "filter.h" #include "globals.h" #include "ncrypt.h" diff --git a/test/rfc2047.c b/test/rfc2047.c index bc9fcd016..b1d5e2c95 100644 --- a/test/rfc2047.c +++ b/test/rfc2047.c @@ -3,8 +3,8 @@ #include "mutt/charset.h" #include "mutt/memory.h" -#include "mutt/rfc2047.h" #include "mutt/string2.h" +#include "email/rfc2047.h" #include diff --git a/version.c b/version.c index 51be569e1..f941e522f 100644 --- a/version.c +++ b/version.c @@ -35,6 +35,7 @@ #include #include #include "mutt/mutt.h" +#include "email/email.h" #include "mutt_curses.h" /* #include "protos.h" */