From 390061c896674fca1af7d16bfadab62a30bde27f Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 3 Sep 2011 13:49:21 +0200 Subject: [PATCH] document database functions --- database.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/database.h b/database.h index 3430589..ae954f3 100644 --- a/database.h +++ b/database.h @@ -9,14 +9,43 @@ #include "zathura.h" #include "bookmarks.h" +/** + * Initialize database system. + * @param path Path to the database file. + * @return A valid zathura_database_t instance or NULL on failure + */ zathura_database_t* zathura_db_init(const char* path); +/** + * Free database instance. + * @param The database instance to free. + */ void zathura_db_free(zathura_database_t* db); +/** + * Add or update bookmark in the database. + * @param db The database instance + * @param file The file to which the bookmark belongs to. + * @param bookmark The bookmark instance. + * @return true on success, false otherwise + */ bool zathura_db_add_bookmark(zathura_database_t* db, const char* file, zathura_bookmark_t* bookmark); +/** + * Add or update bookmark in the database. + * @param db The database instance + * @param file The file to which the bookmark belongs to. + * @param bookmark The bookmark instance. + * @return true on success, false otherwise + */ bool zathura_db_remove_bookmark(zathura_database_t* db, const char* file, const char* id); +/** + * Loads all bookmarks from the database belonging to a specific file. + * @param db The database instance. + * @param file The file for which the bookmarks should be loaded. + * @return List of zathura_bookmark_t* or NULL on failure. + */ girara_list_t* zathura_db_load_bookmarks(zathura_database_t* db, const char* file); #endif // DATABASE_H