R_API void r_core_anal_type_init(RCore *core) {
	Sdb *types = NULL;
	const char *anal_arch = NULL, *os = NULL;
	int bits = 0;
	char *dbpath;
	if (!core || !core->anal) {
		return;
	}
	bits = core->assembler->bits;
	types = core->anal->sdb_types;
 	// make sure they are empty this is initializing
	sdb_reset (types);
	anal_arch = r_config_get (core->config, "anal.arch");
	os = r_config_get (core->config, "asm.os");
	if (r_file_exists (DBSPATH"/types.sdb")) {
		sdb_concat_by_path (types, DBSPATH"/types.sdb");
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%s.sdb", anal_arch);
	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%s.sdb", os);
	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%d.sdb", bits);

	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%s-%d.sdb", os, bits);
	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%s-%d.sdb", anal_arch, bits);
	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%s-%s.sdb", anal_arch, os);
	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%s-%s-%d.sdb", anal_arch, os, bits);
	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
}
R_API void r_core_anal_type_init(RCore *core) {
	Sdb *types = NULL;
	const char *anal_arch = NULL, *os = NULL;
	int bits = 0;
	char *dbpath;
	if (!core || !core->anal) {
		return;
	}
	bits = core->assembler->bits;
	types = core->anal->sdb_types;
 	 
	sdb_reset (types);
	anal_arch = r_config_get (core->config, "anal.arch");
	os = r_config_get (core->config, "asm.os");
	if (r_file_exists (DBSPATH"/types.sdb")) {
		sdb_concat_by_path (types, DBSPATH"/types.sdb");
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%s.sdb", anal_arch);
	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%s.sdb", os);
	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%d.sdb", bits);

	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%s-%d.sdb", os, bits);
	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%s-%d.sdb", anal_arch, bits);
	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%s-%s.sdb", anal_arch, os);
	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
	dbpath = sdb_fmt (-1, DBSPATH"/types-%s-%s-%d.sdb", anal_arch, os, bits);
	if (r_file_exists (dbpath)) {
		sdb_concat_by_path (types, dbpath);
	}
}