3cbc1ad74a3a99a049f591d36a73d00bd27f2a2e
[apps/madmutt.git] / pop / mx_pop.c
1 #ifdef HAVE_CONFIG_H
2 #include "config.h"
3 #endif
4
5 #include "mutt.h"
6 #include "pop.h"
7
8 #include "mx.h"
9 #include "mx_pop.h"
10
11 #include "lib/mem.h"
12 #include "lib/str.h"
13
14 #include "url.h"
15
16 static int pop_is_magic (const char* path) {
17   url_scheme_t s = url_check_scheme (NONULL (path));
18   return ((s == U_POP || s == U_POPS) ? M_POP : -1);
19 }
20
21 mx_t* pop_reg_mx (void) {
22   mx_t* fmt = safe_calloc (1, sizeof (mx_t));
23
24   /* make up mx_t record... */
25   fmt->type = M_POP;
26   fmt->mx_is_magic = pop_is_magic;
27   fmt->mx_open_mailbox = pop_open_mailbox;
28   return (fmt);
29 }