]> granicus.if.org Git - neomutt/commitdiff
add context magic
authorKarel Zak <kzak@redhat.com>
Wed, 14 Dec 2011 13:26:45 +0000 (14:26 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 4 Apr 2016 15:30:04 +0000 (16:30 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
mx.c
mx.h

diff --git a/mx.c b/mx.c
index 4c49c6b10d5c231db0d8a0b25fcb8178f2ba3245..b4d4dd7bec2036825bdc37a7734788963e94cd36 100644 (file)
--- a/mx.c
+++ b/mx.c
 #include "pop.h"
 #endif
 
+#ifdef USE_NOTMUCH
+#include "mutt_notmuch.h"
+#endif
+
 #include "buffy.h"
 
 #ifdef USE_DOTLOCK
@@ -346,6 +350,24 @@ int mx_is_pop (const char *p)
 }
 #endif
 
+#ifdef USE_NOTMUCH
+
+int mx_is_notmuch(const char *p)
+{
+  url_scheme_t scheme;
+
+  if (!p)
+    return 0;
+
+  scheme = url_check_scheme (p);
+  if (scheme == U_NOTMUCH)
+    return 1;
+
+  return 0;
+}
+
+#endif
+
 int mx_get_magic (const char *path)
 {
   struct stat st;
diff --git a/mx.h b/mx.h
index fc67a500286aa54cbc256b39a31cfcae3035e84d..a7a8ca07e6497f5c07f74728280835207d40f883 100644 (file)
--- a/mx.h
+++ b/mx.h
@@ -35,6 +35,7 @@ enum
   M_MH,
   M_MAILDIR,
   M_IMAP,
+  M_NOTMUCH,
   M_POP
 };
 
@@ -76,6 +77,10 @@ int mh_sync_mailbox_message (CONTEXT * ctx, int msgno, header_cache_t *hc);
 int mh_sync_mailbox_message (CONTEXT * ctx, int msgno);
 #endif
 
+#ifdef USE_NOTMUCH
+int mx_is_notmuch(const char *p);
+#endif
+
 int maildir_commit_message (CONTEXT *, MESSAGE *, HEADER *);
 int mh_commit_message (CONTEXT *, MESSAGE *, HEADER *);