config.h 1.09 KB
Newer Older
Jack Moffitt's avatar
Jack Moffitt committed
1 2 3 4 5 6
#ifndef __CONFIG_H__
#define __CONFIG_H__

#define CONFIG_EINSANE -1
#define CONFIG_ENOROOT -2
#define CONFIG_EBADROOT -3
7
#define CONFIG_EPARSE -4
Jack Moffitt's avatar
Jack Moffitt committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

typedef struct ice_config_dir_tag
{
	char *host;
	int touch_freq;
	struct ice_config_dir_tag *next;
} ice_config_dir_t;

typedef struct ice_config_tag
{
	char *location;
	char *admin;

	int client_limit;
	int source_limit;
	int threadpool_size;
	int client_timeout;
	int header_timeout;
26
	int source_timeout;
27
    int ice_login;
Jack Moffitt's avatar
Jack Moffitt committed
28 29 30 31 32 33 34 35 36

	char *source_password;

	int touch_freq;
	ice_config_dir_t *dir_list;

	char *hostname;
	int port;
	char *bind_address;
37 38 39
	char *master_server;
	int master_server_port;
    int master_update_interval;
Jack Moffitt's avatar
Jack Moffitt committed
40 41 42

	char *base_dir;
	char *log_dir;
43
	char *webroot_dir;
Jack Moffitt's avatar
Jack Moffitt committed
44 45 46

	char *access_log;
	char *error_log;
47
    int loglevel;
48 49 50 51 52

    int chroot;
    int chuid;
    char *user;
    char *group;
Jack Moffitt's avatar
Jack Moffitt committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
} ice_config_t;

void config_initialize(void);
void config_shutdown(void);

int config_parse_file(const char *filename);
int config_parse_cmdline(int arg, char **argv);

int config_rehash(void);

ice_config_t *config_get_config(void);

#endif  /* __CONFIG_H__ */