X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mbox.c;h=1c1065792cdb82d3d7ab2a49b2e3b0a2cd5da102;hp=8b5b577a24cfb90e574c3e5d2e2f781a898d010b;hb=250e22d7ca2420a08b34711713839780fd042ba9;hpb=0dbe922d4298aed78dcba64b7c770f315a64505e diff --git a/mbox.c b/mbox.c index 8b5b577..1c10657 100644 --- a/mbox.c +++ b/mbox.c @@ -9,24 +9,9 @@ /* This file contains code to parse ``mbox'' and ``mmdf'' style mailboxes */ -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include +#include #include #include "mutt.h" @@ -76,7 +61,7 @@ int mbox_lock_mailbox (CONTEXT * ctx, int excl, int retry) return (r); } -void mbox_unlock_mailbox (CONTEXT * ctx) +static void mbox_unlock_mailbox (CONTEXT * ctx) { if (ctx->locked) { fflush (ctx->fp); @@ -1085,28 +1070,32 @@ static int mmdf_commit_message (MESSAGE* msg, CONTEXT* ctx) { return (commit_message (msg, ctx, 0)); } -static mx_t* reg_mx (void) { - mx_t* fmt = p_new(mx_t, 1); - fmt->local = 1; - fmt->mx_check_empty = mbox_check_empty; - fmt->mx_is_magic = mbox_is_magic; - fmt->mx_access = access; - fmt->mx_open_mailbox = mbox_open_mailbox; - fmt->mx_open_new_message = mbox_open_new_message; - fmt->mx_sync_mailbox = mbox_sync_mailbox; - fmt->mx_check_mailbox = mbox_check_mailbox; - return (fmt); -} +mx_t const mbox_mx = { + M_MBOX, + 1, + mbox_is_magic, + mbox_check_empty, + access, + mbox_open_mailbox, + mbox_open_new_message, + NULL, + mbox_check_mailbox, + NULL, + mbox_sync_mailbox, + mbox_commit_message, +}; -mx_t* mbox_reg_mx (void) { - mx_t* fmt = reg_mx (); - fmt->type = M_MBOX; - fmt->mx_commit_message = mbox_commit_message; - return (fmt); -} -mx_t* mmdf_reg_mx (void) { - mx_t* fmt = reg_mx (); - fmt->type = M_MMDF; - fmt->mx_commit_message = mmdf_commit_message; - return (fmt); -} +mx_t const mmdf_mx = { + M_MMDF, + 1, + mbox_is_magic, + mbox_check_empty, + access, + mbox_open_mailbox, + mbox_open_new_message, + NULL, + mbox_check_mailbox, + NULL, + mbox_sync_mailbox, + mmdf_commit_message, +};