Example #1
0
void acl_app_conf_unload(void)
{
	if (__app_cfg) {
		acl_xinetd_cfg_free(__app_cfg);
		__app_cfg = NULL;
	}

	if (__app_conf_file) {
		acl_myfree(__app_conf_file);
		__app_conf_file = NULL;
	}
}
Example #2
0
void acl_app_conf_load(const char *pathname)
{
	const char *myname = "acl_app_conf_load";

	if (pathname == NULL || *pathname == 0)
		acl_msg_fatal("%s(%d), %s: input error",
			__FILE__, __LINE__, myname);

	if (__app_cfg != NULL)
		acl_xinetd_cfg_free(__app_cfg);

	__app_cfg = acl_xinetd_cfg_load(pathname);

	if (__app_cfg == NULL)
		acl_msg_fatal("%s(%d), %s: load file(%s) error(%s)",
			__FILE__, __LINE__, myname, pathname, strerror(errno));

	__app_conf_file = acl_mystrdup(pathname);
}
Example #3
0
void master_conf::reset()
{
	if (cfg_)
	{
		acl_xinetd_cfg_free(cfg_);
		cfg_ = NULL;
	}
	if (int_cfg_)
	{
		acl_myfree(int_cfg_);
		int_cfg_ = NULL;
	}
	if (int64_cfg_)
	{
		acl_myfree(int64_cfg_);
		int64_cfg_ = NULL;
	}
	if (str_cfg_)
	{
		for (int i = 0; str_cfg_[i].name != NULL; i++)
		{
			if (*str_cfg_[i].target)
				acl_myfree(*str_cfg_[i].target);
		}
		acl_myfree(str_cfg_);
		str_cfg_ = NULL;
	}
	if (bool_cfg_)
	{
		acl_myfree(bool_cfg_);
		bool_cfg_ = NULL;
	}

	cfg_loaded_ = false;

	bool_tbl_ = NULL;
	int_tbl_ = NULL;
	int64_tbl_ = NULL;
	str_tbl_ = NULL;
}