This will make the patching process less invasive as we start to remove this variable from all source files. Signed-off-by: Dan McGee <dan@archlinux.org> --- 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(-) diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index e9dc7dc..13d3fc4 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 a13d653..17fe5cd 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 738bdfe..1f509d1 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 a3d5304..c70d1e9 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 ab0001e..2e472b3 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 12a68cf..ae34785 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 a158723..c297bc6 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 2d6b5b3..27d0476 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 102b42c..f864518 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 9583b36..8591c9d 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 4d4a065..294ec21 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 08dbe73..129c8ca 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 f500754..20d1ec3 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 d19549d..10ec82f 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 48348fa..c983edb 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 b84d625..8390a2c 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 31c5885..50539c0 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 1918631..6479f85 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 <fgouget_at_codeweavers.com> */ -- 1.7.5.2