mx.h 2.27 KB
Newer Older
Thomas Roessler's avatar
Thomas Roessler committed
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
 *
Thomas Roessler's avatar
Thomas Roessler committed
5 6 7 8 9 10 11 12 13 14 15 16
 *     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
17
 *     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
Thomas Roessler's avatar
Thomas Roessler committed
18 19 20 21 22 23 24
 */ 

/*
 * This header file contains prototypes for internal functions used by the
 * generic mailbox api.  None of these functions should be called directly.
 */

25 26 27 28
#ifndef _MX_H
#define _MX_H

#include "mailbox.h"
29
#include "buffy.h"
30

Thomas Roessler's avatar
Thomas Roessler committed
31 32 33
/* supported mailbox formats */
enum
{
34 35 36 37 38 39
  MUTT_MBOX = 1,
  MUTT_MMDF,
  MUTT_MH,
  MUTT_MAILDIR,
  MUTT_IMAP,
  MUTT_POP
40 41 42
#ifdef USE_COMPRESSED
  , MUTT_COMPRESSED
#endif
Thomas Roessler's avatar
Thomas Roessler committed
43 44
};

45
WHERE short DefaultMagic INITVAL (MUTT_MBOX);
Thomas Roessler's avatar
Thomas Roessler committed
46 47

#define MMDF_SEP "\001\001\001\001\n"
Thomas Roessler's avatar
Thomas Roessler committed
48
#define MAXLOCKATTEMPT 5
Thomas Roessler's avatar
Thomas Roessler committed
49 50 51 52

int mbox_lock_mailbox (CONTEXT *, int, int);
int mbox_parse_mailbox (CONTEXT *);
int mmdf_parse_mailbox (CONTEXT *);
Thomas Roessler's avatar
Thomas Roessler committed
53
void mbox_unlock_mailbox (CONTEXT *);
54
int mbox_check_empty (const char *);
55
void mbox_reset_atime (CONTEXT *, struct stat *);
Thomas Roessler's avatar
Thomas Roessler committed
56

57
int mh_check_empty (const char *);
Thomas Roessler's avatar
Thomas Roessler committed
58

59
int maildir_check_empty (const char *);
60

61 62
FILE *maildir_open_find_message (const char *, const char *);

Thomas Roessler's avatar
Thomas Roessler committed
63 64 65 66
int mbox_strict_cmp_headers (const HEADER *, const HEADER *);
int mutt_reopen_mailbox (CONTEXT *, int *);

void mx_alloc_memory (CONTEXT *);
67
void mx_update_context (CONTEXT *, int);
68
void mx_update_tables (CONTEXT *, int);
Thomas Roessler's avatar
Thomas Roessler committed
69

70

Thomas Roessler's avatar
Thomas Roessler committed
71
int mx_lock_file (const char *, int, int, int, int);
Thomas Roessler's avatar
Thomas Roessler committed
72
int mx_unlock_file (const char *path, int fd, int dot);
73

74
struct mx_ops* mx_get_ops (int magic);
75 76 77 78
extern struct mx_ops mx_maildir_ops;
extern struct mx_ops mx_mbox_ops;
extern struct mx_ops mx_mh_ops;
extern struct mx_ops mx_mmdf_ops;
79 80

#endif