configtest.c 1.35 KB
Newer Older
Jack Moffitt's avatar
Jack Moffitt committed
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
#include "config.h"

void _dump_config(ice_config_t *config);

int main(void)
{
	ice_config_t *config;

	config_initialize();
	
	config_parse_file("icecast.xml");

Michael Smith's avatar
Michael Smith committed
14
	config = config_get_config_unlocked();
Jack Moffitt's avatar
Jack Moffitt committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

	_dump_config(config);

	config_shutdown();

	return 0;
}

void _dump_config(ice_config_t *config)
{
	ice_config_dir_t *node;

	printf("-----\n");
	printf("location = %s\n", config->location);
	printf("admin = %s\n", config->admin);
	printf("client_limit = %d\n", config->client_limit);
	printf("source_limit = %d\n", config->source_limit);
	printf("threadpool_size = %d\n", config->threadpool_size);
	printf("client_timeout = %d\n", config->client_timeout);
	printf("source_password = %s\n", config->source_password);
35
	printf("touch_interval = %d\n", config->touch_interval);
Jack Moffitt's avatar
Jack Moffitt committed
36
37
38

	node = config->dir_list;
	while (node) {
39
		printf("directory.touch_interval = %d\n", node->touch_interval);
Jack Moffitt's avatar
Jack Moffitt committed
40
41
42
43
44
45
46
47
48
49
50
51
		printf("directory.host = %s\n", node->host);
		
		node = node->next;
	}

	printf("hostname = %s\n", config->hostname);
	printf("port = %d\n", config->port);
	printf("bind_address = %s\n", config->bind_address);
	printf("base_dir = %s\n", config->base_dir);
	printf("log_dir = %s\n", config->log_dir);
	printf("access_log = %s\n", config->access_log);
	printf("error_log = %s\n", config->error_log);
brendan's avatar
brendan committed
52
	printf("loglevel = %d\n", config->loglevel);
Jack Moffitt's avatar
Jack Moffitt committed
53
54
55
56
57
58
59
	printf("-----\n");
}