Пример #1
0
int
hgd_read_config(char **config_locations)
{
#ifdef HAVE_LIBCONFIG
	/*
	 * config_lookup_int64 is used because lib_config changed
	 * config_lookup_int from returning a long int, to a int, and debian
	 * still uses the old version.
	 */
	config_t		 cfg, *cf;
	int			 dont_fork = dont_fork;

	cf = &cfg;

	if (hgd_load_config(cf, config_locations) == HGD_FAIL) {
		return (HGD_OK);
	}

	hgd_cfg_statepath(cf, &state_path);
	hgd_cfg_debug(cf, "admin", &hgd_debug);

	config_destroy(cf);
#endif
	return (HGD_OK);
}
Пример #2
0
int
hgd_read_config(char **config_locations)
{
#ifdef HAVE_LIBCONFIG
	/*
	 * config_lookup_int64 is used because lib_config changed
	 * config_lookup_int from returning a long int, to a int, and debian
	 * still uses the old version.
	 * see hgd-playd.c for how to remove need for stat.
	 */
	config_t		 cfg, *cf;
	int			 ret = HGD_OK;

	cf = &cfg;

	if (hgd_load_config(cf, config_locations) == HGD_FAIL)
		return (HGD_OK);

	/* hgd_cfg_c_colours(cf, &colours_on); */
	hgd_cfg_crypto(cf, "hgdc", &crypto_pref);
	hgd_cfg_c_hostname(cf, &host);
	hgd_cfg_c_port(cf, &port);
	hgd_cfg_c_password(cf, &password, *config_locations);
	/* hgd_cfg_c_refreshrate(cf, &hud_refresh_speed); */
	hgd_cfg_c_username(cf, &user);
	hgd_cfg_c_debug(cf, &hgd_debug);

	config_destroy(cf);
	return (ret);
#else
	return (HGD_OK);
#endif
}
Пример #3
0
int
hgd_read_config(char **config_locations)
{
#ifdef HAVE_LIBCONFIG
	/*
	 * config_lookup_int64 is used because lib_config changed
	 * config_lookup_int from returning a long int, to a int, and debian
	 * still uses the old version.
	 */
	config_t		 cfg, *cf;

	cf = &cfg;

	if (hgd_load_config(cf, config_locations) == HGD_FAIL) {
		return (HGD_OK);
	}

	hgd_cfg_daemonise(cf, "playd", &background);
	hgd_cfg_statepath(cf, &state_path);
	hgd_cfg_playd_purgefs(cf, &purge_finished_fs);
#ifdef HAVE_PYTHON
	hgd_cfg_pluginpath(cf, &hgd_py_plugin_dir);
#endif
	hgd_cfg_playd_purgedb(cf, &purge_finished_db);
	hgd_cfg_debug(cf, "playd", &hgd_debug);

	config_destroy(cf);
#endif
	return (HGD_OK);
}
Пример #4
0
int
hgd_read_config(char **config_locations)
{
#ifdef HAVE_LIBCONFIG
	/*
	 * config_lookup_int64 is used because lib_config changed
	 * config_lookup_int from returning a long int, to a int, and debian
	 * still uses the old version.
	 * See hgd-playd.c for how to remove the stat when deb get into gear
	 */
	config_t		 cfg, *cf;

	cf = &cfg;

	if (hgd_load_config(cf, config_locations) == HGD_FAIL) {
		return (HGD_OK);
	}

	hgd_cfg_daemonise(cf, "netd", &background);
	hgd_cfg_netd_rdns(cf, &lookup_client_dns); 
	hgd_cfg_statepath(cf, &state_path);
	hgd_cfg_crypto(cf, "netd", &crypto_pref);	
	hgd_cfg_fork(cf, "netd", &single_client);
	hgd_cfg_netd_flood_limit(cf, &flood_limit);
	hgd_cf_netd_ssl_privkey(cf, &ssl_key_path);
	hgd_cfg_netd_votesound(cf, &req_votes);
	hgd_cfg_netd_port(cf, &port);
	hgd_cfg_netd_max_filesize(cf, &max_upload_size);
	hgd_cfg_netd_sslcert(cf, &ssl_cert_path);
	hgd_cfg_debug(cf, "netd", &hgd_debug);
	hgd_cfg_netd_voteoff_sound(cf, &vote_sound);

	/* we can destory config here because we copy all heap alloc'd stuff */
	config_destroy(cf);
#endif

	return (HGD_OK);
}