mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 07:13:35 +00:00
(Menu/database) Set label of MENU_FILE_RDB_ENTRY to rdb file so that we know
which database to perform query on again
This commit is contained in:
parent
e212f61114
commit
eb0863cb39
@ -139,13 +139,13 @@ static void libretrodb_write_index_header(int fd, libretrodb_index_t * idx)
|
|||||||
rmsgpack_write_uint(fd, idx->next);
|
rmsgpack_write_uint(fd, idx->next);
|
||||||
}
|
}
|
||||||
|
|
||||||
void libretrodb_close(libretrodb_t * db)
|
void libretrodb_close(libretrodb_t *db)
|
||||||
{
|
{
|
||||||
close(db->fd);
|
close(db->fd);
|
||||||
db->fd = -1;
|
db->fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int libretrodb_open(const char * path, libretrodb_t * db)
|
int libretrodb_open(const char *path, libretrodb_t *db)
|
||||||
{
|
{
|
||||||
libretrodb_header_t header;
|
libretrodb_header_t header;
|
||||||
libretrodb_metadata_t md;
|
libretrodb_metadata_t md;
|
||||||
@ -155,6 +155,7 @@ int libretrodb_open(const char * path, libretrodb_t * db)
|
|||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
|
strcpy(db->path, path);
|
||||||
db->root = lseek(fd, 0, SEEK_CUR);
|
db->root = lseek(fd, 0, SEEK_CUR);
|
||||||
|
|
||||||
if ((rv = read(fd, &header, sizeof(header))) == -1)
|
if ((rv = read(fd, &header, sizeof(header))) == -1)
|
||||||
|
@ -23,6 +23,7 @@ typedef struct libretrodb
|
|||||||
uint64_t root;
|
uint64_t root;
|
||||||
uint64_t count;
|
uint64_t count;
|
||||||
uint64_t first_index_offset;
|
uint64_t first_index_offset;
|
||||||
|
char path[1024];
|
||||||
} libretrodb_t;
|
} libretrodb_t;
|
||||||
|
|
||||||
typedef struct libretrodb_index
|
typedef struct libretrodb_index
|
||||||
|
@ -55,7 +55,7 @@ static int menu_database_fetch_from_query(libretrodb_t *db,
|
|||||||
|
|
||||||
if (!strcmp(key->string.buff, "description"))
|
if (!strcmp(key->string.buff, "description"))
|
||||||
{
|
{
|
||||||
menu_list_push(list, val->string.buff, "",
|
menu_list_push(list, val->string.buff, db->path,
|
||||||
MENU_FILE_RDB_ENTRY, 0);
|
MENU_FILE_RDB_ENTRY, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user