8a286b733efe8c5575c07513bb47b9da07397d28
[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 #define IS_SILC_CHANNEL(channel) \
12         (SILC_CHANNEL(channel) ? TRUE : FALSE)
13 #define silc_channel_find(server, name) \
14         SILC_CHANNEL(channel_find(SERVER(server), name))
15
16 #define STRUCT_SERVER_REC SILC_SERVER_REC
17 typedef struct {
18 #include "channel-rec.h"
19   GSList *banlist;              /* list of bans */
20   GSList *ebanlist;             /* list of ban exceptions */
21   GSList *invitelist;           /* invite list */
22   SilcChannelEntry entry;
23 } SILC_CHANNEL_REC;
24
25 void silc_channels_init(void);
26 void silc_channels_deinit(void);
27
28 /* Create new SILC channel record */
29 SILC_CHANNEL_REC *silc_channel_create(SILC_SERVER_REC *server,
30                                       const char *name, int automatic);
31 SILC_CHANNEL_REC *silc_channel_find_entry(SILC_SERVER_REC *server,
32                                           SilcChannelEntry entry);
33
34 #endif