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/alpm.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lib/libalpm/alpm.h') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index f1c6efd3..c9dc247e 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -31,6 +31,10 @@ extern "C" { #include /* off_t */ #include /* va_list */ +/* libarchive */ +#include +#include + #include /* @@ -942,6 +946,23 @@ size_t alpm_pkg_changelog_read(void *ptr, size_t size, int alpm_pkg_changelog_close(const alpm_pkg_t *pkg, void *fp); +/** Open a package mtree file for reading. + * @param pkg the local package to read the changelog of + * @return a archive structure for the package mtree file + */ +struct archive *alpm_pkg_mtree_open(alpm_pkg_t *pkg); + +/** Read next entry from a package mtree file. + * @param pkg the package that the mtree file is being read from + * @param archive the archive structure reading from the mtree file + * @param entry an archive_entry to store the entry header information + * @return 0 if end of archive is reached, non-zero otherwise. + */ +int alpm_pkg_mtree_next(const alpm_pkg_t *pkg, struct archive *archive, + struct archive_entry **entry); + +int alpm_pkg_mtree_close(const alpm_pkg_t *pkg, struct archive *archive); + /** Returns whether the package has an install scriptlet. * @return 0 if FALSE, TRUE otherwise */ -- cgit v1.2.3-24-g4f1b