예제 #1
0
static int reload_module(void) {
	msgs_unhook(&default_msgs, impvbaw_exec);
	msgs_unhook(impvbaw_msgs, mm_impvbaw_exec);
	config_destroy(cfg);
	table_clear(contracts);
	table_clear(expiries);
	table_clear(optns);
	table_clear(spots);
	load_config();
	if (msgs_hook(&default_msgs, impvbaw_exec, impvbaw_msgs) == -1)
		return MODULE_LOAD_FAILURE;
	if (msgs_hook(impvbaw_msgs, mm_impvbaw_exec, NULL) == -1)
		return MODULE_LOAD_FAILURE;
	return MODULE_LOAD_SUCCESS;
}
예제 #2
0
파일: app_ema.c 프로젝트: ArkShen/xcb
static int load_module(void) {
	load_config();
	contracts = map_create();
	if (msgs_hook(&default_msgs, ema_exec, NULL) == -1)
		return MODULE_LOAD_FAILURE;
	return register_application(app, ema_exec, desc, fmt, mod_info->self);
}
예제 #3
0
static int load_module(void) {
	contracts = table_new(cmpstr, hashmurmur2, NULL, vfree);
	load_config();
	if (msgs_hook(&default_msgs, csi300_exec, NULL) == -1)
		return MODULE_LOAD_FAILURE;
	return register_application(app, csi300_exec, desc, fmt, mod_info->self);
}
예제 #4
0
파일: app_ema.c 프로젝트: ArkShen/xcb
static int reload_module(void) {
	msgs_unhook(&default_msgs, ema_exec);
	free_prices(contracts);
	map_clear(contracts);
	load_config();
	if (msgs_hook(&default_msgs, ema_exec, NULL) == -1)
		return MODULE_LOAD_FAILURE;
	return MODULE_LOAD_SUCCESS;
}
예제 #5
0
static int reload_module(void) {
	msgs_unhook(&default_msgs, csi300_exec);
	config_destroy(cfg);
	table_clear(contracts);
	load_config();
	if (msgs_hook(&default_msgs, csi300_exec, NULL) == -1)
		return MODULE_LOAD_FAILURE;
	return MODULE_LOAD_SUCCESS;
}
예제 #6
0
static int load_module(void) {
	int res;

	spots     = table_new(cmpstr, hashmurmur2, kfree, NULL);
	optns     = table_new(cmpstr, hashmurmur2, kfree, vfree);
	expiries  = table_new(cmpstr, hashmurmur2, NULL,  NULL);
	contracts = table_new(cmpstr, hashmurmur2, kfree, vfree);
	load_config();
	if (msgs_init(&impvbaw_msgs, "impvbaw_msgs", mod_info->self) == -1)
		return MODULE_LOAD_FAILURE;
	if (start_msgs(impvbaw_msgs) == -1)
		return MODULE_LOAD_FAILURE;
	if (msgs_hook(impvbaw_msgs, mm_impvbaw_exec, NULL) == -1)
		return MODULE_LOAD_FAILURE;
	if (msgs_hook(&default_msgs, impvbaw_exec, impvbaw_msgs) == -1)
		return MODULE_LOAD_FAILURE;
	res  = register_application(app, impvbaw_exec, desc, fmt, mod_info->self);
	res |= register_application(app2, mm_impvbaw_exec, desc2, fmt2, mod_info->self);
	return res;
}
예제 #7
0
파일: app_hello.c 프로젝트: wang-shun/xcb
static int load_module(void) {
	if (msgs_hook(&default_msgs, hello_exec, NULL) == -1)
		return MODULE_LOAD_FAILURE;
	return register_application(app, hello_exec, desc, fmt, mod_info->self);
}