Exemplo n.º 1
0
void o_engine_release_factory(struct o_storage_factory * factory)
{
	char * path = o_storage_factory_get_path(factory);
	o_map_string_remove(o_engine_get_instance()->factories, path);
	if (o_map_string_size(o_engine_get_instance()->factories) == 0)
		o_engine_release();

}
Exemplo n.º 2
0
void o_engine_release_connection(struct o_connection * connection)
{
	char * name = o_connection_get_path(connection);
	char * username = o_connection_get_last_user(connection);
	char * key = createKey(name, username);
	o_map_string_remove(o_engine_get_instance()->connections, key);
	if (o_map_string_size(o_engine_get_instance()->connections) == 0)
		o_engine_release();
	o_free(key);
}
Exemplo n.º 3
0
struct o_storage_factory * o_engine_get_factory(enum o_url_type type, char *path)
{
	struct o_engine *cur_engine = o_engine_get_instance();
	struct o_storage_factory * new_con;
	if ((new_con = o_map_string_get(cur_engine->factories, path)) == 0)
	{
		new_con = o_storage_factory_new(type, path);
		o_map_string_put(cur_engine->factories, path, new_con);
	}
	return new_con;
}
Exemplo n.º 4
0
struct o_connection * o_engine_get_connection(enum o_url_type type, char *path, char * username)
{
	struct o_engine *cur_engine = o_engine_get_instance();
	struct o_connection * new_con;
	char * key = createKey(path, username);
	if ((new_con = o_map_string_get(cur_engine->connections, key)) == 0)
	{
		new_con = o_connection_new(type, path);
		o_map_string_put(cur_engine->connections, key, new_con);
	}
	o_free(key);
	return new_con;
}