mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 07:13:35 +00:00
Move and rename - menu_database_push_query
This commit is contained in:
parent
84d739d8e6
commit
f7de1a18d6
@ -20,6 +20,39 @@
|
||||
#include "../playlist.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
static int menu_database_push_query(libretrodb_t *db,
|
||||
libretrodb_cursor_t *cur, file_list_t *list)
|
||||
{
|
||||
unsigned i;
|
||||
struct rmsgpack_dom_value item;
|
||||
|
||||
while (libretrodb_cursor_read_item(cur, &item) == 0)
|
||||
{
|
||||
if (item.type != RDT_MAP)
|
||||
continue;
|
||||
|
||||
for (i = 0; i < item.map.len; i++)
|
||||
{
|
||||
struct rmsgpack_dom_value *key = &item.map.items[i].key;
|
||||
struct rmsgpack_dom_value *val = &item.map.items[i].value;
|
||||
|
||||
if (!key || !val)
|
||||
continue;
|
||||
|
||||
if (!strcmp(key->string.buff, "name"))
|
||||
{
|
||||
menu_list_push(list, val->string.buff, db->path,
|
||||
MENU_FILE_RDB_ENTRY, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int menu_database_populate_query(file_list_t *list, const char *path,
|
||||
const char *query)
|
||||
{
|
||||
@ -31,7 +64,7 @@ int menu_database_populate_query(file_list_t *list, const char *path,
|
||||
return -1;
|
||||
if ((database_open_cursor(&db, &cur, query) != 0))
|
||||
return -1;
|
||||
if ((menu_entries_push_query(&db, &cur, list)) != 0)
|
||||
if ((menu_database_push_query(&db, &cur, list)) != 0)
|
||||
return -1;
|
||||
|
||||
libretrodb_cursor_close(&cur);
|
||||
|
@ -48,40 +48,6 @@ int menu_entries_setting_set_flags(rarch_setting_t *setting)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
int menu_entries_push_query(libretrodb_t *db,
|
||||
libretrodb_cursor_t *cur, file_list_t *list)
|
||||
{
|
||||
unsigned i;
|
||||
struct rmsgpack_dom_value item;
|
||||
|
||||
while (libretrodb_cursor_read_item(cur, &item) == 0)
|
||||
{
|
||||
if (item.type != RDT_MAP)
|
||||
continue;
|
||||
|
||||
for (i = 0; i < item.map.len; i++)
|
||||
{
|
||||
struct rmsgpack_dom_value *key = &item.map.items[i].key;
|
||||
struct rmsgpack_dom_value *val = &item.map.items[i].value;
|
||||
|
||||
if (!key || !val)
|
||||
continue;
|
||||
|
||||
if (!strcmp(key->string.buff, "name"))
|
||||
{
|
||||
menu_list_push(list, val->string.buff, db->path,
|
||||
MENU_FILE_RDB_ENTRY, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void menu_entries_content_list_push(
|
||||
file_list_t *list, core_info_t *info, const char* path)
|
||||
{
|
||||
|
@ -55,11 +55,6 @@ int menu_entries_push_horizontal_menu_list(menu_handle_t *menu,
|
||||
const char *path, const char *label,
|
||||
unsigned menu_type);
|
||||
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
int menu_entries_push_query(libretrodb_t *db,
|
||||
libretrodb_cursor_t *cur, file_list_t *list);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user