Rocco Rutte:
[apps/madmutt.git] / nntp / mx_nntp.c
1
2
3 #ifdef HAVE_CONFIG_H
4 #include "config.h"
5 #endif
6
7 #include "mutt.h"
8 #include "nntp.h"
9
10 #include "mx.h"
11 #include "mx_nntp.h"
12
13 #include "lib/mem.h"
14 #include "lib/str.h"
15
16 #include "url.h"
17
18 static int nntp_is_magic (const char* path) {
19   url_scheme_t s = url_check_scheme (NONULL (path));
20   return ((s == U_NNTP || s == U_NNTPS) ? M_NNTP : -1);
21 }
22
23 /* called by nntp_init(); don't call elsewhere */
24 mx_t* nntp_reg_mx (void) {
25   mx_t* fmt = safe_calloc (1, sizeof (mx_t));
26
27   /* make up mx_t record... */
28   fmt->type = M_NNTP;
29   fmt->mx_is_magic = nntp_is_magic;
30   fmt->mx_open_mailbox = nntp_open_mailbox;
31   return (fmt);
32 }