(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:
twinaphex 2015-01-27 04:16:05 +01:00
parent e212f61114
commit eb0863cb39
3 changed files with 5 additions and 3 deletions

View File

@ -139,13 +139,13 @@ static void libretrodb_write_index_header(int fd, libretrodb_index_t * idx)
rmsgpack_write_uint(fd, idx->next);
}
void libretrodb_close(libretrodb_t * db)
void libretrodb_close(libretrodb_t *db)
{
close(db->fd);
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_metadata_t md;
@ -155,6 +155,7 @@ int libretrodb_open(const char * path, libretrodb_t * db)
if (fd == -1)
return -errno;
strcpy(db->path, path);
db->root = lseek(fd, 0, SEEK_CUR);
if ((rv = read(fd, &header, sizeof(header))) == -1)

View File

@ -23,6 +23,7 @@ typedef struct libretrodb
uint64_t root;
uint64_t count;
uint64_t first_index_offset;
char path[1024];
} libretrodb_t;
typedef struct libretrodb_index

View File

@ -55,7 +55,7 @@ static int menu_database_fetch_from_query(libretrodb_t *db,
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);
break;
}