diff --git a/zathura/database.c b/zathura/database.c index 92a8c34..62c69df 100644 --- a/zathura/database.c +++ b/zathura/database.c @@ -68,3 +68,11 @@ zathura_db_get_fileinfo(zathura_database_t* db, const char* file, return ZATHURA_DATABASE_GET_INTERFACE(db)->get_fileinfo(db, file, file_info); } + +girara_list_t* +zathura_db_get_recent_files(zathura_database_t* db) +{ + g_return_val_if_fail(ZATHURA_IS_DATABASE(db), NULL); + + return ZATHURA_DATABASE_GET_INTERFACE(db)->get_recent_files(db); +} diff --git a/zathura/database.h b/zathura/database.h index 5cc5eea..7804411 100644 --- a/zathura/database.h +++ b/zathura/database.h @@ -50,6 +50,8 @@ struct _ZathuraDatabaseInterface bool (*set_fileinfo)(ZathuraDatabase* db, const char* file, zathura_fileinfo_t* file_info); bool (*get_fileinfo)(ZathuraDatabase* db, const char* file, zathura_fileinfo_t* file_info); + + girara_list_t* (*get_recent_files)(ZathuraDatabase* db); }; GType zathura_database_get_type(void); @@ -128,4 +130,13 @@ bool zathura_db_set_fileinfo(zathura_database_t* db, const char* file, bool zathura_db_get_fileinfo(zathura_database_t* db, const char* file, zathura_fileinfo_t* file_info); +/* Get a list of recent files from the database. The most recent file is listed + * first. + * + * @param db The database instance + * @return list of files + */ +girara_list_t* zathura_db_get_recent_files(zathura_database_t* db); + + #endif // DATABASE_H