mutt stable branch with some hacks
1/*
2 * Copyright (C) 1996-2002,2013 Michael R. Elkins <me@mutt.org>
3 * Copyright (C) 1999-2002 Thomas Roessler <roessler@does-not-exist.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20/*
21 * This header file contains prototypes for internal functions used by the
22 * generic mailbox api. None of these functions should be called directly.
23 */
24
25#ifndef _MX_H
26#define _MX_H
27
28#include "mailbox.h"
29#include "buffy.h"
30
31/* supported mailbox formats */
32enum
33{
34 MUTT_MBOX = 1,
35 MUTT_MMDF,
36 MUTT_MH,
37 MUTT_MAILDIR,
38 MUTT_IMAP,
39 MUTT_POP
40#ifdef USE_COMPRESSED
41 , MUTT_COMPRESSED
42#endif
43};
44
45WHERE short DefaultMagic INITVAL (MUTT_MBOX);
46
47#define MMDF_SEP "\001\001\001\001\n"
48#define MAXLOCKATTEMPT 5
49
50int mbox_lock_mailbox (CONTEXT *, int, int);
51int mbox_parse_mailbox (CONTEXT *);
52int mmdf_parse_mailbox (CONTEXT *);
53void mbox_unlock_mailbox (CONTEXT *);
54int mbox_check_empty (const char *);
55void mbox_reset_atime (CONTEXT *, struct stat *);
56
57int mh_check_empty (const char *);
58
59int maildir_check_empty (const char *);
60
61FILE *maildir_open_find_message (const char *, const char *);
62
63int mbox_strict_cmp_headers (const HEADER *, const HEADER *);
64int mutt_reopen_mailbox (CONTEXT *, int *);
65
66void mx_alloc_memory (CONTEXT *);
67void mx_update_context (CONTEXT *, int);
68void mx_update_tables (CONTEXT *, int);
69
70
71int mx_lock_file (const char *, int, int, int, int);
72int mx_unlock_file (const char *path, int fd, int dot);
73
74struct mx_ops* mx_get_ops (int magic);
75extern struct mx_ops mx_maildir_ops;
76extern struct mx_ops mx_mbox_ops;
77extern struct mx_ops mx_mh_ops;
78extern struct mx_ops mx_mmdf_ops;
79
80#endif