1 /* Icecast
2  *
3  * This program is distributed under the GNU General Public License, version 2.
4  * A copy of this license is included with this source.
5  *
6  * Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
7  *                      Michael Smith <msmith@xiph.org>,
8  *                      oddsock <oddsock@xiph.org>,
9  *                      Karl Heyes <karl@xiph.org>
10  *                      and others (see AUTHORS for details).
11  */
12 
13 #ifndef __GLOBAL_H__
14 #define __GLOBAL_H__
15 
16 #define ICECAST_LISTEN_QUEUE 5
17 
18 #define ICECAST_BOOTING 0 /* Still booting  */
19 #define ICECAST_RUNNING 1 /* Up and running */
20 #define ICECAST_HALTING 2 /* Shutting down  */
21 
22 #define ICECAST_VERSION_STRING "Icecast " PACKAGE_VERSION
23 
24 #include "thread/thread.h"
25 #include "slave.h"
26 #include "net/sock.h"
27 
28 typedef struct ice_global_tag
29 {
30     sock_t *serversock;
31     int server_sockets;
32 
33     int running;
34 
35     int sources;
36     int clients;
37     int schedule_config_reread;
38 
39     avl_tree *source_tree;
40     /* for locally defined relays */
41     struct _relay_server *relays;
42     /* relays retrieved from master */
43     struct _relay_server *master_relays;
44 
45     cond_t shutdown_cond;
46 } ice_global_t;
47 
48 extern ice_global_t global;
49 
50 void global_initialize(void);
51 void global_shutdown(void);
52 void global_lock(void);
53 void global_unlock(void);
54 
55 #endif  /* __GLOBAL_H__ */
56