/*
+ * Copyright notice from original mutt:
* Copyright (C) 1997 Alain Penders <Alain@Finale-Dev.com>
*
- * 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, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This file is part of mutt-ng, see http://www.muttng.org/.
+ * It's licensed under the GNU General Public License,
+ * please see the file GPL in the top level source directory.
*/
#include "mutt.h"
#ifdef USE_COMPRESSED
#include "mx.h"
-#include "mailbox.h"
+#include "mbox.h"
#include "mutt_curses.h"
+#include "lib/mem.h"
+#include "lib/intl.h"
+#include "lib/str.h"
+
#include <errno.h>
#include <string.h>
#include <unistd.h>
/* Uncompress to /tmp */
mutt_mktemp (tmppath);
- ctx->path = safe_malloc (strlen (tmppath) + 1);
+ ctx->path = safe_malloc (safe_strlen (tmppath) + 1);
strcpy (ctx->path, tmppath);
}
return (0);
}
+mx_t* compress_reg_mx (void) {
+ mx_t* fmt = safe_calloc (1, sizeof (mx_t));
+ fmt->type = M_COMPRESSED;
+ fmt->local = 1;
+ fmt->mx_is_magic = mbox_is_magic;
+ fmt->mx_check_empty = mbox_check_empty;
+ fmt->mx_access = access;
+ fmt->mx_open_mailbox = mutt_open_read_compressed;
+ return (fmt);
+}
+
#endif /* USE_COMPRESSED */