From: Richard Russon Date: Tue, 3 Jul 2018 22:25:42 +0000 (+0100) Subject: move Tags to library X-Git-Tag: 2019-10-25~762^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82d1e3722fad70031cfcb5cd8c6eb57dc2b417e8;p=neomutt move Tags to library --- diff --git a/Makefile.autosetup b/Makefile.autosetup index dbbb43f7f..e7e38e0ef 100644 --- a/Makefile.autosetup +++ b/Makefile.autosetup @@ -72,7 +72,7 @@ NEOMUTTOBJS= addrbook.o alias.o bcache.o browser.o buffy.o \ postpone.o progress.o query.o recvattach.o recvcmd.o resize.o rfc1524.o \ rfc2047.o rfc2231.o rfc3676.o safe_asprintf.o score.o send.o \ sendlib.o sidebar.o smtp.o sort.o state.o status.o system.o \ - tags.o terminal.o thread.o url.o version.o + terminal.o thread.o url.o version.o @if !HAVE_WCSCASECMP NEOMUTTOBJS+= wcscasecmp.o @@ -97,7 +97,7 @@ LIBMUTTOBJS= mutt/address.o mutt/attach.o mutt/base64.o mutt/body.o mutt/buffer. 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/parameter.o mutt/regex.o mutt/rfc2047.o mutt/sha1.o \ - mutt/signal.o mutt/string.o + mutt/signal.o mutt/string.o mutt/tags.o CLEANFILES+= $(LIBMUTT) $(LIBMUTTOBJS) MUTTLIBS+= $(LIBMUTT) ALLOBJS+= $(LIBMUTTOBJS) diff --git a/copy.c b/copy.c index 098716a48..d37349ae2 100644 --- a/copy.c +++ b/copy.c @@ -47,7 +47,6 @@ #include "protos.h" #include "rfc2047.h" #include "state.h" -#include "tags.h" #ifdef USE_NOTMUCH #include "mutt_notmuch.h" #endif diff --git a/curs_main.c b/curs_main.c index 01acb251c..94b695150 100644 --- a/curs_main.c +++ b/curs_main.c @@ -51,7 +51,6 @@ #include "progress.h" #include "protos.h" #include "sort.h" -#include "tags.h" #include "terminal.h" #include "thread.h" #ifdef USE_SIDEBAR diff --git a/hcache/hcache.c b/hcache/hcache.c index d61078776..5c3505a0c 100644 --- a/hcache/hcache.c +++ b/hcache/hcache.c @@ -54,7 +54,6 @@ #include "hcache/hcversion.h" #include "header.h" #include "protos.h" -#include "tags.h" static unsigned int hcachever = 0x0; diff --git a/hdrline.c b/hdrline.c index 4298a5975..947312d33 100644 --- a/hdrline.c +++ b/hdrline.c @@ -42,7 +42,6 @@ #include "options.h" #include "protos.h" #include "sort.h" -#include "tags.h" #include "thread.h" /** diff --git a/header.h b/header.h index 1410f45bc..0645765dd 100644 --- a/header.h +++ b/header.h @@ -27,7 +27,6 @@ #include #include #include "mutt/mutt.h" -#include "tags.h" /** * struct Header - The header/envelope of an email diff --git a/imap/imap.c b/imap/imap.c index 2756a47be..4f423856e 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -60,7 +60,6 @@ #include "progress.h" #include "protos.h" #include "sort.h" -#include "tags.h" #include "url.h" #ifdef USE_HCACHE #include "hcache/hcache.h" diff --git a/imap/message.c b/imap/message.c index aef50279d..33a189fc1 100644 --- a/imap/message.c +++ b/imap/message.c @@ -52,7 +52,6 @@ #include "options.h" #include "progress.h" #include "protos.h" -#include "tags.h" #ifdef USE_HCACHE #include "hcache/hcache.h" #endif diff --git a/init.h b/init.h index e2623ea9d..521ba2557 100644 --- a/init.h +++ b/init.h @@ -43,7 +43,6 @@ #include "options.h" #include "protos.h" #include "sort.h" -#include "tags.h" #ifdef USE_LUA #include "mutt_lua.h" #endif diff --git a/menu.c b/menu.c index d46e23be2..6c248b206 100644 --- a/menu.c +++ b/menu.c @@ -39,7 +39,6 @@ #include "options.h" #include "pattern.h" #include "protos.h" -#include "tags.h" #ifdef USE_SIDEBAR #include "sidebar.h" #endif diff --git a/mutt/mutt.h b/mutt/mutt.h index 75dbe02c9..929a2f134 100644 --- a/mutt/mutt.h +++ b/mutt/mutt.h @@ -53,6 +53,7 @@ * | mutt/sha1.c | @subpage sha1 | * | mutt/signal.c | @subpage signal | * | mutt/string.c | @subpage string | + * | mutt/tags.c | @subpage tags | * * @note The library is self-contained -- some files may depend on others in * the library, but none depends on source from outside. @@ -90,5 +91,6 @@ #include "sha1.h" #include "signal2.h" #include "string2.h" +#include "tags.h" #endif /* _MUTT_MUTT_H */ diff --git a/tags.c b/mutt/tags.c similarity index 98% rename from tags.c rename to mutt/tags.c index 2f05c394a..95665e472 100644 --- a/tags.c +++ b/mutt/tags.c @@ -28,9 +28,13 @@ #include "config.h" #include +#include #include -#include "mutt/mutt.h" #include "tags.h" +#include "hash.h" +#include "memory.h" +#include "queue.h" +#include "string2.h" char *HiddenTags; /**< Config: Private tags which should not be displayed */ struct Hash *TagTransforms; /**< Lookup table of alternative tag names */ diff --git a/tags.h b/mutt/tags.h similarity index 98% rename from tags.h rename to mutt/tags.h index a73562f75..a0429c765 100644 --- a/tags.h +++ b/mutt/tags.h @@ -24,7 +24,7 @@ #define _MUTT_TAG_H #include -#include "mutt/mutt.h" +#include "queue.h" extern char *HiddenTags; extern struct Hash *TagTransforms; @@ -46,8 +46,8 @@ STAILQ_HEAD(TagHead, TagNode); void driver_tags_free(struct TagHead *head); char *driver_tags_get(struct TagHead *head); -char *driver_tags_get_transformed_for(char *name, struct TagHead *head); char *driver_tags_get_transformed(struct TagHead *head); +char *driver_tags_get_transformed_for(char *name, struct TagHead *head); char *driver_tags_get_with_hidden(struct TagHead *head); bool driver_tags_replace(struct TagHead *head, char *tags); diff --git a/mutt_notmuch.c b/mutt_notmuch.c index 5b5b06d04..6d45e40af 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -59,7 +59,6 @@ #include "mx.h" #include "progress.h" #include "protos.h" -#include "tags.h" #include "thread.h" #include "url.h" diff --git a/muttlib.c b/muttlib.c index 7dbb2dff2..2e55fefb8 100644 --- a/muttlib.c +++ b/muttlib.c @@ -54,7 +54,6 @@ #include "ncrypt/ncrypt.h" #include "options.h" #include "protos.h" -#include "tags.h" #include "url.h" #ifdef HAVE_SYS_SYSCALL_H #include diff --git a/pattern.c b/pattern.c index 1c2a3b322..14c292024 100644 --- a/pattern.c +++ b/pattern.c @@ -53,7 +53,6 @@ #include "progress.h" #include "protos.h" #include "state.h" -#include "tags.h" #include "thread.h" #ifdef USE_IMAP #include "imap/imap.h" diff --git a/po/POTFILES.in b/po/POTFILES.in index 6f5afc083..e0af21eb6 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -86,6 +86,7 @@ mutt/rfc2047.c mutt/sha1.c mutt/signal.c mutt/string.c +mutt/tags.c mutt_account.c mutt_attach.c mutt_body.c @@ -145,7 +146,6 @@ sort.c state.c status.c system.c -tags.c terminal.c thread.c url.c