Nico Golde:
[apps/madmutt.git] / mx.h
1 /*
2  * Copyright notice from original mutt:
3  * Copyright (C) 1996-2002 Michael R. Elkins <me@mutt.org>
4  * Copyright (C) 1999-2002 Thomas Roessler <roessler@does-not-exist.org>
5  *
6  * This file is part of mutt-ng, see http://www.muttng.org/.
7  * It's licensed under the GNU General Public License,
8  * please see the file GPL in the top level source directory.
9  */
10
11 /*
12  * This header file contains prototypes for internal functions used by the
13  * generic mailbox api.  None of these functions should be called directly.
14  */
15
16 #ifndef _MX_H
17 #define _MX_H
18
19 #include "mailbox.h"
20
21 /* supported mailbox formats */
22 enum {
23   M_MBOX = 1,
24   M_MMDF,
25   M_MH,
26   M_MAILDIR
27 #ifdef USE_IMAP
28     , M_IMAP
29 #endif
30 #ifdef USE_POP
31     , M_POP
32 #endif
33 #ifdef USE_NNTP
34     , M_NNTP
35 #endif
36 #ifdef USE_COMPRESSED
37     , M_COMPRESSED
38 #endif
39 };
40
41 WHERE short DefaultMagic INITVAL (M_MBOX);
42
43 #define MMDF_SEP "\001\001\001\001\n"
44 #define MAXLOCKATTEMPT 5
45
46 int mbox_sync_mailbox (CONTEXT *, int *);
47 int mbox_open_mailbox (CONTEXT *);
48 int mbox_check_mailbox (CONTEXT *, int *);
49 int mbox_close_mailbox (CONTEXT *);
50 int mbox_lock_mailbox (CONTEXT *, int, int);
51 int mbox_parse_mailbox (CONTEXT *);
52 int mmdf_parse_mailbox (CONTEXT *);
53 void mbox_unlock_mailbox (CONTEXT *);
54 int mbox_check_empty (const char *);
55
56 int mh_read_dir (CONTEXT *, const char *);
57 int mh_sync_mailbox (CONTEXT *, int *);
58 int mh_check_mailbox (CONTEXT *, int *);
59 int mh_buffy (const char *);
60 int mh_check_empty (const char *);
61
62 int maildir_read_dir (CONTEXT *);
63 int maildir_check_mailbox (CONTEXT *, int *);
64 int maildir_check_empty (const char *);
65
66 int maildir_commit_message (CONTEXT *, MESSAGE *, HEADER *);
67 int mh_commit_message (CONTEXT *, MESSAGE *, HEADER *);
68
69 int maildir_open_new_message (MESSAGE *, CONTEXT *, HEADER *);
70 int mh_open_new_message (MESSAGE *, CONTEXT *, HEADER *);
71
72 FILE *maildir_open_find_message (const char *, const char *);
73
74 int mbox_strict_cmp_headers (const HEADER *, const HEADER *);
75 int mutt_reopen_mailbox (CONTEXT *, int *);
76
77 void mx_alloc_memory (CONTEXT *);
78 void mx_update_context (CONTEXT *, int);
79 void mx_update_tables (CONTEXT *, int);
80
81
82 int mx_lock_file (const char *, int, int, int, int);
83 int mx_unlock_file (const char *path, int fd, int dot);
84
85
86 #endif