2 silc-chatnets.c : irssi
4 Copyright (C) 1999-2000 Timo Sirainen
5 Copyright (C) 2003 Jochen Eisinger
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.
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.
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
24 #include "lib-config/iconfig.h"
27 #include "silc-chatnets.h"
29 static void sig_chatnet_read(SILC_CHATNET_REC *rec, CONFIG_NODE *node)
31 if (!IS_SILC_CHATNET(rec))
37 static void sig_chatnet_saved(SILC_CHATNET_REC *rec, CONFIG_NODE *node)
39 if (!IS_SILC_CHATNET(rec))
45 static void sig_chatnet_destroyed(SILC_CHATNET_REC *rec)
47 if (!IS_SILC_CHATNET(rec))
50 /* free eventually allocated memory */
54 void silc_chatnets_init(void)
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);
61 void silc_chatnets_deinit(void)
65 for (tmp = chatnets; tmp != NULL; tmp = next) {
66 CHATNET_REC *rec = tmp->data;
69 if (IS_SILC_CHATNET(rec))
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);