global.h 1.32 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
/* 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).
11
 * Copyright 2014-2018, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
12 13
 */

Jack Moffitt's avatar
Jack Moffitt committed
14 15 16
#ifndef __GLOBAL_H__
#define __GLOBAL_H__

17
#define ICECAST_LISTEN_QUEUE 5
Jack Moffitt's avatar
Jack Moffitt committed
18

19 20
#define ICECAST_RUNNING 1
#define ICECAST_HALTING 2
Jack Moffitt's avatar
Jack Moffitt committed
21

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

Marvin Scholz's avatar
Marvin Scholz committed
24
#include "common/thread/thread.h"
25
#include "common/avl/avl.h"
26
#include "icecasttypes.h"
27

Jack Moffitt's avatar
Jack Moffitt committed
28 29
typedef struct ice_global_tag
{
30
    listensocket_container_t *listensockets;
Jack Moffitt's avatar
Jack Moffitt committed
31

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

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

38
    avl_tree *source_tree;
39
    /* for locally defined relays */
40
    relay_t *relays;
41
    /* relays retrieved from master */
42
    relay_t *master_relays;
43

44 45
    module_container_t *modulecontainer;

46
    cond_t shutdown_cond;
Jack Moffitt's avatar
Jack Moffitt committed
47 48 49 50 51 52 53 54 55 56
} 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__ */