Added SILC Thread Queue API
[runtime.git] / apps / irssi / src / silc / core / silc-chatnets.c
1 /*
2  silc-chatnets.c : irssi
3
4     Copyright (C) 1999-2000 Timo Sirainen
5     Copyright (C) 2003 Jochen Eisinger
6
7     This program is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11
12     This program is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16
17     You should have received a copy of the GNU General Public License
18     along with this program; if not, write to the Free Software
19     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20 */
21
22 #include "module.h"
23 #include "signals.h"
24 #include "lib-config/iconfig.h"
25 #include "settings.h"
26
27 #include "silc-chatnets.h"
28
29 static void sig_chatnet_read(SILC_CHATNET_REC *rec, CONFIG_NODE *node)
30 {
31         if (!IS_SILC_CHATNET(rec))
32                 return;
33         
34         /* read settings */
35 }
36
37 static void sig_chatnet_saved(SILC_CHATNET_REC *rec, CONFIG_NODE *node)
38 {
39         if (!IS_SILC_CHATNET(rec))
40                 return;
41
42         /* save settings */
43 }
44
45 static void sig_chatnet_destroyed(SILC_CHATNET_REC *rec)
46 {
47         if (!IS_SILC_CHATNET(rec))
48                 return;
49
50         /* free eventually allocated memory */
51 }
52
53
54 void silc_chatnets_init(void)
55 {
56         signal_add("chatnet read", (SIGNAL_FUNC) sig_chatnet_read);
57         signal_add("chatnet saved", (SIGNAL_FUNC) sig_chatnet_saved);
58         signal_add("chatnet destroyed", (SIGNAL_FUNC) sig_chatnet_destroyed);
59 }
60
61 void silc_chatnets_deinit(void)
62 {
63         GSList *tmp, *next;
64
65         for (tmp = chatnets; tmp != NULL; tmp = next) {
66                 CHATNET_REC *rec = tmp->data;
67
68                 next = tmp->next;
69                 if (IS_SILC_CHATNET(rec))
70                         chatnet_destroy(rec);
71         }
72
73         signal_remove("chatnet read", (SIGNAL_FUNC) sig_chatnet_read);
74         signal_remove("chatnet saved", (SIGNAL_FUNC) sig_chatnet_saved);
75         signal_remove("chatnet destroyed", (SIGNAL_FUNC) sig_chatnet_destroyed);
76 }