summaryrefslogtreecommitdiff
path: root/src/libicalcap/icalcap_server.c
blob: 77b84845549994277fd70f29c7d8d719e5ff73dc (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "config.h"

#include "icalcap.h"
#include "icalcap_server.h"
#include "icalcap_server_impl.h"


icalcap_server *
icalcap_server_new(icalcap_auth_handler auth_cb, icalcap_chanup_handler chanup_cb,
	icalcap_msg_handler msg_cb) {

#ifdef WITH_RR
	return icalcap_server_new_rr(auth_cb, chanup_cb, msg_cb);
#else
	return NULL;
#endif
}

int
icalcap_server_listen(icalcap_server *cap, const char *hostname, const int _port) {

	int port = _port;

	if (port <= 0)
		port = 1026;

#ifdef WITH_RR
	return icalcap_server_listen_rr(cap, hostname, port);
#else
	return 0;
#endif
}

int
icalcap_server_run(const icalcap_server *cap) {

#ifdef WITH_RR
	return icalcap_server_run_rr(cap);
#else
	return 0;
#endif
}

int
icalcap_server_shutdown(icalcap_server *cap) {

#ifdef WITH_RR
	return icalcap_server_shutdown_rr(cap);
#else
	return 0;
#endif
}