From 64c1cf792184661a1d3dd73329f129172e688f17 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:04:00 +1000 Subject: Rename pmhandle_t to alpm_handle_t Signed-off-by: Allan McRae --- src/util/cleanupdelta.c | 2 +- src/util/pactree.c | 2 +- src/util/testdb.c | 2 +- src/util/testpkg.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/util') diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c index 5ee59dbb..80fcec3d 100644 --- a/src/util/cleanupdelta.c +++ b/src/util/cleanupdelta.c @@ -29,7 +29,7 @@ #define BASENAME "cleanupdelta" -pmhandle_t *handle = NULL; +alpm_handle_t *handle = NULL; static void cleanup(int signum) { if(handle && alpm_release(handle) == -1) { diff --git a/src/util/pactree.c b/src/util/pactree.c index 5beaa5a7..35ef9439 100644 --- a/src/util/pactree.c +++ b/src/util/pactree.c @@ -76,7 +76,7 @@ static struct color_choices no_color = { }; /* globals */ -pmhandle_t *handle = NULL; +alpm_handle_t *handle = NULL; alpm_list_t *walked = NULL; alpm_list_t *provisions = NULL; diff --git a/src/util/testdb.c b/src/util/testdb.c index af5007e2..ca007454 100644 --- a/src/util/testdb.c +++ b/src/util/testdb.c @@ -31,7 +31,7 @@ #define BASENAME "testdb" -pmhandle_t *handle = NULL; +alpm_handle_t *handle = NULL; static void cleanup(int signum) { if(handle && alpm_release(handle) == -1) { diff --git a/src/util/testpkg.c b/src/util/testpkg.c index d4d058d8..93d3fccd 100644 --- a/src/util/testpkg.c +++ b/src/util/testpkg.c @@ -40,7 +40,7 @@ static void output_cb(pmloglevel_t level, const char *fmt, va_list args) int main(int argc, char *argv[]) { int retval = 1; /* default = false */ - pmhandle_t *handle; + alpm_handle_t *handle; enum _pmerrno_t err; pmpkg_t *pkg = NULL; -- cgit v1.2.3-70-g09d2 From 939d5a9511b2dcbb07390ecfcd23528d8034709b Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:11:43 +1000 Subject: Rename pmdb_t to alpm_db_t Signed-off-by: Allan McRae --- lib/libalpm/add.c | 2 +- lib/libalpm/alpm.c | 2 +- lib/libalpm/alpm.h | 44 +++++++++++++++---------------- lib/libalpm/be_local.c | 20 +++++++------- lib/libalpm/be_sync.c | 18 ++++++------- lib/libalpm/conflict.c | 2 +- lib/libalpm/conflict.h | 2 +- lib/libalpm/db.c | 70 ++++++++++++++++++++++++------------------------- lib/libalpm/db.h | 50 +++++++++++++++++------------------ lib/libalpm/deps.c | 6 ++--- lib/libalpm/deps.h | 2 +- lib/libalpm/handle.c | 2 +- lib/libalpm/handle.h | 4 +-- lib/libalpm/package.c | 6 ++--- lib/libalpm/package.h | 2 +- lib/libalpm/remove.c | 2 +- lib/libalpm/signing.c | 4 +-- lib/libalpm/signing.h | 2 +- lib/libalpm/sync.c | 12 ++++----- lib/libalpm/trans.c | 2 +- src/pacman/conf.c | 4 +-- src/pacman/database.c | 2 +- src/pacman/deptest.c | 2 +- src/pacman/query.c | 10 +++---- src/pacman/remove.c | 2 +- src/pacman/sync.c | 40 ++++++++++++++-------------- src/pacman/util.c | 8 +++--- src/util/cleanupdelta.c | 2 +- src/util/testdb.c | 4 +-- 29 files changed, 164 insertions(+), 164 deletions(-) (limited to 'src/util') 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); } diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 0e7429eb..d3dbc9da 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -378,7 +378,7 @@ static int _parse_options(const char *key, char *value, return 0; } -static int _add_mirror(pmdb_t *db, char *value) +static int _add_mirror(alpm_db_t *db, char *value) { const char *dbname = alpm_db_get_name(db); /* let's attempt a replacement for the current repo */ @@ -535,7 +535,7 @@ static int finish_section(struct section_t *section, int parse_options) { int ret = 0; alpm_list_t *i; - pmdb_t *db; + alpm_db_t *db; pm_printf(PM_LOG_DEBUG, "config: finish section '%s'\n", section->name); diff --git a/src/pacman/database.c b/src/pacman/database.c index 6a06ca33..b7490cea 100644 --- a/src/pacman/database.c +++ b/src/pacman/database.c @@ -40,7 +40,7 @@ int pacman_database(alpm_list_t *targets) { alpm_list_t *i; - pmdb_t *db_local; + alpm_db_t *db_local; int retval = 0; alpm_pkgreason_t reason; diff --git a/src/pacman/deptest.c b/src/pacman/deptest.c index 99abd72d..0055c37e 100644 --- a/src/pacman/deptest.c +++ b/src/pacman/deptest.c @@ -33,7 +33,7 @@ int pacman_deptest(alpm_list_t *targets) { alpm_list_t *i; alpm_list_t *deps = NULL; - pmdb_t *localdb = alpm_option_get_localdb(config->handle); + alpm_db_t *localdb = alpm_option_get_localdb(config->handle); for(i = targets; i; i = alpm_list_next(i)) { char *target = alpm_list_getdata(i); diff --git a/src/pacman/query.c b/src/pacman/query.c index 62472cb7..e0ec2c68 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -113,7 +113,7 @@ static int query_fileowner(alpm_list_t *targets) char *append; size_t max_length; alpm_list_t *t; - pmdb_t *db_local; + alpm_db_t *db_local; /* This code is here for safety only */ if(targets == NULL) { @@ -240,7 +240,7 @@ static int query_search(alpm_list_t *targets) { alpm_list_t *i, *searchlist; int freelist; - pmdb_t *db_local = alpm_option_get_localdb(config->handle); + alpm_db_t *db_local = alpm_option_get_localdb(config->handle); /* if we have a targets list, search for packages matching it */ if(targets) { @@ -299,7 +299,7 @@ static int query_group(alpm_list_t *targets) alpm_list_t *i, *j; char *grpname = NULL; int ret = 0; - pmdb_t *db_local = alpm_option_get_localdb(config->handle); + alpm_db_t *db_local = alpm_option_get_localdb(config->handle); if(targets == NULL) { for(j = alpm_db_get_grpcache(db_local); j; j = alpm_list_next(j)) { @@ -343,7 +343,7 @@ static int is_foreign(pmpkg_t *pkg) int match = 0; for(j = sync_dbs; j; j = alpm_list_next(j)) { - pmdb_t *db = alpm_list_getdata(j); + alpm_db_t *db = alpm_list_getdata(j); pmpkg_t *findpkg = alpm_db_get_pkg(db, pkgname); if(findpkg) { match = 1; @@ -483,7 +483,7 @@ int pacman_query(alpm_list_t *targets) int match = 0; alpm_list_t *i; pmpkg_t *pkg = NULL; - pmdb_t *db_local; + alpm_db_t *db_local; /* First: operations that do not require targets */ diff --git a/src/pacman/remove.c b/src/pacman/remove.c index 60027ae2..f30f5068 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -34,7 +34,7 @@ static int remove_target(const char *target) { pmpkg_t *info; - pmdb_t *db_local = alpm_option_get_localdb(config->handle); + alpm_db_t *db_local = alpm_option_get_localdb(config->handle); alpm_list_t *p; if((info = alpm_db_get_pkg(db_local, target)) != NULL) { diff --git a/src/pacman/sync.c b/src/pacman/sync.c index fa30b8da..9dde7605 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -95,7 +95,7 @@ static int sync_cleandb(const char *dbpath, int keep_used) len = strlen(dname); char *dbname = strndup(dname, len - 3); for(i = syncdbs; i && !found; i = alpm_list_next(i)) { - pmdb_t *db = alpm_list_getdata(i); + alpm_db_t *db = alpm_list_getdata(i); found = !strcmp(dbname, alpm_db_get_name(db)); } free(dbname); @@ -146,7 +146,7 @@ static int sync_cleancache(int level) { alpm_list_t *i; alpm_list_t *sync_dbs = alpm_option_get_syncdbs(config->handle); - pmdb_t *db_local = alpm_option_get_localdb(config->handle); + alpm_db_t *db_local = alpm_option_get_localdb(config->handle); alpm_list_t *cachedirs = alpm_option_get_cachedirs(config->handle); int ret = 0; @@ -249,7 +249,7 @@ static int sync_cleancache(int level) alpm_list_t *j; /* check if this package is in a sync DB */ for(j = sync_dbs; j && delete; j = alpm_list_next(j)) { - pmdb_t *db = alpm_list_getdata(j); + alpm_db_t *db = alpm_list_getdata(j); pkg = alpm_db_get_pkg(db, local_name); if(pkg != NULL && alpm_pkg_vercmp(local_version, alpm_pkg_get_version(pkg)) == 0) { @@ -284,7 +284,7 @@ static int sync_synctree(int level, alpm_list_t *syncs) int success = 0, ret; for(i = syncs; i; i = alpm_list_next(i)) { - pmdb_t *db = alpm_list_getdata(i); + alpm_db_t *db = alpm_list_getdata(i); ret = alpm_db_update((level < 2 ? 0 : 1), db); if(ret < 0) { @@ -308,7 +308,7 @@ static int sync_synctree(int level, alpm_list_t *syncs) return (success > 0); } -static void print_installed(pmdb_t *db_local, pmpkg_t *pkg) +static void print_installed(alpm_db_t *db_local, pmpkg_t *pkg) { const char *pkgname = alpm_pkg_get_name(pkg); const char *pkgver = alpm_pkg_get_version(pkg); @@ -329,10 +329,10 @@ static int sync_search(alpm_list_t *syncs, alpm_list_t *targets) alpm_list_t *i, *j, *ret; int freelist; int found = 0; - pmdb_t *db_local = alpm_option_get_localdb(config->handle); + alpm_db_t *db_local = alpm_option_get_localdb(config->handle); for(i = syncs; i; i = alpm_list_next(i)) { - pmdb_t *db = alpm_list_getdata(i); + alpm_db_t *db = alpm_list_getdata(i); /* if we have a targets list, search for packages matching it */ if(targets) { ret = alpm_db_search(db, targets); @@ -397,7 +397,7 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets) for(i = targets; i; i = alpm_list_next(i)) { const char *grpname = alpm_list_getdata(i); for(j = syncs; j; j = alpm_list_next(j)) { - pmdb_t *db = alpm_list_getdata(j); + alpm_db_t *db = alpm_list_getdata(j); pmgrp_t *grp = alpm_db_readgrp(db, grpname); if(grp) { @@ -415,7 +415,7 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets) } } else { for(i = syncs; i; i = alpm_list_next(i)) { - pmdb_t *db = alpm_list_getdata(i); + alpm_db_t *db = alpm_list_getdata(i); for(j = alpm_db_get_grpcache(db); j; j = alpm_list_next(j)) { pmgrp_t *grp = alpm_list_getdata(j); @@ -451,7 +451,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) strncpy(target, i->data, 512); pkgstr = strchr(target, '/'); if(pkgstr) { - pmdb_t *db = NULL; + alpm_db_t *db = NULL; repo = target; *pkgstr = '\0'; ++pkgstr; @@ -489,7 +489,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) pkgstr = target; for(j = syncs; j; j = alpm_list_next(j)) { - pmdb_t *db = alpm_list_getdata(j); + alpm_db_t *db = alpm_list_getdata(j); for(k = alpm_db_get_pkgcache(db); k; k = alpm_list_next(k)) { pmpkg_t *pkg = alpm_list_getdata(k); @@ -510,7 +510,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) } } else { for(i = syncs; i; i = alpm_list_next(i)) { - pmdb_t *db = alpm_list_getdata(i); + alpm_db_t *db = alpm_list_getdata(i); for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) { pmpkg_t *pkg = alpm_list_getdata(j); @@ -525,15 +525,15 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) static int sync_list(alpm_list_t *syncs, alpm_list_t *targets) { alpm_list_t *i, *j, *ls = NULL; - pmdb_t *db_local = alpm_option_get_localdb(config->handle); + alpm_db_t *db_local = alpm_option_get_localdb(config->handle); if(targets) { for(i = targets; i; i = alpm_list_next(i)) { const char *repo = alpm_list_getdata(i); - pmdb_t *db = NULL; + alpm_db_t *db = NULL; for(j = syncs; j; j = alpm_list_next(j)) { - pmdb_t *d = alpm_list_getdata(j); + alpm_db_t *d = alpm_list_getdata(j); if(strcmp(repo, alpm_db_get_name(d)) == 0) { db = d; @@ -555,7 +555,7 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets) } for(i = ls; i; i = alpm_list_next(i)) { - pmdb_t *db = alpm_list_getdata(i); + alpm_db_t *db = alpm_list_getdata(i); for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) { pmpkg_t *pkg = alpm_list_getdata(j); @@ -580,7 +580,7 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets) static alpm_list_t *syncfirst(void) { alpm_list_t *i, *res = NULL; - pmdb_t *db_local = alpm_option_get_localdb(config->handle); + alpm_db_t *db_local = alpm_option_get_localdb(config->handle); alpm_list_t *syncdbs = alpm_option_get_syncdbs(config->handle); for(i = config->syncfirst; i; i = alpm_list_next(i)) { @@ -598,11 +598,11 @@ static alpm_list_t *syncfirst(void) { return res; } -static pmdb_t *get_db(const char *dbname) +static alpm_db_t *get_db(const char *dbname) { alpm_list_t *i; for(i = alpm_option_get_syncdbs(config->handle); i; i = i->next) { - pmdb_t *db = i->data; + alpm_db_t *db = i->data; if(strcmp(alpm_db_get_name(db), dbname) == 0) { return db; } @@ -705,7 +705,7 @@ static int process_target(char *target) alpm_list_t *dblist = NULL; if(targname) { - pmdb_t *db = NULL; + alpm_db_t *db = NULL; *targname = '\0'; targname++; diff --git a/src/pacman/util.c b/src/pacman/util.c index 75e67170..cdf8b11a 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -666,7 +666,7 @@ static alpm_list_t *create_verbose_row(pmpkg_t *pkg, int install) double size; const char *label; alpm_list_t *ret = NULL; - pmdb_t *ldb = alpm_option_get_localdb(config->handle); + alpm_db_t *ldb = alpm_option_get_localdb(config->handle); /* a row consists of the package name, */ pm_asprintf(&str, "%s", alpm_pkg_get_name(pkg)); @@ -700,7 +700,7 @@ void display_targets(const alpm_list_t *pkgs, int install) const alpm_list_t *i; off_t isize = 0, rsize = 0, dlsize = 0; alpm_list_t *j, *lp, *header = NULL, *targets = NULL; - pmdb_t *db_local = alpm_option_get_localdb(config->handle); + alpm_db_t *db_local = alpm_option_get_localdb(config->handle); if(!pkgs) { return; @@ -882,7 +882,7 @@ void print_packages(const alpm_list_t *packages) /* %r : repo */ if(strstr(temp,"%r")) { const char *repo = "local"; - pmdb_t *db = alpm_pkg_get_db(pkg); + alpm_db_t *db = alpm_pkg_get_db(pkg); if(db) { repo = alpm_db_get_name(db); } @@ -950,7 +950,7 @@ void select_display(const alpm_list_t *pkglist) for (i = pkglist; i; i = i->next) { pmpkg_t *pkg = alpm_list_getdata(i); - pmdb_t *db = alpm_pkg_get_db(pkg); + alpm_db_t *db = alpm_pkg_get_db(pkg); if(!dbname) dbname = alpm_db_get_name(db); diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c index 80fcec3d..f56063db 100644 --- a/src/util/cleanupdelta.c +++ b/src/util/cleanupdelta.c @@ -69,7 +69,7 @@ static void checkpkgs(alpm_list_t *pkglist) static void checkdbs(const char *dbpath, alpm_list_t *dbnames) { char syncdbpath[PATH_MAX]; - pmdb_t *db = NULL; + alpm_db_t *db = NULL; alpm_list_t *i; for(i = dbnames; i; i = alpm_list_next(i)) { diff --git a/src/util/testdb.c b/src/util/testdb.c index ca007454..91dc9b23 100644 --- a/src/util/testdb.c +++ b/src/util/testdb.c @@ -129,7 +129,7 @@ static int checkconflicts(alpm_list_t *pkglist) static int check_localdb(void) { int ret = 0; - pmdb_t *db = NULL; + alpm_db_t *db = NULL; alpm_list_t *pkglist; ret = check_localdb_files(); @@ -146,7 +146,7 @@ static int check_localdb(void) { static int check_syncdbs(alpm_list_t *dbnames) { int ret = 0; - pmdb_t *db = NULL; + alpm_db_t *db = NULL; alpm_list_t *i, *pkglist, *syncpkglist = NULL; for(i = dbnames; i; i = alpm_list_next(i)) { -- cgit v1.2.3-70-g09d2 From 8a04bc25a14df93c0ca207ac83d43cdb867346a1 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 23:26:39 +1000 Subject: Rename pmpkg_t to alpm_pkg_t Signed-off-by: Allan McRae --- lib/libalpm/add.c | 14 ++--- lib/libalpm/alpm.h | 94 ++++++++++++++--------------- lib/libalpm/backup.c | 2 +- lib/libalpm/be_local.c | 62 +++++++++---------- lib/libalpm/be_package.c | 22 +++---- lib/libalpm/be_sync.c | 14 ++--- lib/libalpm/conflict.c | 12 ++-- lib/libalpm/db.c | 18 +++--- lib/libalpm/db.h | 14 ++--- lib/libalpm/delta.c | 2 +- lib/libalpm/deps.c | 64 ++++++++++---------- lib/libalpm/deps.h | 4 +- lib/libalpm/diskspace.c | 8 +-- lib/libalpm/package.c | 152 +++++++++++++++++++++++------------------------ lib/libalpm/package.h | 72 +++++++++++----------- lib/libalpm/pkghash.c | 20 +++---- lib/libalpm/pkghash.h | 10 ++-- lib/libalpm/remove.c | 14 ++--- lib/libalpm/remove.h | 2 +- lib/libalpm/signing.c | 2 +- lib/libalpm/sync.c | 50 ++++++++-------- lib/libalpm/trans.c | 2 +- lib/libalpm/trans.h | 4 +- lib/libalpm/util.h | 2 +- src/pacman/package.c | 8 +-- src/pacman/package.h | 8 +-- src/pacman/query.c | 22 +++---- src/pacman/remove.c | 6 +- src/pacman/sync.c | 26 ++++---- src/pacman/upgrade.c | 2 +- src/pacman/util.c | 20 +++---- src/pacman/util.h | 4 +- src/util/cleanupdelta.c | 2 +- src/util/pactree.c | 12 ++-- src/util/testpkg.c | 2 +- 35 files changed, 386 insertions(+), 386 deletions(-) (limited to 'src/util') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 9c5d800e..27bd04d2 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -50,11 +50,11 @@ #include "handle.h" /** Add a package to the transaction. */ -int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, pmpkg_t *pkg) +int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) { const char *pkgname, *pkgver; pmtrans_t *trans; - pmpkg_t *local; + alpm_pkg_t *local; /* Sanity checks */ CHECK_HANDLE(handle, return -1); @@ -132,7 +132,7 @@ static int perform_extraction(alpm_handle_t *handle, struct archive *archive, } static int extract_single_file(alpm_handle_t *handle, struct archive *archive, - struct archive_entry *entry, pmpkg_t *newpkg, pmpkg_t *oldpkg) + struct archive_entry *entry, alpm_pkg_t *newpkg, alpm_pkg_t *oldpkg) { const char *entryname; mode_t entrymode; @@ -450,13 +450,13 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, return errors; } -static int commit_single_pkg(alpm_handle_t *handle, pmpkg_t *newpkg, +static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, size_t pkg_current, size_t pkg_count) { int i, ret = 0, errors = 0; char scriptlet[PATH_MAX]; int is_upgrade = 0; - pmpkg_t *oldpkg = NULL; + alpm_pkg_t *oldpkg = NULL; alpm_db_t *db = handle->db_local; pmtrans_t *trans = handle->trans; @@ -465,7 +465,7 @@ static int commit_single_pkg(alpm_handle_t *handle, pmpkg_t *newpkg, alpm_pkg_get_version(newpkg)); /* see if this is an upgrade. if so, remove the old package first */ - pmpkg_t *local = _alpm_db_get_pkgfromcache(db, newpkg->name); + alpm_pkg_t *local = _alpm_db_get_pkgfromcache(db, newpkg->name); if(local) { is_upgrade = 1; @@ -700,7 +700,7 @@ int _alpm_upgrade_packages(alpm_handle_t *handle) /* loop through our package list adding/upgrading one at a time */ for(targ = trans->add; targ; targ = targ->next) { - pmpkg_t *newpkg = targ->data; + alpm_pkg_t *newpkg = targ->data; if(handle->trans->state == STATE_INTERRUPTED) { return ret; diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 5b71e9a2..6bff5567 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -102,7 +102,7 @@ typedef enum _pgp_verify_t { typedef struct __alpm_handle_t alpm_handle_t; typedef struct __alpm_db_t alpm_db_t; -typedef struct __pmpkg_t pmpkg_t; +typedef struct __alpm_pkg_t alpm_pkg_t; typedef struct __pmtrans_t pmtrans_t; /** Dependency */ @@ -140,7 +140,7 @@ typedef struct _pmfileconflict_t { typedef struct _pmgrp_t { /** group name */ char *name; - /** list of pmpkg_t packages */ + /** list of alpm_pkg_t packages */ alpm_list_t *packages; } pmgrp_t; @@ -398,7 +398,7 @@ int alpm_db_update(int level, alpm_db_t *db); * @param name of the package * @return the package entry on success, NULL on error */ -pmpkg_t *alpm_db_get_pkg(alpm_db_t *db, const char *name); +alpm_pkg_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 @@ -456,19 +456,19 @@ int alpm_db_set_pkgreason(alpm_db_t *db, const char *name, alpm_pkgreason_t reas * @return 0 on success, -1 on error (pm_errno is set accordingly) */ int alpm_pkg_load(alpm_handle_t *handle, const char *filename, int full, - pgp_verify_t check_sig, pmpkg_t **pkg); + pgp_verify_t check_sig, alpm_pkg_t **pkg); /** Free a package. * @param pkg package pointer to free * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_pkg_free(pmpkg_t *pkg); +int alpm_pkg_free(alpm_pkg_t *pkg); /** Check the integrity (with md5) of a package from the sync cache. * @param pkg package pointer * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_pkg_checkmd5sum(pmpkg_t *pkg); +int alpm_pkg_checkmd5sum(alpm_pkg_t *pkg); /** Compare two version strings and determine which one is 'newer'. */ int alpm_pkg_vercmp(const char *a, const char *b); @@ -479,7 +479,7 @@ int alpm_pkg_vercmp(const char *a, const char *b); * @param pkg a package * @return the list of packages requiring pkg */ -alpm_list_t *alpm_pkg_compute_requiredby(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_compute_requiredby(alpm_pkg_t *pkg); /** @name Package Property Accessors * Any pointer returned by these functions points to internal structures @@ -492,13 +492,13 @@ alpm_list_t *alpm_pkg_compute_requiredby(pmpkg_t *pkg); * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_filename(pmpkg_t *pkg); +const char *alpm_pkg_get_filename(alpm_pkg_t *pkg); /** Returns the package name. * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_name(pmpkg_t *pkg); +const char *alpm_pkg_get_name(alpm_pkg_t *pkg); /** Returns the package version as a string. * This includes all available epoch, version, and pkgrel components. Use @@ -506,116 +506,116 @@ const char *alpm_pkg_get_name(pmpkg_t *pkg); * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_version(pmpkg_t *pkg); +const char *alpm_pkg_get_version(alpm_pkg_t *pkg); /** Returns the package description. * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_desc(pmpkg_t *pkg); +const char *alpm_pkg_get_desc(alpm_pkg_t *pkg); /** Returns the package URL. * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_url(pmpkg_t *pkg); +const char *alpm_pkg_get_url(alpm_pkg_t *pkg); /** Returns the build timestamp of the package. * @param pkg a pointer to package * @return the timestamp of the build time */ -time_t alpm_pkg_get_builddate(pmpkg_t *pkg); +time_t alpm_pkg_get_builddate(alpm_pkg_t *pkg); /** Returns the install timestamp of the package. * @param pkg a pointer to package * @return the timestamp of the install time */ -time_t alpm_pkg_get_installdate(pmpkg_t *pkg); +time_t alpm_pkg_get_installdate(alpm_pkg_t *pkg); /** Returns the packager's name. * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_packager(pmpkg_t *pkg); +const char *alpm_pkg_get_packager(alpm_pkg_t *pkg); /** Returns the package's MD5 checksum as a string. * The returned string is a sequence of lowercase hexadecimal digits. * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_md5sum(pmpkg_t *pkg); +const char *alpm_pkg_get_md5sum(alpm_pkg_t *pkg); /** Returns the architecture for which the package was built. * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_arch(pmpkg_t *pkg); +const char *alpm_pkg_get_arch(alpm_pkg_t *pkg); /** Returns the size of the package. * @param pkg a pointer to package * @return the size of the package in bytes. */ -off_t alpm_pkg_get_size(pmpkg_t *pkg); +off_t alpm_pkg_get_size(alpm_pkg_t *pkg); /** Returns the installed size of the package. * @param pkg a pointer to package * @return the total size of files installed by the package. */ -off_t alpm_pkg_get_isize(pmpkg_t *pkg); +off_t alpm_pkg_get_isize(alpm_pkg_t *pkg); /** Returns the package installation reason. * @param pkg a pointer to package * @return an enum member giving the install reason. */ -alpm_pkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg); +alpm_pkgreason_t alpm_pkg_get_reason(alpm_pkg_t *pkg); /** Returns the list of package licenses. * @param pkg a pointer to package * @return a pointer to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_licenses(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_licenses(alpm_pkg_t *pkg); /** Returns the list of package groups. * @param pkg a pointer to package * @return a pointer to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_groups(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_groups(alpm_pkg_t *pkg); /** Returns the list of package dependencies as pmdepend_t. * @param pkg a pointer to package * @return a reference to an internal list of pmdepend_t structures. */ -alpm_list_t *alpm_pkg_get_depends(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_depends(alpm_pkg_t *pkg); /** Returns the list of package optional dependencies. * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_optdepends(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_optdepends(alpm_pkg_t *pkg); /** Returns the list of package names conflicting with pkg. * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_conflicts(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_conflicts(alpm_pkg_t *pkg); /** Returns the list of package names provided by pkg. * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_provides(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_provides(alpm_pkg_t *pkg); /** Returns the list of available deltas for pkg. * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_deltas(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_deltas(alpm_pkg_t *pkg); /** Returns the list of packages to be replaced by pkg. * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_replaces(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_replaces(alpm_pkg_t *pkg); /** Returns the list of files installed by pkg. * The filenames are relative to the install root, @@ -623,7 +623,7 @@ alpm_list_t *alpm_pkg_get_replaces(pmpkg_t *pkg); * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_files(alpm_pkg_t *pkg); /** Returns the list of files backed up when installing pkg. * The elements of the returned list have the form @@ -632,7 +632,7 @@ alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg); * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_backup(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_backup(alpm_pkg_t *pkg); /** Returns the database containing pkg. * Returns a pointer to the alpm_db_t structure the package is @@ -640,9 +640,9 @@ alpm_list_t *alpm_pkg_get_backup(pmpkg_t *pkg); * @param pkg a pointer to package * @return a pointer to the DB containing pkg, or NULL. */ -alpm_db_t *alpm_pkg_get_db(pmpkg_t *pkg); +alpm_db_t *alpm_pkg_get_db(alpm_pkg_t *pkg); -/* End of pmpkg_t accessors */ +/* End of alpm_pkg_t accessors */ /* @} */ /** Open a package changelog for reading. @@ -651,7 +651,7 @@ alpm_db_t *alpm_pkg_get_db(pmpkg_t *pkg); * @param pkg the package to read the changelog of (either file or db) * @return a 'file stream' to the package changelog */ -void *alpm_pkg_changelog_open(pmpkg_t *pkg); +void *alpm_pkg_changelog_open(alpm_pkg_t *pkg); /** Read data from an open changelog 'file stream'. * Similar to fread in functionality, this function takes a buffer and @@ -664,16 +664,16 @@ void *alpm_pkg_changelog_open(pmpkg_t *pkg); * error occurred. */ size_t alpm_pkg_changelog_read(void *ptr, size_t size, - const pmpkg_t *pkg, const void *fp); + const alpm_pkg_t *pkg, const void *fp); -/*int alpm_pkg_changelog_feof(const pmpkg_t *pkg, void *fp);*/ +/*int alpm_pkg_changelog_feof(const alpm_pkg_t *pkg, void *fp);*/ -int alpm_pkg_changelog_close(const pmpkg_t *pkg, void *fp); +int alpm_pkg_changelog_close(const alpm_pkg_t *pkg, void *fp); /** Returns whether the package has an install scriptlet. * @return 0 if FALSE, TRUE otherwise */ -int alpm_pkg_has_scriptlet(pmpkg_t *pkg); +int alpm_pkg_has_scriptlet(alpm_pkg_t *pkg); /** Returns the size of download. * Returns the size of the files that will be downloaded to install a @@ -681,9 +681,9 @@ int alpm_pkg_has_scriptlet(pmpkg_t *pkg); * @param newpkg the new package to upgrade to * @return the size of the download */ -off_t alpm_pkg_download_size(pmpkg_t *newpkg); +off_t alpm_pkg_download_size(alpm_pkg_t *newpkg); -alpm_list_t *alpm_pkg_unused_deltas(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_unused_deltas(alpm_pkg_t *pkg); /* End of alpm_pkg */ /** @} */ @@ -692,7 +692,7 @@ alpm_list_t *alpm_pkg_unused_deltas(pmpkg_t *pkg); * Signatures */ -int alpm_pkg_check_pgp_signature(pmpkg_t *pkg); +int alpm_pkg_check_pgp_signature(alpm_pkg_t *pkg); int alpm_db_check_pgp_signature(alpm_db_t *db); @@ -706,7 +706,7 @@ alpm_list_t *alpm_find_grp_pkgs(alpm_list_t *dbs, const char *name); * Sync */ -pmpkg_t *alpm_sync_newversion(pmpkg_t *pkg, alpm_list_t *dbs_sync); +alpm_pkg_t *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_sync); /** @addtogroup alpm_api_trans Transaction Functions * Functions to manipulate libalpm transactions @@ -870,13 +870,13 @@ pmtransflag_t alpm_trans_get_flags(alpm_handle_t *handle); /** Returns a list of packages added by the transaction. * @param handle the context handle - * @return a list of pmpkg_t structures + * @return a list of alpm_pkg_t structures */ alpm_list_t * alpm_trans_get_add(alpm_handle_t *handle); /** Returns the list of packages removed by the transaction. * @param handle the context handle - * @return a list of pmpkg_t structures + * @return a list of alpm_pkg_t structures */ alpm_list_t * alpm_trans_get_remove(alpm_handle_t *handle); @@ -938,14 +938,14 @@ int alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade); * @param pkg the package to add * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_add_pkg(alpm_handle_t *handle, pmpkg_t *pkg); +int alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg); /** Add a package removal action to the transaction. * @param handle the context handle * @param pkg the package to uninstall * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_remove_pkg(alpm_handle_t *handle, pmpkg_t *pkg); +int alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg); /** @} */ @@ -957,8 +957,8 @@ int alpm_remove_pkg(alpm_handle_t *handle, pmpkg_t *pkg); alpm_list_t *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglist, alpm_list_t *remove, alpm_list_t *upgrade, int reversedeps); -pmpkg_t *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstring); -pmpkg_t *alpm_find_dbs_satisfier(alpm_handle_t *handle, +alpm_pkg_t *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstring); +alpm_pkg_t *alpm_find_dbs_satisfier(alpm_handle_t *handle, alpm_list_t *dbs, const char *depstring); alpm_list_t *alpm_checkconflicts(alpm_handle_t *handle, alpm_list_t *pkglist); diff --git a/lib/libalpm/backup.c b/lib/libalpm/backup.c index dc0c5674..408c0e17 100644 --- a/lib/libalpm/backup.c +++ b/lib/libalpm/backup.c @@ -55,7 +55,7 @@ int _alpm_split_backup(const char *string, pmbackup_t **backup) return 0; } -/* Look for a filename in a pmpkg_t.backup list. If we find it, +/* Look for a filename in a alpm_pkg_t.backup list. If we find it, * then we return the full backup entry. */ pmbackup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list) diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 1422871d..f59f74fe 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -55,85 +55,85 @@ * initialized. */ -static const char *_cache_get_filename(pmpkg_t *pkg) +static const char *_cache_get_filename(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->filename; } -static const char *_cache_get_desc(pmpkg_t *pkg) +static const char *_cache_get_desc(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->desc; } -static const char *_cache_get_url(pmpkg_t *pkg) +static const char *_cache_get_url(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->url; } -static time_t _cache_get_builddate(pmpkg_t *pkg) +static time_t _cache_get_builddate(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, 0); return pkg->builddate; } -static time_t _cache_get_installdate(pmpkg_t *pkg) +static time_t _cache_get_installdate(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, 0); return pkg->installdate; } -static const char *_cache_get_packager(pmpkg_t *pkg) +static const char *_cache_get_packager(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->packager; } -static const char *_cache_get_md5sum(pmpkg_t *pkg) +static const char *_cache_get_md5sum(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->md5sum; } -static const char *_cache_get_arch(pmpkg_t *pkg) +static const char *_cache_get_arch(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->arch; } -static off_t _cache_get_size(pmpkg_t *pkg) +static off_t _cache_get_size(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, -1); return pkg->size; } -static off_t _cache_get_isize(pmpkg_t *pkg) +static off_t _cache_get_isize(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, -1); return pkg->isize; } -static alpm_pkgreason_t _cache_get_reason(pmpkg_t *pkg) +static alpm_pkgreason_t _cache_get_reason(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, -1); return pkg->reason; } -static alpm_list_t *_cache_get_licenses(pmpkg_t *pkg) +static alpm_list_t *_cache_get_licenses(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->licenses; } -static alpm_list_t *_cache_get_groups(pmpkg_t *pkg) +static alpm_list_t *_cache_get_groups(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->groups; } -static int _cache_has_scriptlet(pmpkg_t *pkg) +static int _cache_has_scriptlet(alpm_pkg_t *pkg) { if(!(pkg->infolevel & INFRQ_SCRIPTLET)) { _alpm_local_db_read(pkg->origin_data.db, pkg, INFRQ_SCRIPTLET); @@ -141,43 +141,43 @@ static int _cache_has_scriptlet(pmpkg_t *pkg) return pkg->scriptlet; } -static alpm_list_t *_cache_get_depends(pmpkg_t *pkg) +static alpm_list_t *_cache_get_depends(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->depends; } -static alpm_list_t *_cache_get_optdepends(pmpkg_t *pkg) +static alpm_list_t *_cache_get_optdepends(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->optdepends; } -static alpm_list_t *_cache_get_conflicts(pmpkg_t *pkg) +static alpm_list_t *_cache_get_conflicts(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->conflicts; } -static alpm_list_t *_cache_get_provides(pmpkg_t *pkg) +static alpm_list_t *_cache_get_provides(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->provides; } -static alpm_list_t *_cache_get_replaces(pmpkg_t *pkg) +static alpm_list_t *_cache_get_replaces(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->replaces; } /* local packages can not have deltas */ -static alpm_list_t *_cache_get_deltas(pmpkg_t UNUSED *pkg) +static alpm_list_t *_cache_get_deltas(alpm_pkg_t UNUSED *pkg) { return NULL; } -static alpm_list_t *_cache_get_files(pmpkg_t *pkg) +static alpm_list_t *_cache_get_files(alpm_pkg_t *pkg) { if(pkg->origin == PKG_FROM_LOCALDB && !(pkg->infolevel & INFRQ_FILES)) { @@ -186,7 +186,7 @@ static alpm_list_t *_cache_get_files(pmpkg_t *pkg) return pkg->files; } -static alpm_list_t *_cache_get_backup(pmpkg_t *pkg) +static alpm_list_t *_cache_get_backup(alpm_pkg_t *pkg) { if(pkg->origin == PKG_FROM_LOCALDB && !(pkg->infolevel & INFRQ_FILES)) { @@ -201,7 +201,7 @@ static alpm_list_t *_cache_get_backup(pmpkg_t *pkg) * @param pkg the package (from db) to read the changelog * @return a 'file stream' to the package changelog */ -static void *_cache_changelog_open(pmpkg_t *pkg) +static void *_cache_changelog_open(alpm_pkg_t *pkg) { char clfile[PATH_MAX]; snprintf(clfile, PATH_MAX, "%s/%s/%s-%s/changelog", @@ -222,7 +222,7 @@ static void *_cache_changelog_open(pmpkg_t *pkg) * @return the number of characters read, or 0 if there is no more data */ static size_t _cache_changelog_read(void *ptr, size_t size, - const pmpkg_t UNUSED *pkg, const void *fp) + const alpm_pkg_t UNUSED *pkg, const void *fp) { return fread(ptr, 1, size, (FILE *)fp); } @@ -234,7 +234,7 @@ static size_t _cache_changelog_read(void *ptr, size_t size, * @param fp a 'file stream' to the package changelog * @return whether closing the package changelog stream was successful */ -static int _cache_changelog_close(const pmpkg_t UNUSED *pkg, void *fp) +static int _cache_changelog_close(const alpm_pkg_t UNUSED *pkg, void *fp) { return fclose((FILE *)fp); } @@ -424,7 +424,7 @@ static int local_db_populate(alpm_db_t *db) while((ent = readdir(dbdir)) != NULL) { const char *name = ent->d_name; - pmpkg_t *pkg; + alpm_pkg_t *pkg; if(strcmp(name, ".") == 0 || strcmp(name, "..") == 0) { continue; @@ -484,7 +484,7 @@ static int local_db_populate(alpm_db_t *db) } /* Note: the return value must be freed by the caller */ -static char *get_pkgpath(alpm_db_t *db, pmpkg_t *info) +static char *get_pkgpath(alpm_db_t *db, alpm_pkg_t *info) { size_t len; char *pkgpath; @@ -498,7 +498,7 @@ static char *get_pkgpath(alpm_db_t *db, pmpkg_t *info) } -int _alpm_local_db_read(alpm_db_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) +int _alpm_local_db_read(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq) { FILE *fp = NULL; char path[PATH_MAX]; @@ -718,7 +718,7 @@ error: return -1; } -int _alpm_local_db_prepare(alpm_db_t *db, pmpkg_t *info) +int _alpm_local_db_prepare(alpm_db_t *db, alpm_pkg_t *info) { mode_t oldmask; int retval = 0; @@ -742,7 +742,7 @@ int _alpm_local_db_prepare(alpm_db_t *db, pmpkg_t *info) return retval; } -int _alpm_local_db_write(alpm_db_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) +int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq) { FILE *fp = NULL; char path[PATH_MAX]; @@ -910,7 +910,7 @@ cleanup: return retval; } -int _alpm_local_db_remove(alpm_db_t *db, pmpkg_t *info) +int _alpm_local_db_remove(alpm_db_t *db, alpm_pkg_t *info) { int ret = 0; char *pkgpath = NULL; diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index b4f729b5..4433d31c 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -43,7 +43,7 @@ * @param pkg the package (file) to read the changelog * @return a 'file stream' to the package changelog */ -static void *_package_changelog_open(pmpkg_t *pkg) +static void *_package_changelog_open(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); @@ -87,7 +87,7 @@ static void *_package_changelog_open(pmpkg_t *pkg) * @return the number of characters read, or 0 if there is no more data */ static size_t _package_changelog_read(void *ptr, size_t size, - const pmpkg_t UNUSED *pkg, const void *fp) + const alpm_pkg_t UNUSED *pkg, const void *fp) { ssize_t sret = archive_read_data((struct archive *)fp, ptr, size); /* Report error (negative values) */ @@ -105,7 +105,7 @@ static size_t _package_changelog_read(void *ptr, size_t size, * @param fp a 'file stream' to the package changelog * @return whether closing the package changelog stream was successful */ -static int _package_changelog_close(const pmpkg_t UNUSED *pkg, void *fp) +static int _package_changelog_close(const alpm_pkg_t UNUSED *pkg, void *fp) { return archive_read_finish((struct archive *)fp); } @@ -130,13 +130,13 @@ static struct pkg_operations *get_file_pkg_ops(void) } /** - * Parses the package description file for a package into a pmpkg_t struct. + * Parses the package description file for a package into a alpm_pkg_t struct. * @param archive the archive to read from, pointed at the .PKGINFO entry - * @param newpkg an empty pmpkg_t struct to fill with package info + * @param newpkg an empty alpm_pkg_t struct to fill with package info * * @return 0 on success, -1 on error */ -static int parse_descfile(alpm_handle_t *handle, struct archive *a, pmpkg_t *newpkg) +static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t *newpkg) { char *ptr = NULL; char *key = NULL; @@ -224,14 +224,14 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, pmpkg_t *new } /** - * Load a package and create the corresponding pmpkg_t struct. + * Load a package and create the corresponding alpm_pkg_t struct. * @param handle the context handle * @param pkgfile path to the package file * @param full whether to stop the load after metadata is read or continue * through the full archive - * @return An information filled pmpkg_t struct + * @return An information filled alpm_pkg_t struct */ -pmpkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, +alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, int full, const char *md5sum, const char *base64_sig, pgp_verify_t check_sig) { @@ -239,7 +239,7 @@ pmpkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, int config = 0; struct archive *archive; struct archive_entry *entry; - pmpkg_t *newpkg = NULL; + alpm_pkg_t *newpkg = NULL; struct stat st; size_t files_count = 0; @@ -388,7 +388,7 @@ error: } int SYMEXPORT alpm_pkg_load(alpm_handle_t *handle, const char *filename, int full, - pgp_verify_t check_sig, pmpkg_t **pkg) + pgp_verify_t check_sig, alpm_pkg_t **pkg) { CHECK_HANDLE(handle, return -1); ASSERT(pkg != NULL, RET_ERR(handle, PM_ERR_WRONG_ARGS, -1)); diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 2ce343c5..9d3646c8 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -245,14 +245,14 @@ cleanup: /* Forward decl so I don't reorganize the whole file right now */ static int sync_db_read(alpm_db_t *db, struct archive *archive, - struct archive_entry *entry, pmpkg_t **likely_pkg); + struct archive_entry *entry, alpm_pkg_t **likely_pkg); -static pmpkg_t *load_pkg_for_entry(alpm_db_t *db, const char *entryname, - const char **entry_filename, pmpkg_t *likely_pkg) +static alpm_pkg_t *load_pkg_for_entry(alpm_db_t *db, const char *entryname, + const char **entry_filename, alpm_pkg_t *likely_pkg) { char *pkgname = NULL, *pkgver = NULL; unsigned long pkgname_hash; - pmpkg_t *pkg; + alpm_pkg_t *pkg; /* get package and db file names */ if(entry_filename) { @@ -368,7 +368,7 @@ static int sync_db_populate(alpm_db_t *db) struct stat buf; struct archive *archive; struct archive_entry *entry; - pmpkg_t *pkg = NULL; + alpm_pkg_t *pkg = NULL; if((archive = archive_read_new()) == NULL) { RET_ERR(db->handle, PM_ERR_LIBARCHIVE, -1); @@ -452,10 +452,10 @@ static int sync_db_populate(alpm_db_t *db) } while(1) /* note the while(1) and not (0) */ static int sync_db_read(alpm_db_t *db, struct archive *archive, - struct archive_entry *entry, pmpkg_t **likely_pkg) + struct archive_entry *entry, alpm_pkg_t **likely_pkg) { const char *entryname, *filename; - pmpkg_t *pkg; + alpm_pkg_t *pkg; struct archive_read_buffer buf; entryname = archive_entry_pathname(entry); diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index dbe90581..d269a066 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -138,7 +138,7 @@ static void check_conflict(alpm_handle_t *handle, return; } for(i = list1; i; i = i->next) { - pmpkg_t *pkg1 = i->data; + alpm_pkg_t *pkg1 = i->data; const char *pkg1name = alpm_pkg_get_name(pkg1); alpm_list_t *j; @@ -148,7 +148,7 @@ static void check_conflict(alpm_handle_t *handle, pmdepend_t *parsed_conflict = _alpm_splitdep(conflict); for(k = list2; k; k = k->next) { - pmpkg_t *pkg2 = k->data; + alpm_pkg_t *pkg2 = k->data; const char *pkg2name = alpm_pkg_get_name(pkg2); if(strcmp(pkg1name, pkg2name) == 0) { @@ -315,7 +315,7 @@ void _alpm_fileconflict_free(pmfileconflict_t *conflict) } static int dir_belongsto_pkg(const char *root, const char *dirpath, - pmpkg_t *pkg) + alpm_pkg_t *pkg) { struct dirent *ent = NULL; struct stat sbuf; @@ -380,7 +380,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, * different cases. */ for(current = 0, i = upgrade; i; i = i->next, current++) { alpm_list_t *k, *tmpfiles; - pmpkg_t *p1, *p2, *dbpkg; + alpm_pkg_t *p1, *p2, *dbpkg; char path[PATH_MAX]; p1 = i->data; @@ -474,7 +474,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, /* Check remove list (will we remove the conflicting local file?) */ for(k = remove; k && !resolved_conflict; k = k->next) { - pmpkg_t *rempkg = k->data; + alpm_pkg_t *rempkg = k->data; if(alpm_list_find_str(alpm_pkg_get_files(rempkg), relative_path)) { _alpm_log(handle, PM_LOG_DEBUG, "local file will be removed, not a conflict: %s\n", @@ -489,7 +489,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, if(!p2 || strcmp(p1->name, p2->name) == 0) { continue; } - pmpkg_t *localp2 = _alpm_db_get_pkgfromcache(handle->db_local, p2->name); + alpm_pkg_t *localp2 = _alpm_db_get_pkgfromcache(handle->db_local, p2->name); /* localp2->files will be removed (target conflicts are handled by CHECK 1) */ if(localp2 && alpm_list_find_str(alpm_pkg_get_files(localp2), filestr)) { diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 6872f517..4c1922d9 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -220,7 +220,7 @@ const char SYMEXPORT *alpm_db_get_name(const alpm_db_t *db) } /** Get a package entry from a package database. */ -pmpkg_t SYMEXPORT *alpm_db_get_pkg(alpm_db_t *db, const char *name) +alpm_pkg_t SYMEXPORT *alpm_db_get_pkg(alpm_db_t *db, const char *name) { ASSERT(db != NULL, return NULL); db->handle->pm_errno = 0; @@ -275,7 +275,7 @@ int SYMEXPORT alpm_db_set_pkgreason(alpm_db_t *db, const char *name, alpm_pkgrea /* TODO assert db == db_local ? shouldn't need a db param at all here... */ ASSERT(name != NULL, RET_ERR(db->handle, PM_ERR_WRONG_ARGS, -1)); - pmpkg_t *pkg = _alpm_db_get_pkgfromcache(db, name); + alpm_pkg_t *pkg = _alpm_db_get_pkgfromcache(db, name); if(pkg == NULL) { RET_ERR(db->handle, PM_ERR_PKG_NOT_FOUND, -1); } @@ -397,7 +397,7 @@ alpm_list_t *_alpm_db_search(alpm_db_t *db, const alpm_list_t *needles) } for(j = list; j; j = j->next) { - pmpkg_t *pkg = j->data; + alpm_pkg_t *pkg = j->data; const char *matched = NULL; const char *name = alpm_pkg_get_name(pkg); const char *desc = alpm_pkg_get_desc(pkg); @@ -513,9 +513,9 @@ alpm_list_t *_alpm_db_get_pkgcache(alpm_db_t *db) } /* "duplicate" pkg then add it to pkgcache */ -int _alpm_db_add_pkgincache(alpm_db_t *db, pmpkg_t *pkg) +int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t *pkg) { - pmpkg_t *newpkg; + alpm_pkg_t *newpkg; if(db == NULL || pkg == NULL || !(db->status & DB_STATUS_PKGCACHE)) { return -1; @@ -535,9 +535,9 @@ int _alpm_db_add_pkgincache(alpm_db_t *db, pmpkg_t *pkg) return 0; } -int _alpm_db_remove_pkgfromcache(alpm_db_t *db, pmpkg_t *pkg) +int _alpm_db_remove_pkgfromcache(alpm_db_t *db, alpm_pkg_t *pkg) { - pmpkg_t *data = NULL; + alpm_pkg_t *data = NULL; if(db == NULL || pkg == NULL || !(db->status & DB_STATUS_PKGCACHE)) { return -1; @@ -561,7 +561,7 @@ int _alpm_db_remove_pkgfromcache(alpm_db_t *db, pmpkg_t *pkg) return 0; } -pmpkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target) +alpm_pkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target) { if(db == NULL) { return NULL; @@ -590,7 +590,7 @@ static int load_grpcache(alpm_db_t *db) for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) { const alpm_list_t *i; - pmpkg_t *pkg = lp->data; + alpm_pkg_t *pkg = lp->data; for(i = alpm_pkg_get_groups(pkg); i; i = i->next) { const char *grpname = i->data; diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index 0e623f09..9c6d6052 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -87,20 +87,20 @@ alpm_db_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename, void _alpm_db_unregister(alpm_db_t *db); /* be_*.c, backend specific calls */ -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); +int _alpm_local_db_read(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq); +int _alpm_local_db_prepare(alpm_db_t *db, alpm_pkg_t *info); +int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq); +int _alpm_local_db_remove(alpm_db_t *db, alpm_pkg_t *info); /* cache bullshit */ /* packages */ 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); +int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t *pkg); +int _alpm_db_remove_pkgfromcache(alpm_db_t *db, alpm_pkg_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); +alpm_pkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target); /* groups */ void _alpm_db_free_grpcache(alpm_db_t *db); alpm_list_t *_alpm_db_get_grpcache(alpm_db_t *db); diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c index 26866aa7..0128e556 100644 --- a/lib/libalpm/delta.c +++ b/lib/libalpm/delta.c @@ -247,7 +247,7 @@ static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota * @{ */ -alpm_list_t SYMEXPORT *alpm_pkg_unused_deltas(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_unused_deltas(alpm_pkg_t *pkg) { off_t pkgsize = alpm_pkg_get_size(pkg); alpm_list_t *unused = find_unused( diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index b9d7a8ff..914d1a3a 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -67,7 +67,7 @@ void _alpm_depmiss_free(pmdepmissing_t *miss) } /* Does pkg1 depend on pkg2, ie. does pkg2 satisfy a dependency of pkg1? */ -static int _alpm_dep_edge(pmpkg_t *pkg1, pmpkg_t *pkg2) +static int _alpm_dep_edge(alpm_pkg_t *pkg1, alpm_pkg_t *pkg2) { alpm_list_t *i; for(i = alpm_pkg_get_depends(pkg1); i; i = i->next) { @@ -78,7 +78,7 @@ static int _alpm_dep_edge(pmpkg_t *pkg1, pmpkg_t *pkg2) return 0; } -/* Convert a list of pmpkg_t * to a graph structure, +/* Convert a list of alpm_pkg_t * to a graph structure, * with a edge for each dependency. * Returns a list of vertices (one vertex = one package) * (used by alpm_sortbydeps) @@ -97,11 +97,11 @@ static alpm_list_t *dep_graph_init(alpm_list_t *targets) /* We compute the edges */ for(i = vertices; i; i = i->next) { pmgraph_t *vertex_i = i->data; - pmpkg_t *p_i = vertex_i->data; + alpm_pkg_t *p_i = vertex_i->data; /* TODO this should be somehow combined with alpm_checkdeps */ for(j = vertices; j; j = j->next) { pmgraph_t *vertex_j = j->data; - pmpkg_t *p_j = vertex_j->data; + alpm_pkg_t *p_j = vertex_j->data; if(_alpm_dep_edge(p_i, p_j)) { vertex_i->children = alpm_list_add(vertex_i->children, vertex_j); @@ -157,8 +157,8 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, vertex = nextchild; } else if(nextchild->state == -1) { - pmpkg_t *vertexpkg = vertex->data; - pmpkg_t *childpkg = nextchild->data; + alpm_pkg_t *vertexpkg = vertex->data; + alpm_pkg_t *childpkg = nextchild->data; const char *message; _alpm_log(handle, PM_LOG_WARNING, _("dependency cycle detected:\n")); @@ -226,12 +226,12 @@ static void release_filtered_depend(pmdepend_t *dep, int nodepversion) } } -static pmpkg_t *find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep) +static alpm_pkg_t *find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep) { alpm_list_t *i; for(i = pkgs; i; i = alpm_list_next(i)) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; if(_alpm_depcmp(pkg, dep)) { return pkg; } @@ -241,17 +241,17 @@ static pmpkg_t *find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep) /** Find a package satisfying a specified dependency. * The dependency can include versions with depmod operators. - * @param pkgs an alpm_list_t* of pmpkg_t where the satisfier will be searched + * @param pkgs an alpm_list_t* of alpm_pkg_t where the satisfier will be searched * @param depstring package or provision name, versioned or not - * @return a pmpkg_t* satisfying depstring + * @return a alpm_pkg_t* satisfying depstring */ -pmpkg_t SYMEXPORT *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstring) +alpm_pkg_t SYMEXPORT *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstring) { pmdepend_t *dep = _alpm_splitdep(depstring); if(!dep) { return NULL; } - pmpkg_t *pkg = find_dep_satisfier(pkgs, dep); + alpm_pkg_t *pkg = find_dep_satisfier(pkgs, dep); _alpm_dep_free(dep); return pkg; } @@ -277,7 +277,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis targets = alpm_list_join(alpm_list_copy(remove), alpm_list_copy(upgrade)); for(i = pkglist; i; i = i->next) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; if(_alpm_pkg_find(targets, pkg->name)) { modified = alpm_list_add(modified, pkg); } else { @@ -290,7 +290,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis /* look for unsatisfied dependencies of the upgrade list */ for(i = upgrade; i; i = i->next) { - pmpkg_t *tp = i->data; + alpm_pkg_t *tp = i->data; _alpm_log(handle, PM_LOG_DEBUG, "checkdeps: package %s-%s\n", alpm_pkg_get_name(tp), alpm_pkg_get_version(tp)); @@ -318,11 +318,11 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis /* reversedeps handles the backwards dependencies, ie, * the packages listed in the requiredby field. */ for(i = dblist; i; i = i->next) { - pmpkg_t *lp = i->data; + alpm_pkg_t *lp = i->data; for(j = alpm_pkg_get_depends(lp); j; j = j->next) { pmdepend_t *depend = j->data; depend = filtered_depend(depend, nodepversion); - pmpkg_t *causingpkg = find_dep_satisfier(modified, depend); + alpm_pkg_t *causingpkg = find_dep_satisfier(modified, depend); /* we won't break this depend, if it is already broken, we ignore it */ /* 1. check upgrade list for satisfiers */ /* 2. check dblist for satisfiers */ @@ -369,7 +369,7 @@ static int dep_vercmp(const char *version1, alpm_depmod_t mod, return equal; } -int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep) +int _alpm_depcmp(alpm_pkg_t *pkg, pmdepend_t *dep) { alpm_list_t *i; int satisfy = 0; @@ -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(alpm_db_t *db, pmpkg_t *pkg, alpm_list_t *targets, +static int can_remove_package(alpm_db_t *db, alpm_pkg_t *pkg, alpm_list_t *targets, int include_explicit) { alpm_list_t *i; @@ -498,7 +498,7 @@ static int can_remove_package(alpm_db_t *db, pmpkg_t *pkg, alpm_list_t *targets, /* see if other packages need it */ for(i = _alpm_db_get_pkgcache(db); i; i = i->next) { - pmpkg_t *lpkg = i->data; + alpm_pkg_t *lpkg = i->data; if(_alpm_dep_edge(lpkg, pkg) && !_alpm_pkg_find(targets, lpkg->name)) { return 0; } @@ -527,9 +527,9 @@ void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit) } for(i = targs; i; i = i->next) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; for(j = _alpm_db_get_pkgcache(db); j; j = j->next) { - pmpkg_t *deppkg = j->data; + alpm_pkg_t *deppkg = j->data; if(_alpm_dep_edge(pkg, deppkg) && can_remove_package(db, deppkg, targs, include_explicit)) { _alpm_log(db->handle, PM_LOG_DEBUG, "adding '%s' to the targets\n", @@ -554,7 +554,7 @@ void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit) * an error code without prompting * @return the resolved package **/ -static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, +static alpm_pkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, alpm_list_t *dbs, alpm_list_t *excluding, int prompt) { alpm_list_t *i, *j; @@ -565,7 +565,7 @@ static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, /* 1. literals */ for(i = dbs; i; i = i->next) { - pmpkg_t *pkg = _alpm_db_get_pkgfromcache(i->data, dep->name); + alpm_pkg_t *pkg = _alpm_db_get_pkgfromcache(i->data, dep->name); if(pkg && _alpm_depcmp(pkg, dep) && !_alpm_pkg_find(excluding, pkg->name)) { if(_alpm_pkg_should_ignore(handle, pkg)) { int install = 0; @@ -586,7 +586,7 @@ static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, /* 2. satisfiers (skip literals here) */ for(i = dbs; i; i = i->next) { for(j = _alpm_db_get_pkgcache(i->data); j; j = j->next) { - pmpkg_t *pkg = j->data; + alpm_pkg_t *pkg = j->data; if(_alpm_depcmp(pkg, dep) && strcmp(pkg->name, dep->name) != 0 && !_alpm_pkg_find(excluding, pkg->name)) { if(_alpm_pkg_should_ignore(handle, pkg)) { @@ -612,7 +612,7 @@ static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, /* first check if one provider is already installed locally */ for(i = providers; i; i = i->next) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; if(_alpm_pkghash_find(_alpm_db_get_pkgcache_hash(handle->db_local), pkg->name)) { alpm_list_free(providers); return pkg; @@ -628,7 +628,7 @@ static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, providers, dep, NULL, &index); } if(index >= 0 && index < count) { - pmpkg_t *pkg = alpm_list_getdata(alpm_list_nth(providers, index)); + alpm_pkg_t *pkg = alpm_list_getdata(alpm_list_nth(providers, index)); alpm_list_free(providers); return pkg; } @@ -651,13 +651,13 @@ static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, * @param handle the context handle * @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 + * @return a alpm_pkg_t* satisfying depstring */ -pmpkg_t SYMEXPORT *alpm_find_dbs_satisfier(alpm_handle_t *handle, +alpm_pkg_t SYMEXPORT *alpm_find_dbs_satisfier(alpm_handle_t *handle, alpm_list_t *dbs, const char *depstring) { pmdepend_t *dep; - pmpkg_t *pkg; + alpm_pkg_t *pkg; CHECK_HANDLE(handle, return NULL); ASSERT(dbs, RET_ERR(handle, PM_ERR_WRONG_ARGS, NULL)); @@ -689,7 +689,7 @@ pmpkg_t SYMEXPORT *alpm_find_dbs_satisfier(alpm_handle_t *handle, * unresolvable dependency, in which case the [*packages] list will be * unmodified by this function */ -int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, pmpkg_t *pkg, +int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t *pkg, alpm_list_t *preferred, alpm_list_t **packages, alpm_list_t *remove, alpm_list_t **data) { @@ -712,7 +712,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, pmpkg_t *pk _alpm_log(handle, PM_LOG_DEBUG, "started resolving dependencies\n"); for(i = alpm_list_last(*packages); i; i = i->next) { - pmpkg_t *tpkg = i->data; + alpm_pkg_t *tpkg = i->data; targ = alpm_list_add(NULL, tpkg); deps = alpm_checkdeps(handle, localpkgs, remove, targ, 0); alpm_list_free(targ); @@ -728,7 +728,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, pmpkg_t *pk } /* check if one of the packages in the [preferred] list already satisfies * this dependency */ - pmpkg_t *spkg = find_dep_satisfier(preferred, missdep); + alpm_pkg_t *spkg = find_dep_satisfier(preferred, missdep); if(!spkg) { /* find a satisfier package in the given repositories */ spkg = resolvedep(handle, missdep, handle->dbs_sync, *packages, 0); diff --git a/lib/libalpm/deps.h b/lib/libalpm/deps.h index d490ab51..438c803a 100644 --- a/lib/libalpm/deps.h +++ b/lib/libalpm/deps.h @@ -32,11 +32,11 @@ 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(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, +int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t *pkg, alpm_list_t *preferred, alpm_list_t **packages, alpm_list_t *remove, alpm_list_t **data); pmdepend_t *_alpm_splitdep(const char *depstring); -int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep); +int _alpm_depcmp(alpm_pkg_t *pkg, pmdepend_t *dep); #endif /* _ALPM_DEPS_H */ diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 6fc2e38a..2bc382e4 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -149,7 +149,7 @@ static alpm_mountpoint_t *match_mount_point(const alpm_list_t *mount_points, } static int calculate_removed_size(alpm_handle_t *handle, - const alpm_list_t *mount_points, pmpkg_t *pkg) + const alpm_list_t *mount_points, alpm_pkg_t *pkg) { alpm_list_t *file; @@ -186,7 +186,7 @@ static int calculate_removed_size(alpm_handle_t *handle, } static int calculate_installed_size(alpm_handle_t *handle, - const alpm_list_t *mount_points, pmpkg_t *pkg) + const alpm_list_t *mount_points, alpm_pkg_t *pkg) { int ret=0; struct archive *archive; @@ -283,7 +283,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle) if(replaces) { numtargs += replaces; for(targ = trans->remove; targ; targ = targ->next, current++) { - pmpkg_t *local_pkg; + alpm_pkg_t *local_pkg; int percent = (current * 100) / numtargs; PROGRESS(trans, PM_TRANS_PROGRESS_DISKSPACE_START, "", percent, numtargs, current); @@ -294,7 +294,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle) } for(targ = trans->add; targ; targ = targ->next, current++) { - pmpkg_t *pkg, *local_pkg; + alpm_pkg_t *pkg, *local_pkg; int percent = (current * 100) / numtargs; PROGRESS(trans, PM_TRANS_PROGRESS_DISKSPACE_START, "", percent, numtargs, current); diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 4de14f8a..efdf1be2 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -43,7 +43,7 @@ */ /** Free a package. */ -int SYMEXPORT alpm_pkg_free(pmpkg_t *pkg) +int SYMEXPORT alpm_pkg_free(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); @@ -56,7 +56,7 @@ int SYMEXPORT alpm_pkg_free(pmpkg_t *pkg) } /** Check the integrity (with md5) of a package from the sync cache. */ -int SYMEXPORT alpm_pkg_checkmd5sum(pmpkg_t *pkg) +int SYMEXPORT alpm_pkg_checkmd5sum(alpm_pkg_t *pkg) { char *fpath; int retval; @@ -85,42 +85,42 @@ int SYMEXPORT alpm_pkg_checkmd5sum(pmpkg_t *pkg) * backend logic that needs lazy access, such as the local database through * a lazy-load cache. However, the defaults will work just fine for fully- * populated package structures. */ -static const char *_pkg_get_filename(pmpkg_t *pkg) { return pkg->filename; } -static const char *_pkg_get_desc(pmpkg_t *pkg) { return pkg->desc; } -static const char *_pkg_get_url(pmpkg_t *pkg) { return pkg->url; } -static time_t _pkg_get_builddate(pmpkg_t *pkg) { return pkg->builddate; } -static time_t _pkg_get_installdate(pmpkg_t *pkg) { return pkg->installdate; } -static const char *_pkg_get_packager(pmpkg_t *pkg) { return pkg->packager; } -static const char *_pkg_get_md5sum(pmpkg_t *pkg) { return pkg->md5sum; } -static const char *_pkg_get_arch(pmpkg_t *pkg) { return pkg->arch; } -static off_t _pkg_get_size(pmpkg_t *pkg) { return pkg->size; } -static off_t _pkg_get_isize(pmpkg_t *pkg) { return pkg->isize; } -static alpm_pkgreason_t _pkg_get_reason(pmpkg_t *pkg) { return pkg->reason; } -static int _pkg_has_scriptlet(pmpkg_t *pkg) { return pkg->scriptlet; } - -static alpm_list_t *_pkg_get_licenses(pmpkg_t *pkg) { return pkg->licenses; } -static alpm_list_t *_pkg_get_groups(pmpkg_t *pkg) { return pkg->groups; } -static alpm_list_t *_pkg_get_depends(pmpkg_t *pkg) { return pkg->depends; } -static alpm_list_t *_pkg_get_optdepends(pmpkg_t *pkg) { return pkg->optdepends; } -static alpm_list_t *_pkg_get_conflicts(pmpkg_t *pkg) { return pkg->conflicts; } -static alpm_list_t *_pkg_get_provides(pmpkg_t *pkg) { return pkg->provides; } -static alpm_list_t *_pkg_get_replaces(pmpkg_t *pkg) { return pkg->replaces; } -static alpm_list_t *_pkg_get_deltas(pmpkg_t *pkg) { return pkg->deltas; } -static alpm_list_t *_pkg_get_files(pmpkg_t *pkg) { return pkg->files; } -static alpm_list_t *_pkg_get_backup(pmpkg_t *pkg) { return pkg->backup; } - -static void *_pkg_changelog_open(pmpkg_t UNUSED *pkg) +static const char *_pkg_get_filename(alpm_pkg_t *pkg) { return pkg->filename; } +static const char *_pkg_get_desc(alpm_pkg_t *pkg) { return pkg->desc; } +static const char *_pkg_get_url(alpm_pkg_t *pkg) { return pkg->url; } +static time_t _pkg_get_builddate(alpm_pkg_t *pkg) { return pkg->builddate; } +static time_t _pkg_get_installdate(alpm_pkg_t *pkg) { return pkg->installdate; } +static const char *_pkg_get_packager(alpm_pkg_t *pkg) { return pkg->packager; } +static const char *_pkg_get_md5sum(alpm_pkg_t *pkg) { return pkg->md5sum; } +static const char *_pkg_get_arch(alpm_pkg_t *pkg) { return pkg->arch; } +static off_t _pkg_get_size(alpm_pkg_t *pkg) { return pkg->size; } +static off_t _pkg_get_isize(alpm_pkg_t *pkg) { return pkg->isize; } +static alpm_pkgreason_t _pkg_get_reason(alpm_pkg_t *pkg) { return pkg->reason; } +static int _pkg_has_scriptlet(alpm_pkg_t *pkg) { return pkg->scriptlet; } + +static alpm_list_t *_pkg_get_licenses(alpm_pkg_t *pkg) { return pkg->licenses; } +static alpm_list_t *_pkg_get_groups(alpm_pkg_t *pkg) { return pkg->groups; } +static alpm_list_t *_pkg_get_depends(alpm_pkg_t *pkg) { return pkg->depends; } +static alpm_list_t *_pkg_get_optdepends(alpm_pkg_t *pkg) { return pkg->optdepends; } +static alpm_list_t *_pkg_get_conflicts(alpm_pkg_t *pkg) { return pkg->conflicts; } +static alpm_list_t *_pkg_get_provides(alpm_pkg_t *pkg) { return pkg->provides; } +static alpm_list_t *_pkg_get_replaces(alpm_pkg_t *pkg) { return pkg->replaces; } +static alpm_list_t *_pkg_get_deltas(alpm_pkg_t *pkg) { return pkg->deltas; } +static alpm_list_t *_pkg_get_files(alpm_pkg_t *pkg) { return pkg->files; } +static alpm_list_t *_pkg_get_backup(alpm_pkg_t *pkg) { return pkg->backup; } + +static void *_pkg_changelog_open(alpm_pkg_t UNUSED *pkg) { return NULL; } static size_t _pkg_changelog_read(void UNUSED *ptr, size_t UNUSED size, - const pmpkg_t UNUSED *pkg, const UNUSED void *fp) + const alpm_pkg_t UNUSED *pkg, const UNUSED void *fp) { return 0; } -static int _pkg_changelog_close(const pmpkg_t UNUSED *pkg, +static int _pkg_changelog_close(const alpm_pkg_t UNUSED *pkg, void UNUSED *fp) { return EOF; @@ -162,168 +162,168 @@ struct pkg_operations default_pkg_ops = { /* Public functions for getting package information. These functions * delegate the hard work to the function callbacks attached to each * package, which depend on where the package was loaded from. */ -const char SYMEXPORT *alpm_pkg_get_filename(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_filename(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_filename(pkg); } -const char SYMEXPORT *alpm_pkg_get_name(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_name(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->name; } -const char SYMEXPORT *alpm_pkg_get_version(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_version(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->version; } -const char SYMEXPORT *alpm_pkg_get_desc(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_desc(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_desc(pkg); } -const char SYMEXPORT *alpm_pkg_get_url(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_url(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_url(pkg); } -time_t SYMEXPORT alpm_pkg_get_builddate(pmpkg_t *pkg) +time_t SYMEXPORT alpm_pkg_get_builddate(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->get_builddate(pkg); } -time_t SYMEXPORT alpm_pkg_get_installdate(pmpkg_t *pkg) +time_t SYMEXPORT alpm_pkg_get_installdate(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->get_installdate(pkg); } -const char SYMEXPORT *alpm_pkg_get_packager(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_packager(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_packager(pkg); } -const char SYMEXPORT *alpm_pkg_get_md5sum(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_md5sum(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_md5sum(pkg); } -const char SYMEXPORT *alpm_pkg_get_arch(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_arch(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_arch(pkg); } -off_t SYMEXPORT alpm_pkg_get_size(pmpkg_t *pkg) +off_t SYMEXPORT alpm_pkg_get_size(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->get_size(pkg); } -off_t SYMEXPORT alpm_pkg_get_isize(pmpkg_t *pkg) +off_t SYMEXPORT alpm_pkg_get_isize(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->get_isize(pkg); } -alpm_pkgreason_t SYMEXPORT alpm_pkg_get_reason(pmpkg_t *pkg) +alpm_pkgreason_t SYMEXPORT alpm_pkg_get_reason(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->get_reason(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_licenses(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_licenses(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_licenses(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_groups(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_groups(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_groups(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_depends(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_depends(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_depends(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_optdepends(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_optdepends(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_optdepends(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_conflicts(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_conflicts(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_conflicts(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_provides(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_provides(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_provides(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_replaces(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_replaces(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_replaces(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_deltas(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_deltas(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_deltas(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_files(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_files(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_files(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_backup(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_backup(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_backup(pkg); } -alpm_db_t SYMEXPORT *alpm_pkg_get_db(pmpkg_t *pkg) +alpm_db_t SYMEXPORT *alpm_pkg_get_db(alpm_pkg_t *pkg) { /* Sanity checks */ ASSERT(pkg != NULL, return NULL); @@ -334,7 +334,7 @@ alpm_db_t SYMEXPORT *alpm_pkg_get_db(pmpkg_t *pkg) } /** Open a package changelog for reading. */ -void SYMEXPORT *alpm_pkg_changelog_open(pmpkg_t *pkg) +void SYMEXPORT *alpm_pkg_changelog_open(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; @@ -343,7 +343,7 @@ void SYMEXPORT *alpm_pkg_changelog_open(pmpkg_t *pkg) /** Read data from an open changelog 'file stream'. */ size_t SYMEXPORT alpm_pkg_changelog_read(void *ptr, size_t size, - const pmpkg_t *pkg, const void *fp) + const alpm_pkg_t *pkg, const void *fp) { ASSERT(pkg != NULL, return 0); pkg->handle->pm_errno = 0; @@ -351,34 +351,34 @@ size_t SYMEXPORT alpm_pkg_changelog_read(void *ptr, size_t size, } /* -int SYMEXPORT alpm_pkg_changelog_feof(const pmpkg_t *pkg, void *fp) +int SYMEXPORT alpm_pkg_changelog_feof(const alpm_pkg_t *pkg, void *fp) { return pkg->ops->changelog_feof(pkg, fp); } */ /** Close a package changelog for reading. */ -int SYMEXPORT alpm_pkg_changelog_close(const pmpkg_t *pkg, void *fp) +int SYMEXPORT alpm_pkg_changelog_close(const alpm_pkg_t *pkg, void *fp) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->changelog_close(pkg, fp); } -int SYMEXPORT alpm_pkg_has_scriptlet(pmpkg_t *pkg) +int SYMEXPORT alpm_pkg_has_scriptlet(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->has_scriptlet(pkg); } -static void find_requiredby(pmpkg_t *pkg, alpm_db_t *db, alpm_list_t **reqs) +static void find_requiredby(alpm_pkg_t *pkg, alpm_db_t *db, alpm_list_t **reqs) { const alpm_list_t *i; pkg->handle->pm_errno = 0; for(i = _alpm_db_get_pkgcache(db); i; i = i->next) { - pmpkg_t *cachepkg = i->data; + alpm_pkg_t *cachepkg = i->data; alpm_list_t *j; for(j = alpm_pkg_get_depends(cachepkg); j; j = j->next) { if(_alpm_depcmp(pkg, j->data)) { @@ -392,7 +392,7 @@ static void find_requiredby(pmpkg_t *pkg, alpm_db_t *db, alpm_list_t **reqs) } /** Compute the packages requiring a given package. */ -alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(alpm_pkg_t *pkg) { const alpm_list_t *i; alpm_list_t *reqs = NULL; @@ -423,21 +423,21 @@ alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(pmpkg_t *pkg) /** @} */ -pmpkg_t *_alpm_pkg_new(void) +alpm_pkg_t *_alpm_pkg_new(void) { - pmpkg_t* pkg; + alpm_pkg_t* pkg; - CALLOC(pkg, 1, sizeof(pmpkg_t), return NULL); + CALLOC(pkg, 1, sizeof(alpm_pkg_t), return NULL); return pkg; } -pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg) +alpm_pkg_t *_alpm_pkg_dup(alpm_pkg_t *pkg) { - pmpkg_t *newpkg; + alpm_pkg_t *newpkg; alpm_list_t *i; - CALLOC(newpkg, 1, sizeof(pmpkg_t), goto cleanup); + CALLOC(newpkg, 1, sizeof(alpm_pkg_t), goto cleanup); newpkg->name_hash = pkg->name_hash; STRDUP(newpkg->filename, pkg->filename, goto cleanup); @@ -490,7 +490,7 @@ cleanup: return NULL; } -void _alpm_pkg_free(pmpkg_t *pkg) +void _alpm_pkg_free(alpm_pkg_t *pkg) { if(pkg == NULL) { return; @@ -532,7 +532,7 @@ void _alpm_pkg_free(pmpkg_t *pkg) * Case 2: If pkg is a pkgcache entry (PKG_FROM_CACHE), it won't be freed, * only the transaction specific fields of pkg will be freed. */ -void _alpm_pkg_free_trans(pmpkg_t *pkg) +void _alpm_pkg_free_trans(alpm_pkg_t *pkg) { if(pkg == NULL) { return; @@ -548,7 +548,7 @@ void _alpm_pkg_free_trans(pmpkg_t *pkg) } /* Is spkg an upgrade for localpkg? */ -int _alpm_pkg_compare_versions(pmpkg_t *spkg, pmpkg_t *localpkg) +int _alpm_pkg_compare_versions(alpm_pkg_t *spkg, alpm_pkg_t *localpkg) { return alpm_pkg_vercmp(alpm_pkg_get_version(spkg), alpm_pkg_get_version(localpkg)); @@ -558,15 +558,15 @@ int _alpm_pkg_compare_versions(pmpkg_t *spkg, pmpkg_t *localpkg) */ int _alpm_pkg_cmp(const void *p1, const void *p2) { - pmpkg_t *pkg1 = (pmpkg_t *)p1; - pmpkg_t *pkg2 = (pmpkg_t *)p2; + alpm_pkg_t *pkg1 = (alpm_pkg_t *)p1; + alpm_pkg_t *pkg2 = (alpm_pkg_t *)p2; return strcoll(pkg1->name, pkg2->name); } /* Test for existence of a package in a alpm_list_t* - * of pmpkg_t* + * of alpm_pkg_t* */ -pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle) +alpm_pkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle) { alpm_list_t *lp; unsigned long needle_hash; @@ -578,7 +578,7 @@ pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle) needle_hash = _alpm_hash_sdbm(needle); for(lp = haystack; lp; lp = lp->next) { - pmpkg_t *info = lp->data; + alpm_pkg_t *info = lp->data; if(info) { /* a zero hash will cause a fall-through just in case */ @@ -605,7 +605,7 @@ pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle) * * @return 1 if the package should be ignored, 0 otherwise */ -int _alpm_pkg_should_ignore(alpm_handle_t *handle, pmpkg_t *pkg) +int _alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg) { alpm_list_t *groups = NULL; diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index b74d30ef..5edf40de 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -48,33 +48,33 @@ typedef enum _pmpkgfrom_t { * defined default_pkg_ops struct to work just fine for their needs. */ struct pkg_operations { - const char *(*get_filename) (pmpkg_t *); - const char *(*get_desc) (pmpkg_t *); - const char *(*get_url) (pmpkg_t *); - time_t (*get_builddate) (pmpkg_t *); - time_t (*get_installdate) (pmpkg_t *); - const char *(*get_packager) (pmpkg_t *); - const char *(*get_md5sum) (pmpkg_t *); - const char *(*get_arch) (pmpkg_t *); - off_t (*get_size) (pmpkg_t *); - off_t (*get_isize) (pmpkg_t *); - alpm_pkgreason_t (*get_reason) (pmpkg_t *); - int (*has_scriptlet) (pmpkg_t *); - - alpm_list_t *(*get_licenses) (pmpkg_t *); - alpm_list_t *(*get_groups) (pmpkg_t *); - alpm_list_t *(*get_depends) (pmpkg_t *); - alpm_list_t *(*get_optdepends) (pmpkg_t *); - alpm_list_t *(*get_conflicts) (pmpkg_t *); - alpm_list_t *(*get_provides) (pmpkg_t *); - alpm_list_t *(*get_replaces) (pmpkg_t *); - alpm_list_t *(*get_deltas) (pmpkg_t *); - alpm_list_t *(*get_files) (pmpkg_t *); - alpm_list_t *(*get_backup) (pmpkg_t *); - - void *(*changelog_open) (pmpkg_t *); - size_t (*changelog_read) (void *, size_t, const pmpkg_t *, const void *); - int (*changelog_close) (const pmpkg_t *, void *); + const char *(*get_filename) (alpm_pkg_t *); + const char *(*get_desc) (alpm_pkg_t *); + const char *(*get_url) (alpm_pkg_t *); + time_t (*get_builddate) (alpm_pkg_t *); + time_t (*get_installdate) (alpm_pkg_t *); + const char *(*get_packager) (alpm_pkg_t *); + const char *(*get_md5sum) (alpm_pkg_t *); + const char *(*get_arch) (alpm_pkg_t *); + off_t (*get_size) (alpm_pkg_t *); + off_t (*get_isize) (alpm_pkg_t *); + alpm_pkgreason_t (*get_reason) (alpm_pkg_t *); + int (*has_scriptlet) (alpm_pkg_t *); + + alpm_list_t *(*get_licenses) (alpm_pkg_t *); + alpm_list_t *(*get_groups) (alpm_pkg_t *); + alpm_list_t *(*get_depends) (alpm_pkg_t *); + alpm_list_t *(*get_optdepends) (alpm_pkg_t *); + alpm_list_t *(*get_conflicts) (alpm_pkg_t *); + alpm_list_t *(*get_provides) (alpm_pkg_t *); + alpm_list_t *(*get_replaces) (alpm_pkg_t *); + alpm_list_t *(*get_deltas) (alpm_pkg_t *); + alpm_list_t *(*get_files) (alpm_pkg_t *); + alpm_list_t *(*get_backup) (alpm_pkg_t *); + + void *(*changelog_open) (alpm_pkg_t *); + size_t (*changelog_read) (void *, size_t, const alpm_pkg_t *, const void *); + int (*changelog_close) (const alpm_pkg_t *, void *); /* still to add: * checkmd5sum() ? @@ -89,7 +89,7 @@ struct pkg_operations { */ extern struct pkg_operations default_pkg_ops; -struct __pmpkg_t { +struct __alpm_pkg_t { unsigned long name_hash; char *filename; char *name; @@ -137,20 +137,20 @@ struct __pmpkg_t { struct pkg_operations *ops; }; -pmpkg_t* _alpm_pkg_new(void); -pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg); -void _alpm_pkg_free(pmpkg_t *pkg); -void _alpm_pkg_free_trans(pmpkg_t *pkg); +alpm_pkg_t* _alpm_pkg_new(void); +alpm_pkg_t *_alpm_pkg_dup(alpm_pkg_t *pkg); +void _alpm_pkg_free(alpm_pkg_t *pkg); +void _alpm_pkg_free_trans(alpm_pkg_t *pkg); -pmpkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, +alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, int full, const char *md5sum, const char *base64_sig, pgp_verify_t check_sig); int _alpm_pkg_cmp(const void *p1, const void *p2); -int _alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg); -pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle); -int _alpm_pkg_should_ignore(alpm_handle_t *handle, pmpkg_t *pkg); +int _alpm_pkg_compare_versions(alpm_pkg_t *local_pkg, alpm_pkg_t *pkg); +alpm_pkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle); +int _alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg); #endif /* _ALPM_PACKAGE_H */ diff --git a/lib/libalpm/pkghash.c b/lib/libalpm/pkghash.c index 9e98fcd8..2fd82de3 100644 --- a/lib/libalpm/pkghash.c +++ b/lib/libalpm/pkghash.c @@ -128,7 +128,7 @@ static pmpkghash_t *rehash(pmpkghash_t *oldhash) for(i = 0; i < oldhash->buckets; i++) { if(oldhash->hash_table[i] != NULL) { - pmpkg_t *package = oldhash->hash_table[i]->data; + alpm_pkg_t *package = oldhash->hash_table[i]->data; position = get_hash_position(package->name_hash, newhash); @@ -144,7 +144,7 @@ static pmpkghash_t *rehash(pmpkghash_t *oldhash) return newhash; } -static pmpkghash_t *pkghash_add_pkg(pmpkghash_t *hash, pmpkg_t *pkg, int sorted) +static pmpkghash_t *pkghash_add_pkg(pmpkghash_t *hash, alpm_pkg_t *pkg, int sorted) { alpm_list_t *ptr; size_t position; @@ -179,12 +179,12 @@ static pmpkghash_t *pkghash_add_pkg(pmpkghash_t *hash, pmpkg_t *pkg, int sorted) return hash; } -pmpkghash_t *_alpm_pkghash_add(pmpkghash_t *hash, pmpkg_t *pkg) +pmpkghash_t *_alpm_pkghash_add(pmpkghash_t *hash, alpm_pkg_t *pkg) { return pkghash_add_pkg(hash, pkg, 0); } -pmpkghash_t *_alpm_pkghash_add_sorted(pmpkghash_t *hash, pmpkg_t *pkg) +pmpkghash_t *_alpm_pkghash_add_sorted(pmpkghash_t *hash, alpm_pkg_t *pkg) { return pkghash_add_pkg(hash, pkg, 1); } @@ -200,7 +200,7 @@ static size_t move_one_entry(pmpkghash_t *hash, size_t start, size_t end) * 'start' we can stop this madness. */ while(end != start) { alpm_list_t *i = hash->hash_table[end]; - pmpkg_t *info = i->data; + alpm_pkg_t *info = i->data; size_t new_position = get_hash_position(info->name_hash, hash); if(new_position == start) { @@ -226,8 +226,8 @@ static size_t move_one_entry(pmpkghash_t *hash, size_t start, size_t end) * * @return the resultant hash */ -pmpkghash_t *_alpm_pkghash_remove(pmpkghash_t *hash, pmpkg_t *pkg, - pmpkg_t **data) +pmpkghash_t *_alpm_pkghash_remove(pmpkghash_t *hash, alpm_pkg_t *pkg, + alpm_pkg_t **data) { alpm_list_t *i; size_t position; @@ -242,7 +242,7 @@ pmpkghash_t *_alpm_pkghash_remove(pmpkghash_t *hash, pmpkg_t *pkg, position = pkg->name_hash % hash->buckets; while((i = hash->hash_table[position]) != NULL) { - pmpkg_t *info = i->data; + alpm_pkg_t *info = i->data; if(info->name_hash == pkg->name_hash && strcmp(info->name, pkg->name) == 0) { @@ -295,7 +295,7 @@ void _alpm_pkghash_free(pmpkghash_t *hash) free(hash); } -pmpkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name) +alpm_pkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name) { alpm_list_t *lp; unsigned long name_hash; @@ -310,7 +310,7 @@ pmpkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name) position = name_hash % hash->buckets; while((lp = hash->hash_table[position]) != NULL) { - pmpkg_t *info = lp->data; + alpm_pkg_t *info = lp->data; if(info->name_hash == name_hash && strcmp(info->name, name) == 0) { return info; diff --git a/lib/libalpm/pkghash.h b/lib/libalpm/pkghash.h index 617e60bd..ab8fef0c 100644 --- a/lib/libalpm/pkghash.h +++ b/lib/libalpm/pkghash.h @@ -27,7 +27,7 @@ /** - * @brief A hash table for holding pmpkg_t objects. + * @brief A hash table for holding alpm_pkg_t objects. * * A combination of a hash table and a list, allowing for fast look-up * by package name but also iteration over the packages. @@ -47,13 +47,13 @@ typedef struct __pmpkghash_t pmpkghash_t; pmpkghash_t *_alpm_pkghash_create(size_t size); -pmpkghash_t *_alpm_pkghash_add(pmpkghash_t *hash, pmpkg_t *pkg); -pmpkghash_t *_alpm_pkghash_add_sorted(pmpkghash_t *hash, pmpkg_t *pkg); -pmpkghash_t *_alpm_pkghash_remove(pmpkghash_t *hash, pmpkg_t *pkg, pmpkg_t **data); +pmpkghash_t *_alpm_pkghash_add(pmpkghash_t *hash, alpm_pkg_t *pkg); +pmpkghash_t *_alpm_pkghash_add_sorted(pmpkghash_t *hash, alpm_pkg_t *pkg); +pmpkghash_t *_alpm_pkghash_remove(pmpkghash_t *hash, alpm_pkg_t *pkg, alpm_pkg_t **data); void _alpm_pkghash_free(pmpkghash_t *hash); -pmpkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name); +alpm_pkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name); #define MAX_HASH_LOAD 0.7 diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 9a56e9b3..bc290736 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -44,7 +44,7 @@ #include "deps.h" #include "handle.h" -int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, pmpkg_t *pkg) +int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) { const char *pkgname; pmtrans_t *trans; @@ -78,7 +78,7 @@ static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp) alpm_list_t *i; for(i = lp; i; i = i->next) { pmdepmissing_t *miss = (pmdepmissing_t *)i->data; - pmpkg_t *info = _alpm_db_get_pkgfromcache(handle->db_local, miss->target); + alpm_pkg_t *info = _alpm_db_get_pkgfromcache(handle->db_local, miss->target); if(info) { if(!_alpm_pkg_find(trans->remove, alpm_pkg_get_name(info))) { _alpm_log(handle, PM_LOG_DEBUG, "pulling %s in target list\n", @@ -107,7 +107,7 @@ static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp) for(i = lp; i; i = i->next) { pmdepmissing_t *miss = (pmdepmissing_t *)i->data; void *vpkg; - pmpkg_t *pkg = _alpm_pkg_find(trans->remove, miss->causingpkg); + alpm_pkg_t *pkg = _alpm_pkg_find(trans->remove, miss->causingpkg); if(pkg == NULL) { continue; } @@ -219,7 +219,7 @@ static int can_remove_file(alpm_handle_t *handle, const char *path, /* Helper function for iterating through a package's file and deleting them * Used by _alpm_remove_commit. */ -static void unlink_file(alpm_handle_t *handle, pmpkg_t *info, const char *filename, +static void unlink_file(alpm_handle_t *handle, alpm_pkg_t *info, const char *filename, alpm_list_t *skip_remove, int nosave) { struct stat buf; @@ -283,7 +283,7 @@ static void unlink_file(alpm_handle_t *handle, pmpkg_t *info, const char *filena } int _alpm_upgraderemove_package(alpm_handle_t *handle, - pmpkg_t *oldpkg, pmpkg_t *newpkg) + alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg) { alpm_list_t *skip_remove, *b; alpm_list_t *newfiles, *lp; @@ -355,7 +355,7 @@ db: int _alpm_remove_packages(alpm_handle_t *handle) { - pmpkg_t *info; + alpm_pkg_t *info; alpm_list_t *targ, *lp; size_t pkg_count; pmtrans_t *trans = handle->trans; @@ -365,7 +365,7 @@ int _alpm_remove_packages(alpm_handle_t *handle) for(targ = trans->remove; targ; targ = targ->next) { int position = 0; char scriptlet[PATH_MAX]; - info = (pmpkg_t *)targ->data; + info = (alpm_pkg_t *)targ->data; const char *pkgname = NULL; size_t targcount = alpm_list_count(targ); diff --git a/lib/libalpm/remove.h b/lib/libalpm/remove.h index d4565580..48dc2e9c 100644 --- a/lib/libalpm/remove.h +++ b/lib/libalpm/remove.h @@ -28,7 +28,7 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data); int _alpm_remove_packages(alpm_handle_t *handle); int _alpm_upgraderemove_package(alpm_handle_t *handle, - pmpkg_t *oldpkg, pmpkg_t *newpkg); + alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg); #endif /* _ALPM_REMOVE_H */ diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index 0bab1063..35b352be 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -381,7 +381,7 @@ pgp_verify_t _alpm_db_get_sigverify_level(alpm_db_t *db) * @param pkg the package to check * @return a int value : 0 (valid), 1 (invalid), -1 (an error occurred) */ -int SYMEXPORT alpm_pkg_check_pgp_signature(pmpkg_t *pkg) +int SYMEXPORT alpm_pkg_check_pgp_signature(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index c60f019c..86cd48ce 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -53,10 +53,10 @@ /** Check for new version of pkg in sync repos * (only the first occurrence is considered in sync) */ -pmpkg_t SYMEXPORT *alpm_sync_newversion(pmpkg_t *pkg, alpm_list_t *dbs_sync) +alpm_pkg_t SYMEXPORT *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_sync) { alpm_list_t *i; - pmpkg_t *spkg = NULL; + alpm_pkg_t *spkg = NULL; ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; @@ -99,7 +99,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) _alpm_log(handle, PM_LOG_DEBUG, "checking for package upgrades\n"); for(i = _alpm_db_get_pkgcache(db_local); i; i = i->next) { - pmpkg_t *lpkg = i->data; + alpm_pkg_t *lpkg = i->data; if(_alpm_pkg_find(trans->add, lpkg->name)) { _alpm_log(handle, PM_LOG_DEBUG, "%s is already in the target list -- skipping\n", lpkg->name); @@ -111,7 +111,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) for(j = dbs_sync; j; j = j->next) { alpm_db_t *sdb = j->data; /* Check sdb */ - pmpkg_t *spkg = _alpm_db_get_pkgfromcache(sdb, lpkg->name); + alpm_pkg_t *spkg = _alpm_db_get_pkgfromcache(sdb, lpkg->name); if(spkg) { /* 1. literal was found in sdb */ int cmp = _alpm_pkg_compare_versions(spkg, lpkg); @@ -170,7 +170,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) /* If spkg is already in the target list, we append lpkg to spkg's * removes list */ - pmpkg_t *tpkg = _alpm_pkg_find(trans->add, spkg->name); + alpm_pkg_t *tpkg = _alpm_pkg_find(trans->add, spkg->name); if(tpkg) { /* sanity check, multiple repos can contain spkg->name */ if(tpkg->origin_data.db != sdb) { @@ -211,7 +211,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) * IgnorePkg is also handled. * @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) + * @return the list of alpm_pkg_t * (caller is responsible for alpm_list_free) */ alpm_list_t SYMEXPORT *alpm_find_grp_pkgs(alpm_list_t *dbs, const char *name) @@ -226,7 +226,7 @@ alpm_list_t SYMEXPORT *alpm_find_grp_pkgs(alpm_list_t *dbs, continue; for(j = grp->packages; j; j = j->next) { - pmpkg_t *pkg = j->data; + alpm_pkg_t *pkg = j->data; if(_alpm_pkg_find(ignorelist, alpm_pkg_get_name(pkg))) { continue; @@ -252,7 +252,7 @@ alpm_list_t SYMEXPORT *alpm_find_grp_pkgs(alpm_list_t *dbs, * package. * @param newpkg the new package to upgrade to */ -static int compute_download_size(pmpkg_t *newpkg) +static int compute_download_size(alpm_pkg_t *newpkg) { const char *fname; char *fpath; @@ -325,7 +325,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) /* build remove list for resolvedeps */ for(i = trans->add; i; i = i->next) { - pmpkg_t *spkg = i->data; + alpm_pkg_t *spkg = i->data; for(j = spkg->removes; j; j = j->next) { remove = alpm_list_add(remove, j->data); } @@ -339,7 +339,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) /* Resolve packages in the transaction one at a time, in addition building up a list of packages which could not be resolved. */ for(i = trans->add; i; i = i->next) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; if(_alpm_resolvedeps(handle, localpkgs, pkg, trans->add, &resolved, remove, data) == -1) { unresolvable = alpm_list_add(unresolvable, pkg); @@ -376,7 +376,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) /* Set DEPEND reason for pulled packages */ for(i = resolved; i; i = i->next) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; if(!_alpm_pkg_find(trans->add, pkg->name)) { pkg->reason = PM_PKG_REASON_DEPEND; } @@ -406,7 +406,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) for(i = deps; i; i = i->next) { pmconflict_t *conflict = i->data; - pmpkg_t *rsync, *sync, *sync1, *sync2; + alpm_pkg_t *rsync, *sync, *sync1, *sync2; /* have we already removed one of the conflicting targets? */ sync1 = _alpm_pkg_find(trans->add, conflict->package1); @@ -470,7 +470,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) we ask the user */ int found = 0; for(j = trans->add; j && !found; j = j->next) { - pmpkg_t *spkg = j->data; + alpm_pkg_t *spkg = j->data; if(_alpm_pkg_find(spkg->removes, conflict->package2)) { found = 1; } @@ -482,8 +482,8 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) _alpm_log(handle, PM_LOG_DEBUG, "package '%s' conflicts with '%s'\n", conflict->package1, conflict->package2); - pmpkg_t *sync = _alpm_pkg_find(trans->add, conflict->package1); - pmpkg_t *local = _alpm_db_get_pkgfromcache(handle->db_local, conflict->package2); + alpm_pkg_t *sync = _alpm_pkg_find(trans->add, conflict->package1); + alpm_pkg_t *local = _alpm_db_get_pkgfromcache(handle->db_local, conflict->package2); int doremove = 0; QUESTION(trans, PM_TRANS_CONV_CONFLICT_PKG, conflict->package1, conflict->package2, conflict->reason, &doremove); @@ -513,9 +513,9 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) /* Build trans->remove list */ for(i = trans->add; i; i = i->next) { - pmpkg_t *spkg = i->data; + alpm_pkg_t *spkg = i->data; for(j = spkg->removes; j; j = j->next) { - pmpkg_t *rpkg = j->data; + alpm_pkg_t *rpkg = j->data; if(!_alpm_pkg_find(trans->remove, rpkg->name)) { _alpm_log(handle, PM_LOG_DEBUG, "adding '%s' to remove list\n", rpkg->name); trans->remove = alpm_list_add(trans->remove, _alpm_pkg_dup(rpkg)); @@ -541,7 +541,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) } for(i = trans->add; i; i = i->next) { /* update download size field */ - pmpkg_t *spkg = i->data; + alpm_pkg_t *spkg = i->data; if(compute_download_size(spkg) != 0) { ret = -1; goto cleanup; @@ -560,7 +560,7 @@ cleanup: * @param newpkg the new package to upgrade to * @return the size of the download */ -off_t SYMEXPORT alpm_pkg_download_size(pmpkg_t *newpkg) +off_t SYMEXPORT alpm_pkg_download_size(alpm_pkg_t *newpkg) { if(!(newpkg->infolevel & INFRQ_DSIZE)) { compute_download_size(newpkg); @@ -591,7 +591,7 @@ static int apply_deltas(alpm_handle_t *handle) pmtrans_t *trans = handle->trans; for(i = trans->add; i; i = i->next) { - pmpkg_t *spkg = i->data; + alpm_pkg_t *spkg = i->data; alpm_list_t *delta_path = spkg->delta_path; alpm_list_t *dlts = NULL; @@ -743,7 +743,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) off_t total_size = (off_t)0; /* sum up the download size for each package and store total */ for(i = handle->trans->add; i; i = i->next) { - pmpkg_t *spkg = i->data; + alpm_pkg_t *spkg = i->data; total_size += spkg->download_size; } handle->totaldlcb(total_size); @@ -754,7 +754,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) alpm_db_t *current = i->data; for(j = handle->trans->add; j; j = j->next) { - pmpkg_t *spkg = j->data; + alpm_pkg_t *spkg = j->data; if(spkg->origin != PKG_FROM_FILE && current == spkg->origin_data.db) { const char *fname = NULL; @@ -821,7 +821,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) } for(j = handle->trans->add; j; j = j->next) { - pmpkg_t *pkg = j->data; + alpm_pkg_t *pkg = j->data; pkg->infolevel &= ~INFRQ_DSIZE; pkg->download_size = 0; } @@ -859,7 +859,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) errors = 0; for(i = trans->add; i; i = i->next, current++) { - pmpkg_t *spkg = i->data; + alpm_pkg_t *spkg = i->data; int percent = (current * 100) / numtargs; const char *filename; char *filepath; @@ -881,7 +881,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) _alpm_log(handle, PM_LOG_DEBUG, "replacing pkgcache entry with package file for target %s\n", spkg->name); - pmpkg_t *pkgfile =_alpm_pkg_load_internal(handle, filepath, 1, spkg->md5sum, + alpm_pkg_t *pkgfile =_alpm_pkg_load_internal(handle, filepath, 1, spkg->md5sum, spkg->base64_sig, check_sig); if(!pkgfile) { errors++; diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 7e7c2558..73dd6a42 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -95,7 +95,7 @@ static alpm_list_t *check_arch(alpm_handle_t *handle, alpm_list_t *pkgs) return NULL; } for(i = pkgs; i; i = i->next) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; const char *pkgarch = alpm_pkg_get_arch(pkg); if(pkgarch && strcmp(pkgarch, arch) && strcmp(pkgarch, "any")) { char *string; diff --git a/lib/libalpm/trans.h b/lib/libalpm/trans.h index d9b8e90a..87238e4a 100644 --- a/lib/libalpm/trans.h +++ b/lib/libalpm/trans.h @@ -39,8 +39,8 @@ typedef enum _pmtransstate_t { struct __pmtrans_t { pmtransflag_t flags; pmtransstate_t state; - alpm_list_t *add; /* list of (pmpkg_t *) */ - alpm_list_t *remove; /* list of (pmpkg_t *) */ + alpm_list_t *add; /* list of (alpm_pkg_t *) */ + alpm_list_t *remove; /* list of (alpm_pkg_t *) */ alpm_list_t *skip_remove; /* list of (char *) */ alpm_trans_cb_event cb_event; alpm_trans_cb_conv cb_conv; diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h index 8006c74a..614c2fbb 100644 --- a/lib/libalpm/util.h +++ b/lib/libalpm/util.h @@ -28,7 +28,7 @@ #include "alpm_list.h" #include "alpm.h" -#include "package.h" /* pmpkg_t */ +#include "package.h" /* alpm_pkg_t */ #include "handle.h" /* alpm_handle_t */ #include diff --git a/src/pacman/package.c b/src/pacman/package.c index 32156c53..22b9045e 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -45,7 +45,7 @@ * @param from the type of package we are dealing with * @param extra should we show extra information */ -void dump_pkg_full(pmpkg_t *pkg, enum pkg_from from, int extra) +void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra) { const char *reason; time_t bdate, idate; @@ -192,7 +192,7 @@ static const char *get_backup_file_status(const char *root, /* Display list of backup files and their modification states */ -void dump_pkg_backups(pmpkg_t *pkg) +void dump_pkg_backups(alpm_pkg_t *pkg) { alpm_list_t *i; const char *root = alpm_option_get_root(config->handle); @@ -216,7 +216,7 @@ void dump_pkg_backups(pmpkg_t *pkg) /* List all files contained in a package */ -void dump_pkg_files(pmpkg_t *pkg, int quiet) +void dump_pkg_files(alpm_pkg_t *pkg, int quiet) { const char *pkgname, *root, *filestr; alpm_list_t *i, *pkgfiles; @@ -239,7 +239,7 @@ void dump_pkg_files(pmpkg_t *pkg, int quiet) /* Display the changelog of a package */ -void dump_pkg_changelog(pmpkg_t *pkg) +void dump_pkg_changelog(alpm_pkg_t *pkg) { void *fp = NULL; diff --git a/src/pacman/package.h b/src/pacman/package.h index 7a5e5853..6f71d20e 100644 --- a/src/pacman/package.h +++ b/src/pacman/package.h @@ -29,11 +29,11 @@ enum pkg_from { PKG_FROM_SYNCDB }; -void dump_pkg_full(pmpkg_t *pkg, enum pkg_from from, int extra); +void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra); -void dump_pkg_backups(pmpkg_t *pkg); -void dump_pkg_files(pmpkg_t *pkg, int quiet); -void dump_pkg_changelog(pmpkg_t *pkg); +void dump_pkg_backups(alpm_pkg_t *pkg); +void dump_pkg_files(alpm_pkg_t *pkg, int quiet); +void dump_pkg_changelog(alpm_pkg_t *pkg); #endif /* _PM_PACKAGE_H */ diff --git a/src/pacman/query.c b/src/pacman/query.c index e0ec2c68..2602c114 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -95,7 +95,7 @@ static int search_path(char **filename, struct stat *bufptr) return -1; } -static void print_query_fileowner(const char *filename, pmpkg_t *info) +static void print_query_fileowner(const char *filename, alpm_pkg_t *info) { if(!config->quiet) { printf(_("%s is owned by %s %s\n"), filename, @@ -189,7 +189,7 @@ static int query_fileowner(alpm_list_t *targets) for(i = alpm_db_get_pkgcache(db_local); i && !found; i = alpm_list_next(i)) { alpm_list_t *j; - pmpkg_t *info = alpm_list_getdata(i); + alpm_pkg_t *info = alpm_list_getdata(i); for(j = alpm_pkg_get_files(info); j && !found; j = alpm_list_next(j)) { char *ppath, *pdname; @@ -256,7 +256,7 @@ static int query_search(alpm_list_t *targets) for(i = searchlist; i; i = alpm_list_next(i)) { alpm_list_t *grp; - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); if(!config->quiet) { printf("local/%s %s", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg)); @@ -307,7 +307,7 @@ static int query_group(alpm_list_t *targets) const alpm_list_t *p; for(p = grp->packages; p; p = alpm_list_next(p)) { - pmpkg_t *pkg = alpm_list_getdata(p); + alpm_pkg_t *pkg = alpm_list_getdata(p); printf("%s %s\n", grp->name, alpm_pkg_get_name(pkg)); } } @@ -335,7 +335,7 @@ static int query_group(alpm_list_t *targets) return ret; } -static int is_foreign(pmpkg_t *pkg) +static int is_foreign(alpm_pkg_t *pkg) { const char *pkgname = alpm_pkg_get_name(pkg); alpm_list_t *j; @@ -344,7 +344,7 @@ static int is_foreign(pmpkg_t *pkg) int match = 0; for(j = sync_dbs; j; j = alpm_list_next(j)) { alpm_db_t *db = alpm_list_getdata(j); - pmpkg_t *findpkg = alpm_db_get_pkg(db, pkgname); + alpm_pkg_t *findpkg = alpm_db_get_pkg(db, pkgname); if(findpkg) { match = 1; break; @@ -356,7 +356,7 @@ static int is_foreign(pmpkg_t *pkg) return 0; } -static int is_unrequired(pmpkg_t *pkg) +static int is_unrequired(alpm_pkg_t *pkg) { alpm_list_t *requiredby = alpm_pkg_compute_requiredby(pkg); if(requiredby == NULL) { @@ -366,7 +366,7 @@ static int is_unrequired(pmpkg_t *pkg) return 0; } -static int filter(pmpkg_t *pkg) +static int filter(alpm_pkg_t *pkg) { /* check if this package was explicitly installed */ if(config->op_q_explicit && @@ -396,7 +396,7 @@ static int filter(pmpkg_t *pkg) /* Loop through the packages. For each package, * loop through files to check if they exist. */ -static int check(pmpkg_t *pkg) +static int check(alpm_pkg_t *pkg) { alpm_list_t *i; const char *root; @@ -446,7 +446,7 @@ static int check(pmpkg_t *pkg) return (errors != 0 ? 1 : 0); } -static int display(pmpkg_t *pkg) +static int display(alpm_pkg_t *pkg) { int ret = 0; @@ -482,7 +482,7 @@ int pacman_query(alpm_list_t *targets) int ret = 0; int match = 0; alpm_list_t *i; - pmpkg_t *pkg = NULL; + alpm_pkg_t *pkg = NULL; alpm_db_t *db_local; /* First: operations that do not require targets */ diff --git a/src/pacman/remove.c b/src/pacman/remove.c index f30f5068..c2490e3b 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -33,7 +33,7 @@ static int remove_target(const char *target) { - pmpkg_t *info; + alpm_pkg_t *info; alpm_db_t *db_local = alpm_option_get_localdb(config->handle); alpm_list_t *p; @@ -53,7 +53,7 @@ static int remove_target(const char *target) return -1; } for(p = grp->packages; p; p = alpm_list_next(p)) { - pmpkg_t *pkg = alpm_list_getdata(p); + alpm_pkg_t *pkg = alpm_list_getdata(p); if(alpm_remove_pkg(config->handle, pkg) == -1) { pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", target, alpm_strerror(alpm_errno(config->handle))); @@ -131,7 +131,7 @@ int pacman_remove(alpm_list_t *targets) /* Search for holdpkg in target list */ int holdpkg = 0; for(i = alpm_trans_get_remove(config->handle); i; i = alpm_list_next(i)) { - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); if(alpm_list_find_str(config->holdpkg, alpm_pkg_get_name(pkg))) { pm_printf(PM_LOG_WARNING, _("%s is designated as a HoldPkg.\n"), alpm_pkg_get_name(pkg)); diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 9dde7605..ae28ac97 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -196,7 +196,7 @@ static int sync_cleancache(int level) char path[PATH_MAX]; size_t pathlen; int delete = 1; - pmpkg_t *localpkg = NULL, *pkg = NULL; + alpm_pkg_t *localpkg = NULL, *pkg = NULL; const char *local_name, *local_version; if(strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) { @@ -308,11 +308,11 @@ static int sync_synctree(int level, alpm_list_t *syncs) return (success > 0); } -static void print_installed(alpm_db_t *db_local, pmpkg_t *pkg) +static void print_installed(alpm_db_t *db_local, alpm_pkg_t *pkg) { const char *pkgname = alpm_pkg_get_name(pkg); const char *pkgver = alpm_pkg_get_version(pkg); - pmpkg_t *lpkg = alpm_db_get_pkg(db_local, pkgname); + alpm_pkg_t *lpkg = alpm_db_get_pkg(db_local, pkgname); if(lpkg) { const char *lpkgver = alpm_pkg_get_version(lpkg); if(strcmp(lpkgver,pkgver) == 0) { @@ -348,7 +348,7 @@ static int sync_search(alpm_list_t *syncs, alpm_list_t *targets) } for(j = ret; j; j = alpm_list_next(j)) { alpm_list_t *grp; - pmpkg_t *pkg = alpm_list_getdata(j); + alpm_pkg_t *pkg = alpm_list_getdata(j); if(!config->quiet) { printf("%s/%s %s", alpm_db_get_name(db), alpm_pkg_get_name(pkg), @@ -471,7 +471,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) } for(k = alpm_db_get_pkgcache(db); k; k = alpm_list_next(k)) { - pmpkg_t *pkg = alpm_list_getdata(k); + alpm_pkg_t *pkg = alpm_list_getdata(k); if(strcmp(alpm_pkg_get_name(pkg), pkgstr) == 0) { dump_pkg_full(pkg, PKG_FROM_SYNCDB, config->op_s_info > 1); @@ -492,7 +492,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) alpm_db_t *db = alpm_list_getdata(j); for(k = alpm_db_get_pkgcache(db); k; k = alpm_list_next(k)) { - pmpkg_t *pkg = alpm_list_getdata(k); + alpm_pkg_t *pkg = alpm_list_getdata(k); if(strcmp(alpm_pkg_get_name(pkg), pkgstr) == 0) { dump_pkg_full(pkg, PKG_FROM_SYNCDB, config->op_s_info > 1); @@ -513,7 +513,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) alpm_db_t *db = alpm_list_getdata(i); for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) { - pmpkg_t *pkg = alpm_list_getdata(j); + alpm_pkg_t *pkg = alpm_list_getdata(j); dump_pkg_full(pkg, PKG_FROM_SYNCDB, config->op_s_info > 1); } } @@ -558,7 +558,7 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets) alpm_db_t *db = alpm_list_getdata(i); for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) { - pmpkg_t *pkg = alpm_list_getdata(j); + alpm_pkg_t *pkg = alpm_list_getdata(j); if(!config->quiet) { printf("%s %s %s", alpm_db_get_name(db), alpm_pkg_get_name(pkg), @@ -585,7 +585,7 @@ static alpm_list_t *syncfirst(void) { for(i = config->syncfirst; i; i = alpm_list_next(i)) { char *pkgname = alpm_list_getdata(i); - pmpkg_t *pkg = alpm_db_get_pkg(db_local, pkgname); + alpm_pkg_t *pkg = alpm_db_get_pkg(db_local, pkgname); if(pkg == NULL) { continue; } @@ -610,7 +610,7 @@ static alpm_db_t *get_db(const char *dbname) return NULL; } -static int process_pkg(pmpkg_t *pkg) +static int process_pkg(alpm_pkg_t *pkg) { int ret = alpm_add_pkg(config->handle, pkg); @@ -653,7 +653,7 @@ static int process_group(alpm_list_t *dbs, char *group) for(i = pkgs; i; i = alpm_list_next(i)) { if(array[n++] == 0) continue; - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); if(process_pkg(pkg) == 1) { ret = 1; @@ -663,7 +663,7 @@ static int process_group(alpm_list_t *dbs, char *group) } } else { for(i = pkgs; i; i = alpm_list_next(i)) { - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); if(process_pkg(pkg) == 1) { ret = 1; @@ -678,7 +678,7 @@ cleanup: static int process_targname(alpm_list_t *dblist, char *targname) { - pmpkg_t *pkg = alpm_find_dbs_satisfier(config->handle, dblist, targname); + alpm_pkg_t *pkg = alpm_find_dbs_satisfier(config->handle, dblist, targname); /* #FS#23342 - skip ignored packages when user says no */ if(alpm_errno(config->handle) == PM_ERR_PKG_IGNORED) { diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c index c1f72f6d..24420ef0 100644 --- a/src/pacman/upgrade.c +++ b/src/pacman/upgrade.c @@ -74,7 +74,7 @@ int pacman_upgrade(alpm_list_t *targets) /* add targets to the created transaction */ for(i = targets; i; i = alpm_list_next(i)) { char *targ = alpm_list_getdata(i); - pmpkg_t *pkg; + alpm_pkg_t *pkg; if(alpm_pkg_load(config->handle, targ, 1, check_sig, &pkg) != 0) { pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", diff --git a/src/pacman/util.c b/src/pacman/util.c index cdf8b11a..1e6d1e18 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -660,7 +660,7 @@ static alpm_list_t *create_verbose_header(int install) } /* returns package info as list of strings */ -static alpm_list_t *create_verbose_row(pmpkg_t *pkg, int install) +static alpm_list_t *create_verbose_row(alpm_pkg_t *pkg, int install) { char *str; double size; @@ -674,7 +674,7 @@ static alpm_list_t *create_verbose_row(pmpkg_t *pkg, int install) /* old and new versions */ if(install) { - pmpkg_t *oldpkg = alpm_db_get_pkg(ldb, alpm_pkg_get_name(pkg)); + alpm_pkg_t *oldpkg = alpm_db_get_pkg(ldb, alpm_pkg_get_name(pkg)); pm_asprintf(&str, "%s", oldpkg != NULL ? alpm_pkg_get_version(oldpkg) : ""); ret = alpm_list_add(ret, str); @@ -708,10 +708,10 @@ void display_targets(const alpm_list_t *pkgs, int install) /* gather pkg infos */ for(i = pkgs; i; i = alpm_list_next(i)) { - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); if(install) { - pmpkg_t *lpkg = alpm_db_get_pkg(db_local, alpm_pkg_get_name(pkg)); + alpm_pkg_t *lpkg = alpm_db_get_pkg(db_local, alpm_pkg_get_name(pkg)); dlsize += alpm_pkg_download_size(pkg); if(lpkg) { /* add up size of all removed packages */ @@ -779,7 +779,7 @@ out: free(str); } -static off_t pkg_get_size(pmpkg_t *pkg) +static off_t pkg_get_size(alpm_pkg_t *pkg) { switch(config->op) { case PM_OP_SYNC: @@ -791,7 +791,7 @@ static off_t pkg_get_size(pmpkg_t *pkg) } } -static char *pkg_get_location(pmpkg_t *pkg) +static char *pkg_get_location(alpm_pkg_t *pkg) { alpm_list_t *servers; char *string = NULL; @@ -856,7 +856,7 @@ void print_packages(const alpm_list_t *packages) config->print_format = strdup("%l"); } for(i = packages; i; i = alpm_list_next(i)) { - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); char *string = strdup(config->print_format); char *temp = string; /* %n : pkgname */ @@ -910,7 +910,7 @@ int str_cmp(const void *s1, const void *s2) return strcmp(s1, s2); } -void display_new_optdepends(pmpkg_t *oldpkg, pmpkg_t *newpkg) +void display_new_optdepends(alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg) { alpm_list_t *old = alpm_pkg_get_optdepends(oldpkg); alpm_list_t *new = alpm_pkg_get_optdepends(newpkg); @@ -922,7 +922,7 @@ void display_new_optdepends(pmpkg_t *oldpkg, pmpkg_t *newpkg) alpm_list_free(optdeps); } -void display_optdepends(pmpkg_t *pkg) +void display_optdepends(alpm_pkg_t *pkg) { alpm_list_t *optdeps = alpm_pkg_get_optdepends(pkg); if(optdeps) { @@ -949,7 +949,7 @@ void select_display(const alpm_list_t *pkglist) const char *dbname = NULL; for (i = pkglist; i; i = i->next) { - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); alpm_db_t *db = alpm_pkg_get_db(pkg); if(!dbname) diff --git a/src/pacman/util.h b/src/pacman/util.h index d8ae7d80..89ab903a 100644 --- a/src/pacman/util.h +++ b/src/pacman/util.h @@ -58,8 +58,8 @@ void list_display(const char *title, const alpm_list_t *list); void list_display_linebreak(const char *title, const alpm_list_t *list); void display_targets(const alpm_list_t *pkgs, int install); int str_cmp(const void *s1, const void *s2); -void display_new_optdepends(pmpkg_t *oldpkg, pmpkg_t *newpkg); -void display_optdepends(pmpkg_t *pkg); +void display_new_optdepends(alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg); +void display_optdepends(alpm_pkg_t *pkg); void print_packages(const alpm_list_t *packages); void select_display(const alpm_list_t *pkglist); int select_question(int count); diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c index f56063db..dcd849bb 100644 --- a/src/util/cleanupdelta.c +++ b/src/util/cleanupdelta.c @@ -57,7 +57,7 @@ static void checkpkgs(alpm_list_t *pkglist) { alpm_list_t *i, *j; for(i = pkglist; i; i = alpm_list_next(i)) { - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); alpm_list_t *unused = alpm_pkg_unused_deltas(pkg); for(j = unused; j; j = alpm_list_next(j)) { char *delta = alpm_list_getdata(j); diff --git a/src/util/pactree.c b/src/util/pactree.c index 35ef9439..f677a4de 100644 --- a/src/util/pactree.c +++ b/src/util/pactree.c @@ -316,9 +316,9 @@ static void print_end(void) } } -static pmpkg_t *get_pkg_from_dbs(alpm_list_t *dbs, const char *needle) { +static alpm_pkg_t *get_pkg_from_dbs(alpm_list_t *dbs, const char *needle) { alpm_list_t *i; - pmpkg_t *ret; + alpm_pkg_t *ret; for(i = dbs; i; i = alpm_list_next(i)) { ret = alpm_db_get_pkg(alpm_list_getdata(i), needle); @@ -332,7 +332,7 @@ static pmpkg_t *get_pkg_from_dbs(alpm_list_t *dbs, const char *needle) { /** * walk dependencies in reverse, showing packages which require the target */ -static void walk_reverse_deps(alpm_list_t *dblist, pmpkg_t *pkg, int depth) +static void walk_reverse_deps(alpm_list_t *dblist, alpm_pkg_t *pkg, int depth) { alpm_list_t *required_by, *i; @@ -364,7 +364,7 @@ static void walk_reverse_deps(alpm_list_t *dblist, pmpkg_t *pkg, int depth) /** * walk dependencies, showing dependencies of the target */ -static void walk_deps(alpm_list_t *dblist, pmpkg_t *pkg, int depth) +static void walk_deps(alpm_list_t *dblist, alpm_pkg_t *pkg, int depth) { alpm_list_t *i; @@ -376,7 +376,7 @@ static void walk_deps(alpm_list_t *dblist, pmpkg_t *pkg, int depth) for(i = alpm_pkg_get_depends(pkg); i; i = alpm_list_next(i)) { pmdepend_t *depend = alpm_list_getdata(i); - pmpkg_t *provider = alpm_find_dbs_satisfier(handle, dblist, depend->name); + alpm_pkg_t *provider = alpm_find_dbs_satisfier(handle, dblist, depend->name); if(provider) { const char *provname = alpm_pkg_get_name(provider); @@ -403,7 +403,7 @@ int main(int argc, char *argv[]) int freelist = 0, ret = 0; enum _pmerrno_t err; const char *target_name; - pmpkg_t *pkg; + alpm_pkg_t *pkg; alpm_list_t *dblist = NULL; if(parse_options(argc, argv) != 0) { diff --git a/src/util/testpkg.c b/src/util/testpkg.c index 93d3fccd..972b2f47 100644 --- a/src/util/testpkg.c +++ b/src/util/testpkg.c @@ -42,7 +42,7 @@ int main(int argc, char *argv[]) int retval = 1; /* default = false */ alpm_handle_t *handle; enum _pmerrno_t err; - pmpkg_t *pkg = NULL; + alpm_pkg_t *pkg = NULL; if(argc != 2) { fprintf(stderr, "usage: %s \n", BASENAME); -- cgit v1.2.3-70-g09d2 From 9540dfc4d9cc70266a425cc334f78d7805b2340b Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:29:55 +1000 Subject: Rename pmdepend_t to alpm_depend_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 12 ++++++------ lib/libalpm/be_local.c | 2 +- lib/libalpm/be_package.c | 2 +- lib/libalpm/conflict.c | 2 +- lib/libalpm/deps.c | 42 +++++++++++++++++++++--------------------- lib/libalpm/deps.h | 8 ++++---- lib/libalpm/sync.c | 4 ++-- src/pacman/callback.c | 2 +- src/pacman/package.c | 2 +- src/util/pactree.c | 2 +- 10 files changed, 39 insertions(+), 39 deletions(-) (limited to 'src/util') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 16a30a41..c23fa4d3 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -106,17 +106,17 @@ typedef struct __alpm_pkg_t alpm_pkg_t; typedef struct __alpm_trans_t alpm_trans_t; /** Dependency */ -typedef struct _pmdepend_t { +typedef struct _alpm_depend_t { char *name; char *version; unsigned long name_hash; alpm_depmod_t mod; -} pmdepend_t; +} alpm_depend_t; /** Missing dependency */ typedef struct _pmdepmissing_t { char *target; - pmdepend_t *depend; + alpm_depend_t *depend; /* this is used in case of remove dependency error only */ char *causingpkg; } pmdepmissing_t; @@ -581,9 +581,9 @@ alpm_list_t *alpm_pkg_get_licenses(alpm_pkg_t *pkg); */ alpm_list_t *alpm_pkg_get_groups(alpm_pkg_t *pkg); -/** Returns the list of package dependencies as pmdepend_t. +/** Returns the list of package dependencies as alpm_depend_t. * @param pkg a pointer to package - * @return a reference to an internal list of pmdepend_t structures. + * @return a reference to an internal list of alpm_depend_t structures. */ alpm_list_t *alpm_pkg_get_depends(alpm_pkg_t *pkg); @@ -967,7 +967,7 @@ alpm_list_t *alpm_checkconflicts(alpm_handle_t *handle, alpm_list_t *pkglist); * @param dep a dependency info structure * @return a formatted string, e.g. "glibc>=2.12" */ -char *alpm_dep_compute_string(const pmdepend_t *dep); +char *alpm_dep_compute_string(const alpm_depend_t *dep); /** @} */ diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index f59f74fe..06a948c1 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -639,7 +639,7 @@ int _alpm_local_db_read(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq) } } else if(strcmp(line, "%DEPENDS%") == 0) { while(fgets(line, sizeof(line), fp) && strlen(_alpm_strtrim(line))) { - pmdepend_t *dep = _alpm_splitdep(line); + alpm_depend_t *dep = _alpm_splitdep(line); info->depends = alpm_list_add(info->depends, dep); } } else if(strcmp(line, "%OPTDEPENDS%") == 0) { diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index 4433d31c..a372526d 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -189,7 +189,7 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t * /* size in the raw package is uncompressed (installed) size */ newpkg->isize = atol(ptr); } else if(strcmp(key, "depend") == 0) { - pmdepend_t *dep = _alpm_splitdep(ptr); + alpm_depend_t *dep = _alpm_splitdep(ptr); newpkg->depends = alpm_list_add(newpkg->depends, dep); } else if(strcmp(key, "optdepend") == 0) { newpkg->optdepends = alpm_list_add(newpkg->optdepends, strdup(ptr)); diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 8a626be6..1e535122 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -145,7 +145,7 @@ static void check_conflict(alpm_handle_t *handle, for(j = alpm_pkg_get_conflicts(pkg1); j; j = j->next) { const char *conflict = j->data; alpm_list_t *k; - pmdepend_t *parsed_conflict = _alpm_splitdep(conflict); + alpm_depend_t *parsed_conflict = _alpm_splitdep(conflict); for(k = list2; k; k = k->next) { alpm_pkg_t *pkg2 = k->data; diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 914d1a3a..93a7821e 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -37,14 +37,14 @@ #include "handle.h" #include "trans.h" -void _alpm_dep_free(pmdepend_t *dep) +void _alpm_dep_free(alpm_depend_t *dep) { FREE(dep->name); FREE(dep->version); FREE(dep); } -static pmdepmissing_t *depmiss_new(const char *target, pmdepend_t *dep, +static pmdepmissing_t *depmiss_new(const char *target, alpm_depend_t *dep, const char *causingpkg) { pmdepmissing_t *miss; @@ -208,10 +208,10 @@ static int no_dep_version(alpm_handle_t *handle) return flags != -1 && (flags & PM_TRANS_FLAG_NODEPVERSION); } -static pmdepend_t *filtered_depend(pmdepend_t *dep, int nodepversion) +static alpm_depend_t *filtered_depend(alpm_depend_t *dep, int nodepversion) { if(nodepversion) { - pmdepend_t *newdep = _alpm_dep_dup(dep); + alpm_depend_t *newdep = _alpm_dep_dup(dep); ASSERT(newdep, return dep); newdep->mod = PM_DEP_MOD_ANY; dep = newdep; @@ -219,14 +219,14 @@ static pmdepend_t *filtered_depend(pmdepend_t *dep, int nodepversion) return dep; } -static void release_filtered_depend(pmdepend_t *dep, int nodepversion) +static void release_filtered_depend(alpm_depend_t *dep, int nodepversion) { if(nodepversion) { free(dep); } } -static alpm_pkg_t *find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep) +static alpm_pkg_t *find_dep_satisfier(alpm_list_t *pkgs, alpm_depend_t *dep) { alpm_list_t *i; @@ -247,7 +247,7 @@ static alpm_pkg_t *find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep) */ alpm_pkg_t SYMEXPORT *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstring) { - pmdepend_t *dep = _alpm_splitdep(depstring); + alpm_depend_t *dep = _alpm_splitdep(depstring); if(!dep) { return NULL; } @@ -295,7 +295,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis alpm_pkg_get_name(tp), alpm_pkg_get_version(tp)); for(j = alpm_pkg_get_depends(tp); j; j = j->next) { - pmdepend_t *depend = j->data; + alpm_depend_t *depend = j->data; depend = filtered_depend(depend, nodepversion); /* 1. we check the upgrade list */ /* 2. we check database for untouched satisfying packages */ @@ -320,7 +320,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis for(i = dblist; i; i = i->next) { alpm_pkg_t *lp = i->data; for(j = alpm_pkg_get_depends(lp); j; j = j->next) { - pmdepend_t *depend = j->data; + alpm_depend_t *depend = j->data; depend = filtered_depend(depend, nodepversion); alpm_pkg_t *causingpkg = find_dep_satisfier(modified, depend); /* we won't break this depend, if it is already broken, we ignore it */ @@ -369,7 +369,7 @@ static int dep_vercmp(const char *version1, alpm_depmod_t mod, return equal; } -int _alpm_depcmp(alpm_pkg_t *pkg, pmdepend_t *dep) +int _alpm_depcmp(alpm_pkg_t *pkg, alpm_depend_t *dep) { alpm_list_t *i; int satisfy = 0; @@ -411,16 +411,16 @@ int _alpm_depcmp(alpm_pkg_t *pkg, pmdepend_t *dep) return satisfy; } -pmdepend_t *_alpm_splitdep(const char *depstring) +alpm_depend_t *_alpm_splitdep(const char *depstring) { - pmdepend_t *depend; + alpm_depend_t *depend; const char *ptr, *version = NULL; if(depstring == NULL) { return NULL; } - CALLOC(depend, 1, sizeof(pmdepend_t), return NULL); + CALLOC(depend, 1, sizeof(alpm_depend_t), return NULL); /* Find a version comparator if one exists. If it does, set the type and * increment the ptr accordingly so we can copy the right strings. */ @@ -455,10 +455,10 @@ pmdepend_t *_alpm_splitdep(const char *depstring) return depend; } -pmdepend_t *_alpm_dep_dup(const pmdepend_t *dep) +alpm_depend_t *_alpm_dep_dup(const alpm_depend_t *dep) { - pmdepend_t *newdep; - CALLOC(newdep, 1, sizeof(pmdepend_t), return NULL); + alpm_depend_t *newdep; + CALLOC(newdep, 1, sizeof(alpm_depend_t), return NULL); STRDUP(newdep->name, dep->name, return NULL); newdep->name_hash = dep->name_hash; @@ -554,7 +554,7 @@ void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit) * an error code without prompting * @return the resolved package **/ -static alpm_pkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, +static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep, alpm_list_t *dbs, alpm_list_t *excluding, int prompt) { alpm_list_t *i, *j; @@ -656,7 +656,7 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, alpm_pkg_t SYMEXPORT *alpm_find_dbs_satisfier(alpm_handle_t *handle, alpm_list_t *dbs, const char *depstring) { - pmdepend_t *dep; + alpm_depend_t *dep; alpm_pkg_t *pkg; CHECK_HANDLE(handle, return NULL); @@ -719,7 +719,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t for(j = deps; j; j = j->next) { pmdepmissing_t *miss = j->data; - pmdepend_t *missdep = miss->depend; + alpm_depend_t *missdep = miss->depend; /* check if one of the packages in the [*packages] list already satisfies * this dependency */ if(find_dep_satisfier(*packages, missdep)) { @@ -764,12 +764,12 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t return ret; } -/** Reverse of splitdep; make a dep string from a pmdepend_t struct. +/** Reverse of splitdep; make a dep string from a alpm_depend_t struct. * The string must be freed! * @param dep the depend to turn into a string * @return a string-formatted dependency with operator if necessary */ -char SYMEXPORT *alpm_dep_compute_string(const pmdepend_t *dep) +char SYMEXPORT *alpm_dep_compute_string(const alpm_depend_t *dep) { const char *name, *opr, *ver; char *str; diff --git a/lib/libalpm/deps.h b/lib/libalpm/deps.h index 438c803a..8935175d 100644 --- a/lib/libalpm/deps.h +++ b/lib/libalpm/deps.h @@ -27,16 +27,16 @@ #include "package.h" #include "alpm.h" -void _alpm_dep_free(pmdepend_t *dep); -pmdepend_t *_alpm_dep_dup(const pmdepend_t *dep); +void _alpm_dep_free(alpm_depend_t *dep); +alpm_depend_t *_alpm_dep_dup(const alpm_depend_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(alpm_db_t *db, alpm_list_t *targs, int include_explicit); int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t *pkg, alpm_list_t *preferred, alpm_list_t **packages, alpm_list_t *remove, alpm_list_t **data); -pmdepend_t *_alpm_splitdep(const char *depstring); -int _alpm_depcmp(alpm_pkg_t *pkg, pmdepend_t *dep); +alpm_depend_t *_alpm_splitdep(const char *depstring); +int _alpm_depcmp(alpm_pkg_t *pkg, alpm_depend_t *dep); #endif /* _ALPM_DEPS_H */ diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index f447c067..e3dda23d 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -419,8 +419,8 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) conflict->package1, conflict->package2); /* if sync1 provides sync2, we remove sync2 from the targets, and vice versa */ - pmdepend_t *dep1 = _alpm_splitdep(conflict->package1); - pmdepend_t *dep2 = _alpm_splitdep(conflict->package2); + alpm_depend_t *dep1 = _alpm_splitdep(conflict->package1); + alpm_depend_t *dep2 = _alpm_splitdep(conflict->package2); if(_alpm_depcmp(sync1, dep2)) { rsync = sync2; sync = sync1; diff --git a/src/pacman/callback.c b/src/pacman/callback.c index ffca8bec..0cc462d6 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -312,7 +312,7 @@ void cb_trans_conv(pmtransconv_t event, void *data1, void *data2, { alpm_list_t *providers = (alpm_list_t *)data1; int count = alpm_list_count(providers); - char *depstring = alpm_dep_compute_string((pmdepend_t *)data2); + char *depstring = alpm_dep_compute_string((alpm_depend_t *)data2); printf(_(":: There are %d providers available for %s:\n"), count, depstring); free(depstring); diff --git a/src/pacman/package.c b/src/pacman/package.c index 22b9045e..49d80ef0 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -83,7 +83,7 @@ void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra) /* turn depends list into a text list */ for(i = alpm_pkg_get_depends(pkg); i; i = alpm_list_next(i)) { - pmdepend_t *dep = (pmdepend_t *)alpm_list_getdata(i); + alpm_depend_t *dep = (alpm_depend_t *)alpm_list_getdata(i); depstrings = alpm_list_add(depstrings, alpm_dep_compute_string(dep)); } diff --git a/src/util/pactree.c b/src/util/pactree.c index f677a4de..bdc1cb2f 100644 --- a/src/util/pactree.c +++ b/src/util/pactree.c @@ -375,7 +375,7 @@ static void walk_deps(alpm_list_t *dblist, alpm_pkg_t *pkg, int depth) walked = alpm_list_add(walked, (void *)alpm_pkg_get_name(pkg)); for(i = alpm_pkg_get_depends(pkg); i; i = alpm_list_next(i)) { - pmdepend_t *depend = alpm_list_getdata(i); + alpm_depend_t *depend = alpm_list_getdata(i); alpm_pkg_t *provider = alpm_find_dbs_satisfier(handle, dblist, depend->name); if(provider) { -- cgit v1.2.3-70-g09d2 From 6d876f9b6be055d54e50d42a34c267aad64c0b21 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:32:09 +1000 Subject: Rename pmdepmissing_t to alpm_depmissing_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 6 +++--- lib/libalpm/deps.c | 16 ++++++++-------- lib/libalpm/deps.h | 2 +- lib/libalpm/remove.c | 6 +++--- src/pacman/remove.c | 2 +- src/pacman/sync.c | 2 +- src/pacman/upgrade.c | 2 +- src/util/testdb.c | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src/util') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index c23fa4d3..53ff4a9f 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -114,12 +114,12 @@ typedef struct _alpm_depend_t { } alpm_depend_t; /** Missing dependency */ -typedef struct _pmdepmissing_t { +typedef struct _alpm_depmissing_t { char *target; alpm_depend_t *depend; /* this is used in case of remove dependency error only */ char *causingpkg; -} pmdepmissing_t; +} alpm_depmissing_t; /** Conflict */ typedef struct _pmconflict_t { @@ -895,7 +895,7 @@ int alpm_trans_init(alpm_handle_t *handle, pmtransflag_t flags, /** Prepare a transaction. * @param handle the context handle * @param data the address of an alpm_list where a list - * of pmdepmissing_t objects is dumped (conflicting packages) + * of alpm_depmissing_t objects is dumped (conflicting packages) * @return 0 on success, -1 on error (pm_errno is set accordingly) */ int alpm_trans_prepare(alpm_handle_t *handle, alpm_list_t **data); diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 93a7821e..2ec5451e 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -44,12 +44,12 @@ void _alpm_dep_free(alpm_depend_t *dep) FREE(dep); } -static pmdepmissing_t *depmiss_new(const char *target, alpm_depend_t *dep, +static alpm_depmissing_t *depmiss_new(const char *target, alpm_depend_t *dep, const char *causingpkg) { - pmdepmissing_t *miss; + alpm_depmissing_t *miss; - MALLOC(miss, sizeof(pmdepmissing_t), return NULL); + MALLOC(miss, sizeof(alpm_depmissing_t), return NULL); STRDUP(miss->target, target, return NULL); miss->depend = _alpm_dep_dup(dep); @@ -58,7 +58,7 @@ static pmdepmissing_t *depmiss_new(const char *target, alpm_depend_t *dep, return miss; } -void _alpm_depmiss_free(pmdepmissing_t *miss) +void _alpm_depmiss_free(alpm_depmissing_t *miss) { _alpm_dep_free(miss->depend); FREE(miss->target); @@ -263,7 +263,7 @@ alpm_pkg_t SYMEXPORT *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstri * @param remove an alpm_list_t* of packages to be removed * @param upgrade an alpm_list_t* of packages to be upgraded (remove-then-upgrade) * @param reversedeps handles the backward dependencies - * @return an alpm_list_t* of pmdepmissing_t pointers. + * @return an alpm_list_t* of alpm_depmissing_t pointers. */ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglist, alpm_list_t *remove, alpm_list_t *upgrade, int reversedeps) @@ -302,7 +302,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis if(!find_dep_satisfier(upgrade, depend) && !find_dep_satisfier(dblist, depend)) { /* Unsatisfied dependency in the upgrade list */ - pmdepmissing_t *miss; + alpm_depmissing_t *miss; char *missdepstring = alpm_dep_compute_string(depend); _alpm_log(handle, PM_LOG_DEBUG, "checkdeps: missing dependency '%s' for package '%s'\n", missdepstring, alpm_pkg_get_name(tp)); @@ -329,7 +329,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis if(causingpkg && !find_dep_satisfier(upgrade, depend) && !find_dep_satisfier(dblist, depend)) { - pmdepmissing_t *miss; + alpm_depmissing_t *miss; char *missdepstring = alpm_dep_compute_string(depend); _alpm_log(handle, PM_LOG_DEBUG, "checkdeps: transaction would break '%s' dependency of '%s'\n", missdepstring, alpm_pkg_get_name(lp)); @@ -718,7 +718,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t alpm_list_free(targ); for(j = deps; j; j = j->next) { - pmdepmissing_t *miss = j->data; + alpm_depmissing_t *miss = j->data; alpm_depend_t *missdep = miss->depend; /* check if one of the packages in the [*packages] list already satisfies * this dependency */ diff --git a/lib/libalpm/deps.h b/lib/libalpm/deps.h index 8935175d..6ef4cbbe 100644 --- a/lib/libalpm/deps.h +++ b/lib/libalpm/deps.h @@ -29,7 +29,7 @@ void _alpm_dep_free(alpm_depend_t *dep); alpm_depend_t *_alpm_dep_dup(const alpm_depend_t *dep); -void _alpm_depmiss_free(pmdepmissing_t *miss); +void _alpm_depmiss_free(alpm_depmissing_t *miss); alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, alpm_list_t *targets, int reverse); 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, alpm_pkg_t *pkg, diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index aab49f13..3412774b 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -77,7 +77,7 @@ static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp) while(lp) { alpm_list_t *i; for(i = lp; i; i = i->next) { - pmdepmissing_t *miss = (pmdepmissing_t *)i->data; + alpm_depmissing_t *miss = (alpm_depmissing_t *)i->data; alpm_pkg_t *info = _alpm_db_get_pkgfromcache(handle->db_local, miss->target); if(info) { if(!_alpm_pkg_find(trans->remove, alpm_pkg_get_name(info))) { @@ -105,7 +105,7 @@ static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp) while(lp != NULL) { alpm_list_t *i; for(i = lp; i; i = i->next) { - pmdepmissing_t *miss = (pmdepmissing_t *)i->data; + alpm_depmissing_t *miss = (alpm_depmissing_t *)i->data; void *vpkg; alpm_pkg_t *pkg = _alpm_pkg_find(trans->remove, miss->causingpkg); if(pkg == NULL) { @@ -129,7 +129,7 @@ static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp) /** Transaction preparation for remove actions. * This functions takes a pointer to a alpm_list_t which will be - * filled with a list of pmdepmissing_t* objects representing + * filled with a list of alpm_depmissing_t* objects representing * the packages blocking the transaction. * @param handle the context handle * @param data a pointer to an alpm_list_t* to fill diff --git a/src/pacman/remove.c b/src/pacman/remove.c index c2490e3b..75388f1a 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -114,7 +114,7 @@ int pacman_remove(alpm_list_t *targets) break; case PM_ERR_UNSATISFIED_DEPS: for(i = data; i; i = alpm_list_next(i)) { - pmdepmissing_t *miss = alpm_list_getdata(i); + alpm_depmissing_t *miss = alpm_list_getdata(i); char *depstring = alpm_dep_compute_string(miss->depend); printf(_(":: %s: requires %s\n"), miss->target, depstring); free(depstring); diff --git a/src/pacman/sync.c b/src/pacman/sync.c index ae28ac97..659396cd 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -775,7 +775,7 @@ static int sync_trans(alpm_list_t *targets) break; case PM_ERR_UNSATISFIED_DEPS: for(i = data; i; i = alpm_list_next(i)) { - pmdepmissing_t *miss = alpm_list_getdata(i); + alpm_depmissing_t *miss = alpm_list_getdata(i); char *depstring = alpm_dep_compute_string(miss->depend); printf(_(":: %s: requires %s\n"), miss->target, depstring); free(depstring); diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c index 24420ef0..67860277 100644 --- a/src/pacman/upgrade.c +++ b/src/pacman/upgrade.c @@ -106,7 +106,7 @@ int pacman_upgrade(alpm_list_t *targets) break; case PM_ERR_UNSATISFIED_DEPS: for(i = data; i; i = alpm_list_next(i)) { - pmdepmissing_t *miss = alpm_list_getdata(i); + alpm_depmissing_t *miss = alpm_list_getdata(i); char *depstring = alpm_dep_compute_string(miss->depend); /* TODO indicate if the error was a virtual package or not: diff --git a/src/util/testdb.c b/src/util/testdb.c index 91dc9b23..fff43a22 100644 --- a/src/util/testdb.c +++ b/src/util/testdb.c @@ -100,7 +100,7 @@ static int checkdeps(alpm_list_t *pkglist) /* check dependencies */ data = alpm_checkdeps(handle, pkglist, NULL, pkglist, 0); for(i = data; i; i = alpm_list_next(i)) { - pmdepmissing_t *miss = alpm_list_getdata(i); + alpm_depmissing_t *miss = alpm_list_getdata(i); char *depstring = alpm_dep_compute_string(miss->depend); printf("missing dependency for %s : %s\n", miss->target, depstring); -- cgit v1.2.3-70-g09d2 From 220842b37ba484a452f5e4d8071d91d3f2b6c2d4 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:33:55 +1000 Subject: Rename pmconflict_t to alpm_conflict_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 4 ++-- lib/libalpm/conflict.c | 22 +++++++++++----------- lib/libalpm/conflict.h | 4 ++-- lib/libalpm/sync.c | 8 ++++---- src/pacman/sync.c | 2 +- src/pacman/upgrade.c | 2 +- src/util/testdb.c | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src/util') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 53ff4a9f..ff966f18 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -122,11 +122,11 @@ typedef struct _alpm_depmissing_t { } alpm_depmissing_t; /** Conflict */ -typedef struct _pmconflict_t { +typedef struct _alpm_conflict_t { char *package1; char *package2; char *reason; -} pmconflict_t; +} alpm_conflict_t; /** File conflict */ typedef struct _pmfileconflict_t { diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 1e535122..83a1fa5f 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -40,12 +40,12 @@ #include "log.h" #include "deps.h" -static pmconflict_t *conflict_new(const char *package1, const char *package2, +static alpm_conflict_t *conflict_new(const char *package1, const char *package2, const char *reason) { - pmconflict_t *conflict; + alpm_conflict_t *conflict; - MALLOC(conflict, sizeof(pmconflict_t), return NULL); + MALLOC(conflict, sizeof(alpm_conflict_t), return NULL); STRDUP(conflict->package1, package1, return NULL); STRDUP(conflict->package2, package2, return NULL); @@ -54,7 +54,7 @@ static pmconflict_t *conflict_new(const char *package1, const char *package2, return conflict; } -void _alpm_conflict_free(pmconflict_t *conflict) +void _alpm_conflict_free(alpm_conflict_t *conflict) { FREE(conflict->package2); FREE(conflict->package1); @@ -62,10 +62,10 @@ void _alpm_conflict_free(pmconflict_t *conflict) FREE(conflict); } -pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict) +alpm_conflict_t *_alpm_conflict_dup(const alpm_conflict_t *conflict) { - pmconflict_t *newconflict; - CALLOC(newconflict, 1, sizeof(pmconflict_t), ); + alpm_conflict_t *newconflict; + CALLOC(newconflict, 1, sizeof(alpm_conflict_t), ); STRDUP(newconflict->package1, conflict->package1, return NULL); STRDUP(newconflict->package2, conflict->package2, return NULL); @@ -74,14 +74,14 @@ pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict) return newconflict; } -static int conflict_isin(pmconflict_t *needle, alpm_list_t *haystack) +static int conflict_isin(alpm_conflict_t *needle, alpm_list_t *haystack) { alpm_list_t *i; const char *npkg1 = needle->package1; const char *npkg2 = needle->package2; for(i = haystack; i; i = i->next) { - pmconflict_t *conflict = i->data; + alpm_conflict_t *conflict = i->data; const char *cpkg1 = conflict->package1; const char *cpkg2 = conflict->package2; if((strcmp(cpkg1, npkg1) == 0 && strcmp(cpkg2, npkg2) == 0) @@ -103,7 +103,7 @@ static int conflict_isin(pmconflict_t *needle, alpm_list_t *haystack) static int add_conflict(alpm_handle_t *handle, alpm_list_t **baddeps, const char *pkg1, const char *pkg2, const char *reason) { - pmconflict_t *conflict = conflict_new(pkg1, pkg2, reason); + alpm_conflict_t *conflict = conflict_new(pkg1, pkg2, reason); if(!conflict) { return -1; } @@ -209,7 +209,7 @@ alpm_list_t *_alpm_outerconflicts(alpm_db_t *db, alpm_list_t *packages) * * @param handle the context handle * @param pkglist the list of packages to check - * @return an alpm_list_t of pmconflict_t + * @return an alpm_list_t of alpm_conflict_t */ alpm_list_t SYMEXPORT *alpm_checkconflicts(alpm_handle_t *handle, alpm_list_t *pkglist) diff --git a/lib/libalpm/conflict.h b/lib/libalpm/conflict.h index 83266959..4edbe620 100644 --- a/lib/libalpm/conflict.h +++ b/lib/libalpm/conflict.h @@ -24,8 +24,8 @@ #include "db.h" #include "package.h" -pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict); -void _alpm_conflict_free(pmconflict_t *conflict); +alpm_conflict_t *_alpm_conflict_dup(const alpm_conflict_t *conflict); +void _alpm_conflict_free(alpm_conflict_t *conflict); alpm_list_t *_alpm_innerconflicts(alpm_handle_t *handle, 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, diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index e3dda23d..954253d9 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -405,7 +405,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) deps = _alpm_innerconflicts(handle, trans->add); for(i = deps; i; i = i->next) { - pmconflict_t *conflict = i->data; + alpm_conflict_t *conflict = i->data; alpm_pkg_t *rsync, *sync, *sync1, *sync2; /* have we already removed one of the conflicting targets? */ @@ -432,7 +432,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) handle->pm_errno = PM_ERR_CONFLICTING_DEPS; ret = -1; if(data) { - pmconflict_t *newconflict = _alpm_conflict_dup(conflict); + alpm_conflict_t *newconflict = _alpm_conflict_dup(conflict); if(newconflict) { *data = alpm_list_add(*data, newconflict); } @@ -464,7 +464,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) deps = _alpm_outerconflicts(handle->db_local, trans->add); for(i = deps; i; i = i->next) { - pmconflict_t *conflict = i->data; + alpm_conflict_t *conflict = i->data; /* if conflict->package2 (the local package) is not elected for removal, we ask the user */ @@ -496,7 +496,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) handle->pm_errno = PM_ERR_CONFLICTING_DEPS; ret = -1; if(data) { - pmconflict_t *newconflict = _alpm_conflict_dup(conflict); + alpm_conflict_t *newconflict = _alpm_conflict_dup(conflict); if(newconflict) { *data = alpm_list_add(*data, newconflict); } diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 659396cd..f0d7dba8 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -783,7 +783,7 @@ static int sync_trans(alpm_list_t *targets) break; case PM_ERR_CONFLICTING_DEPS: for(i = data; i; i = alpm_list_next(i)) { - pmconflict_t *conflict = alpm_list_getdata(i); + alpm_conflict_t *conflict = alpm_list_getdata(i); /* only print reason if it contains new information */ if(strcmp(conflict->package1, conflict->reason) == 0 || strcmp(conflict->package2, conflict->reason) == 0) { diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c index 67860277..1fa538da 100644 --- a/src/pacman/upgrade.c +++ b/src/pacman/upgrade.c @@ -118,7 +118,7 @@ int pacman_upgrade(alpm_list_t *targets) break; case PM_ERR_CONFLICTING_DEPS: for(i = data; i; i = alpm_list_next(i)) { - pmconflict_t *conflict = alpm_list_getdata(i); + alpm_conflict_t *conflict = alpm_list_getdata(i); if(strcmp(conflict->package1, conflict->reason) == 0 || strcmp(conflict->package2, conflict->reason) == 0) { printf(_(":: %s and %s are in conflict\n"), diff --git a/src/util/testdb.c b/src/util/testdb.c index fff43a22..38067911 100644 --- a/src/util/testdb.c +++ b/src/util/testdb.c @@ -118,7 +118,7 @@ static int checkconflicts(alpm_list_t *pkglist) /* check conflicts */ data = alpm_checkconflicts(handle, pkglist); for(i = data; i; i = i->next) { - pmconflict_t *conflict = alpm_list_getdata(i); + alpm_conflict_t *conflict = alpm_list_getdata(i); printf("%s conflicts with %s\n", conflict->package1, conflict->package2); ret++; -- cgit v1.2.3-70-g09d2 From 0aef91bc4fc5e872afe7da1692bf97c027eecf37 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:41:07 +1000 Subject: Rename pmloglevel_t to alpm_loglevel_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 6 +++--- lib/libalpm/log.c | 2 +- lib/libalpm/log.h | 2 +- src/pacman/callback.c | 2 +- src/pacman/callback.h | 2 +- src/pacman/util.c | 8 ++++---- src/pacman/util.h | 8 ++++---- src/util/cleanupdelta.c | 2 +- src/util/testdb.c | 2 +- src/util/testpkg.c | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/util') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index d8fb8349..83dad5d8 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -173,14 +173,14 @@ typedef struct _alpm_backup_t { /** * Logging Levels */ -typedef enum _pmloglevel_t { +typedef enum _alpm_loglevel_t { PM_LOG_ERROR = 1, PM_LOG_WARNING = (1 << 1), PM_LOG_DEBUG = (1 << 2), PM_LOG_FUNCTION = (1 << 3) -} pmloglevel_t; +} alpm_loglevel_t; -typedef void (*alpm_cb_log)(pmloglevel_t, const char *, va_list); +typedef void (*alpm_cb_log)(alpm_loglevel_t, const char *, va_list); int alpm_logaction(alpm_handle_t *handle, const char *fmt, ...); /* diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index e8a6e429..eeeaef3c 100644 --- a/lib/libalpm/log.c +++ b/lib/libalpm/log.c @@ -83,7 +83,7 @@ int SYMEXPORT alpm_logaction(alpm_handle_t *handle, const char *fmt, ...) /** @} */ -void _alpm_log(alpm_handle_t *handle, pmloglevel_t flag, const char *fmt, ...) +void _alpm_log(alpm_handle_t *handle, alpm_loglevel_t flag, const char *fmt, ...) { va_list args; diff --git a/lib/libalpm/log.h b/lib/libalpm/log.h index c0813689..a43290d8 100644 --- a/lib/libalpm/log.h +++ b/lib/libalpm/log.h @@ -22,7 +22,7 @@ #include "alpm.h" -void _alpm_log(alpm_handle_t *handle, pmloglevel_t flag, +void _alpm_log(alpm_handle_t *handle, alpm_loglevel_t flag, const char *fmt, ...) __attribute__((format(printf,3,4))); #endif /* _ALPM_LOG_H */ diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 0cc462d6..6b5546a6 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -655,7 +655,7 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total) } /* Callback to handle notifications from the library */ -void cb_log(pmloglevel_t level, const char *fmt, va_list args) +void cb_log(alpm_loglevel_t level, const char *fmt, va_list args) { if(!fmt || strlen(fmt) == 0) { return; diff --git a/src/pacman/callback.h b/src/pacman/callback.h index 1109a3b2..5e8acd7a 100644 --- a/src/pacman/callback.h +++ b/src/pacman/callback.h @@ -41,7 +41,7 @@ void cb_dl_total(off_t total); void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total); /* callback to handle messages/notifications from pacman library */ -void cb_log(pmloglevel_t level, const char *fmt, va_list args); +void cb_log(alpm_loglevel_t level, const char *fmt, va_list args); #endif /* _PM_CALLBACK_H */ diff --git a/src/pacman/util.c b/src/pacman/util.c index 1e6d1e18..5dceead3 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -1194,7 +1194,7 @@ int noyes(char *fmt, ...) return ret; } -int pm_printf(pmloglevel_t level, const char *format, ...) +int pm_printf(alpm_loglevel_t level, const char *format, ...) { int ret; va_list args; @@ -1207,7 +1207,7 @@ int pm_printf(pmloglevel_t level, const char *format, ...) return ret; } -int pm_fprintf(FILE *stream, pmloglevel_t level, const char *format, ...) +int pm_fprintf(FILE *stream, alpm_loglevel_t level, const char *format, ...) { int ret; va_list args; @@ -1236,7 +1236,7 @@ int pm_asprintf(char **string, const char *format, ...) return ret; } -int pm_vasprintf(char **string, pmloglevel_t level, const char *format, va_list args) +int pm_vasprintf(char **string, alpm_loglevel_t level, const char *format, va_list args) { int ret = 0; char *msg = NULL; @@ -1272,7 +1272,7 @@ int pm_vasprintf(char **string, pmloglevel_t level, const char *format, va_list return ret; } -int pm_vfprintf(FILE *stream, pmloglevel_t level, const char *format, va_list args) +int pm_vfprintf(FILE *stream, alpm_loglevel_t level, const char *format, va_list args) { int ret = 0; diff --git a/src/pacman/util.h b/src/pacman/util.h index 89ab903a..25e2f302 100644 --- a/src/pacman/util.h +++ b/src/pacman/util.h @@ -66,11 +66,11 @@ int select_question(int count); int multiselect_question(char *array, int count); int yesno(char *fmt, ...); int noyes(char *fmt, ...); -int pm_printf(pmloglevel_t level, const char *format, ...) __attribute__((format(printf,2,3))); -int pm_fprintf(FILE *stream, pmloglevel_t level, const char *format, ...) __attribute__((format(printf,3,4))); +int pm_printf(alpm_loglevel_t level, const char *format, ...) __attribute__((format(printf,2,3))); +int pm_fprintf(FILE *stream, alpm_loglevel_t level, const char *format, ...) __attribute__((format(printf,3,4))); int pm_asprintf(char **string, const char *format, ...); -int pm_vfprintf(FILE *stream, pmloglevel_t level, const char *format, va_list args) __attribute__((format(printf,3,0))); -int pm_vasprintf(char **string, pmloglevel_t level, const char *format, va_list args) __attribute__((format(printf,3,0))); +int pm_vfprintf(FILE *stream, alpm_loglevel_t level, const char *format, va_list args) __attribute__((format(printf,3,0))); +int pm_vasprintf(char **string, alpm_loglevel_t level, const char *format, va_list args) __attribute__((format(printf,3,0))); #ifndef HAVE_STRNDUP char *strndup(const char *s, size_t n); diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c index dcd849bb..43897730 100644 --- a/src/util/cleanupdelta.c +++ b/src/util/cleanupdelta.c @@ -39,7 +39,7 @@ static void cleanup(int signum) { exit(signum); } -static void output_cb(pmloglevel_t level, const char *fmt, va_list args) +static void output_cb(alpm_loglevel_t level, const char *fmt, va_list args) { if(strlen(fmt)) { switch(level) { diff --git a/src/util/testdb.c b/src/util/testdb.c index 38067911..c887f6d5 100644 --- a/src/util/testdb.c +++ b/src/util/testdb.c @@ -41,7 +41,7 @@ static void cleanup(int signum) { exit(signum); } -static void output_cb(pmloglevel_t level, const char *fmt, va_list args) +static void output_cb(alpm_loglevel_t level, const char *fmt, va_list args) { if(strlen(fmt)) { switch(level) { diff --git a/src/util/testpkg.c b/src/util/testpkg.c index 972b2f47..70a395e8 100644 --- a/src/util/testpkg.c +++ b/src/util/testpkg.c @@ -24,7 +24,7 @@ #define BASENAME "testpkg" -static void output_cb(pmloglevel_t level, const char *fmt, va_list args) +static void output_cb(alpm_loglevel_t level, const char *fmt, va_list args) { if(fmt[0] == '\0') { return; -- cgit v1.2.3-70-g09d2 From ddad400900fbf253f6e247f51ef4aeb9d89d8643 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:50:48 +1000 Subject: Rename pmerrno_t to alpm_errno_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.c | 4 ++-- lib/libalpm/alpm.h | 8 ++++---- lib/libalpm/error.c | 4 ++-- lib/libalpm/handle.c | 2 +- lib/libalpm/handle.h | 4 ++-- src/pacman/conf.c | 2 +- src/pacman/remove.c | 2 +- src/pacman/sync.c | 6 +++--- src/pacman/upgrade.c | 4 ++-- src/pacman/util.c | 2 +- src/util/cleanupdelta.c | 2 +- src/util/pactree.c | 2 +- src/util/testdb.c | 2 +- src/util/testpkg.c | 2 +- 14 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src/util') diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 4cafa6a3..abbc7db8 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -47,9 +47,9 @@ * @return a context handle on success, NULL on error, err will be set if provided */ alpm_handle_t SYMEXPORT *alpm_initialize(const char *root, const char *dbpath, - enum _pmerrno_t *err) + enum _alpm_errno_t *err) { - enum _pmerrno_t myerr; + enum _alpm_errno_t myerr; const char *lf = "db.lck"; size_t lockfilelen; alpm_handle_t *myhandle = _alpm_handle_new(); diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index cf040807..54a9ba42 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -983,7 +983,7 @@ char *alpm_compute_md5sum(const char *name); /** @addtogroup alpm_api_errors Error Codes * @{ */ -enum _pmerrno_t { +enum _alpm_errno_t { PM_ERR_MEMORY = 1, PM_ERR_SYSTEM, PM_ERR_BADPERMS, @@ -1048,16 +1048,16 @@ enum _pmerrno_t { }; /** Returns the current error code from the handle. */ -enum _pmerrno_t alpm_errno(alpm_handle_t *handle); +enum _alpm_errno_t alpm_errno(alpm_handle_t *handle); /** Returns the string corresponding to an error number. */ -const char *alpm_strerror(enum _pmerrno_t err); +const char *alpm_strerror(enum _alpm_errno_t err); /* End of alpm_api_errors */ /** @} */ alpm_handle_t *alpm_initialize(const char *root, const char *dbpath, - enum _pmerrno_t *err); + enum _alpm_errno_t *err); int alpm_release(alpm_handle_t *handle); const char *alpm_version(void); diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c index fb0493ff..225d8859 100644 --- a/lib/libalpm/error.c +++ b/lib/libalpm/error.c @@ -29,12 +29,12 @@ #include "alpm.h" #include "handle.h" -enum _pmerrno_t SYMEXPORT alpm_errno(alpm_handle_t *handle) +enum _alpm_errno_t SYMEXPORT alpm_errno(alpm_handle_t *handle) { return handle->pm_errno; } -const char SYMEXPORT *alpm_strerror(enum _pmerrno_t err) +const char SYMEXPORT *alpm_strerror(enum _alpm_errno_t err) { switch(err) { /* System */ diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 48b674c0..bb2ce50c 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -303,7 +303,7 @@ static char *canonicalize_path(const char *path) { return new_path; } -enum _pmerrno_t _alpm_set_directory_option(const char *value, +enum _alpm_errno_t _alpm_set_directory_option(const char *value, char **storage, int must_exist) { struct stat st; diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h index c0078b0b..4b366193 100644 --- a/lib/libalpm/handle.h +++ b/lib/libalpm/handle.h @@ -72,7 +72,7 @@ struct __alpm_handle_t { pgp_verify_t sigverify; /* Default signature verification level */ /* error code */ - enum _pmerrno_t pm_errno; + enum _alpm_errno_t pm_errno; }; alpm_handle_t *_alpm_handle_new(void); @@ -81,7 +81,7 @@ void _alpm_handle_free(alpm_handle_t *handle); int _alpm_handle_lock(alpm_handle_t *handle); int _alpm_handle_unlock(alpm_handle_t *handle); -enum _pmerrno_t _alpm_set_directory_option(const char *value, +enum _alpm_errno_t _alpm_set_directory_option(const char *value, char **storage, int must_exist); #endif /* _ALPM_HANDLE_H */ diff --git a/src/pacman/conf.c b/src/pacman/conf.c index d3dbc9da..368e71fa 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -420,7 +420,7 @@ static int _add_mirror(alpm_db_t *db, char *value) static int setup_libalpm(void) { int ret = 0; - enum _pmerrno_t err; + enum _alpm_errno_t err; alpm_handle_t *handle; pm_printf(PM_LOG_DEBUG, "setup_libalpm called\n"); diff --git a/src/pacman/remove.c b/src/pacman/remove.c index eab8bdfc..d48b0386 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -102,7 +102,7 @@ int pacman_remove(alpm_list_t *targets) /* Step 2: prepare the transaction based on its type, targets and flags */ if(alpm_trans_prepare(config->handle, &data) == -1) { - enum _pmerrno_t err = alpm_errno(config->handle); + enum _alpm_errno_t err = alpm_errno(config->handle); pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"), alpm_strerror(err)); switch(err) { diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 5b06a806..20be450c 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -615,7 +615,7 @@ static int process_pkg(alpm_pkg_t *pkg) int ret = alpm_add_pkg(config->handle, pkg); if(ret == -1) { - enum _pmerrno_t err = alpm_errno(config->handle); + enum _alpm_errno_t err = alpm_errno(config->handle); if(err == PM_ERR_TRANS_DUP_TARGET || err == PM_ERR_PKG_IGNORED) { /* just skip duplicate or ignored targets */ @@ -763,7 +763,7 @@ static int sync_trans(alpm_list_t *targets) /* Step 2: "compute" the transaction based on targets and flags */ if(alpm_trans_prepare(config->handle, &data) == -1) { - enum _pmerrno_t err = alpm_errno(config->handle); + enum _alpm_errno_t err = alpm_errno(config->handle); pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"), alpm_strerror(err)); switch(err) { @@ -830,7 +830,7 @@ static int sync_trans(alpm_list_t *targets) } if(alpm_trans_commit(config->handle, &data) == -1) { - enum _pmerrno_t err = alpm_errno(config->handle); + enum _alpm_errno_t err = alpm_errno(config->handle); pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"), alpm_strerror(err)); switch(err) { diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c index 7f6e0986..31536a43 100644 --- a/src/pacman/upgrade.c +++ b/src/pacman/upgrade.c @@ -94,7 +94,7 @@ int pacman_upgrade(alpm_list_t *targets) /* Step 2: "compute" the transaction based on targets and flags */ /* TODO: No, compute nothing. This is stupid. */ if(alpm_trans_prepare(config->handle, &data) == -1) { - enum _pmerrno_t err = alpm_errno(config->handle); + enum _alpm_errno_t err = alpm_errno(config->handle); pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"), alpm_strerror(err)); switch(err) { @@ -162,7 +162,7 @@ int pacman_upgrade(alpm_list_t *targets) } if(alpm_trans_commit(config->handle, &data) == -1) { - enum _pmerrno_t err = alpm_errno(config->handle); + enum _alpm_errno_t err = alpm_errno(config->handle); pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"), alpm_strerror(err)); switch(err) { diff --git a/src/pacman/util.c b/src/pacman/util.c index a661b2e9..6a93f6df 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -60,7 +60,7 @@ int trans_init(alpm_transflag_t flags) } if(ret == -1) { - enum _pmerrno_t err = alpm_errno(config->handle); + enum _alpm_errno_t err = alpm_errno(config->handle); pm_fprintf(stderr, PM_LOG_ERROR, _("failed to init transaction (%s)\n"), alpm_strerror(err)); if(err == PM_ERR_HANDLE_LOCK) { diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c index 43897730..70fb7607 100644 --- a/src/util/cleanupdelta.c +++ b/src/util/cleanupdelta.c @@ -96,7 +96,7 @@ static void usage(void) { int main(int argc, char *argv[]) { const char *dbpath = DBPATH; - enum _pmerrno_t err; + enum _alpm_errno_t err; int a = 1; alpm_list_t *dbnames = NULL; diff --git a/src/util/pactree.c b/src/util/pactree.c index bdc1cb2f..7b87ac13 100644 --- a/src/util/pactree.c +++ b/src/util/pactree.c @@ -401,7 +401,7 @@ static void walk_deps(alpm_list_t *dblist, alpm_pkg_t *pkg, int depth) int main(int argc, char *argv[]) { int freelist = 0, ret = 0; - enum _pmerrno_t err; + enum _alpm_errno_t err; const char *target_name; alpm_pkg_t *pkg; alpm_list_t *dblist = NULL; diff --git a/src/util/testdb.c b/src/util/testdb.c index c887f6d5..b8ab33ca 100644 --- a/src/util/testdb.c +++ b/src/util/testdb.c @@ -180,7 +180,7 @@ static void usage(void) { int main(int argc, char *argv[]) { int ret = 0; - enum _pmerrno_t err; + enum _alpm_errno_t err; const char *dbpath = DBPATH; int a = 1; alpm_list_t *dbnames = NULL; diff --git a/src/util/testpkg.c b/src/util/testpkg.c index 70a395e8..a745984d 100644 --- a/src/util/testpkg.c +++ b/src/util/testpkg.c @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) { int retval = 1; /* default = false */ alpm_handle_t *handle; - enum _pmerrno_t err; + enum _alpm_errno_t err; alpm_pkg_t *pkg = NULL; if(argc != 2) { -- cgit v1.2.3-70-g09d2