configtest.c 1.92 KB
Newer Older
1 2 3 4 5
/* Icecast
 *
 * This program is distributed under the GNU General Public License, version 2.
 * A copy of this license is included with this source.
 *
6
 * Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
7 8 9 10 11 12
 *                      Michael Smith <msmith@xiph.org>,
 *                      oddsock <oddsock@xiph.org>,
 *                      Karl Heyes <karl@xiph.org>
 *                      and others (see AUTHORS for details).
 */

13 14 15 16
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

Jack Moffitt's avatar
Jack Moffitt committed
17
#include <stdio.h>
18
#include "cfgfile.h"
Jack Moffitt's avatar
Jack Moffitt committed
19 20 21 22 23

void _dump_config(ice_config_t *config);

int main(void)
{
24
    ice_config_t *config;
Jack Moffitt's avatar
Jack Moffitt committed
25

26
    config_initialize();
27

28
    config_parse_file("icecast.xml");
Jack Moffitt's avatar
Jack Moffitt committed
29

30
    config = config_get_config_unlocked();
Jack Moffitt's avatar
Jack Moffitt committed
31

32
    _dump_config(config);
Jack Moffitt's avatar
Jack Moffitt committed
33

34
    config_shutdown();
Jack Moffitt's avatar
Jack Moffitt committed
35

36
    return 0;
Jack Moffitt's avatar
Jack Moffitt committed
37 38 39 40
}

void _dump_config(ice_config_t *config)
{
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
    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);
    printf("touch_interval = %d\n", config->touch_interval);

    node = config->dir_list;
    while (node) {
        printf("directory.touch_interval = %d\n", node->touch_interval);
        printf("directory.host = %s\n", node->host);
57

58 59 60 61 62 63 64 65 66 67 68 69
        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);
    printf("loglevel = %d\n", config->loglevel);
    printf("-----\n");
Jack Moffitt's avatar
Jack Moffitt committed
70 71 72 73 74 75
}