From 1c5c7c907c8cfb26c129d60d919c837ff42ca1c5 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 13:58:59 +1000 Subject: Rename pmfileconflicttype_t to alpm_fileconflicttype_t Signed-off-by: Allan McRae --- lib/libalpm/conflict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/conflict.c') diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 94d82dd9..dd3fdf76 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -281,7 +281,7 @@ static alpm_list_t *filelist_operation(alpm_list_t *filesA, alpm_list_t *filesB, * a wrapper for former functionality that was done inline. */ static alpm_list_t *add_fileconflict(pmhandle_t *handle, - alpm_list_t *conflicts, pmfileconflicttype_t type, const char *filestr, + alpm_list_t *conflicts, alpm_fileconflicttype_t type, const char *filestr, const char *name1, const char *name2) { pmfileconflict_t *conflict; -- cgit v1.2.3-70-g09d2 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 --- lib/libalpm/add.c | 10 ++-- lib/libalpm/add.h | 2 +- lib/libalpm/alpm.c | 6 +- lib/libalpm/alpm.h | 140 +++++++++++++++++++++++------------------------ lib/libalpm/be_local.c | 2 +- lib/libalpm/be_package.c | 6 +- lib/libalpm/be_sync.c | 6 +- lib/libalpm/conflict.c | 12 ++-- lib/libalpm/conflict.h | 4 +- lib/libalpm/db.c | 6 +- lib/libalpm/db.h | 6 +- lib/libalpm/delta.c | 4 +- lib/libalpm/delta.h | 2 +- lib/libalpm/deps.c | 12 ++-- lib/libalpm/deps.h | 4 +- lib/libalpm/diskspace.c | 8 +-- lib/libalpm/diskspace.h | 2 +- lib/libalpm/dload.c | 6 +- lib/libalpm/dload.h | 4 +- lib/libalpm/error.c | 2 +- lib/libalpm/handle.c | 106 +++++++++++++++++------------------ lib/libalpm/handle.h | 10 ++-- lib/libalpm/log.c | 4 +- lib/libalpm/log.h | 2 +- lib/libalpm/package.c | 2 +- lib/libalpm/package.h | 6 +- lib/libalpm/remove.c | 16 +++--- lib/libalpm/remove.h | 6 +- lib/libalpm/signing.c | 6 +- lib/libalpm/signing.h | 2 +- lib/libalpm/sync.c | 14 ++--- lib/libalpm/sync.h | 4 +- lib/libalpm/trans.c | 20 +++---- lib/libalpm/trans.h | 2 +- lib/libalpm/util.c | 14 ++--- lib/libalpm/util.h | 16 +++--- src/pacman/conf.c | 2 +- src/pacman/conf.h | 2 +- src/util/cleanupdelta.c | 2 +- src/util/pactree.c | 2 +- src/util/testdb.c | 2 +- src/util/testpkg.c | 2 +- 42 files changed, 243 insertions(+), 243 deletions(-) (limited to 'lib/libalpm/conflict.c') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index fd8799b1..c8d21161 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -50,7 +50,7 @@ #include "handle.h" /** Add a package to the transaction. */ -int SYMEXPORT alpm_add_pkg(pmhandle_t *handle, pmpkg_t *pkg) +int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, pmpkg_t *pkg) { const char *pkgname, *pkgver; pmtrans_t *trans; @@ -106,7 +106,7 @@ int SYMEXPORT alpm_add_pkg(pmhandle_t *handle, pmpkg_t *pkg) return 0; } -static int perform_extraction(pmhandle_t *handle, struct archive *archive, +static int perform_extraction(alpm_handle_t *handle, struct archive *archive, struct archive_entry *entry, const char *filename, const char *origname) { int ret; @@ -131,7 +131,7 @@ static int perform_extraction(pmhandle_t *handle, struct archive *archive, return 0; } -static int extract_single_file(pmhandle_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) { const char *entryname; @@ -450,7 +450,7 @@ static int extract_single_file(pmhandle_t *handle, struct archive *archive, return errors; } -static int commit_single_pkg(pmhandle_t *handle, pmpkg_t *newpkg, +static int commit_single_pkg(alpm_handle_t *handle, pmpkg_t *newpkg, size_t pkg_current, size_t pkg_count) { int i, ret = 0, errors = 0; @@ -684,7 +684,7 @@ cleanup: return ret; } -int _alpm_upgrade_packages(pmhandle_t *handle) +int _alpm_upgrade_packages(alpm_handle_t *handle) { size_t pkg_count, pkg_current; int skip_ldconfig = 0, ret = 0; diff --git a/lib/libalpm/add.h b/lib/libalpm/add.h index 1baab8d4..77a3d22a 100644 --- a/lib/libalpm/add.h +++ b/lib/libalpm/add.h @@ -24,7 +24,7 @@ #include "alpm_list.h" #include "trans.h" -int _alpm_upgrade_packages(pmhandle_t *handle); +int _alpm_upgrade_packages(alpm_handle_t *handle); #endif /* _ALPM_ADD_H */ diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index b0bbbe8c..93585298 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -46,13 +46,13 @@ * @param err an optional variable to hold any error return codes * @return a context handle on success, NULL on error, err will be set if provided */ -pmhandle_t SYMEXPORT *alpm_initialize(const char *root, const char *dbpath, +alpm_handle_t SYMEXPORT *alpm_initialize(const char *root, const char *dbpath, enum _pmerrno_t *err) { enum _pmerrno_t myerr; const char *lf = "db.lck"; size_t lockfilelen; - pmhandle_t *myhandle = _alpm_handle_new(); + alpm_handle_t *myhandle = _alpm_handle_new(); if(myhandle == NULL) { myerr = PM_ERR_MEMORY; @@ -99,7 +99,7 @@ cleanup: * @param handle the context handle * @return 0 on success, -1 on error */ -int SYMEXPORT alpm_release(pmhandle_t *myhandle) +int SYMEXPORT alpm_release(alpm_handle_t *myhandle) { int ret = 0; pmdb_t *db; diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 8a7979f2..d0d9e2f9 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -100,7 +100,7 @@ typedef enum _pgp_verify_t { * Structures */ -typedef struct __pmhandle_t pmhandle_t; +typedef struct __alpm_handle_t alpm_handle_t; typedef struct __pmdb_t pmdb_t; typedef struct __pmpkg_t pmpkg_t; typedef struct __pmtrans_t pmtrans_t; @@ -181,7 +181,7 @@ typedef enum _pmloglevel_t { } pmloglevel_t; typedef void (*alpm_cb_log)(pmloglevel_t, const char *, va_list); -int alpm_logaction(pmhandle_t *handle, const char *fmt, ...); +int alpm_logaction(alpm_handle_t *handle, const char *fmt, ...); /* * Downloading @@ -212,7 +212,7 @@ typedef int (*alpm_cb_fetch)(const char *url, const char *localpath, * @param url URL of the package to download * @return the downloaded filepath on success, NULL on error */ -char *alpm_fetch_pkgurl(pmhandle_t *handle, const char *url); +char *alpm_fetch_pkgurl(alpm_handle_t *handle, const char *url); /** @addtogroup alpm_api_options Options * Libalpm option getters and setters @@ -220,67 +220,67 @@ char *alpm_fetch_pkgurl(pmhandle_t *handle, const char *url); */ /** Returns the callback used for logging. */ -alpm_cb_log alpm_option_get_logcb(pmhandle_t *handle); +alpm_cb_log alpm_option_get_logcb(alpm_handle_t *handle); /** Sets the callback used for logging. */ -int alpm_option_set_logcb(pmhandle_t *handle, alpm_cb_log cb); +int alpm_option_set_logcb(alpm_handle_t *handle, alpm_cb_log cb); /** Returns the callback used to report download progress. */ -alpm_cb_download alpm_option_get_dlcb(pmhandle_t *handle); +alpm_cb_download alpm_option_get_dlcb(alpm_handle_t *handle); /** Sets the callback used to report download progress. */ -int alpm_option_set_dlcb(pmhandle_t *handle, alpm_cb_download cb); +int alpm_option_set_dlcb(alpm_handle_t *handle, alpm_cb_download cb); /** Returns the downloading callback. */ -alpm_cb_fetch alpm_option_get_fetchcb(pmhandle_t *handle); +alpm_cb_fetch alpm_option_get_fetchcb(alpm_handle_t *handle); /** Sets the downloading callback. */ -int alpm_option_set_fetchcb(pmhandle_t *handle, alpm_cb_fetch cb); +int alpm_option_set_fetchcb(alpm_handle_t *handle, alpm_cb_fetch cb); /** Returns the callback used to report total download size. */ -alpm_cb_totaldl alpm_option_get_totaldlcb(pmhandle_t *handle); +alpm_cb_totaldl alpm_option_get_totaldlcb(alpm_handle_t *handle); /** Sets the callback used to report total download size. */ -int alpm_option_set_totaldlcb(pmhandle_t *handle, alpm_cb_totaldl cb); +int alpm_option_set_totaldlcb(alpm_handle_t *handle, alpm_cb_totaldl cb); /** Returns the root of the destination filesystem. Read-only. */ -const char *alpm_option_get_root(pmhandle_t *handle); +const char *alpm_option_get_root(alpm_handle_t *handle); /** Returns the path to the database directory. Read-only. */ -const char *alpm_option_get_dbpath(pmhandle_t *handle); +const char *alpm_option_get_dbpath(alpm_handle_t *handle); /** Get the name of the database lock file. Read-only. */ -const char *alpm_option_get_lockfile(pmhandle_t *handle); +const char *alpm_option_get_lockfile(alpm_handle_t *handle); /** @name Accessors to the list of package cache directories. * @{ */ -alpm_list_t *alpm_option_get_cachedirs(pmhandle_t *handle); -int alpm_option_set_cachedirs(pmhandle_t *handle, alpm_list_t *cachedirs); -int alpm_option_add_cachedir(pmhandle_t *handle, const char *cachedir); -int alpm_option_remove_cachedir(pmhandle_t *handle, const char *cachedir); +alpm_list_t *alpm_option_get_cachedirs(alpm_handle_t *handle); +int alpm_option_set_cachedirs(alpm_handle_t *handle, alpm_list_t *cachedirs); +int alpm_option_add_cachedir(alpm_handle_t *handle, const char *cachedir); +int alpm_option_remove_cachedir(alpm_handle_t *handle, const char *cachedir); /** @} */ /** Returns the logfile name. */ -const char *alpm_option_get_logfile(pmhandle_t *handle); +const char *alpm_option_get_logfile(alpm_handle_t *handle); /** Sets the logfile name. */ -int alpm_option_set_logfile(pmhandle_t *handle, const char *logfile); +int alpm_option_set_logfile(alpm_handle_t *handle, const char *logfile); /** Returns the path to libalpm's GnuPG home directory. */ -const char *alpm_option_get_gpgdir(pmhandle_t *handle); +const char *alpm_option_get_gpgdir(alpm_handle_t *handle); /** Sets the path to libalpm's GnuPG home directory. */ -int alpm_option_set_gpgdir(pmhandle_t *handle, const char *gpgdir); +int alpm_option_set_gpgdir(alpm_handle_t *handle, const char *gpgdir); /** Returns whether to use syslog (0 is FALSE, TRUE otherwise). */ -int alpm_option_get_usesyslog(pmhandle_t *handle); +int alpm_option_get_usesyslog(alpm_handle_t *handle); /** Sets whether to use syslog (0 is FALSE, TRUE otherwise). */ -int alpm_option_set_usesyslog(pmhandle_t *handle, int usesyslog); +int alpm_option_set_usesyslog(alpm_handle_t *handle, int usesyslog); /** @name Accessors to the list of no-upgrade files. * These functions modify the list of files which should * not be updated by package installation. * @{ */ -alpm_list_t *alpm_option_get_noupgrades(pmhandle_t *handle); -int alpm_option_add_noupgrade(pmhandle_t *handle, const char *pkg); -int alpm_option_set_noupgrades(pmhandle_t *handle, alpm_list_t *noupgrade); -int alpm_option_remove_noupgrade(pmhandle_t *handle, const char *pkg); +alpm_list_t *alpm_option_get_noupgrades(alpm_handle_t *handle); +int alpm_option_add_noupgrade(alpm_handle_t *handle, const char *pkg); +int alpm_option_set_noupgrades(alpm_handle_t *handle, alpm_list_t *noupgrade); +int alpm_option_remove_noupgrade(alpm_handle_t *handle, const char *pkg); /** @} */ /** @name Accessors to the list of no-extract files. @@ -289,10 +289,10 @@ int alpm_option_remove_noupgrade(pmhandle_t *handle, const char *pkg); * not be upgraded by a sysupgrade operation. * @{ */ -alpm_list_t *alpm_option_get_noextracts(pmhandle_t *handle); -int alpm_option_add_noextract(pmhandle_t *handle, const char *pkg); -int alpm_option_set_noextracts(pmhandle_t *handle, alpm_list_t *noextract); -int alpm_option_remove_noextract(pmhandle_t *handle, const char *pkg); +alpm_list_t *alpm_option_get_noextracts(alpm_handle_t *handle); +int alpm_option_add_noextract(alpm_handle_t *handle, const char *pkg); +int alpm_option_set_noextracts(alpm_handle_t *handle, alpm_list_t *noextract); +int alpm_option_remove_noextract(alpm_handle_t *handle, const char *pkg); /** @} */ /** @name Accessors to the list of ignored packages. @@ -300,10 +300,10 @@ int alpm_option_remove_noextract(pmhandle_t *handle, const char *pkg); * should be ignored by a sysupgrade. * @{ */ -alpm_list_t *alpm_option_get_ignorepkgs(pmhandle_t *handle); -int alpm_option_add_ignorepkg(pmhandle_t *handle, const char *pkg); -int alpm_option_set_ignorepkgs(pmhandle_t *handle, alpm_list_t *ignorepkgs); -int alpm_option_remove_ignorepkg(pmhandle_t *handle, const char *pkg); +alpm_list_t *alpm_option_get_ignorepkgs(alpm_handle_t *handle); +int alpm_option_add_ignorepkg(alpm_handle_t *handle, const char *pkg); +int alpm_option_set_ignorepkgs(alpm_handle_t *handle, alpm_list_t *ignorepkgs); +int alpm_option_remove_ignorepkg(alpm_handle_t *handle, const char *pkg); /** @} */ /** @name Accessors to the list of ignored groups. @@ -311,25 +311,25 @@ int alpm_option_remove_ignorepkg(pmhandle_t *handle, const char *pkg); * should be ignored by a sysupgrade. * @{ */ -alpm_list_t *alpm_option_get_ignoregrps(pmhandle_t *handle); -int alpm_option_add_ignoregrp(pmhandle_t *handle, const char *grp); -int alpm_option_set_ignoregrps(pmhandle_t *handle, alpm_list_t *ignoregrps); -int alpm_option_remove_ignoregrp(pmhandle_t *handle, const char *grp); +alpm_list_t *alpm_option_get_ignoregrps(alpm_handle_t *handle); +int alpm_option_add_ignoregrp(alpm_handle_t *handle, const char *grp); +int alpm_option_set_ignoregrps(alpm_handle_t *handle, alpm_list_t *ignoregrps); +int alpm_option_remove_ignoregrp(alpm_handle_t *handle, const char *grp); /** @} */ /** Returns the targeted architecture. */ -const char *alpm_option_get_arch(pmhandle_t *handle); +const char *alpm_option_get_arch(alpm_handle_t *handle); /** Sets the targeted architecture. */ -int alpm_option_set_arch(pmhandle_t *handle, const char *arch); +int alpm_option_set_arch(alpm_handle_t *handle, const char *arch); -int alpm_option_get_usedelta(pmhandle_t *handle); -int alpm_option_set_usedelta(pmhandle_t *handle, int usedelta); +int alpm_option_get_usedelta(alpm_handle_t *handle); +int alpm_option_set_usedelta(alpm_handle_t *handle, int usedelta); -int alpm_option_get_checkspace(pmhandle_t *handle); -int alpm_option_set_checkspace(pmhandle_t *handle, int checkspace); +int alpm_option_get_checkspace(alpm_handle_t *handle); +int alpm_option_set_checkspace(alpm_handle_t *handle, int checkspace); -pgp_verify_t alpm_option_get_default_sigverify(pmhandle_t *handle); -int alpm_option_set_default_sigverify(pmhandle_t *handle, pgp_verify_t level); +pgp_verify_t alpm_option_get_default_sigverify(alpm_handle_t *handle); +int alpm_option_set_default_sigverify(alpm_handle_t *handle, pgp_verify_t level); /** @} */ @@ -344,7 +344,7 @@ int alpm_option_set_default_sigverify(pmhandle_t *handle, pgp_verify_t level); * libalpm functions. * @return a reference to the local database */ -pmdb_t *alpm_option_get_localdb(pmhandle_t *handle); +pmdb_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 @@ -352,7 +352,7 @@ pmdb_t *alpm_option_get_localdb(pmhandle_t *handle); * @param handle the context handle * @return a reference to an internal list of pmdb_t structures */ -alpm_list_t *alpm_option_get_syncdbs(pmhandle_t *handle); +alpm_list_t *alpm_option_get_syncdbs(alpm_handle_t *handle); /** Register a sync database of packages. * @param handle the context handle @@ -361,7 +361,7 @@ alpm_list_t *alpm_option_get_syncdbs(pmhandle_t *handle); * database; note that this must be a '.sig' file type verification * @return a pmdb_t* on success (the value), NULL on error */ -pmdb_t *alpm_db_register_sync(pmhandle_t *handle, const char *treename, +pmdb_t *alpm_db_register_sync(alpm_handle_t *handle, const char *treename, pgp_verify_t check_sig); /** Unregister a package database. @@ -374,7 +374,7 @@ int alpm_db_unregister(pmdb_t *db); * @param handle the context handle * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_db_unregister_all(pmhandle_t *handle); +int alpm_db_unregister_all(alpm_handle_t *handle); /** Get the name of a package database. * @param db pointer to the package database @@ -455,7 +455,7 @@ int alpm_db_set_pkgreason(pmdb_t *db, const char *name, alpm_pkgreason_t reason) * @param pkg address of the package pointer * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_pkg_load(pmhandle_t *handle, const char *filename, int full, +int alpm_pkg_load(alpm_handle_t *handle, const char *filename, int full, pgp_verify_t check_sig, pmpkg_t **pkg); /** Free a package. @@ -866,19 +866,19 @@ typedef void (*alpm_trans_cb_progress)(pmtransprog_t, const char *, int, size_t, * @param handle the context handle * @return the bitfield of transaction flags */ -pmtransflag_t alpm_trans_get_flags(pmhandle_t *handle); +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 */ -alpm_list_t * alpm_trans_get_add(pmhandle_t *handle); +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 */ -alpm_list_t * alpm_trans_get_remove(pmhandle_t *handle); +alpm_list_t * alpm_trans_get_remove(alpm_handle_t *handle); /** Initialize the transaction. * @param handle the context handle @@ -888,7 +888,7 @@ alpm_list_t * alpm_trans_get_remove(pmhandle_t *handle); * @param progress progress callback function pointer * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_trans_init(pmhandle_t *handle, pmtransflag_t flags, +int alpm_trans_init(alpm_handle_t *handle, pmtransflag_t flags, alpm_trans_cb_event cb_event, alpm_trans_cb_conv conv, alpm_trans_cb_progress cb_progress); @@ -898,7 +898,7 @@ int alpm_trans_init(pmhandle_t *handle, pmtransflag_t flags, * of pmdepmissing_t objects is dumped (conflicting packages) * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_trans_prepare(pmhandle_t *handle, alpm_list_t **data); +int alpm_trans_prepare(alpm_handle_t *handle, alpm_list_t **data); /** Commit a transaction. * @param handle the context handle @@ -906,19 +906,19 @@ int alpm_trans_prepare(pmhandle_t *handle, alpm_list_t **data); * of an error can be dumped (ie. list of conflicting files) * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_trans_commit(pmhandle_t *handle, alpm_list_t **data); +int alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data); /** Interrupt a transaction. * @param handle the context handle * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_trans_interrupt(pmhandle_t *handle); +int alpm_trans_interrupt(alpm_handle_t *handle); /** Release a transaction. * @param handle the context handle * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_trans_release(pmhandle_t *handle); +int alpm_trans_release(alpm_handle_t *handle); /** @} */ /** @name Common Transactions */ @@ -929,7 +929,7 @@ int alpm_trans_release(pmhandle_t *handle); * @param enable_downgrade allow downgrading of packages if the remote version is lower * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_sync_sysupgrade(pmhandle_t *handle, int enable_downgrade); +int alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade); /** Add a package to the transaction. * If the package was loaded by alpm_pkg_load(), it will be freed upon @@ -938,14 +938,14 @@ int alpm_sync_sysupgrade(pmhandle_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(pmhandle_t *handle, pmpkg_t *pkg); +int alpm_add_pkg(alpm_handle_t *handle, pmpkg_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(pmhandle_t *handle, pmpkg_t *pkg); +int alpm_remove_pkg(alpm_handle_t *handle, pmpkg_t *pkg); /** @} */ @@ -955,13 +955,13 @@ int alpm_remove_pkg(pmhandle_t *handle, pmpkg_t *pkg); * @{ */ -alpm_list_t *alpm_checkdeps(pmhandle_t *handle, alpm_list_t *pkglist, +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(pmhandle_t *handle, +pmpkg_t *alpm_find_dbs_satisfier(alpm_handle_t *handle, alpm_list_t *dbs, const char *depstring); -alpm_list_t *alpm_checkconflicts(pmhandle_t *handle, alpm_list_t *pkglist); +alpm_list_t *alpm_checkconflicts(alpm_handle_t *handle, alpm_list_t *pkglist); /** Returns a newly allocated string representing the dependency information. * @param dep a dependency info structure @@ -1048,7 +1048,7 @@ enum _pmerrno_t { }; /** Returns the current error code from the handle. */ -enum _pmerrno_t alpm_errno(pmhandle_t *handle); +enum _pmerrno_t alpm_errno(alpm_handle_t *handle); /** Returns the string corresponding to an error number. */ const char *alpm_strerror(enum _pmerrno_t err); @@ -1056,9 +1056,9 @@ const char *alpm_strerror(enum _pmerrno_t err); /* End of alpm_api_errors */ /** @} */ -pmhandle_t *alpm_initialize(const char *root, const char *dbpath, +alpm_handle_t *alpm_initialize(const char *root, const char *dbpath, enum _pmerrno_t *err); -int alpm_release(pmhandle_t *handle); +int alpm_release(alpm_handle_t *handle); const char *alpm_version(void); /* End of alpm_api */ diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index a1e2a003..12b2d920 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -930,7 +930,7 @@ struct db_operations local_db_ops = { .unregister = _alpm_db_unregister, }; -pmdb_t *_alpm_db_register_local(pmhandle_t *handle) +pmdb_t *_alpm_db_register_local(alpm_handle_t *handle) { pmdb_t *db; diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index 748f27a0..b4f729b5 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -136,7 +136,7 @@ static struct pkg_operations *get_file_pkg_ops(void) * * @return 0 on success, -1 on error */ -static int parse_descfile(pmhandle_t *handle, struct archive *a, pmpkg_t *newpkg) +static int parse_descfile(alpm_handle_t *handle, struct archive *a, pmpkg_t *newpkg) { char *ptr = NULL; char *key = NULL; @@ -231,7 +231,7 @@ static int parse_descfile(pmhandle_t *handle, struct archive *a, pmpkg_t *newpkg * through the full archive * @return An information filled pmpkg_t struct */ -pmpkg_t *_alpm_pkg_load_internal(pmhandle_t *handle, const char *pkgfile, +pmpkg_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) { @@ -387,7 +387,7 @@ error: return NULL; } -int SYMEXPORT alpm_pkg_load(pmhandle_t *handle, const char *filename, int full, +int SYMEXPORT alpm_pkg_load(alpm_handle_t *handle, const char *filename, int full, pgp_verify_t check_sig, pmpkg_t **pkg) { CHECK_HANDLE(handle, return -1); diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 2bf37dab..4f0cc2b6 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -39,7 +39,7 @@ #include "deps.h" #include "dload.h" -static char *get_sync_dir(pmhandle_t *handle) +static char *get_sync_dir(alpm_handle_t *handle) { const char *dbpath = alpm_option_get_dbpath(handle); size_t len = strlen(dbpath) + 6; @@ -148,7 +148,7 @@ int SYMEXPORT alpm_db_update(int force, pmdb_t *db) alpm_list_t *i; int ret = -1; mode_t oldmask; - pmhandle_t *handle; + alpm_handle_t *handle; pgp_verify_t check_sig; /* Sanity checks */ @@ -584,7 +584,7 @@ struct db_operations sync_db_ops = { .unregister = _alpm_db_unregister, }; -pmdb_t *_alpm_db_register_sync(pmhandle_t *handle, const char *treename, +pmdb_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename, pgp_verify_t level) { pmdb_t *db; diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index dd3fdf76..7dd79fd7 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -100,7 +100,7 @@ static int conflict_isin(pmconflict_t *needle, alpm_list_t *haystack) * @param pkg2 package causing conflict * @param reason reason for this conflict */ -static int add_conflict(pmhandle_t *handle, alpm_list_t **baddeps, +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); @@ -129,7 +129,7 @@ static int add_conflict(pmhandle_t *handle, alpm_list_t **baddeps, * @param baddeps list to store conflicts * @param order if >= 0 the conflict order is preserved, if < 0 it's reversed */ -static void check_conflict(pmhandle_t *handle, +static void check_conflict(alpm_handle_t *handle, alpm_list_t *list1, alpm_list_t *list2, alpm_list_t **baddeps, int order) { alpm_list_t *i; @@ -170,7 +170,7 @@ static void check_conflict(pmhandle_t *handle, } /* Check for inter-conflicts */ -alpm_list_t *_alpm_innerconflicts(pmhandle_t *handle, alpm_list_t *packages) +alpm_list_t *_alpm_innerconflicts(alpm_handle_t *handle, alpm_list_t *packages) { alpm_list_t *baddeps = NULL; @@ -211,7 +211,7 @@ alpm_list_t *_alpm_outerconflicts(pmdb_t *db, alpm_list_t *packages) * @param pkglist the list of packages to check * @return an alpm_list_t of pmconflict_t */ -alpm_list_t SYMEXPORT *alpm_checkconflicts(pmhandle_t *handle, +alpm_list_t SYMEXPORT *alpm_checkconflicts(alpm_handle_t *handle, alpm_list_t *pkglist) { CHECK_HANDLE(handle, return NULL); @@ -280,7 +280,7 @@ static alpm_list_t *filelist_operation(alpm_list_t *filesA, alpm_list_t *filesB, * string, and either two package names or one package name and NULL. This is * a wrapper for former functionality that was done inline. */ -static alpm_list_t *add_fileconflict(pmhandle_t *handle, +static alpm_list_t *add_fileconflict(alpm_handle_t *handle, alpm_list_t *conflicts, alpm_fileconflicttype_t type, const char *filestr, const char *name1, const char *name2) { @@ -362,7 +362,7 @@ static int dir_belongsto_pkg(const char *root, const char *dirpath, /* Find file conflicts that may occur during the transaction with two checks: * 1: check every target against every target * 2: check every target against the filesystem */ -alpm_list_t *_alpm_db_find_fileconflicts(pmhandle_t *handle, +alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, alpm_list_t *upgrade, alpm_list_t *remove) { alpm_list_t *i, *j, *conflicts = NULL; diff --git a/lib/libalpm/conflict.h b/lib/libalpm/conflict.h index 546a2820..d226ba23 100644 --- a/lib/libalpm/conflict.h +++ b/lib/libalpm/conflict.h @@ -26,9 +26,9 @@ pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict); void _alpm_conflict_free(pmconflict_t *conflict); -alpm_list_t *_alpm_innerconflicts(pmhandle_t *handle, alpm_list_t *packages); +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_db_find_fileconflicts(pmhandle_t *handle, +alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, alpm_list_t *upgrade, alpm_list_t *remove); void _alpm_fileconflict_free(pmfileconflict_t *conflict); diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index c1518101..465bdd37 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(pmhandle_t *handle, const char *treename, +pmdb_t SYMEXPORT *alpm_db_register_sync(alpm_handle_t *handle, const char *treename, pgp_verify_t check_sig) { /* Sanity checks */ @@ -70,7 +70,7 @@ void _alpm_db_unregister(pmdb_t *db) } /** Unregister all package databases. */ -int SYMEXPORT alpm_db_unregister_all(pmhandle_t *handle) +int SYMEXPORT alpm_db_unregister_all(alpm_handle_t *handle) { alpm_list_t *i; pmdb_t *db; @@ -94,7 +94,7 @@ int SYMEXPORT alpm_db_unregister_all(pmhandle_t *handle) int SYMEXPORT alpm_db_unregister(pmdb_t *db) { int found = 0; - pmhandle_t *handle; + alpm_handle_t *handle; /* Sanity checks */ ASSERT(db != NULL, return -1); diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index 03187342..a0c4d6a1 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -57,7 +57,7 @@ struct db_operations { /* Database */ struct __pmdb_t { - pmhandle_t *handle; + alpm_handle_t *handle; char *treename; /* do not access directly, use _alpm_db_path(db) for lazy access */ char *_path; @@ -81,8 +81,8 @@ const char *_alpm_db_path(pmdb_t *db); char *_alpm_db_sig_path(pmdb_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(pmhandle_t *handle); -pmdb_t *_alpm_db_register_sync(pmhandle_t *handle, const char *treename, +pmdb_t *_alpm_db_register_local(alpm_handle_t *handle); +pmdb_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename, pgp_verify_t level); void _alpm_db_unregister(pmdb_t *db); diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c index fc7a0f75..26866aa7 100644 --- a/lib/libalpm/delta.c +++ b/lib/libalpm/delta.c @@ -78,7 +78,7 @@ static alpm_list_t *graph_init(alpm_list_t *deltas, int reverse) return vertices; } -static void graph_init_size(pmhandle_t *handle, alpm_list_t *vertices) +static void graph_init_size(alpm_handle_t *handle, alpm_list_t *vertices) { alpm_list_t *i; @@ -186,7 +186,7 @@ static off_t shortest_path(alpm_list_t *vertices, const char *to, alpm_list_t ** * possible with the files available. * @return the size of the path stored, or LONG_MAX if path is unfindable */ -off_t _alpm_shortest_delta_path(pmhandle_t *handle, alpm_list_t *deltas, +off_t _alpm_shortest_delta_path(alpm_handle_t *handle, alpm_list_t *deltas, const char *to, alpm_list_t **path) { alpm_list_t *bestpath = NULL; diff --git a/lib/libalpm/delta.h b/lib/libalpm/delta.h index 6ac54139..1f38a572 100644 --- a/lib/libalpm/delta.h +++ b/lib/libalpm/delta.h @@ -29,7 +29,7 @@ pmdelta_t *_alpm_delta_parse(char *line); void _alpm_delta_free(pmdelta_t *delta); pmdelta_t *_alpm_delta_dup(const pmdelta_t *delta); -off_t _alpm_shortest_delta_path(pmhandle_t *handle, alpm_list_t *deltas, +off_t _alpm_shortest_delta_path(alpm_handle_t *handle, alpm_list_t *deltas, const char *to, alpm_list_t **path); /* max percent of package size to download deltas */ diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index fd118a0b..1fae6636 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -126,7 +126,7 @@ static alpm_list_t *dep_graph_init(alpm_list_t *targets) * This function returns the new alpm_list_t* target list. * */ -alpm_list_t *_alpm_sortbydeps(pmhandle_t *handle, +alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, alpm_list_t *targets, int reverse) { alpm_list_t *newtargs = NULL; @@ -202,7 +202,7 @@ alpm_list_t *_alpm_sortbydeps(pmhandle_t *handle, return newtargs; } -static int no_dep_version(pmhandle_t *handle) +static int no_dep_version(alpm_handle_t *handle) { int flags = alpm_trans_get_flags(handle); return flags != -1 && (flags & PM_TRANS_FLAG_NODEPVERSION); @@ -265,7 +265,7 @@ pmpkg_t SYMEXPORT *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstring) * @param reversedeps handles the backward dependencies * @return an alpm_list_t* of pmdepmissing_t pointers. */ -alpm_list_t SYMEXPORT *alpm_checkdeps(pmhandle_t *handle, alpm_list_t *pkglist, +alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglist, alpm_list_t *remove, alpm_list_t *upgrade, int reversedeps) { alpm_list_t *i, *j; @@ -554,7 +554,7 @@ void _alpm_recursedeps(pmdb_t *db, alpm_list_t *targs, int include_explicit) * an error code without prompting * @return the resolved package **/ -static pmpkg_t *resolvedep(pmhandle_t *handle, pmdepend_t *dep, +static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, alpm_list_t *dbs, alpm_list_t *excluding, int prompt) { alpm_list_t *i, *j; @@ -653,7 +653,7 @@ static pmpkg_t *resolvedep(pmhandle_t *handle, pmdepend_t *dep, * @param depstring package or provision name, versioned or not * @return a pmpkg_t* satisfying depstring */ -pmpkg_t SYMEXPORT *alpm_find_dbs_satisfier(pmhandle_t *handle, +pmpkg_t SYMEXPORT *alpm_find_dbs_satisfier(alpm_handle_t *handle, alpm_list_t *dbs, const char *depstring) { pmdepend_t *dep; @@ -689,7 +689,7 @@ pmpkg_t SYMEXPORT *alpm_find_dbs_satisfier(pmhandle_t *handle, * unresolvable dependency, in which case the [*packages] list will be * unmodified by this function */ -int _alpm_resolvedeps(pmhandle_t *handle, alpm_list_t *localpkgs, pmpkg_t *pkg, +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/deps.h b/lib/libalpm/deps.h index ecc3b92c..01ea4cbd 100644 --- a/lib/libalpm/deps.h +++ b/lib/libalpm/deps.h @@ -30,9 +30,9 @@ 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(pmhandle_t *handle, alpm_list_t *targets, int reverse); +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); -int _alpm_resolvedeps(pmhandle_t *handle, alpm_list_t *localpkgs, pmpkg_t *pkg, +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); pmdepend_t *_alpm_splitdep(const char *depstring); diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 51aa47f2..6fc2e38a 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -59,7 +59,7 @@ static int mount_point_cmp(const void *p1, const void *p2) return -strcmp(mp1->mount_dir, mp2->mount_dir); } -static alpm_list_t *mount_point_list(pmhandle_t *handle) +static alpm_list_t *mount_point_list(alpm_handle_t *handle) { alpm_list_t *mount_points = NULL, *ptr; alpm_mountpoint_t *mp; @@ -148,7 +148,7 @@ static alpm_mountpoint_t *match_mount_point(const alpm_list_t *mount_points, return NULL; } -static int calculate_removed_size(pmhandle_t *handle, +static int calculate_removed_size(alpm_handle_t *handle, const alpm_list_t *mount_points, pmpkg_t *pkg) { alpm_list_t *file; @@ -185,7 +185,7 @@ static int calculate_removed_size(pmhandle_t *handle, return 0; } -static int calculate_installed_size(pmhandle_t *handle, +static int calculate_installed_size(alpm_handle_t *handle, const alpm_list_t *mount_points, pmpkg_t *pkg) { int ret=0; @@ -257,7 +257,7 @@ cleanup: return ret; } -int _alpm_check_diskspace(pmhandle_t *handle) +int _alpm_check_diskspace(alpm_handle_t *handle) { alpm_list_t *mount_points, *i; alpm_mountpoint_t *root_mp; diff --git a/lib/libalpm/diskspace.h b/lib/libalpm/diskspace.h index 28aca7e9..79e16772 100644 --- a/lib/libalpm/diskspace.h +++ b/lib/libalpm/diskspace.h @@ -46,7 +46,7 @@ typedef struct __alpm_mountpoint_t { FSSTATSTYPE fsp; } alpm_mountpoint_t; -int _alpm_check_diskspace(pmhandle_t *handle); +int _alpm_check_diskspace(alpm_handle_t *handle); #endif /* _ALPM_DISKSPACE_H */ diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index c7903ff0..73f75144 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -149,7 +149,7 @@ static int utimes_long(const char *path, long seconds) } -static int curl_download_internal(pmhandle_t *handle, +static int curl_download_internal(alpm_handle_t *handle, const char *url, const char *localpath, int force, int allow_resume, int errors_ok) { @@ -321,7 +321,7 @@ cleanup: * @param errors_ok do not log errors (but still return them) * @return 0 on success, -1 on error (pm_errno is set accordingly if errors_ok == 0) */ -int _alpm_download(pmhandle_t *handle, const char *url, const char *localpath, +int _alpm_download(alpm_handle_t *handle, const char *url, const char *localpath, int force, int allow_resume, int errors_ok) { if(handle->fetchcb == NULL) { @@ -341,7 +341,7 @@ int _alpm_download(pmhandle_t *handle, const char *url, const char *localpath, } /** Fetch a remote pkg. */ -char SYMEXPORT *alpm_fetch_pkgurl(pmhandle_t *handle, const char *url) +char SYMEXPORT *alpm_fetch_pkgurl(alpm_handle_t *handle, const char *url) { char *filepath; const char *filename, *cachedir; diff --git a/lib/libalpm/dload.h b/lib/libalpm/dload.h index e409c32b..0cdd9001 100644 --- a/lib/libalpm/dload.h +++ b/lib/libalpm/dload.h @@ -27,12 +27,12 @@ /* internal structure for communicating with curl progress callback */ struct fileinfo { - pmhandle_t *handle; + alpm_handle_t *handle; const char *filename; double initial_size; }; -int _alpm_download(pmhandle_t *handle, const char *url, const char *localpath, +int _alpm_download(alpm_handle_t *handle, const char *url, const char *localpath, int force, int allow_resume, int errors_ok); #endif /* _ALPM_DLOAD_H */ diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c index 1e4e705b..fb0493ff 100644 --- a/lib/libalpm/error.c +++ b/lib/libalpm/error.c @@ -29,7 +29,7 @@ #include "alpm.h" #include "handle.h" -enum _pmerrno_t SYMEXPORT alpm_errno(pmhandle_t *handle) +enum _pmerrno_t SYMEXPORT alpm_errno(alpm_handle_t *handle) { return handle->pm_errno; } diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index acd35409..842353d8 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -39,18 +39,18 @@ #include "trans.h" #include "alpm.h" -pmhandle_t *_alpm_handle_new() +alpm_handle_t *_alpm_handle_new() { - pmhandle_t *handle; + alpm_handle_t *handle; - CALLOC(handle, 1, sizeof(pmhandle_t), return NULL); + CALLOC(handle, 1, sizeof(alpm_handle_t), return NULL); handle->sigverify = PM_PGP_VERIFY_OPTIONAL; return handle; } -void _alpm_handle_free(pmhandle_t *handle) +void _alpm_handle_free(alpm_handle_t *handle) { if(handle == NULL) { return; @@ -89,7 +89,7 @@ void _alpm_handle_free(pmhandle_t *handle) } /** Lock the database */ -int _alpm_handle_lock(pmhandle_t *handle) +int _alpm_handle_lock(alpm_handle_t *handle) { int fd; char *dir, *ptr; @@ -124,7 +124,7 @@ int _alpm_handle_lock(pmhandle_t *handle) } /** Remove a lock file */ -int _alpm_handle_unlock(pmhandle_t *handle) +int _alpm_handle_unlock(alpm_handle_t *handle) { ASSERT(handle->lockfile != NULL, return -1); ASSERT(handle->lckstream != NULL, return 0); @@ -140,148 +140,148 @@ int _alpm_handle_unlock(pmhandle_t *handle) } -alpm_cb_log SYMEXPORT alpm_option_get_logcb(pmhandle_t *handle) +alpm_cb_log SYMEXPORT alpm_option_get_logcb(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->logcb; } -alpm_cb_download SYMEXPORT alpm_option_get_dlcb(pmhandle_t *handle) +alpm_cb_download SYMEXPORT alpm_option_get_dlcb(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->dlcb; } -alpm_cb_fetch SYMEXPORT alpm_option_get_fetchcb(pmhandle_t *handle) +alpm_cb_fetch SYMEXPORT alpm_option_get_fetchcb(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->fetchcb; } -alpm_cb_totaldl SYMEXPORT alpm_option_get_totaldlcb(pmhandle_t *handle) +alpm_cb_totaldl SYMEXPORT alpm_option_get_totaldlcb(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->totaldlcb; } -const char SYMEXPORT *alpm_option_get_root(pmhandle_t *handle) +const char SYMEXPORT *alpm_option_get_root(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->root; } -const char SYMEXPORT *alpm_option_get_dbpath(pmhandle_t *handle) +const char SYMEXPORT *alpm_option_get_dbpath(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->dbpath; } -alpm_list_t SYMEXPORT *alpm_option_get_cachedirs(pmhandle_t *handle) +alpm_list_t SYMEXPORT *alpm_option_get_cachedirs(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->cachedirs; } -const char SYMEXPORT *alpm_option_get_logfile(pmhandle_t *handle) +const char SYMEXPORT *alpm_option_get_logfile(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->logfile; } -const char SYMEXPORT *alpm_option_get_lockfile(pmhandle_t *handle) +const char SYMEXPORT *alpm_option_get_lockfile(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->lockfile; } -const char SYMEXPORT *alpm_option_get_gpgdir(pmhandle_t *handle) +const char SYMEXPORT *alpm_option_get_gpgdir(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->gpgdir; } -int SYMEXPORT alpm_option_get_usesyslog(pmhandle_t *handle) +int SYMEXPORT alpm_option_get_usesyslog(alpm_handle_t *handle) { CHECK_HANDLE(handle, return -1); return handle->usesyslog; } -alpm_list_t SYMEXPORT *alpm_option_get_noupgrades(pmhandle_t *handle) +alpm_list_t SYMEXPORT *alpm_option_get_noupgrades(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->noupgrade; } -alpm_list_t SYMEXPORT *alpm_option_get_noextracts(pmhandle_t *handle) +alpm_list_t SYMEXPORT *alpm_option_get_noextracts(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->noextract; } -alpm_list_t SYMEXPORT *alpm_option_get_ignorepkgs(pmhandle_t *handle) +alpm_list_t SYMEXPORT *alpm_option_get_ignorepkgs(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->ignorepkg; } -alpm_list_t SYMEXPORT *alpm_option_get_ignoregrps(pmhandle_t *handle) +alpm_list_t SYMEXPORT *alpm_option_get_ignoregrps(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->ignoregrp; } -const char SYMEXPORT *alpm_option_get_arch(pmhandle_t *handle) +const char SYMEXPORT *alpm_option_get_arch(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->arch; } -int SYMEXPORT alpm_option_get_usedelta(pmhandle_t *handle) +int SYMEXPORT alpm_option_get_usedelta(alpm_handle_t *handle) { CHECK_HANDLE(handle, return -1); return handle->usedelta; } -int SYMEXPORT alpm_option_get_checkspace(pmhandle_t *handle) +int SYMEXPORT alpm_option_get_checkspace(alpm_handle_t *handle) { CHECK_HANDLE(handle, return -1); return handle->checkspace; } -pmdb_t SYMEXPORT *alpm_option_get_localdb(pmhandle_t *handle) +pmdb_t SYMEXPORT *alpm_option_get_localdb(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->db_local; } -alpm_list_t SYMEXPORT *alpm_option_get_syncdbs(pmhandle_t *handle) +alpm_list_t SYMEXPORT *alpm_option_get_syncdbs(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->dbs_sync; } -int SYMEXPORT alpm_option_set_logcb(pmhandle_t *handle, alpm_cb_log cb) +int SYMEXPORT alpm_option_set_logcb(alpm_handle_t *handle, alpm_cb_log cb) { CHECK_HANDLE(handle, return -1); handle->logcb = cb; return 0; } -int SYMEXPORT alpm_option_set_dlcb(pmhandle_t *handle, alpm_cb_download cb) +int SYMEXPORT alpm_option_set_dlcb(alpm_handle_t *handle, alpm_cb_download cb) { CHECK_HANDLE(handle, return -1); handle->dlcb = cb; return 0; } -int SYMEXPORT alpm_option_set_fetchcb(pmhandle_t *handle, alpm_cb_fetch cb) +int SYMEXPORT alpm_option_set_fetchcb(alpm_handle_t *handle, alpm_cb_fetch cb) { CHECK_HANDLE(handle, return -1); handle->fetchcb = cb; return 0; } -int SYMEXPORT alpm_option_set_totaldlcb(pmhandle_t *handle, alpm_cb_totaldl cb) +int SYMEXPORT alpm_option_set_totaldlcb(alpm_handle_t *handle, alpm_cb_totaldl cb) { CHECK_HANDLE(handle, return -1); handle->totaldlcb = cb; @@ -337,7 +337,7 @@ enum _pmerrno_t _alpm_set_directory_option(const char *value, return 0; } -int SYMEXPORT alpm_option_add_cachedir(pmhandle_t *handle, const char *cachedir) +int SYMEXPORT alpm_option_add_cachedir(alpm_handle_t *handle, const char *cachedir) { char *newcachedir; @@ -355,7 +355,7 @@ int SYMEXPORT alpm_option_add_cachedir(pmhandle_t *handle, const char *cachedir) return 0; } -int SYMEXPORT alpm_option_set_cachedirs(pmhandle_t *handle, alpm_list_t *cachedirs) +int SYMEXPORT alpm_option_set_cachedirs(alpm_handle_t *handle, alpm_list_t *cachedirs) { alpm_list_t *i; CHECK_HANDLE(handle, return -1); @@ -371,7 +371,7 @@ int SYMEXPORT alpm_option_set_cachedirs(pmhandle_t *handle, alpm_list_t *cachedi return 0; } -int SYMEXPORT alpm_option_remove_cachedir(pmhandle_t *handle, const char *cachedir) +int SYMEXPORT alpm_option_remove_cachedir(alpm_handle_t *handle, const char *cachedir) { char *vdata = NULL; char *newcachedir; @@ -391,7 +391,7 @@ int SYMEXPORT alpm_option_remove_cachedir(pmhandle_t *handle, const char *cached return 0; } -int SYMEXPORT alpm_option_set_logfile(pmhandle_t *handle, const char *logfile) +int SYMEXPORT alpm_option_set_logfile(alpm_handle_t *handle, const char *logfile) { char *oldlogfile = handle->logfile; @@ -416,7 +416,7 @@ int SYMEXPORT alpm_option_set_logfile(pmhandle_t *handle, const char *logfile) return 0; } -int SYMEXPORT alpm_option_set_gpgdir(pmhandle_t *handle, const char *gpgdir) +int SYMEXPORT alpm_option_set_gpgdir(alpm_handle_t *handle, const char *gpgdir) { CHECK_HANDLE(handle, return -1); if(!gpgdir) { @@ -433,21 +433,21 @@ int SYMEXPORT alpm_option_set_gpgdir(pmhandle_t *handle, const char *gpgdir) return 0; } -int SYMEXPORT alpm_option_set_usesyslog(pmhandle_t *handle, int usesyslog) +int SYMEXPORT alpm_option_set_usesyslog(alpm_handle_t *handle, int usesyslog) { CHECK_HANDLE(handle, return -1); handle->usesyslog = usesyslog; return 0; } -int SYMEXPORT alpm_option_add_noupgrade(pmhandle_t *handle, const char *pkg) +int SYMEXPORT alpm_option_add_noupgrade(alpm_handle_t *handle, const char *pkg) { CHECK_HANDLE(handle, return -1); handle->noupgrade = alpm_list_add(handle->noupgrade, strdup(pkg)); return 0; } -int SYMEXPORT alpm_option_set_noupgrades(pmhandle_t *handle, alpm_list_t *noupgrade) +int SYMEXPORT alpm_option_set_noupgrades(alpm_handle_t *handle, alpm_list_t *noupgrade) { CHECK_HANDLE(handle, return -1); if(handle->noupgrade) FREELIST(handle->noupgrade); @@ -455,7 +455,7 @@ int SYMEXPORT alpm_option_set_noupgrades(pmhandle_t *handle, alpm_list_t *noupgr return 0; } -int SYMEXPORT alpm_option_remove_noupgrade(pmhandle_t *handle, const char *pkg) +int SYMEXPORT alpm_option_remove_noupgrade(alpm_handle_t *handle, const char *pkg) { char *vdata = NULL; CHECK_HANDLE(handle, return -1); @@ -467,14 +467,14 @@ int SYMEXPORT alpm_option_remove_noupgrade(pmhandle_t *handle, const char *pkg) return 0; } -int SYMEXPORT alpm_option_add_noextract(pmhandle_t *handle, const char *pkg) +int SYMEXPORT alpm_option_add_noextract(alpm_handle_t *handle, const char *pkg) { CHECK_HANDLE(handle, return -1); handle->noextract = alpm_list_add(handle->noextract, strdup(pkg)); return 0; } -int SYMEXPORT alpm_option_set_noextracts(pmhandle_t *handle, alpm_list_t *noextract) +int SYMEXPORT alpm_option_set_noextracts(alpm_handle_t *handle, alpm_list_t *noextract) { CHECK_HANDLE(handle, return -1); if(handle->noextract) FREELIST(handle->noextract); @@ -482,7 +482,7 @@ int SYMEXPORT alpm_option_set_noextracts(pmhandle_t *handle, alpm_list_t *noextr return 0; } -int SYMEXPORT alpm_option_remove_noextract(pmhandle_t *handle, const char *pkg) +int SYMEXPORT alpm_option_remove_noextract(alpm_handle_t *handle, const char *pkg) { char *vdata = NULL; CHECK_HANDLE(handle, return -1); @@ -494,14 +494,14 @@ int SYMEXPORT alpm_option_remove_noextract(pmhandle_t *handle, const char *pkg) return 0; } -int SYMEXPORT alpm_option_add_ignorepkg(pmhandle_t *handle, const char *pkg) +int SYMEXPORT alpm_option_add_ignorepkg(alpm_handle_t *handle, const char *pkg) { CHECK_HANDLE(handle, return -1); handle->ignorepkg = alpm_list_add(handle->ignorepkg, strdup(pkg)); return 0; } -int SYMEXPORT alpm_option_set_ignorepkgs(pmhandle_t *handle, alpm_list_t *ignorepkgs) +int SYMEXPORT alpm_option_set_ignorepkgs(alpm_handle_t *handle, alpm_list_t *ignorepkgs) { CHECK_HANDLE(handle, return -1); if(handle->ignorepkg) FREELIST(handle->ignorepkg); @@ -509,7 +509,7 @@ int SYMEXPORT alpm_option_set_ignorepkgs(pmhandle_t *handle, alpm_list_t *ignore return 0; } -int SYMEXPORT alpm_option_remove_ignorepkg(pmhandle_t *handle, const char *pkg) +int SYMEXPORT alpm_option_remove_ignorepkg(alpm_handle_t *handle, const char *pkg) { char *vdata = NULL; CHECK_HANDLE(handle, return -1); @@ -521,14 +521,14 @@ int SYMEXPORT alpm_option_remove_ignorepkg(pmhandle_t *handle, const char *pkg) return 0; } -int SYMEXPORT alpm_option_add_ignoregrp(pmhandle_t *handle, const char *grp) +int SYMEXPORT alpm_option_add_ignoregrp(alpm_handle_t *handle, const char *grp) { CHECK_HANDLE(handle, return -1); handle->ignoregrp = alpm_list_add(handle->ignoregrp, strdup(grp)); return 0; } -int SYMEXPORT alpm_option_set_ignoregrps(pmhandle_t *handle, alpm_list_t *ignoregrps) +int SYMEXPORT alpm_option_set_ignoregrps(alpm_handle_t *handle, alpm_list_t *ignoregrps) { CHECK_HANDLE(handle, return -1); if(handle->ignoregrp) FREELIST(handle->ignoregrp); @@ -536,7 +536,7 @@ int SYMEXPORT alpm_option_set_ignoregrps(pmhandle_t *handle, alpm_list_t *ignore return 0; } -int SYMEXPORT alpm_option_remove_ignoregrp(pmhandle_t *handle, const char *grp) +int SYMEXPORT alpm_option_remove_ignoregrp(alpm_handle_t *handle, const char *grp) { char *vdata = NULL; CHECK_HANDLE(handle, return -1); @@ -548,7 +548,7 @@ int SYMEXPORT alpm_option_remove_ignoregrp(pmhandle_t *handle, const char *grp) return 0; } -int SYMEXPORT alpm_option_set_arch(pmhandle_t *handle, const char *arch) +int SYMEXPORT alpm_option_set_arch(alpm_handle_t *handle, const char *arch) { CHECK_HANDLE(handle, return -1); if(handle->arch) FREE(handle->arch); @@ -560,21 +560,21 @@ int SYMEXPORT alpm_option_set_arch(pmhandle_t *handle, const char *arch) return 0; } -int SYMEXPORT alpm_option_set_usedelta(pmhandle_t *handle, int usedelta) +int SYMEXPORT alpm_option_set_usedelta(alpm_handle_t *handle, int usedelta) { CHECK_HANDLE(handle, return -1); handle->usedelta = usedelta; return 0; } -int SYMEXPORT alpm_option_set_checkspace(pmhandle_t *handle, int checkspace) +int SYMEXPORT alpm_option_set_checkspace(alpm_handle_t *handle, int checkspace) { CHECK_HANDLE(handle, return -1); handle->checkspace = checkspace; return 0; } -int SYMEXPORT alpm_option_set_default_sigverify(pmhandle_t *handle, pgp_verify_t level) +int SYMEXPORT alpm_option_set_default_sigverify(alpm_handle_t *handle, pgp_verify_t level) { CHECK_HANDLE(handle, return -1); ASSERT(level != PM_PGP_VERIFY_UNKNOWN, RET_ERR(handle, PM_ERR_WRONG_ARGS, -1)); @@ -582,7 +582,7 @@ int SYMEXPORT alpm_option_set_default_sigverify(pmhandle_t *handle, pgp_verify_t return 0; } -pgp_verify_t SYMEXPORT alpm_option_get_default_sigverify(pmhandle_t *handle) +pgp_verify_t SYMEXPORT alpm_option_get_default_sigverify(alpm_handle_t *handle) { CHECK_HANDLE(handle, return PM_PGP_VERIFY_UNKNOWN); return handle->sigverify; diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h index 4ffd00c4..6f5ee58a 100644 --- a/lib/libalpm/handle.h +++ b/lib/libalpm/handle.h @@ -30,7 +30,7 @@ #include #endif -struct __pmhandle_t { +struct __alpm_handle_t { /* internal usage */ pmdb_t *db_local; /* local db pointer */ alpm_list_t *dbs_sync; /* List of (pmdb_t *) */ @@ -75,11 +75,11 @@ struct __pmhandle_t { enum _pmerrno_t pm_errno; }; -pmhandle_t *_alpm_handle_new(void); -void _alpm_handle_free(pmhandle_t *handle); +alpm_handle_t *_alpm_handle_new(void); +void _alpm_handle_free(alpm_handle_t *handle); -int _alpm_handle_lock(pmhandle_t *handle); -int _alpm_handle_unlock(pmhandle_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, char **storage, int must_exist); diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index 8bb88117..e8a6e429 100644 --- a/lib/libalpm/log.c +++ b/lib/libalpm/log.c @@ -40,7 +40,7 @@ * @param fmt output format * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int SYMEXPORT alpm_logaction(pmhandle_t *handle, const char *fmt, ...) +int SYMEXPORT alpm_logaction(alpm_handle_t *handle, const char *fmt, ...) { int ret; va_list args; @@ -83,7 +83,7 @@ int SYMEXPORT alpm_logaction(pmhandle_t *handle, const char *fmt, ...) /** @} */ -void _alpm_log(pmhandle_t *handle, pmloglevel_t flag, const char *fmt, ...) +void _alpm_log(alpm_handle_t *handle, pmloglevel_t flag, const char *fmt, ...) { va_list args; diff --git a/lib/libalpm/log.h b/lib/libalpm/log.h index 105430c4..c0813689 100644 --- a/lib/libalpm/log.h +++ b/lib/libalpm/log.h @@ -22,7 +22,7 @@ #include "alpm.h" -void _alpm_log(pmhandle_t *handle, pmloglevel_t flag, +void _alpm_log(alpm_handle_t *handle, pmloglevel_t flag, const char *fmt, ...) __attribute__((format(printf,3,4))); #endif /* _ALPM_LOG_H */ diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index dc890581..9296825c 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -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(pmhandle_t *handle, pmpkg_t *pkg) +int _alpm_pkg_should_ignore(alpm_handle_t *handle, pmpkg_t *pkg) { alpm_list_t *groups = NULL; diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index fc1a7c3a..08a53b6b 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -119,7 +119,7 @@ struct __pmpkg_t { pmdb_t *db; char *file; } origin_data; - pmhandle_t *handle; + alpm_handle_t *handle; alpm_list_t *licenses; alpm_list_t *replaces; @@ -143,14 +143,14 @@ void _alpm_pkg_free(pmpkg_t *pkg); void _alpm_pkg_free_trans(pmpkg_t *pkg); -pmpkg_t *_alpm_pkg_load_internal(pmhandle_t *handle, const char *pkgfile, +pmpkg_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(pmhandle_t *handle, pmpkg_t *pkg); +int _alpm_pkg_should_ignore(alpm_handle_t *handle, pmpkg_t *pkg); #endif /* _ALPM_PACKAGE_H */ diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 134c6662..078e3e25 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(pmhandle_t *handle, pmpkg_t *pkg) +int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, pmpkg_t *pkg) { const char *pkgname; pmtrans_t *trans; @@ -70,7 +70,7 @@ int SYMEXPORT alpm_remove_pkg(pmhandle_t *handle, pmpkg_t *pkg) return 0; } -static void remove_prepare_cascade(pmhandle_t *handle, alpm_list_t *lp) +static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp) { pmtrans_t *trans = handle->trans; @@ -97,7 +97,7 @@ static void remove_prepare_cascade(pmhandle_t *handle, alpm_list_t *lp) } } -static void remove_prepare_keep_needed(pmhandle_t *handle, alpm_list_t *lp) +static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp) { pmtrans_t *trans = handle->trans; @@ -134,7 +134,7 @@ static void remove_prepare_keep_needed(pmhandle_t *handle, alpm_list_t *lp) * @param handle the context handle * @param data a pointer to an alpm_list_t* to fill */ -int _alpm_remove_prepare(pmhandle_t *handle, alpm_list_t **data) +int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data) { alpm_list_t *lp; pmtrans_t *trans = handle->trans; @@ -191,7 +191,7 @@ int _alpm_remove_prepare(pmhandle_t *handle, alpm_list_t **data) return 0; } -static int can_remove_file(pmhandle_t *handle, const char *path, +static int can_remove_file(alpm_handle_t *handle, const char *path, alpm_list_t *skip_remove) { char file[PATH_MAX]; @@ -219,7 +219,7 @@ static int can_remove_file(pmhandle_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(pmhandle_t *handle, pmpkg_t *info, const char *filename, +static void unlink_file(alpm_handle_t *handle, pmpkg_t *info, const char *filename, alpm_list_t *skip_remove, int nosave) { struct stat buf; @@ -282,7 +282,7 @@ static void unlink_file(pmhandle_t *handle, pmpkg_t *info, const char *filename, } } -int _alpm_upgraderemove_package(pmhandle_t *handle, +int _alpm_upgraderemove_package(alpm_handle_t *handle, pmpkg_t *oldpkg, pmpkg_t *newpkg) { alpm_list_t *skip_remove, *b; @@ -353,7 +353,7 @@ db: return 0; } -int _alpm_remove_packages(pmhandle_t *handle) +int _alpm_remove_packages(alpm_handle_t *handle) { pmpkg_t *info; alpm_list_t *targ, *lp; diff --git a/lib/libalpm/remove.h b/lib/libalpm/remove.h index 5cab526a..d4565580 100644 --- a/lib/libalpm/remove.h +++ b/lib/libalpm/remove.h @@ -24,10 +24,10 @@ #include "alpm_list.h" #include "trans.h" -int _alpm_remove_prepare(pmhandle_t *handle, alpm_list_t **data); -int _alpm_remove_packages(pmhandle_t *handle); +int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data); +int _alpm_remove_packages(alpm_handle_t *handle); -int _alpm_upgraderemove_package(pmhandle_t *handle, +int _alpm_upgraderemove_package(alpm_handle_t *handle, pmpkg_t *oldpkg, pmpkg_t *newpkg); #endif /* _ALPM_REMOVE_H */ diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index 9826e425..c26819e7 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -104,7 +104,7 @@ static alpm_list_t *list_sigsum(gpgme_sigsum_t sigsum) return summary; } -static int init_gpgme(pmhandle_t *handle) +static int init_gpgme(alpm_handle_t *handle) { static int init = 0; const char *version, *sigdir; @@ -205,7 +205,7 @@ error: * @param base64_sig optional PGP signature data in base64 encoding * @return a int value : 0 (valid), 1 (invalid), -1 (an error occurred) */ -int _alpm_gpgme_checksig(pmhandle_t *handle, const char *path, +int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path, const char *base64_sig) { int ret = 0; @@ -354,7 +354,7 @@ error: return ret; } #else -int _alpm_gpgme_checksig(pmhandle_t *handle, const char *path, +int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path, const char *base64_sig) { return -1; diff --git a/lib/libalpm/signing.h b/lib/libalpm/signing.h index fdf81fcf..60e71afb 100644 --- a/lib/libalpm/signing.h +++ b/lib/libalpm/signing.h @@ -21,7 +21,7 @@ #include "alpm.h" -int _alpm_gpgme_checksig(pmhandle_t *handle, const char *path, +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); diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 15f135ba..0dc594f3 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -83,7 +83,7 @@ pmpkg_t SYMEXPORT *alpm_sync_newversion(pmpkg_t *pkg, alpm_list_t *dbs_sync) } /** Search for packages to upgrade and add them to the transaction. */ -int SYMEXPORT alpm_sync_sysupgrade(pmhandle_t *handle, int enable_downgrade) +int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) { alpm_list_t *i, *j, *k; pmtrans_t *trans; @@ -257,7 +257,7 @@ static int compute_download_size(pmpkg_t *newpkg) const char *fname; char *fpath; off_t size = 0; - pmhandle_t *handle = newpkg->handle; + alpm_handle_t *handle = newpkg->handle; if(newpkg->origin != PKG_FROM_SYNCDB) { newpkg->infolevel |= INFRQ_DSIZE; @@ -302,7 +302,7 @@ static int compute_download_size(pmpkg_t *newpkg) return 0; } -int _alpm_sync_prepare(pmhandle_t *handle, alpm_list_t **data) +int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) { alpm_list_t *i, *j; alpm_list_t *deps = NULL; @@ -583,7 +583,7 @@ static int endswith(const char *filename, const char *extension) * * @return 0 if all delta files were able to be applied, 1 otherwise. */ -static int apply_deltas(pmhandle_t *handle) +static int apply_deltas(alpm_handle_t *handle) { alpm_list_t *i; int ret = 0; @@ -689,7 +689,7 @@ static int test_md5sum(pmtrans_t *trans, const char *filepath, return ret; } -static int validate_deltas(pmhandle_t *handle, alpm_list_t *deltas, +static int validate_deltas(alpm_handle_t *handle, alpm_list_t *deltas, alpm_list_t **data) { int errors = 0, ret = 0; @@ -726,7 +726,7 @@ static int validate_deltas(pmhandle_t *handle, alpm_list_t *deltas, return ret; } -static int download_files(pmhandle_t *handle, alpm_list_t **deltas) +static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) { const char *cachedir; alpm_list_t *i, *j; @@ -833,7 +833,7 @@ static int download_files(pmhandle_t *handle, alpm_list_t **deltas) return 0; } -int _alpm_sync_commit(pmhandle_t *handle, alpm_list_t **data) +int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) { alpm_list_t *i; alpm_list_t *deltas = NULL; diff --git a/lib/libalpm/sync.h b/lib/libalpm/sync.h index 3049dd21..472d1dfc 100644 --- a/lib/libalpm/sync.h +++ b/lib/libalpm/sync.h @@ -24,8 +24,8 @@ #include "alpm.h" -int _alpm_sync_prepare(pmhandle_t *handle, alpm_list_t **data); -int _alpm_sync_commit(pmhandle_t *handle, alpm_list_t **data); +int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data); +int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data); #endif /* _ALPM_SYNC_H */ diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 507ea027..09afc255 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -48,7 +48,7 @@ */ /** Initialize the transaction. */ -int SYMEXPORT alpm_trans_init(pmhandle_t *handle, pmtransflag_t flags, +int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, pmtransflag_t flags, alpm_trans_cb_event event, alpm_trans_cb_conv conv, alpm_trans_cb_progress progress) { @@ -85,7 +85,7 @@ int SYMEXPORT alpm_trans_init(pmhandle_t *handle, pmtransflag_t flags, return 0; } -static alpm_list_t *check_arch(pmhandle_t *handle, alpm_list_t *pkgs) +static alpm_list_t *check_arch(alpm_handle_t *handle, alpm_list_t *pkgs) { alpm_list_t *i; alpm_list_t *invalid = NULL; @@ -111,7 +111,7 @@ static alpm_list_t *check_arch(pmhandle_t *handle, alpm_list_t *pkgs) } /** Prepare a transaction. */ -int SYMEXPORT alpm_trans_prepare(pmhandle_t *handle, alpm_list_t **data) +int SYMEXPORT alpm_trans_prepare(alpm_handle_t *handle, alpm_list_t **data) { pmtrans_t *trans; @@ -155,7 +155,7 @@ int SYMEXPORT alpm_trans_prepare(pmhandle_t *handle, alpm_list_t **data) } /** Commit a transaction. */ -int SYMEXPORT alpm_trans_commit(pmhandle_t *handle, alpm_list_t **data) +int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data) { pmtrans_t *trans; @@ -194,7 +194,7 @@ int SYMEXPORT alpm_trans_commit(pmhandle_t *handle, alpm_list_t **data) } /** Interrupt a transaction. */ -int SYMEXPORT alpm_trans_interrupt(pmhandle_t *handle) +int SYMEXPORT alpm_trans_interrupt(alpm_handle_t *handle) { pmtrans_t *trans; @@ -212,7 +212,7 @@ int SYMEXPORT alpm_trans_interrupt(pmhandle_t *handle) } /** Release a transaction. */ -int SYMEXPORT alpm_trans_release(pmhandle_t *handle) +int SYMEXPORT alpm_trans_release(alpm_handle_t *handle) { pmtrans_t *trans; @@ -285,7 +285,7 @@ static int grep(const char *fn, const char *needle) return 0; } -int _alpm_runscriptlet(pmhandle_t *handle, const char *installfn, +int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn, const char *script, const char *ver, const char *oldver) { char scriptfn[PATH_MAX]; @@ -359,7 +359,7 @@ cleanup: return retval; } -pmtransflag_t SYMEXPORT alpm_trans_get_flags(pmhandle_t *handle) +pmtransflag_t SYMEXPORT alpm_trans_get_flags(alpm_handle_t *handle) { /* Sanity checks */ CHECK_HANDLE(handle, return -1); @@ -368,7 +368,7 @@ pmtransflag_t SYMEXPORT alpm_trans_get_flags(pmhandle_t *handle) return handle->trans->flags; } -alpm_list_t SYMEXPORT *alpm_trans_get_add(pmhandle_t *handle) +alpm_list_t SYMEXPORT *alpm_trans_get_add(alpm_handle_t *handle) { /* Sanity checks */ CHECK_HANDLE(handle, return NULL); @@ -377,7 +377,7 @@ alpm_list_t SYMEXPORT *alpm_trans_get_add(pmhandle_t *handle) return handle->trans->add; } -alpm_list_t SYMEXPORT *alpm_trans_get_remove(pmhandle_t *handle) +alpm_list_t SYMEXPORT *alpm_trans_get_remove(alpm_handle_t *handle) { /* Sanity checks */ CHECK_HANDLE(handle, return NULL); diff --git a/lib/libalpm/trans.h b/lib/libalpm/trans.h index e8587156..d9b8e90a 100644 --- a/lib/libalpm/trans.h +++ b/lib/libalpm/trans.h @@ -70,7 +70,7 @@ void _alpm_trans_free(pmtrans_t *trans); int _alpm_trans_init(pmtrans_t *trans, pmtransflag_t flags, alpm_trans_cb_event event, alpm_trans_cb_conv conv, alpm_trans_cb_progress progress); -int _alpm_runscriptlet(pmhandle_t *handle, const char *installfn, +int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn, const char *script, const char *ver, const char *oldver); #endif /* _ALPM_TRANS_H */ diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 6fbe08ae..991898e1 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -218,7 +218,7 @@ char *_alpm_strtrim(char *str) * @param filename a file within the archive to unpack * @return 0 on success, 1 on failure */ -int _alpm_unpack_single(pmhandle_t *handle, const char *archive, +int _alpm_unpack_single(alpm_handle_t *handle, const char *archive, const char *prefix, const char *filename) { alpm_list_t *list = NULL; @@ -243,7 +243,7 @@ int _alpm_unpack_single(pmhandle_t *handle, const char *archive, * * @return 0 on success, 1 on failure */ -int _alpm_unpack(pmhandle_t *handle, const char *archive, const char *prefix, +int _alpm_unpack(alpm_handle_t *handle, const char *archive, const char *prefix, alpm_list_t *list, int breakfirst) { int ret = 0; @@ -388,7 +388,7 @@ int _alpm_rmrf(const char *path) return 0; } -int _alpm_logaction(pmhandle_t *handle, const char *fmt, va_list args) +int _alpm_logaction(alpm_handle_t *handle, const char *fmt, va_list args) { int ret = 0; @@ -419,7 +419,7 @@ int _alpm_logaction(pmhandle_t *handle, const char *fmt, va_list args) return ret; } -int _alpm_run_chroot(pmhandle_t *handle, const char *path, char *const argv[]) +int _alpm_run_chroot(alpm_handle_t *handle, const char *path, char *const argv[]) { char cwd[PATH_MAX]; pid_t pid; @@ -536,7 +536,7 @@ cleanup: return retval; } -int _alpm_ldconfig(pmhandle_t *handle) +int _alpm_ldconfig(alpm_handle_t *handle) { char line[PATH_MAX]; @@ -566,7 +566,7 @@ int _alpm_str_cmp(const void *s1, const void *s2) * @param filename name of file to find * @return malloced path of file, NULL if not found */ -char *_alpm_filecache_find(pmhandle_t *handle, const char *filename) +char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename) { char path[PATH_MAX]; char *retpath; @@ -592,7 +592,7 @@ char *_alpm_filecache_find(pmhandle_t *handle, const char *filename) * @param handle the context handle * @return pointer to a writable cache directory. */ -const char *_alpm_filecache_setup(pmhandle_t *handle) +const char *_alpm_filecache_setup(alpm_handle_t *handle) { struct stat buf; alpm_list_t *i, *tmp; diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h index c68b07ba..8006c74a 100644 --- a/lib/libalpm/util.h +++ b/lib/libalpm/util.h @@ -29,7 +29,7 @@ #include "alpm_list.h" #include "alpm.h" #include "package.h" /* pmpkg_t */ -#include "handle.h" /* pmhandle_t */ +#include "handle.h" /* alpm_handle_t */ #include #include @@ -95,17 +95,17 @@ int _alpm_makepath(const char *path); int _alpm_makepath_mode(const char *path, mode_t mode); int _alpm_copyfile(const char *src, const char *dest); char *_alpm_strtrim(char *str); -int _alpm_unpack_single(pmhandle_t *handle, const char *archive, +int _alpm_unpack_single(alpm_handle_t *handle, const char *archive, const char *prefix, const char *filename); -int _alpm_unpack(pmhandle_t *handle, const char *archive, const char *prefix, +int _alpm_unpack(alpm_handle_t *handle, const char *archive, const char *prefix, alpm_list_t *list, int breakfirst); int _alpm_rmrf(const char *path); -int _alpm_logaction(pmhandle_t *handle, const char *fmt, va_list args); -int _alpm_run_chroot(pmhandle_t *handle, const char *path, char *const argv[]); -int _alpm_ldconfig(pmhandle_t *handle); +int _alpm_logaction(alpm_handle_t *handle, const char *fmt, va_list args); +int _alpm_run_chroot(alpm_handle_t *handle, const char *path, char *const argv[]); +int _alpm_ldconfig(alpm_handle_t *handle); int _alpm_str_cmp(const void *s1, const void *s2); -char *_alpm_filecache_find(pmhandle_t *handle, const char *filename); -const char *_alpm_filecache_setup(pmhandle_t *handle); +char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename); +const char *_alpm_filecache_setup(alpm_handle_t *handle); int _alpm_lstat(const char *path, struct stat *buf); int _alpm_test_md5sum(const char *filepath, const char *md5sum); int _alpm_archive_fgets(struct archive *a, struct archive_read_buffer *b); diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 076e854d..0e7429eb 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -421,7 +421,7 @@ static int setup_libalpm(void) { int ret = 0; enum _pmerrno_t err; - pmhandle_t *handle; + alpm_handle_t *handle; pm_printf(PM_LOG_DEBUG, "setup_libalpm called\n"); diff --git a/src/pacman/conf.h b/src/pacman/conf.h index 4c44bfdd..c0f35493 100644 --- a/src/pacman/conf.h +++ b/src/pacman/conf.h @@ -92,7 +92,7 @@ typedef struct __config_t { char *xfercommand; /* our connection to libalpm */ - pmhandle_t *handle; + alpm_handle_t *handle; } config_t; /* Operations */ 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 'lib/libalpm/conflict.c') 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 'lib/libalpm/conflict.c') 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 6b62508c865feaa35d000fa0bcd0ccd8321cd742 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 23:27:16 +1000 Subject: Rename pmtrans_t to alpm_trans_t Signed-off-by: Allan McRae --- lib/libalpm/add.c | 6 +++--- lib/libalpm/alpm.h | 2 +- lib/libalpm/conflict.c | 2 +- lib/libalpm/diskspace.c | 2 +- lib/libalpm/handle.h | 2 +- lib/libalpm/remove.c | 10 +++++----- lib/libalpm/sync.c | 12 ++++++------ lib/libalpm/trans.c | 14 +++++++------- lib/libalpm/trans.h | 6 +++--- 9 files changed, 28 insertions(+), 28 deletions(-) (limited to 'lib/libalpm/conflict.c') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 27bd04d2..3455744f 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -53,7 +53,7 @@ int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) { const char *pkgname, *pkgver; - pmtrans_t *trans; + alpm_trans_t *trans; alpm_pkg_t *local; /* Sanity checks */ @@ -458,7 +458,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, int is_upgrade = 0; alpm_pkg_t *oldpkg = NULL; alpm_db_t *db = handle->db_local; - pmtrans_t *trans = handle->trans; + alpm_trans_t *trans = handle->trans; snprintf(scriptlet, PATH_MAX, "%s%s-%s/install", _alpm_db_path(db), alpm_pkg_get_name(newpkg), @@ -689,7 +689,7 @@ int _alpm_upgrade_packages(alpm_handle_t *handle) size_t pkg_count, pkg_current; int skip_ldconfig = 0, ret = 0; alpm_list_t *targ; - pmtrans_t *trans = handle->trans; + alpm_trans_t *trans = handle->trans; if(trans->add == NULL) { return 0; diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 6bff5567..16a30a41 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -103,7 +103,7 @@ typedef enum _pgp_verify_t { typedef struct __alpm_handle_t alpm_handle_t; typedef struct __alpm_db_t alpm_db_t; typedef struct __alpm_pkg_t alpm_pkg_t; -typedef struct __pmtrans_t pmtrans_t; +typedef struct __alpm_trans_t alpm_trans_t; /** Dependency */ typedef struct _pmdepend_t { diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index d269a066..8a626be6 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -368,7 +368,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, alpm_list_t *i, *j, *conflicts = NULL; size_t numtargs = alpm_list_count(upgrade); size_t current; - pmtrans_t *trans = handle->trans; + alpm_trans_t *trans = handle->trans; if(!upgrade) { return NULL; diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 2bc382e4..7ca72c3c 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -264,7 +264,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle) size_t replaces = 0, current = 0, numtargs; int error = 0; alpm_list_t *targ; - pmtrans_t *trans = handle->trans; + alpm_trans_t *trans = handle->trans; numtargs = alpm_list_count(trans->add); mount_points = mount_point_list(handle); diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h index 35fe4877..c0078b0b 100644 --- a/lib/libalpm/handle.h +++ b/lib/libalpm/handle.h @@ -36,7 +36,7 @@ struct __alpm_handle_t { 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; + alpm_trans_t *trans; #ifdef HAVE_LIBCURL /* libcurl handle */ diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index bc290736..aab49f13 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -47,7 +47,7 @@ int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) { const char *pkgname; - pmtrans_t *trans; + alpm_trans_t *trans; /* Sanity checks */ CHECK_HANDLE(handle, return -1); @@ -72,7 +72,7 @@ int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp) { - pmtrans_t *trans = handle->trans; + alpm_trans_t *trans = handle->trans; while(lp) { alpm_list_t *i; @@ -99,7 +99,7 @@ static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp) static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp) { - pmtrans_t *trans = handle->trans; + alpm_trans_t *trans = handle->trans; /* Remove needed packages (which break dependencies) from target list */ while(lp != NULL) { @@ -137,7 +137,7 @@ static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp) int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data) { alpm_list_t *lp; - pmtrans_t *trans = handle->trans; + alpm_trans_t *trans = handle->trans; alpm_db_t *db = handle->db_local; if((trans->flags & PM_TRANS_FLAG_RECURSE) && !(trans->flags & PM_TRANS_FLAG_CASCADE)) { @@ -358,7 +358,7 @@ int _alpm_remove_packages(alpm_handle_t *handle) alpm_pkg_t *info; alpm_list_t *targ, *lp; size_t pkg_count; - pmtrans_t *trans = handle->trans; + alpm_trans_t *trans = handle->trans; pkg_count = alpm_list_count(trans->remove); diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 86cd48ce..f447c067 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -86,7 +86,7 @@ alpm_pkg_t SYMEXPORT *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_syn int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) { alpm_list_t *i, *j, *k; - pmtrans_t *trans; + alpm_trans_t *trans; alpm_db_t *db_local; alpm_list_t *dbs_sync; @@ -309,7 +309,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) alpm_list_t *unresolvable = NULL; alpm_list_t *remove = NULL; int ret = 0; - pmtrans_t *trans = handle->trans; + alpm_trans_t *trans = handle->trans; if(data) { *data = NULL; @@ -588,7 +588,7 @@ static int apply_deltas(alpm_handle_t *handle) alpm_list_t *i; int ret = 0; const char *cachedir = _alpm_filecache_setup(handle); - pmtrans_t *trans = handle->trans; + alpm_trans_t *trans = handle->trans; for(i = trans->add; i; i = i->next) { alpm_pkg_t *spkg = i->data; @@ -673,7 +673,7 @@ static int apply_deltas(alpm_handle_t *handle) * * @return 0 if the md5sum matched, 1 if not, -1 in case of errors */ -static int test_md5sum(pmtrans_t *trans, const char *filepath, +static int test_md5sum(alpm_trans_t *trans, const char *filepath, const char *md5sum) { int ret = _alpm_test_md5sum(filepath, md5sum); @@ -694,7 +694,7 @@ static int validate_deltas(alpm_handle_t *handle, alpm_list_t *deltas, { int errors = 0, ret = 0; alpm_list_t *i; - pmtrans_t *trans = handle->trans; + alpm_trans_t *trans = handle->trans; if(!deltas) { return 0; @@ -839,7 +839,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) alpm_list_t *deltas = NULL; size_t numtargs, current = 0, replaces = 0; int errors; - pmtrans_t *trans = handle->trans; + alpm_trans_t *trans = handle->trans; if(download_files(handle, &deltas)) { alpm_list_free(deltas); diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 73dd6a42..fdcdcdc6 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -52,7 +52,7 @@ int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, pmtransflag_t flags, alpm_trans_cb_event event, alpm_trans_cb_conv conv, alpm_trans_cb_progress progress) { - pmtrans_t *trans; + alpm_trans_t *trans; alpm_list_t *i; /* Sanity checks */ @@ -73,7 +73,7 @@ int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, pmtransflag_t flags, } } - CALLOC(trans, 1, sizeof(pmtrans_t), RET_ERR(handle, PM_ERR_MEMORY, -1)); + CALLOC(trans, 1, sizeof(alpm_trans_t), RET_ERR(handle, PM_ERR_MEMORY, -1)); trans->flags = flags; trans->cb_event = event; trans->cb_conv = conv; @@ -113,7 +113,7 @@ static alpm_list_t *check_arch(alpm_handle_t *handle, alpm_list_t *pkgs) /** Prepare a transaction. */ int SYMEXPORT alpm_trans_prepare(alpm_handle_t *handle, alpm_list_t **data) { - pmtrans_t *trans; + alpm_trans_t *trans; /* Sanity checks */ CHECK_HANDLE(handle, return -1); @@ -157,7 +157,7 @@ int SYMEXPORT alpm_trans_prepare(alpm_handle_t *handle, alpm_list_t **data) /** Commit a transaction. */ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data) { - pmtrans_t *trans; + alpm_trans_t *trans; /* Sanity checks */ CHECK_HANDLE(handle, return -1); @@ -196,7 +196,7 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data) /** Interrupt a transaction. */ int SYMEXPORT alpm_trans_interrupt(alpm_handle_t *handle) { - pmtrans_t *trans; + alpm_trans_t *trans; /* Sanity checks */ CHECK_HANDLE(handle, return -1); @@ -214,7 +214,7 @@ int SYMEXPORT alpm_trans_interrupt(alpm_handle_t *handle) /** Release a transaction. */ int SYMEXPORT alpm_trans_release(alpm_handle_t *handle) { - pmtrans_t *trans; + alpm_trans_t *trans; /* Sanity checks */ CHECK_HANDLE(handle, return -1); @@ -243,7 +243,7 @@ int SYMEXPORT alpm_trans_release(alpm_handle_t *handle) /** @} */ -void _alpm_trans_free(pmtrans_t *trans) +void _alpm_trans_free(alpm_trans_t *trans) { if(trans == NULL) { return; diff --git a/lib/libalpm/trans.h b/lib/libalpm/trans.h index 87238e4a..8fd01ae3 100644 --- a/lib/libalpm/trans.h +++ b/lib/libalpm/trans.h @@ -36,7 +36,7 @@ typedef enum _pmtransstate_t { } pmtransstate_t; /* Transaction */ -struct __pmtrans_t { +struct __alpm_trans_t { pmtransflag_t flags; pmtransstate_t state; alpm_list_t *add; /* list of (alpm_pkg_t *) */ @@ -66,8 +66,8 @@ do { \ } \ } while(0) -void _alpm_trans_free(pmtrans_t *trans); -int _alpm_trans_init(pmtrans_t *trans, pmtransflag_t flags, +void _alpm_trans_free(alpm_trans_t *trans); +int _alpm_trans_init(alpm_trans_t *trans, pmtransflag_t flags, alpm_trans_cb_event event, alpm_trans_cb_conv conv, alpm_trans_cb_progress progress); int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn, -- 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 'lib/libalpm/conflict.c') 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 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 'lib/libalpm/conflict.c') 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 37b6cceed41bc22d0d9fb1fe2f274067ddd2b2cc Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:35:17 +1000 Subject: Rename pmfileconflict_t to alpm_fileconflict_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 4 ++-- lib/libalpm/conflict.c | 8 ++++---- lib/libalpm/conflict.h | 2 +- src/pacman/sync.c | 2 +- src/pacman/upgrade.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/libalpm/conflict.c') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index ff966f18..90bb5405 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -129,12 +129,12 @@ typedef struct _alpm_conflict_t { } alpm_conflict_t; /** File conflict */ -typedef struct _pmfileconflict_t { +typedef struct _alpm_fileconflict_t { char *target; alpm_fileconflicttype_t type; char *file; char *ctarget; -} pmfileconflict_t; +} alpm_fileconflict_t; /** Package group */ typedef struct _pmgrp_t { diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 83a1fa5f..e54c7147 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -275,7 +275,7 @@ static alpm_list_t *filelist_operation(alpm_list_t *filesA, alpm_list_t *filesB, return ret; } -/* Adds pmfileconflict_t to a conflicts list. Pass the conflicts list, type +/* Adds alpm_fileconflict_t to a conflicts list. Pass the conflicts list, type * (either PM_FILECONFLICT_TARGET or PM_FILECONFLICT_FILESYSTEM), a file * string, and either two package names or one package name and NULL. This is * a wrapper for former functionality that was done inline. @@ -284,8 +284,8 @@ static alpm_list_t *add_fileconflict(alpm_handle_t *handle, alpm_list_t *conflicts, alpm_fileconflicttype_t type, const char *filestr, const char *name1, const char *name2) { - pmfileconflict_t *conflict; - MALLOC(conflict, sizeof(pmfileconflict_t), goto error); + alpm_fileconflict_t *conflict; + MALLOC(conflict, sizeof(alpm_fileconflict_t), goto error); conflict->type = type; STRDUP(conflict->target, name1, goto error); @@ -306,7 +306,7 @@ error: RET_ERR(handle, PM_ERR_MEMORY, conflicts); } -void _alpm_fileconflict_free(pmfileconflict_t *conflict) +void _alpm_fileconflict_free(alpm_fileconflict_t *conflict) { FREE(conflict->ctarget); FREE(conflict->file); diff --git a/lib/libalpm/conflict.h b/lib/libalpm/conflict.h index 4edbe620..6c13cb28 100644 --- a/lib/libalpm/conflict.h +++ b/lib/libalpm/conflict.h @@ -31,7 +31,7 @@ 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); -void _alpm_fileconflict_free(pmfileconflict_t *conflict); +void _alpm_fileconflict_free(alpm_fileconflict_t *conflict); #endif /* _ALPM_CONFLICT_H */ diff --git a/src/pacman/sync.c b/src/pacman/sync.c index f0d7dba8..418cda1d 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -836,7 +836,7 @@ static int sync_trans(alpm_list_t *targets) switch(err) { case PM_ERR_FILE_CONFLICTS: for(i = data; i; i = alpm_list_next(i)) { - pmfileconflict_t *conflict = alpm_list_getdata(i); + alpm_fileconflict_t *conflict = alpm_list_getdata(i); switch(conflict->type) { case PM_FILECONFLICT_TARGET: printf(_("%s exists in both '%s' and '%s'\n"), diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c index 1fa538da..7f6e0986 100644 --- a/src/pacman/upgrade.c +++ b/src/pacman/upgrade.c @@ -168,7 +168,7 @@ int pacman_upgrade(alpm_list_t *targets) switch(err) { case PM_ERR_FILE_CONFLICTS: for(i = data; i; i = alpm_list_next(i)) { - pmfileconflict_t *conflict = alpm_list_getdata(i); + alpm_fileconflict_t *conflict = alpm_list_getdata(i); switch(conflict->type) { case PM_FILECONFLICT_TARGET: printf(_("%s exists in both '%s' and '%s'\n"), -- cgit v1.2.3-70-g09d2