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

Jack Moffitt's avatar
Jack Moffitt committed
13 14 15 16 17 18 19 20
#ifndef __GLOBAL_H__
#define __GLOBAL_H__

#define ICE_LISTEN_QUEUE 5

#define ICE_RUNNING 1
#define ICE_HALTING 2

Ed "oddsock" Zaleski's avatar
Ed "oddsock" Zaleski committed
21
#define ICECAST_VERSION_STRING "Icecast " PACKAGE_VERSION
22

23 24
#define MAX_LISTEN_SOCKETS 10

25
#include "thread/thread.h"
26
#include "slave.h"
27

Jack Moffitt's avatar
Jack Moffitt committed
28 29
typedef struct ice_global_tag
{
30
    int serversock[MAX_LISTEN_SOCKETS];
31
    int server_sockets;
Jack Moffitt's avatar
Jack Moffitt committed
32

33
    int running;
Jack Moffitt's avatar
Jack Moffitt committed
34

35 36
    int sources;
    int clients;
37
    int schedule_config_reread;
Jack Moffitt's avatar
Jack Moffitt committed
38

39
    avl_tree *source_tree;
40 41 42 43
    /* for locally defined relays */
    struct _relay_server *relays;
    /* relays retrieved from master */
    struct _relay_server *master_relays;
44 45

    cond_t shutdown_cond;
Jack Moffitt's avatar
Jack Moffitt committed
46 47 48 49 50 51 52 53 54 55
} ice_global_t;

extern ice_global_t global;

void global_initialize(void);
void global_shutdown(void);
void global_lock(void);
void global_unlock(void);

#endif  /* __GLOBAL_H__ */