further pop_mx_ng work
[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 typedef struct buffy_t {
13     char *path;
14     short new;                    /* mailbox has new mail */
15     short has_new;                /* set it new if new and not read */
16     int msgcount;                 /* total number of messages */
17     int msg_unread;               /* number of unread messages */
18     int msg_flagged;              /* number of flagged messages */
19     short notified;               /* user has been notified */
20     short magic;                  /* mailbox type */
21     short newly_created;          /* mbox just popped into existence */
22 } BUFFY;
23
24 DO_INIT(BUFFY, buffy);
25 static inline void buffy_wipe(BUFFY *p) {
26     p_delete(&p->path);
27 }
28 DO_NEW(BUFFY, buffy);
29 DO_DELETE(BUFFY, buffy);
30
31 DO_ARRAY_TYPE(BUFFY, buffy);
32 DO_ARRAY_FUNCS(BUFFY, buffy, buffy_delete);
33
34 #include "buffy.li"
35
36 /* folders with incomming mail (via mailboxes command) */
37 extern buffy_array Incoming;
38
39 int buffy_lookup (const char*);
40 void buffy_do_mailboxes(const char *s, int add);
41
42 /* from given path, gets next mailbox in Incoming with new mail */
43 void buffy_next (char*, size_t);
44 /* checks mailboxes for new mail (returns number) */
45 int buffy_check (int);
46 /* lists mailboxes with new mail */
47 int buffy_list (void);
48 /* wrapper around buffy_list() */
49 int buffy_notify (void);
50
51 #endif /* !_BUFFY_H */