imported.
[silc.git] / apps / irssi / src / silc / core / silc-channels.h
1 #ifndef __SILC_CHANNELS_H
2 #define __SILC_CHANNELS_H
3
4 #include "chat-protocols.h"
5 #include "channels.h"
6 #include "silc-servers.h"
7
8 /* Returns SILC_CHANNEL_REC if it's SILC channel, NULL if it isn't. */
9 #define SILC_CHANNEL(channel) \
10         PROTO_CHECK_CAST(CHANNEL(channel), SILC_CHANNEL_REC, chat_type, "SILC")
11
12 #define IS_SILC_CHANNEL(channel) \
13         (SILC_CHANNEL(channel) ? TRUE : FALSE)
14
15 #define STRUCT_SERVER_REC SILC_SERVER_REC
16 typedef struct {
17 #include "channel-rec.h"
18
19         GSList *banlist; /* list of bans */
20         GSList *ebanlist; /* list of ban exceptions */
21         GSList *invitelist; /* invite list */
22
23         SilcChannelEntry entry;
24 } SILC_CHANNEL_REC;
25
26 void silc_channels_init(void);
27 void silc_channels_deinit(void);
28
29 /* Create new SILC channel record */
30 SILC_CHANNEL_REC *silc_channel_create(SILC_SERVER_REC *server,
31                                       const char *name, int automatic);
32
33 #define silc_channel_find(server, name) \
34         SILC_CHANNEL(channel_find(SERVER(server), name))
35
36 SILC_CHANNEL_REC *silc_channel_find_entry(SILC_SERVER_REC *server,
37                                           SilcChannelEntry entry);
38
39 #endif