summaryrefslogtreecommitdiff
path: root/lib/libalpm/db.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/db.c')
-rw-r--r--lib/libalpm/db.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index f6f810c0..b6a436f1 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -219,6 +219,14 @@ const char SYMEXPORT *alpm_db_get_name(const alpm_db_t *db)
return db->treename;
}
+/** Check the validity of a database. */
+int SYMEXPORT alpm_db_get_valid(alpm_db_t *db)
+{
+ ASSERT(db != NULL, return -1);
+ db->handle->pm_errno = 0;
+ return db->ops->validate(db);
+}
+
/** Get a package entry from a package database. */
alpm_pkg_t SYMEXPORT *alpm_db_get_pkg(alpm_db_t *db, const char *name)
{