organize module
[apps/madmutt.git] / lib-mx / pop-new.c
1 /*
2  *  This program is free software; you can redistribute it and/or modify
3  *  it under the terms of the GNU General Public License as published by
4  *  the Free Software Foundation; either version 2 of the License, or (at
5  *  your option) any later version.
6  *
7  *  This program is distributed in the hope that it will be useful, but
8  *  WITHOUT ANY WARRANTY; without even the implied warranty of
9  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10  *  General Public License for more details.
11  *
12  *  You should have received a copy of the GNU General Public License
13  *  along with this program; if not, write to the Free Software
14  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
15  *  MA 02110-1301, USA.
16  */
17 /*
18  *  Copyright © 2007 Pierre Habouzit
19  *  Copyright © 2000-2002 Vsevolod Volkov <vvv@mutt.org.ua>
20  */
21
22 #include <lib-sys/evtloop.h>
23 #include "pop.h"
24
25 typedef struct pop_data_t {
26     int refcnt;
27     job_t *w;
28 } pop_data_t;
29 DO_INIT(pop_data_t, pop_data);
30 DO_WIPE(pop_data_t, pop_data);
31 DO_REFCNT(pop_data_t, pop_data);
32 DO_ARRAY_TYPE(pop_data_t, pop_data);
33 DO_ARRAY_FUNCS(pop_data_t, pop_data, pop_data_delete);
34
35 /****************************************************************************/
36 /* module                                                                   */
37 /****************************************************************************/
38
39 static pop_data_array conns;
40
41 static __init void pop_initialize(void)
42 {
43     pop_data_array_init(&conns);
44 }
45 static __fini void pop_shutdown(void)
46 {
47     pop_data_array_wipe(&conns);
48 }
49
50 /****************************************************************************/
51 /* pop3 machine                                                             */
52 /****************************************************************************/
53
54 static int pop_setup(job_t *w, void *cfg)
55 {
56     return 0;
57 }
58
59 static void pop_finalize(job_t *w, el_status reason)
60 {
61 }
62
63 static machine_t const pop_machine = {
64     .name     = "POP3",
65     .setup    = &pop_setup,
66     .finalize = &pop_finalize,
67 };
68
69 /****************************************************************************/
70 /* pop3 mx driver                                                           */
71 /****************************************************************************/
72
73 mx_t const pop_mx_ng = {
74     M_POP,
75     0,
76     NULL,
77     NULL,
78     NULL,
79     NULL,
80     NULL,
81     NULL,
82     NULL,
83     NULL,
84     NULL,
85     NULL,
86     NULL,
87 };