Added SILC Thread Queue API
[crypto.git] / apps / irssi / src / core / channels.h
1 #ifndef __CHANNELS_H
2 #define __CHANNELS_H
3
4 #include "modules.h"
5
6 /* Returns CHANNEL_REC if it's channel, NULL if it isn't. */
7 #define CHANNEL(channel) \
8         MODULE_CHECK_CAST_MODULE(channel, CHANNEL_REC, type, \
9                               "WINDOW ITEM TYPE", "CHANNEL")
10
11 #define IS_CHANNEL(channel) \
12         (CHANNEL(channel) ? TRUE : FALSE)
13
14 #define STRUCT_SERVER_REC SERVER_REC
15 struct _CHANNEL_REC {
16 #include "channel-rec.h"
17 };
18
19 extern GSList *channels;
20
21 /* Create new channel record */
22 void channel_init(CHANNEL_REC *channel, SERVER_REC *server, const char *name,
23                   const char *visible_name, int automatic);
24 void channel_destroy(CHANNEL_REC *channel);
25
26 /* find channel by name, if `server' is NULL, search from all servers */
27 CHANNEL_REC *channel_find(SERVER_REC *server, const char *name);
28
29 void channel_change_name(CHANNEL_REC *channel, const char *name);
30 void channel_change_visible_name(CHANNEL_REC *channel, const char *name);
31
32 /* Send the auto send command to channel */
33 void channel_send_autocommands(CHANNEL_REC *channel);
34
35 void channels_init(void);
36 void channels_deinit(void);
37
38 #endif