summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2011-06-28 14:11:43 +1000
committerAllan McRae <allan@archlinux.org>2011-06-28 14:16:12 +1000
commit939d5a9511b2dcbb07390ecfcd23528d8034709b (patch)
tree93487183da9dfdad8c33c7fa8f6929fd810a1c29 /lib
parent64c1cf792184661a1d3dd73329f129172e688f17 (diff)
downloadpacman-939d5a9511b2dcbb07390ecfcd23528d8034709b.tar.xz
Rename pmdb_t to alpm_db_t
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/add.c2
-rw-r--r--lib/libalpm/alpm.c2
-rw-r--r--lib/libalpm/alpm.h44
-rw-r--r--lib/libalpm/be_local.c20
-rw-r--r--lib/libalpm/be_sync.c18
-rw-r--r--lib/libalpm/conflict.c2
-rw-r--r--lib/libalpm/conflict.h2
-rw-r--r--lib/libalpm/db.c70
-rw-r--r--lib/libalpm/db.h50
-rw-r--r--lib/libalpm/deps.c6
-rw-r--r--lib/libalpm/deps.h2
-rw-r--r--lib/libalpm/handle.c2
-rw-r--r--lib/libalpm/handle.h4
-rw-r--r--lib/libalpm/package.c6
-rw-r--r--lib/libalpm/package.h2
-rw-r--r--lib/libalpm/remove.c2
-rw-r--r--lib/libalpm/signing.c4
-rw-r--r--lib/libalpm/signing.h2
-rw-r--r--lib/libalpm/sync.c12
-rw-r--r--lib/libalpm/trans.c2
20 files changed, 127 insertions, 127 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index c8d21161..9c5d800e 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -457,7 +457,7 @@ static int commit_single_pkg(alpm_handle_t *handle, pmpkg_t *newpkg,
char scriptlet[PATH_MAX];
int is_upgrade = 0;
pmpkg_t *oldpkg = NULL;
- pmdb_t *db = handle->db_local;
+ alpm_db_t *db = handle->db_local;
pmtrans_t *trans = handle->trans;
snprintf(scriptlet, PATH_MAX, "%s%s-%s/install",
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 93585298..4cafa6a3 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -102,7 +102,7 @@ cleanup:
int SYMEXPORT alpm_release(alpm_handle_t *myhandle)
{
int ret = 0;
- pmdb_t *db;
+ alpm_db_t *db;
CHECK_HANDLE(myhandle, return -1);
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index d0d9e2f9..5b71e9a2 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -101,7 +101,7 @@ typedef enum _pgp_verify_t {
*/
typedef struct __alpm_handle_t alpm_handle_t;
-typedef struct __pmdb_t pmdb_t;
+typedef struct __alpm_db_t alpm_db_t;
typedef struct __pmpkg_t pmpkg_t;
typedef struct __pmtrans_t pmtrans_t;
@@ -344,13 +344,13 @@ int alpm_option_set_default_sigverify(alpm_handle_t *handle, pgp_verify_t level)
* libalpm functions.
* @return a reference to the local database
*/
-pmdb_t *alpm_option_get_localdb(alpm_handle_t *handle);
+alpm_db_t *alpm_option_get_localdb(alpm_handle_t *handle);
/** Get the list of sync databases.
- * Returns a list of pmdb_t structures, one for each registered
+ * Returns a list of alpm_db_t structures, one for each registered
* sync database.
* @param handle the context handle
- * @return a reference to an internal list of pmdb_t structures
+ * @return a reference to an internal list of alpm_db_t structures
*/
alpm_list_t *alpm_option_get_syncdbs(alpm_handle_t *handle);
@@ -359,16 +359,16 @@ alpm_list_t *alpm_option_get_syncdbs(alpm_handle_t *handle);
* @param treename the name of the sync repository
* @param check_sig what level of signature checking to perform on the
* database; note that this must be a '.sig' file type verification
- * @return a pmdb_t* on success (the value), NULL on error
+ * @return a alpm_db_t* on success (the value), NULL on error
*/
-pmdb_t *alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
+alpm_db_t *alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
pgp_verify_t check_sig);
/** Unregister a package database.
* @param db pointer to the package database to unregister
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_db_unregister(pmdb_t *db);
+int alpm_db_unregister(alpm_db_t *db);
/** Unregister all package databases.
* @param handle the context handle
@@ -380,51 +380,51 @@ int alpm_db_unregister_all(alpm_handle_t *handle);
* @param db pointer to the package database
* @return the name of the package database, NULL on error
*/
-const char *alpm_db_get_name(const pmdb_t *db);
+const char *alpm_db_get_name(const alpm_db_t *db);
/** @name Accessors to the list of servers for a database.
* @{
*/
-alpm_list_t *alpm_db_get_servers(const pmdb_t *db);
-int alpm_db_set_servers(pmdb_t *db, alpm_list_t *servers);
-int alpm_db_add_server(pmdb_t *db, const char *url);
-int alpm_db_remove_server(pmdb_t *db, const char *url);
+alpm_list_t *alpm_db_get_servers(const alpm_db_t *db);
+int alpm_db_set_servers(alpm_db_t *db, alpm_list_t *servers);
+int alpm_db_add_server(alpm_db_t *db, const char *url);
+int alpm_db_remove_server(alpm_db_t *db, const char *url);
/** @} */
-int alpm_db_update(int level, pmdb_t *db);
+int alpm_db_update(int level, alpm_db_t *db);
/** Get a package entry from a package database.
* @param db pointer to the package database to get the package from
* @param name of the package
* @return the package entry on success, NULL on error
*/
-pmpkg_t *alpm_db_get_pkg(pmdb_t *db, const char *name);
+pmpkg_t *alpm_db_get_pkg(alpm_db_t *db, const char *name);
/** Get the package cache of a package database.
* @param db pointer to the package database to get the package from
* @return the list of packages on success, NULL on error
*/
-alpm_list_t *alpm_db_get_pkgcache(pmdb_t *db);
+alpm_list_t *alpm_db_get_pkgcache(alpm_db_t *db);
/** Get a group entry from a package database.
* @param db pointer to the package database to get the group from
* @param name of the group
* @return the groups entry on success, NULL on error
*/
-pmgrp_t *alpm_db_readgrp(pmdb_t *db, const char *name);
+pmgrp_t *alpm_db_readgrp(alpm_db_t *db, const char *name);
/** Get the group cache of a package database.
* @param db pointer to the package database to get the group from
* @return the list of groups on success, NULL on error
*/
-alpm_list_t *alpm_db_get_grpcache(pmdb_t *db);
+alpm_list_t *alpm_db_get_grpcache(alpm_db_t *db);
/** Searches a database with regular expressions.
* @param db pointer to the package database to search in
* @param needles a list of regular expressions to search for
* @return the list of packages matching all regular expressions on success, NULL on error
*/
-alpm_list_t *alpm_db_search(pmdb_t *db, const alpm_list_t* needles);
+alpm_list_t *alpm_db_search(alpm_db_t *db, const alpm_list_t* needles);
/** Set install reason for a package in db.
* @param db pointer to the package database
@@ -432,7 +432,7 @@ alpm_list_t *alpm_db_search(pmdb_t *db, const alpm_list_t* needles);
* @param reason the new install reason
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_db_set_pkgreason(pmdb_t *db, const char *name, alpm_pkgreason_t reason);
+int alpm_db_set_pkgreason(alpm_db_t *db, const char *name, alpm_pkgreason_t reason);
/** @} */
@@ -635,12 +635,12 @@ alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg);
alpm_list_t *alpm_pkg_get_backup(pmpkg_t *pkg);
/** Returns the database containing pkg.
- * Returns a pointer to the pmdb_t structure the package is
+ * Returns a pointer to the alpm_db_t structure the package is
* originating from, or NULL if the package was loaded from a file.
* @param pkg a pointer to package
* @return a pointer to the DB containing pkg, or NULL.
*/
-pmdb_t *alpm_pkg_get_db(pmpkg_t *pkg);
+alpm_db_t *alpm_pkg_get_db(pmpkg_t *pkg);
/* End of pmpkg_t accessors */
/* @} */
@@ -694,7 +694,7 @@ alpm_list_t *alpm_pkg_unused_deltas(pmpkg_t *pkg);
int alpm_pkg_check_pgp_signature(pmpkg_t *pkg);
-int alpm_db_check_pgp_signature(pmdb_t *db);
+int alpm_db_check_pgp_signature(alpm_db_t *db);
/*
* Groups
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c
index 12b2d920..1422871d 100644
--- a/lib/libalpm/be_local.c
+++ b/lib/libalpm/be_local.c
@@ -273,7 +273,7 @@ static struct pkg_operations local_pkg_ops = {
.changelog_close = _cache_changelog_close,
};
-static int checkdbdir(pmdb_t *db)
+static int checkdbdir(alpm_db_t *db)
{
struct stat buf;
const char *path = _alpm_db_path(db);
@@ -314,7 +314,7 @@ static int is_dir(const char *path, struct dirent *entry)
return 0;
}
-static int local_db_validate(pmdb_t *db)
+static int local_db_validate(alpm_db_t *db)
{
struct dirent *ent = NULL;
const char *dbpath;
@@ -370,7 +370,7 @@ done:
return ret;
}
-static int local_db_populate(pmdb_t *db)
+static int local_db_populate(alpm_db_t *db)
{
size_t est_count;
int count = 0;
@@ -484,7 +484,7 @@ static int local_db_populate(pmdb_t *db)
}
/* Note: the return value must be freed by the caller */
-static char *get_pkgpath(pmdb_t *db, pmpkg_t *info)
+static char *get_pkgpath(alpm_db_t *db, pmpkg_t *info)
{
size_t len;
char *pkgpath;
@@ -498,7 +498,7 @@ static char *get_pkgpath(pmdb_t *db, pmpkg_t *info)
}
-int _alpm_local_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
+int _alpm_local_db_read(alpm_db_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
{
FILE *fp = NULL;
char path[PATH_MAX];
@@ -718,7 +718,7 @@ error:
return -1;
}
-int _alpm_local_db_prepare(pmdb_t *db, pmpkg_t *info)
+int _alpm_local_db_prepare(alpm_db_t *db, pmpkg_t *info)
{
mode_t oldmask;
int retval = 0;
@@ -742,7 +742,7 @@ int _alpm_local_db_prepare(pmdb_t *db, pmpkg_t *info)
return retval;
}
-int _alpm_local_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
+int _alpm_local_db_write(alpm_db_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
{
FILE *fp = NULL;
char path[PATH_MAX];
@@ -910,7 +910,7 @@ cleanup:
return retval;
}
-int _alpm_local_db_remove(pmdb_t *db, pmpkg_t *info)
+int _alpm_local_db_remove(alpm_db_t *db, pmpkg_t *info)
{
int ret = 0;
char *pkgpath = NULL;
@@ -930,9 +930,9 @@ struct db_operations local_db_ops = {
.unregister = _alpm_db_unregister,
};
-pmdb_t *_alpm_db_register_local(alpm_handle_t *handle)
+alpm_db_t *_alpm_db_register_local(alpm_handle_t *handle)
{
- pmdb_t *db;
+ alpm_db_t *db;
_alpm_log(handle, PM_LOG_DEBUG, "registering local database\n");
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index 4f0cc2b6..2ce343c5 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -67,7 +67,7 @@ static char *get_sync_dir(alpm_handle_t *handle)
return syncpath;
}
-static int sync_db_validate(pmdb_t *db)
+static int sync_db_validate(alpm_db_t *db)
{
pgp_verify_t check_sig;
@@ -120,7 +120,7 @@ valid:
* @code
* alpm_list_t *syncs = alpm_option_get_syncdbs();
* for(i = syncs; i; i = alpm_list_next(i)) {
- * pmdb_t *db = alpm_list_getdata(i);
+ * alpm_db_t *db = alpm_list_getdata(i);
* result = alpm_db_update(0, db);
*
* if(result < 0) {
@@ -142,7 +142,7 @@ valid:
* @return 0 on success, -1 on error (pm_errno is set accordingly), 1 if up to
* to date
*/
-int SYMEXPORT alpm_db_update(int force, pmdb_t *db)
+int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
{
char *syncpath;
alpm_list_t *i;
@@ -244,10 +244,10 @@ cleanup:
}
/* Forward decl so I don't reorganize the whole file right now */
-static int sync_db_read(pmdb_t *db, struct archive *archive,
+static int sync_db_read(alpm_db_t *db, struct archive *archive,
struct archive_entry *entry, pmpkg_t **likely_pkg);
-static pmpkg_t *load_pkg_for_entry(pmdb_t *db, const char *entryname,
+static pmpkg_t *load_pkg_for_entry(alpm_db_t *db, const char *entryname,
const char **entry_filename, pmpkg_t *likely_pkg)
{
char *pkgname = NULL, *pkgver = NULL;
@@ -360,7 +360,7 @@ static size_t estimate_package_count(struct stat *st, struct archive *archive)
return (size_t)((st->st_size / per_package) + 1);
}
-static int sync_db_populate(pmdb_t *db)
+static int sync_db_populate(alpm_db_t *db)
{
const char *dbpath;
size_t est_count;
@@ -451,7 +451,7 @@ static int sync_db_populate(pmdb_t *db)
f = alpm_list_add(f, linedup); \
} while(1) /* note the while(1) and not (0) */
-static int sync_db_read(pmdb_t *db, struct archive *archive,
+static int sync_db_read(alpm_db_t *db, struct archive *archive,
struct archive_entry *entry, pmpkg_t **likely_pkg)
{
const char *entryname, *filename;
@@ -584,10 +584,10 @@ struct db_operations sync_db_ops = {
.unregister = _alpm_db_unregister,
};
-pmdb_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
+alpm_db_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
pgp_verify_t level)
{
- pmdb_t *db;
+ alpm_db_t *db;
_alpm_log(handle, PM_LOG_DEBUG, "registering sync database '%s'\n", treename);
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index 7dd79fd7..dbe90581 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -184,7 +184,7 @@ alpm_list_t *_alpm_innerconflicts(alpm_handle_t *handle, alpm_list_t *packages)
* In case of conflict the package1 field of pmdepconflict_t contains
* the target package, package2 field contains the local package
*/
-alpm_list_t *_alpm_outerconflicts(pmdb_t *db, alpm_list_t *packages)
+alpm_list_t *_alpm_outerconflicts(alpm_db_t *db, alpm_list_t *packages)
{
alpm_list_t *baddeps = NULL;
diff --git a/lib/libalpm/conflict.h b/lib/libalpm/conflict.h
index d226ba23..83266959 100644
--- a/lib/libalpm/conflict.h
+++ b/lib/libalpm/conflict.h
@@ -27,7 +27,7 @@
pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict);
void _alpm_conflict_free(pmconflict_t *conflict);
alpm_list_t *_alpm_innerconflicts(alpm_handle_t *handle, alpm_list_t *packages);
-alpm_list_t *_alpm_outerconflicts(pmdb_t *db, alpm_list_t *packages);
+alpm_list_t *_alpm_outerconflicts(alpm_db_t *db, alpm_list_t *packages);
alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
alpm_list_t *upgrade, alpm_list_t *remove);
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 465bdd37..6872f517 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -45,7 +45,7 @@
*/
/** Register a sync database of packages. */
-pmdb_t SYMEXPORT *alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
+alpm_db_t SYMEXPORT *alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
pgp_verify_t check_sig)
{
/* Sanity checks */
@@ -59,7 +59,7 @@ pmdb_t SYMEXPORT *alpm_db_register_sync(alpm_handle_t *handle, const char *treen
}
/* Helper function for alpm_db_unregister{_all} */
-void _alpm_db_unregister(pmdb_t *db)
+void _alpm_db_unregister(alpm_db_t *db)
{
if(db == NULL) {
return;
@@ -73,7 +73,7 @@ void _alpm_db_unregister(pmdb_t *db)
int SYMEXPORT alpm_db_unregister_all(alpm_handle_t *handle)
{
alpm_list_t *i;
- pmdb_t *db;
+ alpm_db_t *db;
/* Sanity checks */
CHECK_HANDLE(handle, return -1);
@@ -91,7 +91,7 @@ int SYMEXPORT alpm_db_unregister_all(alpm_handle_t *handle)
}
/** Unregister a package database. */
-int SYMEXPORT alpm_db_unregister(pmdb_t *db)
+int SYMEXPORT alpm_db_unregister(alpm_db_t *db)
{
int found = 0;
alpm_handle_t *handle;
@@ -128,14 +128,14 @@ int SYMEXPORT alpm_db_unregister(pmdb_t *db)
}
/** Get the serverlist of a database. */
-alpm_list_t SYMEXPORT *alpm_db_get_servers(const pmdb_t *db)
+alpm_list_t SYMEXPORT *alpm_db_get_servers(const alpm_db_t *db)
{
ASSERT(db != NULL, return NULL);
return db->servers;
}
/** Set the serverlist of a database. */
-int SYMEXPORT alpm_db_set_servers(pmdb_t *db, alpm_list_t *servers)
+int SYMEXPORT alpm_db_set_servers(alpm_db_t *db, alpm_list_t *servers)
{
ASSERT(db != NULL, return -1);
if(db->servers) FREELIST(db->servers);
@@ -161,7 +161,7 @@ static char *sanitize_url(const char *url)
* @param url url of the server
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int SYMEXPORT alpm_db_add_server(pmdb_t *db, const char *url)
+int SYMEXPORT alpm_db_add_server(alpm_db_t *db, const char *url)
{
char *newurl;
@@ -187,7 +187,7 @@ int SYMEXPORT alpm_db_add_server(pmdb_t *db, const char *url)
* @return 0 on success, 1 on server not present,
* -1 on error (pm_errno is set accordingly)
*/
-int SYMEXPORT alpm_db_remove_server(pmdb_t *db, const char *url)
+int SYMEXPORT alpm_db_remove_server(alpm_db_t *db, const char *url)
{
char *newurl, *vdata = NULL;
@@ -213,14 +213,14 @@ int SYMEXPORT alpm_db_remove_server(pmdb_t *db, const char *url)
}
/** Get the name of a package database. */
-const char SYMEXPORT *alpm_db_get_name(const pmdb_t *db)
+const char SYMEXPORT *alpm_db_get_name(const alpm_db_t *db)
{
ASSERT(db != NULL, return NULL);
return db->treename;
}
/** Get a package entry from a package database. */
-pmpkg_t SYMEXPORT *alpm_db_get_pkg(pmdb_t *db, const char *name)
+pmpkg_t SYMEXPORT *alpm_db_get_pkg(alpm_db_t *db, const char *name)
{
ASSERT(db != NULL, return NULL);
db->handle->pm_errno = 0;
@@ -231,7 +231,7 @@ pmpkg_t SYMEXPORT *alpm_db_get_pkg(pmdb_t *db, const char *name)
}
/** Get the package cache of a package database. */
-alpm_list_t SYMEXPORT *alpm_db_get_pkgcache(pmdb_t *db)
+alpm_list_t SYMEXPORT *alpm_db_get_pkgcache(alpm_db_t *db)
{
ASSERT(db != NULL, return NULL);
db->handle->pm_errno = 0;
@@ -239,7 +239,7 @@ alpm_list_t SYMEXPORT *alpm_db_get_pkgcache(pmdb_t *db)
}
/** Get a group entry from a package database. */
-pmgrp_t SYMEXPORT *alpm_db_readgrp(pmdb_t *db, const char *name)
+pmgrp_t SYMEXPORT *alpm_db_readgrp(alpm_db_t *db, const char *name)
{
ASSERT(db != NULL, return NULL);
db->handle->pm_errno = 0;
@@ -250,7 +250,7 @@ pmgrp_t SYMEXPORT *alpm_db_readgrp(pmdb_t *db, const char *name)
}
/** Get the group cache of a package database. */
-alpm_list_t SYMEXPORT *alpm_db_get_grpcache(pmdb_t *db)
+alpm_list_t SYMEXPORT *alpm_db_get_grpcache(alpm_db_t *db)
{
ASSERT(db != NULL, return NULL);
db->handle->pm_errno = 0;
@@ -259,7 +259,7 @@ alpm_list_t SYMEXPORT *alpm_db_get_grpcache(pmdb_t *db)
}
/** Searches a database. */
-alpm_list_t SYMEXPORT *alpm_db_search(pmdb_t *db, const alpm_list_t* needles)
+alpm_list_t SYMEXPORT *alpm_db_search(alpm_db_t *db, const alpm_list_t* needles)
{
ASSERT(db != NULL, return NULL);
db->handle->pm_errno = 0;
@@ -268,7 +268,7 @@ alpm_list_t SYMEXPORT *alpm_db_search(pmdb_t *db, const alpm_list_t* needles)
}
/** Set install reason for a package in db. */
-int SYMEXPORT alpm_db_set_pkgreason(pmdb_t *db, const char *name, alpm_pkgreason_t reason)
+int SYMEXPORT alpm_db_set_pkgreason(alpm_db_t *db, const char *name, alpm_pkgreason_t reason)
{
ASSERT(db != NULL, return -1);
db->handle->pm_errno = 0;
@@ -297,11 +297,11 @@ int SYMEXPORT alpm_db_set_pkgreason(pmdb_t *db, const char *name, alpm_pkgreason
/** @} */
-pmdb_t *_alpm_db_new(const char *treename, int is_local)
+alpm_db_t *_alpm_db_new(const char *treename, int is_local)
{
- pmdb_t *db;
+ alpm_db_t *db;
- CALLOC(db, 1, sizeof(pmdb_t), return NULL);
+ CALLOC(db, 1, sizeof(alpm_db_t), return NULL);
STRDUP(db->treename, treename, return NULL);
db->is_local = is_local;
db->pgp_verify = PM_PGP_VERIFY_UNKNOWN;
@@ -309,7 +309,7 @@ pmdb_t *_alpm_db_new(const char *treename, int is_local)
return db;
}
-void _alpm_db_free(pmdb_t *db)
+void _alpm_db_free(alpm_db_t *db)
{
/* cleanup pkgcache */
_alpm_db_free_pkgcache(db);
@@ -322,7 +322,7 @@ void _alpm_db_free(pmdb_t *db)
return;
}
-const char *_alpm_db_path(pmdb_t *db)
+const char *_alpm_db_path(alpm_db_t *db)
{
if(!db) {
return NULL;
@@ -353,7 +353,7 @@ const char *_alpm_db_path(pmdb_t *db)
return db->_path;
}
-char *_alpm_db_sig_path(pmdb_t *db)
+char *_alpm_db_sig_path(alpm_db_t *db)
{
char *sigpath;
size_t len;
@@ -369,12 +369,12 @@ char *_alpm_db_sig_path(pmdb_t *db)
int _alpm_db_cmp(const void *d1, const void *d2)
{
- pmdb_t *db1 = (pmdb_t *)d1;
- pmdb_t *db2 = (pmdb_t *)d2;
+ alpm_db_t *db1 = (alpm_db_t *)d1;
+ alpm_db_t *db2 = (alpm_db_t *)d2;
return strcmp(db1->treename, db2->treename);
}
-alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles)
+alpm_list_t *_alpm_db_search(alpm_db_t *db, const alpm_list_t *needles)
{
const alpm_list_t *i, *j, *k;
alpm_list_t *ret = NULL;
@@ -451,7 +451,7 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles)
/* Returns a new package cache from db.
* It frees the cache if it already exists.
*/
-static int load_pkgcache(pmdb_t *db)
+static int load_pkgcache(alpm_db_t *db)
{
_alpm_db_free_pkgcache(db);
@@ -467,7 +467,7 @@ static int load_pkgcache(pmdb_t *db)
return 0;
}
-void _alpm_db_free_pkgcache(pmdb_t *db)
+void _alpm_db_free_pkgcache(alpm_db_t *db)
{
if(db == NULL || !(db->status & DB_STATUS_PKGCACHE)) {
return;
@@ -484,7 +484,7 @@ void _alpm_db_free_pkgcache(pmdb_t *db)
_alpm_db_free_grpcache(db);
}
-pmpkghash_t *_alpm_db_get_pkgcache_hash(pmdb_t *db)
+pmpkghash_t *_alpm_db_get_pkgcache_hash(alpm_db_t *db)
{
if(db == NULL) {
return NULL;
@@ -501,7 +501,7 @@ pmpkghash_t *_alpm_db_get_pkgcache_hash(pmdb_t *db)
return db->pkgcache;
}
-alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db)
+alpm_list_t *_alpm_db_get_pkgcache(alpm_db_t *db)
{
pmpkghash_t *hash = _alpm_db_get_pkgcache_hash(db);
@@ -513,7 +513,7 @@ alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db)
}
/* "duplicate" pkg then add it to pkgcache */
-int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg)
+int _alpm_db_add_pkgincache(alpm_db_t *db, pmpkg_t *pkg)
{
pmpkg_t *newpkg;
@@ -535,7 +535,7 @@ int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg)
return 0;
}
-int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg)
+int _alpm_db_remove_pkgfromcache(alpm_db_t *db, pmpkg_t *pkg)
{
pmpkg_t *data = NULL;
@@ -561,7 +561,7 @@ int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg)
return 0;
}
-pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, const char *target)
+pmpkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target)
{
if(db == NULL) {
return NULL;
@@ -577,7 +577,7 @@ pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, const char *target)
/* Returns a new group cache from db.
*/
-static int load_grpcache(pmdb_t *db)
+static int load_grpcache(alpm_db_t *db)
{
alpm_list_t *lp;
@@ -627,7 +627,7 @@ static int load_grpcache(pmdb_t *db)
return 0;
}
-void _alpm_db_free_grpcache(pmdb_t *db)
+void _alpm_db_free_grpcache(alpm_db_t *db)
{
alpm_list_t *lg;
@@ -646,7 +646,7 @@ void _alpm_db_free_grpcache(pmdb_t *db)
db->status &= ~DB_STATUS_GRPCACHE;
}
-alpm_list_t *_alpm_db_get_grpcache(pmdb_t *db)
+alpm_list_t *_alpm_db_get_grpcache(alpm_db_t *db)
{
if(db == NULL) {
return NULL;
@@ -663,7 +663,7 @@ alpm_list_t *_alpm_db_get_grpcache(pmdb_t *db)
return db->grpcache;
}
-pmgrp_t *_alpm_db_get_grpfromcache(pmdb_t *db, const char *target)
+pmgrp_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target)
{
alpm_list_t *i;
diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h
index a0c4d6a1..0e623f09 100644
--- a/lib/libalpm/db.h
+++ b/lib/libalpm/db.h
@@ -51,12 +51,12 @@ enum _pmdbstatus_t {
};
struct db_operations {
- int (*populate) (pmdb_t *);
- void (*unregister) (pmdb_t *);
+ int (*populate) (alpm_db_t *);
+ void (*unregister) (alpm_db_t *);
};
/* Database */
-struct __pmdb_t {
+struct __alpm_db_t {
alpm_handle_t *handle;
char *treename;
/* do not access directly, use _alpm_db_path(db) for lazy access */
@@ -75,36 +75,36 @@ struct __pmdb_t {
/* db.c, database general calls */
-pmdb_t *_alpm_db_new(const char *treename, int is_local);
-void _alpm_db_free(pmdb_t *db);
-const char *_alpm_db_path(pmdb_t *db);
-char *_alpm_db_sig_path(pmdb_t *db);
+alpm_db_t *_alpm_db_new(const char *treename, int is_local);
+void _alpm_db_free(alpm_db_t *db);
+const char *_alpm_db_path(alpm_db_t *db);
+char *_alpm_db_sig_path(alpm_db_t *db);
int _alpm_db_cmp(const void *d1, const void *d2);
-alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles);
-pmdb_t *_alpm_db_register_local(alpm_handle_t *handle);
-pmdb_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
+alpm_list_t *_alpm_db_search(alpm_db_t *db, const alpm_list_t *needles);
+alpm_db_t *_alpm_db_register_local(alpm_handle_t *handle);
+alpm_db_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
pgp_verify_t level);
-void _alpm_db_unregister(pmdb_t *db);
+void _alpm_db_unregister(alpm_db_t *db);
/* be_*.c, backend specific calls */
-int _alpm_local_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq);
-int _alpm_local_db_prepare(pmdb_t *db, pmpkg_t *info);
-int _alpm_local_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq);
-int _alpm_local_db_remove(pmdb_t *db, pmpkg_t *info);
+int _alpm_local_db_read(alpm_db_t *db, pmpkg_t *info, pmdbinfrq_t inforeq);
+int _alpm_local_db_prepare(alpm_db_t *db, pmpkg_t *info);
+int _alpm_local_db_write(alpm_db_t *db, pmpkg_t *info, pmdbinfrq_t inforeq);
+int _alpm_local_db_remove(alpm_db_t *db, pmpkg_t *info);
/* cache bullshit */
/* packages */
-void _alpm_db_free_pkgcache(pmdb_t *db);
-int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg);
-int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg);
-pmpkghash_t *_alpm_db_get_pkgcache_hash(pmdb_t *db);
-alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db);
-int _alpm_db_ensure_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel);
-pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, const char *target);
+void _alpm_db_free_pkgcache(alpm_db_t *db);
+int _alpm_db_add_pkgincache(alpm_db_t *db, pmpkg_t *pkg);
+int _alpm_db_remove_pkgfromcache(alpm_db_t *db, pmpkg_t *pkg);
+pmpkghash_t *_alpm_db_get_pkgcache_hash(alpm_db_t *db);
+alpm_list_t *_alpm_db_get_pkgcache(alpm_db_t *db);
+int _alpm_db_ensure_pkgcache(alpm_db_t *db, pmdbinfrq_t infolevel);
+pmpkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target);
/* groups */
-void _alpm_db_free_grpcache(pmdb_t *db);
-alpm_list_t *_alpm_db_get_grpcache(pmdb_t *db);
-pmgrp_t *_alpm_db_get_grpfromcache(pmdb_t *db, const char *target);
+void _alpm_db_free_grpcache(alpm_db_t *db);
+alpm_list_t *_alpm_db_get_grpcache(alpm_db_t *db);
+pmgrp_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target);
#endif /* _ALPM_DB_H */
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 1fae6636..b9d7a8ff 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -472,7 +472,7 @@ pmdepend_t *_alpm_dep_dup(const pmdepend_t *dep)
* targets and a db is safe to remove. We do NOT remove it if it is in the
* target list, or if if the package was explictly installed and
* include_explicit == 0 */
-static int can_remove_package(pmdb_t *db, pmpkg_t *pkg, alpm_list_t *targets,
+static int can_remove_package(alpm_db_t *db, pmpkg_t *pkg, alpm_list_t *targets,
int include_explicit)
{
alpm_list_t *i;
@@ -518,7 +518,7 @@ static int can_remove_package(pmdb_t *db, pmpkg_t *pkg, alpm_list_t *targets,
* @param *targs pointer to a list of packages
* @param include_explicit if 0, explicitly installed packages are not included
*/
-void _alpm_recursedeps(pmdb_t *db, alpm_list_t *targs, int include_explicit)
+void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit)
{
alpm_list_t *i, *j;
@@ -649,7 +649,7 @@ static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep,
* providers. The first satisfier found is returned.
* The dependency can include versions with depmod operators.
* @param handle the context handle
- * @param dbs an alpm_list_t* of pmdb_t where the satisfier will be searched
+ * @param dbs an alpm_list_t* of alpm_db_t where the satisfier will be searched
* @param depstring package or provision name, versioned or not
* @return a pmpkg_t* satisfying depstring
*/
diff --git a/lib/libalpm/deps.h b/lib/libalpm/deps.h
index 01ea4cbd..d490ab51 100644
--- a/lib/libalpm/deps.h
+++ b/lib/libalpm/deps.h
@@ -31,7 +31,7 @@ void _alpm_dep_free(pmdepend_t *dep);
pmdepend_t *_alpm_dep_dup(const pmdepend_t *dep);
void _alpm_depmiss_free(pmdepmissing_t *miss);
alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, alpm_list_t *targets, int reverse);
-void _alpm_recursedeps(pmdb_t *db, alpm_list_t *targs, int include_explicit);
+void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit);
int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, pmpkg_t *pkg,
alpm_list_t *preferred, alpm_list_t **packages, alpm_list_t *remove,
alpm_list_t **data);
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 842353d8..48b674c0 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -248,7 +248,7 @@ int SYMEXPORT alpm_option_get_checkspace(alpm_handle_t *handle)
return handle->checkspace;
}
-pmdb_t SYMEXPORT *alpm_option_get_localdb(alpm_handle_t *handle)
+alpm_db_t SYMEXPORT *alpm_option_get_localdb(alpm_handle_t *handle)
{
CHECK_HANDLE(handle, return NULL);
return handle->db_local;
diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h
index 6f5ee58a..35fe4877 100644
--- a/lib/libalpm/handle.h
+++ b/lib/libalpm/handle.h
@@ -32,8 +32,8 @@
struct __alpm_handle_t {
/* internal usage */
- pmdb_t *db_local; /* local db pointer */
- alpm_list_t *dbs_sync; /* List of (pmdb_t *) */
+ alpm_db_t *db_local; /* local db pointer */
+ alpm_list_t *dbs_sync; /* List of (alpm_db_t *) */
FILE *logstream; /* log file stream pointer */
FILE *lckstream; /* lock file stream pointer if one exists */
pmtrans_t *trans;
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 9296825c..4de14f8a 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -323,7 +323,7 @@ alpm_list_t SYMEXPORT *alpm_pkg_get_backup(pmpkg_t *pkg)
return pkg->ops->get_backup(pkg);
}
-pmdb_t SYMEXPORT *alpm_pkg_get_db(pmpkg_t *pkg)
+alpm_db_t SYMEXPORT *alpm_pkg_get_db(pmpkg_t *pkg)
{
/* Sanity checks */
ASSERT(pkg != NULL, return NULL);
@@ -372,7 +372,7 @@ int SYMEXPORT alpm_pkg_has_scriptlet(pmpkg_t *pkg)
return pkg->ops->has_scriptlet(pkg);
}
-static void find_requiredby(pmpkg_t *pkg, pmdb_t *db, alpm_list_t **reqs)
+static void find_requiredby(pmpkg_t *pkg, alpm_db_t *db, alpm_list_t **reqs)
{
const alpm_list_t *i;
pkg->handle->pm_errno = 0;
@@ -396,7 +396,7 @@ alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(pmpkg_t *pkg)
{
const alpm_list_t *i;
alpm_list_t *reqs = NULL;
- pmdb_t *db;
+ alpm_db_t *db;
ASSERT(pkg != NULL, return NULL);
pkg->handle->pm_errno = 0;
diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h
index 08a53b6b..b74d30ef 100644
--- a/lib/libalpm/package.h
+++ b/lib/libalpm/package.h
@@ -116,7 +116,7 @@ struct __pmpkg_t {
/* origin == PKG_FROM_FILE, use pkg->origin_data.file
* origin == PKG_FROM_*DB, use pkg->origin_data.db */
union {
- pmdb_t *db;
+ alpm_db_t *db;
char *file;
} origin_data;
alpm_handle_t *handle;
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 078e3e25..9a56e9b3 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -138,7 +138,7 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data)
{
alpm_list_t *lp;
pmtrans_t *trans = handle->trans;
- pmdb_t *db = handle->db_local;
+ alpm_db_t *db = handle->db_local;
if((trans->flags & PM_TRANS_FLAG_RECURSE) && !(trans->flags & PM_TRANS_FLAG_CASCADE)) {
_alpm_log(handle, PM_LOG_DEBUG, "finding removable dependencies\n");
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index c26819e7..0bab1063 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -367,7 +367,7 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
*
* @return signature verification level
*/
-pgp_verify_t _alpm_db_get_sigverify_level(pmdb_t *db)
+pgp_verify_t _alpm_db_get_sigverify_level(alpm_db_t *db)
{
if(db->pgp_verify != PM_PGP_VERIFY_UNKNOWN) {
return db->pgp_verify;
@@ -395,7 +395,7 @@ int SYMEXPORT alpm_pkg_check_pgp_signature(pmpkg_t *pkg)
* @param db the database to check
* @return a int value : 0 (valid), 1 (invalid), -1 (an error occurred)
*/
-int SYMEXPORT alpm_db_check_pgp_signature(pmdb_t *db)
+int SYMEXPORT alpm_db_check_pgp_signature(alpm_db_t *db)
{
ASSERT(db != NULL, return -1);
db->handle->pm_errno = 0;
diff --git a/lib/libalpm/signing.h b/lib/libalpm/signing.h
index 60e71afb..eb4cb18a 100644
--- a/lib/libalpm/signing.h
+++ b/lib/libalpm/signing.h
@@ -23,7 +23,7 @@
int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
const char *base64_sig);
-pgp_verify_t _alpm_db_get_sigverify_level(pmdb_t *db);
+pgp_verify_t _alpm_db_get_sigverify_level(alpm_db_t *db);
#endif /* _ALPM_SIGNING_H */
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 0dc594f3..c60f019c 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -87,7 +87,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade)
{
alpm_list_t *i, *j, *k;
pmtrans_t *trans;
- pmdb_t *db_local;
+ alpm_db_t *db_local;
alpm_list_t *dbs_sync;
CHECK_HANDLE(handle, return -1);
@@ -109,7 +109,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade)
/* Search for literal then replacers in each sync database.
* If found, don't check other databases */
for(j = dbs_sync; j; j = j->next) {
- pmdb_t *sdb = j->data;
+ alpm_db_t *sdb = j->data;
/* Check sdb */
pmpkg_t *spkg = _alpm_db_get_pkgfromcache(sdb, lpkg->name);
if(spkg) {
@@ -209,7 +209,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade)
/** Find group members across a list of databases.
* If a member exists in several databases, only the first database is used.
* IgnorePkg is also handled.
- * @param dbs the list of pmdb_t *
+ * @param dbs the list of alpm_db_t *
* @pram name the name of the group
* @return the list of pmpkg_t * (caller is responsible for alpm_list_free)
*/
@@ -219,7 +219,7 @@ alpm_list_t SYMEXPORT *alpm_find_grp_pkgs(alpm_list_t *dbs,
alpm_list_t *i, *j, *pkgs = NULL, *ignorelist = NULL;
for(i = dbs; i; i = i->next) {
- pmdb_t *db = i->data;
+ alpm_db_t *db = i->data;
pmgrp_t *grp = alpm_db_readgrp(db, name);
if(!grp)
@@ -751,7 +751,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas)
/* group sync records by repository and download */
for(i = handle->dbs_sync; i; i = i->next) {
- pmdb_t *current = i->data;
+ alpm_db_t *current = i->data;
for(j = handle->trans->add; j; j = j->next) {
pmpkg_t *spkg = j->data;
@@ -873,7 +873,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data)
filename = alpm_pkg_get_filename(spkg);
filepath = _alpm_filecache_find(handle, filename);
- pmdb_t *sdb = alpm_pkg_get_db(spkg);
+ alpm_db_t *sdb = alpm_pkg_get_db(spkg);
check_sig = _alpm_db_get_sigverify_level(sdb);
/* load the package file and replace pkgcache entry with it in the target list */
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 09afc255..7e7c2558 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -60,7 +60,7 @@ int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, pmtransflag_t flags,
ASSERT(handle->trans == NULL, RET_ERR(handle, PM_ERR_TRANS_NOT_NULL, -1));
for(i = handle->dbs_sync; i; i = i->next) {
- const pmdb_t *db = i->data;
+ const alpm_db_t *db = i->data;
if(!(db->status & DB_STATUS_VALID)) {
RET_ERR(handle, PM_ERR_DB_INVALID, -1);
}