missing add
[apps/madmutt.git] / buffy.h
1 /*
2  * Copyright notice from original mutt:
3  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
4  *
5  * This file is part of mutt-ng, see http://www.muttng.org/.
6  * It's licensed under the GNU General Public License,
7  * please see the file GPL in the top level source directory.
8  */
9 #ifndef _BUFFY_H
10 #define _BUFFY_H
11
12 /*parameter to mutt_parse_mailboxes*/
13 #define M_MAILBOXES   1
14 #define M_UNMAILBOXES 2
15
16 typedef struct buffy_t {
17   char *path;
18   short new;                    /* mailbox has new mail */
19   short has_new;                /* set it new if new and not read */
20   int msgcount;                 /* total number of messages */
21   int msg_unread;               /* number of unread messages */
22   int msg_flagged;              /* number of flagged messages */
23   short notified;               /* user has been notified */
24   short magic;                  /* mailbox type */
25   short newly_created;          /* mbox or mmdf just popped into existence */
26 } BUFFY;
27
28 DO_INIT(BUFFY, buffy);
29 static inline void buffy_wipe(BUFFY *p) {
30     p_delete(&p->path);
31 }
32 DO_NEW(BUFFY, buffy);
33 DO_DELETE(BUFFY, buffy);
34
35 DO_ARRAY_TYPE(BUFFY, buffy);
36 DO_ARRAY_FUNCS(BUFFY, buffy, buffy_delete);
37
38 /* folders with incomming mail (via mailboxes command) */
39 WHERE buffy_array Incoming;
40 WHERE short BuffyTimeout INITVAL (3);
41 extern time_t BuffyDoneTime;    /* last time we knew for sure how much mail there was */
42
43 /* looks up a path in Incoming list (returns index) */
44 int buffy_lookup (const char*);
45 /* handles mailboxes commands */
46 int buffy_parse_mailboxes (BUFFER*, BUFFER*, unsigned long, BUFFER*);
47 /* from given path, gets next mailbox in Incoming with new mail */
48 void buffy_next (char*, size_t);
49 /* checks mailboxes for new mail (returns number) */
50 int buffy_check (int);
51 /* lists mailboxes with new mail */
52 int buffy_list (void);
53 /* wrapper around buffy_list() */
54 int buffy_notify (void);
55
56 #endif /* !_BUFFY_H */