Merged silc_1_0_branch to trunk.
[silc.git] / apps / irssi / src / perl / silc / Silc.xs
1 #include "module.h"
2
3 static void perl_silc_server_fill_hash(HV *hv, SILC_SERVER_REC *server)
4 {
5         perl_server_fill_hash(hv, (SERVER_REC *) server);
6
7         hv_store(hv, "umode", 5, newSViv(server->umode), 0);
8 }
9
10 MODULE = Irssi::Silc    PACKAGE = Irssi::Silc
11
12 PROTOTYPES: ENABLE
13
14 void
15 init()
16 PREINIT:
17         static int initialized = FALSE;
18         int chat_type;
19 CODE:
20         if (initialized) return;
21         perl_api_version_check("Irssi::Silc");
22         initialized = TRUE;
23
24         chat_type = chat_protocol_lookup("SILC");
25
26         irssi_add_object(module_get_uniq_id("SERVER", 0),
27                          chat_type, "Irssi::Silc::Server",
28                          (PERL_OBJECT_FUNC) perl_silc_server_fill_hash);
29
30 void
31 deinit()
32 CODE:
33
34 BOOT:
35         irssi_boot(Silc__Channel);
36         irssi_boot(Silc__Query);
37         irssi_boot(Silc__Server);