summaryrefslogtreecommitdiff
path: root/src/core/channels-setup.h
blob: 3bb7da7fe155b46872b8824fc6b3d9598e672d01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef __CHANNELS_SETUP_H
#define __CHANNELS_SETUP_H

#include "modules.h"

#define CHANNEL_SETUP(server) \
	MODULE_CHECK_CAST(server, CHANNEL_SETUP_REC, type, "CHANNEL SETUP")

#define IS_CHANNEL_SETUP(server) \
	(CHANNEL_SETUP(server) ? TRUE : FALSE)

struct _CHANNEL_SETUP_REC {
#include "channel-setup-rec.h"
};

extern GSList *setupchannels;

void channels_setup_init(void);
void channels_setup_deinit(void);

void channel_setup_create(CHANNEL_SETUP_REC *channel);
void channel_setup_remove(CHANNEL_SETUP_REC *channel);

/* Remove channels attached to chatnet */
void channel_setup_remove_chatnet(const char *chatnet);

CHANNEL_SETUP_REC *channel_setup_find(const char *channel,
				      const char *chatnet);

#define channel_chatnet_match(rec, chatnet) \
	((rec) == NULL || (rec)[0] == '\0' || \
	 ((chatnet) != NULL && g_ascii_strcasecmp(rec, chatnet) == 0))

#endif