]> granicus.if.org Git - mutt/blob - buffy.h
Convert pgp_app_handler to use buffer pool.
[mutt] / buffy.h
1 /*
2  * Copyright (C) 1996-2000,2010,2013 Michael R. Elkins <me@mutt.org>
3  *
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.
8  *
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.
13  *
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.
17  */
18
19 #ifndef _BUFFY_H
20 #define _BUFFY_H
21
22 /*parameter to mutt_parse_mailboxes*/
23 #define MUTT_MAILBOXES   1
24 #define MUTT_UNMAILBOXES 2
25
26 typedef struct buffy_t
27 {
28   BUFFER *pathbuf;
29   const char *realpath; /* used for duplicate detection, context comparison,
30                            and the sidebar */
31   off_t size;
32   struct buffy_t *next;
33   short new;                    /* mailbox has new mail */
34
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 */
39
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. */
45 }
46 BUFFY;
47
48 WHERE BUFFY *Incoming;
49 WHERE short BuffyTimeout INITVAL (3);
50 WHERE short BuffyCheckStatsInterval INITVAL (60);
51
52 extern time_t BuffyDoneTime;    /* last time we knew for sure how much mail there was */
53
54 void mutt_buffer_buffy (BUFFER *);
55 void mutt_buffy (char *, size_t);
56
57 int  mutt_buffy_list (void);
58 int mutt_buffy_check (int);
59 int mutt_buffy_notify (void);
60
61 BUFFY *mutt_find_mailbox (const char *path);
62 void mutt_update_mailbox (BUFFY * b);
63
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);
67
68 /* mark mailbox just left as already notified */
69 void mutt_buffy_setnotified (const char *path);
70
71 int mh_buffy (BUFFY *, int);
72
73 /* force flags passed to mutt_buffy_check() */
74 #define MUTT_BUFFY_CHECK_FORCE       1
75 #define MUTT_BUFFY_CHECK_FORCE_STATS (1<<1)
76
77 #endif /* _BUFFY_H */