2 * Copyright (C) 1996-2000,2010,2013 Michael R. Elkins <me@mutt.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 /*parameter to mutt_parse_mailboxes*/
23 #define MUTT_MAILBOXES 1
24 #define MUTT_UNMAILBOXES 2
26 typedef struct buffy_t
29 const char *realpath; /* used for duplicate detection, context comparison,
33 short new; /* mailbox has new mail */
35 /* These next three are only set when OPTMAILCHECKSTATS is set */
36 int msg_count; /* total number of messages */
37 int msg_unread; /* number of unread messages */
38 int msg_flagged; /* number of flagged messages */
40 short notified; /* user has been notified */
41 short magic; /* mailbox type */
42 short newly_created; /* mbox or mmdf just popped into existence */
43 struct timespec last_visited; /* time of last exit from this mailbox */
44 struct timespec stats_last_checked; /* mtime of mailbox the last time stats where checked. */
48 WHERE BUFFY *Incoming;
49 WHERE short BuffyTimeout INITVAL (3);
50 WHERE short BuffyCheckStatsInterval INITVAL (60);
52 extern time_t BuffyDoneTime; /* last time we knew for sure how much mail there was */
54 void mutt_buffer_buffy (BUFFER *);
55 void mutt_buffy (char *, size_t);
57 int mutt_buffy_list (void);
58 int mutt_buffy_check (int);
59 int mutt_buffy_notify (void);
61 BUFFY *mutt_find_mailbox (const char *path);
62 void mutt_update_mailbox (BUFFY * b);
64 /* fixes up atime + mtime after mbox/mmdf mailbox was modified
65 according to stat() info taken before a modification */
66 void mutt_buffy_cleanup (const char *buf, struct stat *st);
68 /* mark mailbox just left as already notified */
69 void mutt_buffy_setnotified (const char *path);
71 int mh_buffy (BUFFY *, int);
73 /* force flags passed to mutt_buffy_check() */
74 #define MUTT_BUFFY_CHECK_FORCE 1
75 #define MUTT_BUFFY_CHECK_FORCE_STATS (1<<1)