Added SILC Thread Queue API
[crypto.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   SilcUInt32 cur_key;
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,
32                                       const char *visible_name,
33                                       int automatic);
34 SILC_CHANNEL_REC *silc_channel_find_entry(SILC_SERVER_REC *server,
35                                           SilcChannelEntry entry);
36
37 bool silc_set_away(const char *reason, SILC_SERVER_REC *server);
38 #endif