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 void silcnet_create(SILC_CHATNET_REC *rec)
31 g_return_if_fail(rec != NULL);
33 rec->chat_type = SILC_PROTOCOL;
34 chatnet_create((CHATNET_REC *) rec);
37 static void sig_chatnet_read(SILC_CHATNET_REC *rec, CONFIG_NODE *node)
39 if (!IS_SILC_CHATNET(rec))
45 static void sig_chatnet_saved(SILC_CHATNET_REC *rec, CONFIG_NODE *node)
47 if (!IS_SILC_CHATNET(rec))
53 static void sig_chatnet_destroyed(SILC_CHATNET_REC *rec)
55 if (!IS_SILC_CHATNET(rec))
58 /* free eventually allocated memory */
62 void silc_chatnets_init(void)
64 signal_add("chatnet read", (SIGNAL_FUNC) sig_chatnet_read);
65 signal_add("chatnet saved", (SIGNAL_FUNC) sig_chatnet_saved);
66 signal_add("chatnet destroyed", (SIGNAL_FUNC) sig_chatnet_destroyed);
69 void silc_chatnets_deinit(void)
73 for (tmp = chatnets; tmp != NULL; tmp = next) {
74 CHATNET_REC *rec = tmp->data;
77 if (IS_SILC_CHATNET(rec))
81 signal_remove("chatnet read", (SIGNAL_FUNC) sig_chatnet_read);
82 signal_remove("chatnet saved", (SIGNAL_FUNC) sig_chatnet_saved);
83 signal_remove("chatnet destroyed", (SIGNAL_FUNC) sig_chatnet_destroyed);