From: Richard Russon Date: Sat, 7 Jul 2018 10:56:44 +0000 (+0100) Subject: create libmbox X-Git-Tag: 2019-10-25~759^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e15d6521105db2c4ac5333b5dd937152e1c5246;p=neomutt create libmbox --- diff --git a/Makefile.autosetup b/Makefile.autosetup index db5fc7b94..a6dc53478 100644 --- a/Makefile.autosetup +++ b/Makefile.autosetup @@ -66,7 +66,7 @@ NEOMUTTOBJS= addrbook.o alias.o bcache.o browser.o buffy.o \ 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 mbox.o menu.o mh.o muttlib.o mutt_account.o mutt_attach.o mutt_body.o mutt_header.o \ + main.o menu.o mh.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 \ @@ -114,6 +114,14 @@ CLEANFILES+= $(LIBNNTP) $(LIBNNTPOBJS) MUTTLIBS+= $(LIBNNTP) ALLOBJS+= $(LIBNNTPOBJS) +############################################################################### +# libmbox +LIBMBOX= libmbox.a +LIBMBOXOBJS= mbox/mbox.o +CLEANFILES+= $(LIBMBOX) $(LIBMBOXOBJS) +MUTTLIBS+= $(LIBMBOX) +ALLOBJS+= $(LIBMBOXOBJS) + ############################################################################### # libmutt LIBMUTT= libmutt.a @@ -265,6 +273,13 @@ $(LIBNNTP): $(PWD)/nntp $(LIBNNTPOBJS) $(PWD)/nntp: $(MKDIR_P) $(PWD)/nntp +# libmbox +$(LIBMBOX): $(PWD)/mbox $(LIBMBOXOBJS) + $(AR) cr $@ $(LIBMBOXOBJS) + $(RANLIB) $@ +$(PWD)/mbox: + $(MKDIR_P) $(PWD)/mbox + # libncrypt $(LIBNCRYPT): $(PWD)/ncrypt $(LIBNCRYPTOBJS) $(AR) cr $@ $(LIBNCRYPTOBJS) diff --git a/mbox.c b/mbox/mbox.c similarity index 100% rename from mbox.c rename to mbox/mbox.c diff --git a/mbox/mbox.h b/mbox/mbox.h new file mode 100644 index 000000000..6f91065ed --- /dev/null +++ b/mbox/mbox.h @@ -0,0 +1,34 @@ +/** + * @file + * Mbox local mailbox type + * + * @authors + * Copyright (C) 1996-2002,2010,2013 Michael R. Elkins + * + * @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 . + */ + +#ifndef _MBOX_MBOX_H +#define _MBOX_MBOX_H + +struct Context; +struct stat; + +extern struct MxOps mx_mbox_ops; +extern struct MxOps mx_mmdf_ops; + +void mbox_reset_atime(struct Context *ctx, struct stat *st); + +#endif /* _MBOX_MBOX_H */ diff --git a/mx.c b/mx.c index d64129be3..8b0015589 100644 --- a/mx.c +++ b/mx.c @@ -47,6 +47,7 @@ #include "globals.h" #include "keymap.h" #include "mailbox.h" +#include "mbox/mbox.h" #include "mutt_header.h" #include "mutt_thread.h" #include "ncrypt/ncrypt.h" diff --git a/mx.h b/mx.h index 6e1a40f39..c137f99d5 100644 --- a/mx.h +++ b/mx.h @@ -188,9 +188,7 @@ 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_mbox_ops; extern struct MxOps mx_mh_ops; -extern struct MxOps mx_mmdf_ops; /* This variable is backing for a config item */ WHERE short MboxType; diff --git a/po/POTFILES.in b/po/POTFILES.in index 27c972c4f..435e25672 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -64,7 +64,7 @@ imap/util.c init.c keymap.c main.c -mbox.c +mbox/mbox.c menu.c mh.c mutt/base64.c