From 097d5a478b32aece93013580fdb06cacbaf0e9a0 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Wed, 2 May 2012 11:08:07 +1000 Subject: Add public functions for accessing mtree data Signed-off-by: Allan McRae --- lib/libalpm/package.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'lib/libalpm/package.c') diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 0909ba9b..d77471fd 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -403,6 +403,31 @@ int SYMEXPORT alpm_pkg_changelog_close(const alpm_pkg_t *pkg, void *fp) return pkg->ops->changelog_close(pkg, fp); } +/** Open a package mtree file for reading. */ +struct archive SYMEXPORT *alpm_pkg_mtree_open(alpm_pkg_t * pkg) +{ + ASSERT(pkg != NULL, return NULL); + pkg->handle->pm_errno = 0; + return pkg->ops->mtree_open(pkg); +} + +/** Read entry from an open mtree file. */ +int SYMEXPORT alpm_pkg_mtree_next(const alpm_pkg_t * pkg, struct archive *archive, + struct archive_entry **entry) +{ + ASSERT(pkg != NULL, return -1); + pkg->handle->pm_errno = 0; + return pkg->ops->mtree_next(pkg, archive, entry); +} + +/** Close a package mtree file for reading. */ +int SYMEXPORT alpm_pkg_mtree_close(const alpm_pkg_t * pkg, struct archive *archive) +{ + ASSERT(pkg != NULL, return -1); + pkg->handle->pm_errno = 0; + return pkg->ops->mtree_close(pkg, archive); +} + int SYMEXPORT alpm_pkg_has_scriptlet(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); -- cgit v1.2.3-70-g09d2