From de36c5fac4ab50259418c3850b6fb25b96b702f3 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 3 Jun 2011 12:23:32 -0500 Subject: Push down extern handle variable to files that need it This will make the patching process less invasive as we start to remove this variable from all source files. Signed-off-by: Dan McGee --- lib/libalpm/add.c | 3 +++ lib/libalpm/alpm.c | 1 + lib/libalpm/be_local.c | 2 ++ lib/libalpm/be_package.c | 3 +++ lib/libalpm/be_sync.c | 3 +++ lib/libalpm/conflict.c | 3 +++ lib/libalpm/db.c | 3 +++ lib/libalpm/deps.c | 3 +++ lib/libalpm/diskspace.c | 3 +++ lib/libalpm/dload.c | 3 +++ lib/libalpm/error.c | 3 +++ lib/libalpm/handle.h | 3 --- lib/libalpm/log.c | 3 +++ lib/libalpm/package.c | 3 +++ lib/libalpm/remove.c | 3 +++ lib/libalpm/sync.c | 3 +++ lib/libalpm/trans.c | 3 +++ lib/libalpm/util.c | 3 +++ 18 files changed, 48 insertions(+), 3 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index e9dc7dcd..13d3fc4a 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -47,6 +47,9 @@ #include "remove.h" #include "handle.h" +/* global handle variable */ +extern pmhandle_t *handle; + /** Add a package to the transaction. */ int SYMEXPORT alpm_add_pkg(pmpkg_t *pkg) { diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index a13d653a..17fe5cd8 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -35,6 +35,7 @@ /* Globals */ enum _pmerrno_t pm_errno SYMEXPORT; +extern pmhandle_t *handle; /** \addtogroup alpm_interface Interface Functions * @brief Functions to initialize and release libalpm diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 738bdfeb..1f509d19 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -41,6 +41,8 @@ #include "package.h" #include "deps.h" +/* global handle variable */ +extern pmhandle_t *handle; #define LAZY_LOAD(info, errret) \ do { \ diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index a3d5304d..c70d1e9a 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -36,6 +36,9 @@ #include "package.h" #include "deps.h" /* _alpm_splitdep */ +/* global handle variable */ +extern pmhandle_t *handle; + /** * Open a package changelog for reading. Similar to fopen in functionality, * except that the returned 'file stream' is from an archive. diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index ab0001ec..2e472b3d 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -37,6 +37,9 @@ #include "deps.h" #include "dload.h" +/* global handle variable */ +extern pmhandle_t *handle; + /** Update a package database * * An update of the package database \a db will be attempted. Unless diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 12a68cfe..ae34785b 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -40,6 +40,9 @@ #include "log.h" #include "deps.h" +/* global handle variable */ +extern pmhandle_t *handle; + pmconflict_t *_alpm_conflict_new(const char *package1, const char *package2, const char *reason) { diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index a1587230..c297bc69 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -39,6 +39,9 @@ #include "package.h" #include "group.h" +/* global handle variable */ +extern pmhandle_t *handle; + /** \addtogroup alpm_databases Database Functions * @brief Functions to query and manipulate the database of libalpm * @{ diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 2d6b5b32..27d04765 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -36,6 +36,9 @@ #include "db.h" #include "handle.h" +/* global handle variable */ +extern pmhandle_t *handle; + void _alpm_dep_free(pmdepend_t *dep) { FREE(dep->name); diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 102b42c6..f864518e 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -51,6 +51,9 @@ #include "trans.h" #include "handle.h" +/* global handle variable */ +extern pmhandle_t *handle; + static int mount_point_cmp(const void *p1, const void *p2) { const alpm_mountpoint_t *mp1 = p1; diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 9583b363..8591c9d5 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -42,6 +42,9 @@ #include "util.h" #include "handle.h" +/* global handle variable */ +extern pmhandle_t *handle; + #ifdef HAVE_LIBCURL static double prevprogress; /* last download amount */ #endif diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c index 4d4a065c..294ec214 100644 --- a/lib/libalpm/error.c +++ b/lib/libalpm/error.c @@ -29,6 +29,9 @@ #include "alpm.h" #include "handle.h" +/* global handle variable */ +extern pmhandle_t *handle; + const char SYMEXPORT *alpm_strerrorlast(void) { return alpm_strerror(pm_errno); diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h index 08dbe739..129c8ca4 100644 --- a/lib/libalpm/handle.h +++ b/lib/libalpm/handle.h @@ -75,9 +75,6 @@ struct __pmhandle_t { pgp_verify_t sigverify; /* Default signature verification level */ }; -/* global handle variable */ -extern pmhandle_t *handle; - pmhandle_t *_alpm_handle_new(void); void _alpm_handle_free(pmhandle_t *handle); diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index f500754d..20d1ec37 100644 --- a/lib/libalpm/log.c +++ b/lib/libalpm/log.c @@ -30,6 +30,9 @@ #include "util.h" #include "alpm.h" +/* global handle variable */ +extern pmhandle_t *handle; + /** \addtogroup alpm_log Logging Functions * @brief Functions to log using libalpm * @{ diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index d19549d1..10ec82f1 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -37,6 +37,9 @@ #include "handle.h" #include "deps.h" +/* global handle variable */ +extern pmhandle_t *handle; + /** \addtogroup alpm_packages Package Functions * @brief Functions to manipulate libalpm packages * @{ diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 48348fa2..c983edba 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -44,6 +44,9 @@ #include "deps.h" #include "handle.h" +/* global handle variable */ +extern pmhandle_t *handle; + int SYMEXPORT alpm_remove_pkg(pmpkg_t *pkg) { pmtrans_t *trans; diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index b84d6256..8390a2c2 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -50,6 +50,9 @@ #include "diskspace.h" #include "signing.h" +/* global handle variable */ +extern pmhandle_t *handle; + /** Check for new version of pkg in sync repos * (only the first occurrence is considered in sync) */ diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 31c5885c..50539c0b 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -43,6 +43,9 @@ #include "sync.h" #include "alpm.h" +/* global handle variable */ +extern pmhandle_t *handle; + /** \addtogroup alpm_trans Transaction Functions * @brief Functions to manipulate libalpm transactions * @{ diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 19186312..6479f85a 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -57,6 +57,9 @@ #include "alpm_list.h" #include "handle.h" +/* global handle variable */ +extern pmhandle_t *handle; + #ifndef HAVE_STRSEP /* This is a replacement for strsep which is not portable (missing on Solaris). * Copyright (c) 2001 by François Gouget */ -- cgit v1.2.3-70-g09d2