コード例 #1
0
ファイル: main.c プロジェクト: rampantpixels/lua_lib
static int
test_foundation_initialize(void) {
	lua_config_t lua_config;
	resource_config_t resource_config;

	memset(&lua_config, 0, sizeof(lua_config));
	memset(&resource_config, 0, sizeof(resource_config));

	resource_config.enable_local_source = true;
	resource_config.enable_local_cache = true;
	resource_config.enable_remote_sourced = true;
	resource_config.enable_remote_compiled = true;
	resource_config.enable_local_autoimport = true;

	if (resource_module_initialize(resource_config) < 0)
		return -1;

	if (lua_module_initialize(lua_config) < 0)
		return -1;

	test_set_suitable_working_directory();
	test_load_config(test_parse_config);

	return 0;
}
コード例 #2
0
static int
test_foundation_initialize(void) {
	lua_config_t lua_config;
	resource_config_t resource_config;

	log_set_suppress(HASH_RESOURCE, ERRORLEVEL_NONE);

	memset(&lua_config, 0, sizeof(lua_config));
	memset(&resource_config, 0, sizeof(resource_config));

	resource_config.enable_local_source = true;
	resource_config.enable_local_cache = true;
	resource_config.enable_remote_cache = true;

	if (resource_module_initialize(resource_config) < 0)
		return -1;

	if (lua_module_initialize(lua_config) < 0)
		return -1;

	test_set_suitable_working_directory();
	test_load_config(test_parse_config);

	return 0;
}
コード例 #3
0
ファイル: main.c プロジェクト: rampantpixels/lua_lib
int
main_initialize(void) {
    int ret = 0;
    application_t application;
    foundation_config_t foundation_config;
    resource_config_t resource_config;
    lua_config_t lua_config;

    memset(&foundation_config, 0, sizeof(foundation_config));
    memset(&resource_config, 0, sizeof(resource_config));
    memset(&lua_config, 0, sizeof(lua_config));

    memset(&application, 0, sizeof(application));
    application.name = string_const(STRING_CONST("luacompile"));
    application.short_name = string_const(STRING_CONST("luacompile"));
    application.company = string_const(STRING_CONST("Rampant Pixels"));
    application.flags = APPLICATION_UTILITY;

    log_enable_prefix(false);
    log_set_suppress(0, ERRORLEVEL_WARNING);

    resource_config.enable_local_source = true;
    resource_config.enable_local_cache = true;
    resource_config.enable_remote_cache = true;

    if ((ret = foundation_initialize(memory_system_malloc(), application, foundation_config)) < 0)
        return ret;
    if ((ret = resource_module_initialize(resource_config)) < 0)
        return ret;
    if ((ret = lua_module_initialize(lua_config)) < 0)
        return ret;

    log_set_suppress(HASH_RESOURCE, ERRORLEVEL_DEBUG);
    log_set_suppress(HASH_SCRIPT, ERRORLEVEL_INFO);
    log_set_suppress(HASH_LUA, ERRORLEVEL_INFO);

    return 0;
}