mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 12:40:23 +00:00
Cleanups - turn some functions into static functions and move
to task_database.c
This commit is contained in:
parent
88f915dadd
commit
c8dc0fef0c
@ -659,31 +659,3 @@ void database_info_list_free(database_info_list_t *database_info_list)
|
|||||||
|
|
||||||
free(database_info_list->list);
|
free(database_info_list->list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void database_info_set_type(database_info_handle_t *handle, enum database_type type)
|
|
||||||
{
|
|
||||||
if (!handle)
|
|
||||||
return;
|
|
||||||
handle->type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum database_type database_info_get_type(database_info_handle_t *handle)
|
|
||||||
{
|
|
||||||
if (!handle)
|
|
||||||
return DATABASE_TYPE_NONE;
|
|
||||||
return handle->type;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *database_info_get_current_name(database_state_handle_t *handle)
|
|
||||||
{
|
|
||||||
if (!handle || !handle->list)
|
|
||||||
return NULL;
|
|
||||||
return handle->list->elems[handle->list_index].data;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *database_info_get_current_element_name(database_info_handle_t *handle)
|
|
||||||
{
|
|
||||||
if (!handle || !handle->list)
|
|
||||||
return NULL;
|
|
||||||
return handle->list->elems[handle->list_ptr].data;
|
|
||||||
}
|
|
||||||
|
@ -47,7 +47,6 @@ enum database_type
|
|||||||
DATABASE_TYPE_CRC_LOOKUP
|
DATABASE_TYPE_CRC_LOOKUP
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
enum database_status status;
|
enum database_status status;
|
||||||
@ -98,19 +97,6 @@ typedef struct
|
|||||||
size_t count;
|
size_t count;
|
||||||
} database_info_list_t;
|
} database_info_list_t;
|
||||||
|
|
||||||
typedef struct database_state_handle
|
|
||||||
{
|
|
||||||
database_info_list_t *info;
|
|
||||||
struct string_list *list;
|
|
||||||
size_t list_index;
|
|
||||||
size_t entry_index;
|
|
||||||
uint32_t crc;
|
|
||||||
uint32_t archive_crc;
|
|
||||||
uint8_t *buf;
|
|
||||||
char archive_name[255];
|
|
||||||
char serial[4096];
|
|
||||||
} database_state_handle_t;
|
|
||||||
|
|
||||||
database_info_list_t *database_info_list_new(const char *rdb_path,
|
database_info_list_t *database_info_list_new(const char *rdb_path,
|
||||||
const char *query);
|
const char *query);
|
||||||
|
|
||||||
@ -122,14 +108,6 @@ database_info_handle_t *database_info_dir_init(const char *dir,
|
|||||||
database_info_handle_t *database_info_file_init(const char *path,
|
database_info_handle_t *database_info_file_init(const char *path,
|
||||||
enum database_type type);
|
enum database_type type);
|
||||||
|
|
||||||
void database_info_set_type(database_info_handle_t *handle, enum database_type type);
|
|
||||||
|
|
||||||
const char *database_info_get_current_element_name(database_info_handle_t *handle);
|
|
||||||
|
|
||||||
const char *database_info_get_current_name(database_state_handle_t *handle);
|
|
||||||
|
|
||||||
enum database_type database_info_get_type(database_info_handle_t *handle);
|
|
||||||
|
|
||||||
void database_info_free(database_info_handle_t *handle);
|
void database_info_free(database_info_handle_t *handle);
|
||||||
|
|
||||||
int database_info_build_query(
|
int database_info_build_query(
|
||||||
|
@ -42,6 +42,19 @@
|
|||||||
#define COLLECTION_SIZE 99999
|
#define COLLECTION_SIZE 99999
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef struct database_state_handle
|
||||||
|
{
|
||||||
|
database_info_list_t *info;
|
||||||
|
struct string_list *list;
|
||||||
|
size_t list_index;
|
||||||
|
size_t entry_index;
|
||||||
|
uint32_t crc;
|
||||||
|
uint32_t archive_crc;
|
||||||
|
uint8_t *buf;
|
||||||
|
char archive_name[255];
|
||||||
|
char serial[4096];
|
||||||
|
} database_state_handle_t;
|
||||||
|
|
||||||
typedef struct db_handle
|
typedef struct db_handle
|
||||||
{
|
{
|
||||||
database_state_handle_t state;
|
database_state_handle_t state;
|
||||||
@ -50,6 +63,34 @@ typedef struct db_handle
|
|||||||
unsigned status;
|
unsigned status;
|
||||||
} db_handle_t;
|
} db_handle_t;
|
||||||
|
|
||||||
|
static void database_info_set_type(database_info_handle_t *handle, enum database_type type)
|
||||||
|
{
|
||||||
|
if (!handle)
|
||||||
|
return;
|
||||||
|
handle->type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
static enum database_type database_info_get_type(database_info_handle_t *handle)
|
||||||
|
{
|
||||||
|
if (!handle)
|
||||||
|
return DATABASE_TYPE_NONE;
|
||||||
|
return handle->type;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char *database_info_get_current_name(database_state_handle_t *handle)
|
||||||
|
{
|
||||||
|
if (!handle || !handle->list)
|
||||||
|
return NULL;
|
||||||
|
return handle->list->elems[handle->list_index].data;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char *database_info_get_current_element_name(database_info_handle_t *handle)
|
||||||
|
{
|
||||||
|
if (!handle || !handle->list)
|
||||||
|
return NULL;
|
||||||
|
return handle->list->elems[handle->list_ptr].data;
|
||||||
|
}
|
||||||
|
|
||||||
static int task_database_iterate_start(database_info_handle_t *db,
|
static int task_database_iterate_start(database_info_handle_t *db,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user