1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
/*
* Copyright (C) 1996-2002,2013 Michael R. Elkins <me@mutt.org>
* Copyright (C) 1999-2002 Thomas Roessler <roessler@does-not-exist.org>
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*
* This header file contains prototypes for internal functions used by the
* generic mailbox api. None of these functions should be called directly.
*/
#ifndef _MX_H
#define _MX_H
#include "mailbox.h"
#include "buffy.h"
/* supported mailbox formats */
enum
{
MUTT_MBOX = 1,
MUTT_MMDF,
MUTT_MH,
MUTT_MAILDIR,
#ifdef USE_NNTP
MUTT_NNTP,
#endif
MUTT_IMAP,
MUTT_NOTMUCH,
MUTT_POP
#ifdef USE_COMPRESSED
, MUTT_COMPRESSED
#endif
};
WHERE short DefaultMagic INITVAL (MUTT_MBOX);
#define MMDF_SEP "\001\001\001\001\n"
#define MAXLOCKATTEMPT 5
int mbox_lock_mailbox (CONTEXT *, int, int);
int mbox_parse_mailbox (CONTEXT *);
int mmdf_parse_mailbox (CONTEXT *);
void mbox_unlock_mailbox (CONTEXT *);
int mbox_check_empty (const char *);
void mbox_reset_atime (CONTEXT *, struct stat *);
int mh_check_empty (const char *);
int maildir_check_empty (const char *);
HEADER *maildir_parse_message (int magic, const char *fname, int is_old, HEADER * _h);
HEADER *maildir_parse_stream (int magic, FILE *f, const char *fname, int is_old, HEADER * _h);
void maildir_parse_flags (HEADER * h, const char *path);
void maildir_update_flags (CONTEXT *ctx, HEADER *o, HEADER *n);
void maildir_flags(char *dest, size_t destlen, HEADER * hdr);
#if USE_HCACHE
#include <hcache.h>
int mh_sync_mailbox_message (CONTEXT * ctx, int msgno, header_cache_t *hc);
#else
int mh_sync_mailbox_message (CONTEXT * ctx, int msgno);
#endif
#ifdef USE_NOTMUCH
int mx_is_notmuch(const char *p);
#endif
FILE *maildir_open_find_message (const char *, const char *, char **);
int mbox_strict_cmp_headers (const HEADER *, const HEADER *);
int mutt_reopen_mailbox (CONTEXT *, int *);
void mx_alloc_memory (CONTEXT *);
void mx_update_context (CONTEXT *, int);
void mx_update_tables (CONTEXT *, int);
int mx_lock_file (const char *, int, int, int, int);
int mx_unlock_file (const char *path, int fd, int dot);
struct mx_ops* mx_get_ops (int magic);
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;
#endif
|