sort out some prototypes, put them where they belong.
[apps/madmutt.git] / pop / mx_pop.c
1 /*
2  * This file is part of mutt-ng, see http://www.muttng.org/.
3  * It's licensed under the GNU General Public License,
4  * please see the file GPL in the top level source directory.
5  */
6 #ifdef HAVE_CONFIG_H
7 #include "config.h"
8 #endif
9
10 #include <sys/stat.h>
11
12 #include <lib-lib/lib-lib.h>
13
14 #include "mutt.h"
15 #include "pop.h"
16
17 #include "mx.h"
18 #include "mx_pop.h"
19
20 static int pop_is_magic (const char* path, struct stat* st __attribute__ ((unused))) {
21   url_scheme_t s = url_check_scheme (NONULL (path));
22   return ((s == U_POP || s == U_POPS) ? M_POP : -1);
23 }
24
25 static int acl_check_pop (CONTEXT* ctx __attribute__ ((unused)), int bit) {
26   switch (bit) {
27     case ACL_INSERT:    /* editing messages */
28     case ACL_WRITE:     /* change importance */
29       return (0);
30     case ACL_DELETE:    /* (un)deletion */
31     case ACL_SEEN:      /* mark as read */
32       return (1);
33     default:
34       return (0);
35   }
36 }
37
38 mx_t* pop_reg_mx (void) {
39   mx_t* fmt = p_new(mx_t, 1);
40
41   /* make up mx_t record... */
42   fmt->type = M_POP;
43   fmt->mx_is_magic = pop_is_magic;
44   fmt->mx_open_mailbox = pop_open_mailbox;
45   fmt->mx_acl_check = acl_check_pop;
46   fmt->mx_fastclose_mailbox = pop_close_mailbox;
47   fmt->mx_sync_mailbox = pop_sync_mailbox;
48   fmt->mx_check_mailbox = pop_check_mailbox;
49   return (fmt);
50 }