From 7d27cf8364b9c5d9a8d89017173f8c88d40cedd5 Mon Sep 17 00:00:00 2001
From: Dan McGee <dan@archlinux.org>
Date: Tue, 7 Jun 2011 13:34:30 -0500
Subject: Require handle for alpm_db_register_sync()

Signed-off-by: Dan McGee <dan@archlinux.org>
---
 lib/libalpm/alpm.h | 4 +++-
 lib/libalpm/db.c   | 5 +----
 2 files changed, 4 insertions(+), 5 deletions(-)

(limited to 'lib')

diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index d63b9877..50ab06ef 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -268,15 +268,17 @@ pmdb_t *alpm_option_get_localdb(pmhandle_t *handle);
 /** Get the list of sync databases.
  * Returns a list of pmdb_t structures, one for each registered
  * sync database.
+ * @param handle the context handle
  * @return a reference to an internal list of pmdb_t structures
  */
 alpm_list_t *alpm_option_get_syncdbs(pmhandle_t *handle);
 
 /** Register a sync database of packages.
+ * @param handle the context handle
  * @param treename the name of the sync repository
  * @return a pmdb_t* on success (the value), NULL on error
  */
-pmdb_t *alpm_db_register_sync(const char *treename);
+pmdb_t *alpm_db_register_sync(pmhandle_t *handle, const char *treename);
 
 /** Unregister a package database.
  * @param db pointer to the package database to unregister
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 61143349..8156f2ac 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -39,16 +39,13 @@
 #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
  * @{
  */
 
 /** Register a sync database of packages. */
-pmdb_t SYMEXPORT *alpm_db_register_sync(const char *treename)
+pmdb_t SYMEXPORT *alpm_db_register_sync(pmhandle_t *handle, const char *treename)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, NULL));
-- 
cgit v1.2.3-54-g00ecf