zathura
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
database.c File Reference
#include "database.h"

Go to the source code of this file.

Functions

bool zathura_db_add_bookmark (zathura_database_t *db, const char *file, zathura_bookmark_t *bookmark)
bool zathura_db_remove_bookmark (zathura_database_t *db, const char *file, const char *id)
girara_list_t * zathura_db_load_bookmarks (zathura_database_t *db, const char *file)
girara_list_t * zathura_db_load_jumplist (zathura_database_t *db, const char *file)
bool zathura_db_save_jumplist (zathura_database_t *db, const char *file, girara_list_t *jumplist)
bool zathura_db_set_fileinfo (zathura_database_t *db, const char *file, zathura_fileinfo_t *file_info)
bool zathura_db_get_fileinfo (zathura_database_t *db, const char *file, zathura_fileinfo_t *file_info)

Function Documentation

bool zathura_db_add_bookmark ( zathura_database_t db,
const char *  file,
zathura_bookmark_t *  bookmark 
)

Add or update bookmark in the database.

Parameters
dbThe database instance
fileThe file to which the bookmark belongs.
bookmarkThe bookmark instance.
Returns
true on success, false otherwise

Definition at line 13 of file database.c.

bool zathura_db_get_fileinfo ( zathura_database_t db,
const char *  file,
zathura_fileinfo_t file_info 
)

Definition at line 64 of file database.c.

girara_list_t* zathura_db_load_bookmarks ( zathura_database_t db,
const char *  file 
)

Loads all bookmarks from the database belonging to a specific file.

Parameters
dbThe database instance.
fileThe file for which the bookmarks should be loaded.
Returns
List of zathura_bookmark_t* or NULL on failure.

Definition at line 31 of file database.c.

girara_list_t* zathura_db_load_jumplist ( ZathuraDatabase db,
const char *  file 
)

Load the jumplist belonging to the specified file from the database.

Parameters
dbThe database instance.
fileThe file to which the jumplist belongs.

return A linked list constituting the jumplist of the specified file.

Definition at line 39 of file database.c.

bool zathura_db_remove_bookmark ( zathura_database_t db,
const char *  file,
const char *  id 
)

Remove a bookmark from the database.

Parameters
dbThe database instance
fileThe file to which the bookmark belongs.
idThe id of the bookmark
Returns
true on success, false otherwise

Definition at line 22 of file database.c.

bool zathura_db_save_jumplist ( ZathuraDatabase db,
const char *  file,
girara_list_t *  jumplist 
)

Save the jumplist belonging to the specified file to the database.

Parameters
dbThe database instance.
fileThe file to which the jumplist belongs.
jumplistThe jumplist to be saved

return true on success, false otherwise.

Definition at line 47 of file database.c.

bool zathura_db_set_fileinfo ( zathura_database_t db,
const char *  file,
zathura_fileinfo_t file_info 
)

Set file info (last site, ...) in the database.

Parameters
dbThe database instance
fileThe file to which the file info belongs.
file_infoThe file info
Returns
true on success, false otherwise.

Definition at line 55 of file database.c.