From afe0f3e2f024715b0187959fdab3f42ffac77522 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 21 Feb 2011 14:03:08 +0100 Subject: [PATCH] Make the xbps_handle struct const internally. --- include/xbps_api_impl.h | 2 +- lib/download.c | 2 +- lib/initend.c | 4 ++-- lib/package_unpack.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/xbps_api_impl.h b/include/xbps_api_impl.h index 2acb5619..46303f19 100644 --- a/include/xbps_api_impl.h +++ b/include/xbps_api_impl.h @@ -78,7 +78,7 @@ __BEGIN_DECLS * @private * From lib/initend.c */ -struct xbps_handle HIDDEN *xbps_handle_get(void); +const struct xbps_handle HIDDEN *xbps_handle_get(void); /** * @private diff --git a/lib/download.c b/lib/download.c index 19043d8c..10d9583e 100644 --- a/lib/download.c +++ b/lib/download.c @@ -91,7 +91,7 @@ xbps_fetch_file(const char *uri, bool refetch, const char *flags) { - struct xbps_handle *xhp; + const struct xbps_handle *xhp; struct stat st; struct url *url = NULL; struct url_stat url_st; diff --git a/lib/initend.c b/lib/initend.c index 8343ed02..6b524822 100644 --- a/lib/initend.c +++ b/lib/initend.c @@ -41,7 +41,7 @@ * using libxbps and finalize usage to release resources at the end. */ static bool debug; -static struct xbps_handle *xhp; +static const struct xbps_handle *xhp; void xbps_init(struct xbps_handle *xh) @@ -63,7 +63,7 @@ xbps_end(void) xhp = NULL; } -struct xbps_handle HIDDEN * +const struct xbps_handle HIDDEN * xbps_handle_get(void) { return xhp; diff --git a/lib/package_unpack.c b/lib/package_unpack.c index c9892b4a..5fd8dde7 100644 --- a/lib/package_unpack.c +++ b/lib/package_unpack.c @@ -160,7 +160,7 @@ unpack_archive(prop_dictionary_t pkg_repod, struct archive *ar, const char *pkgname, const char *version, - struct xbps_handle *xhp) + const struct xbps_handle *xhp) { prop_dictionary_t propsd = NULL, filesd = NULL, old_filesd = NULL; prop_array_t array; @@ -463,7 +463,7 @@ out: int xbps_unpack_binary_pkg(prop_dictionary_t pkg_repod) { - struct xbps_handle *xhp; + const struct xbps_handle *xhp; struct archive *ar; const char *pkgname, *version, *repoloc; char *bpkg;