conststrings.o copy.o curs_lib.o curs_main.o edit.o editmsg.o \
enriched.o enter.o filter.o flags.o from.o group.o handler.o \
hdrline.o help.o history.o hook.o init.o keymap.o \
- main.o menu.o mh.o muttlib.o mutt_account.o mutt_attach.o mutt_body.o mutt_header.o \
+ main.o menu.o muttlib.o mutt_account.o mutt_attach.o mutt_body.o mutt_header.o \
mutt_logging.o mutt_signal.o mutt_socket.o mutt_thread.o mutt_window.o mx.o \
pager.o parse.o pattern.o \
postpone.o progress.o query.o recvattach.o recvcmd.o resize.o rfc1524.o \
ALLOBJS+= $(LIBNOTMUCHOBJS)
@endif
+###############################################################################
+# libmaildir
+LIBMAILDIR= libmaildir.a
+LIBMAILDIROBJS= maildir/mh.o
+CLEANFILES+= $(LIBMAILDIR) $(LIBMAILDIROBJS)
+MUTTLIBS+= $(LIBMAILDIR)
+ALLOBJS+= $(LIBMAILDIROBJS)
+
###############################################################################
# libmutt
LIBMUTT= libmutt.a
$(PWD)/notmuch:
$(MKDIR_P) $(PWD)/notmuch
+# libmaildir
+$(LIBMAILDIR): $(PWD)/maildir $(LIBMAILDIROBJS)
+ $(AR) cr $@ $(LIBMAILDIROBJS)
+ $(RANLIB) $@
+$(PWD)/maildir:
+ $(MKDIR_P) $(PWD)/maildir
+
# libncrypt
$(LIBNCRYPT): $(PWD)/ncrypt $(LIBNCRYPTOBJS)
$(AR) cr $@ $(LIBNCRYPTOBJS)
#include "globals.h"
#include "keymap.h"
#include "mailbox.h"
+#include "maildir/maildir.h"
#include "mutt_attach.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "context.h"
#include "globals.h"
#include "mailbox.h"
+#include "maildir/maildir.h"
#include "mutt_menu.h"
#include "mutt_window.h"
#include "mx.h"
/** mark mailbox just left as already notified */
void mutt_buffy_setnotified(const char *path);
-bool mh_buffy(struct Buffy *mailbox, bool check_stats);
-
/* force flags passed to mutt_buffy_check() */
#define MUTT_BUFFY_CHECK_FORCE (1 << 0)
#define MUTT_BUFFY_CHECK_FORCE_STATS (1 << 1)
int mx_access(const char *path, int flags);
int mx_check_empty(const char *path);
-bool mx_is_maildir(const char *path);
-bool mx_is_mh(const char *path);
-
#endif /* _MUTT_MAILBOX_H */
--- /dev/null
+/**
+ * @file
+ * Maildir local mailbox type
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _MAILDIR_MAILDIR_H
+#define _MAILDIR_MAILDIR_H
+
+#include <stdbool.h>
+#include <stdio.h>
+#include "mx.h"
+#ifdef USE_HCACHE
+#include "hcache/hcache.h"
+#endif
+
+struct Buffy;
+struct Context;
+struct Header;
+
+extern struct MxOps mx_maildir_ops;
+extern struct MxOps mx_mh_ops;
+
+int maildir_check_empty(const char *path);
+void maildir_flags(char *dest, size_t destlen, struct Header *hdr);
+FILE * maildir_open_find_message(const char *folder, const char *msg, char **newname);
+void maildir_parse_flags(struct Header *h, const char *path);
+struct Header *maildir_parse_message(int magic, const char *fname, bool is_old, struct Header *h);
+struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname, bool is_old, struct Header *h);
+bool maildir_update_flags(struct Context *ctx, struct Header *o, struct Header *n);
+
+bool mh_buffy(struct Buffy *mailbox, bool check_stats);
+int mh_check_empty(const char *path);
+
+bool mx_is_maildir(const char *path);
+bool mx_is_mh(const char *path);
+
+#ifdef USE_HCACHE
+int mh_sync_mailbox_message(struct Context *ctx, int msgno, header_cache_t *hc);
+#else
+int mh_sync_mailbox_message(struct Context *ctx, int msgno);
+#endif
+
+#endif /* _MAILDIR_MAILDIR_H */
#include "copy.h"
#include "globals.h"
#include "mailbox.h"
+#include "maildir.h"
#include "mutt_thread.h"
#include "mx.h"
#include "options.h"
#include "globals.h"
#include "keymap.h"
#include "mailbox.h"
+#include "maildir/maildir.h"
#include "mbox/mbox.h"
#include "mutt_header.h"
#include "mutt_thread.h"
void mbox_reset_atime(struct Context *ctx, struct stat *st);
-int mh_check_empty(const char *path);
-
-int maildir_check_empty(const char *path);
-
-struct Header *maildir_parse_message(int magic, const char *fname, bool is_old, struct Header *h);
-struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname, bool is_old, struct Header *h);
-void maildir_parse_flags(struct Header *h, const char *path);
-bool maildir_update_flags(struct Context *ctx, struct Header *o, struct Header *n);
-void maildir_flags(char *dest, size_t destlen, struct Header *hdr);
-
-#ifdef USE_HCACHE
-int mh_sync_mailbox_message(struct Context *ctx, int msgno, header_cache_t *hc);
-#else
-int mh_sync_mailbox_message(struct Context *ctx, int msgno);
-#endif
-
#ifdef USE_NOTMUCH
bool mx_is_notmuch(const char *p);
#endif
bool mx_tags_is_supported(struct Context *ctx);
-FILE *maildir_open_find_message(const char *folder, const char *msg, char **newname);
-
void mx_alloc_memory(struct Context *ctx);
void mx_update_context(struct Context *ctx, int new_messages);
void mx_update_tables(struct Context *ctx, bool committing);
struct MxOps *mx_get_ops(int magic);
-extern struct MxOps mx_maildir_ops;
-extern struct MxOps mx_mh_ops;
/* This variable is backing for a config item */
WHERE short MboxType;
#include "context.h"
#include "globals.h"
#include "mailbox.h"
+#include "maildir/maildir.h"
#include "mutt_thread.h"
#include "mx.h"
#include "progress.h"
imap/util.c
init.c
keymap.c
+maildir/mh.c
main.c
mbox/mbox.c
menu.c
-mh.c
mutt/base64.c
mutt/buffer.c
mutt/charset.c