From 7ce674491bd854610855fe83482eda6b18273fa0 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 13:54:04 +1000 Subject: Rename pmpkgreason_t to alpm_pkgreason_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 8 ++++---- lib/libalpm/be_local.c | 4 ++-- lib/libalpm/db.c | 2 +- lib/libalpm/package.c | 4 ++-- lib/libalpm/package.h | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index ac352131..00d21563 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -53,12 +53,12 @@ extern "C" { * Install reasons. * Why the package was installed. */ -typedef enum _pmpkgreason_t { +typedef enum _alpm_pkgreason_t { /** Explicitly requested by the user. */ PM_PKG_REASON_EXPLICIT = 0, /** Installed as a dependency for another package. */ PM_PKG_REASON_DEPEND = 1 -} pmpkgreason_t; +} alpm_pkgreason_t; /** Types of version constraints in dependency specs. */ typedef enum _pmdepmod_t { @@ -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, pmpkgreason_t reason); +int alpm_db_set_pkgreason(pmdb_t *db, const char *name, alpm_pkgreason_t reason); /** @} */ @@ -567,7 +567,7 @@ off_t alpm_pkg_get_isize(pmpkg_t *pkg); * @param pkg a pointer to package * @return an enum member giving the install reason. */ -pmpkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg); +alpm_pkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg); /** Returns the list of package licenses. * @param pkg a pointer to package diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 50066883..a1e2a003 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -115,7 +115,7 @@ static off_t _cache_get_isize(pmpkg_t *pkg) return pkg->isize; } -static pmpkgreason_t _cache_get_reason(pmpkg_t *pkg) +static alpm_pkgreason_t _cache_get_reason(pmpkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, -1); return pkg->reason; @@ -618,7 +618,7 @@ int _alpm_local_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) if(fgets(line, sizeof(line), fp) == NULL) { goto error; } - info->reason = (pmpkgreason_t)atol(_alpm_strtrim(line)); + info->reason = (alpm_pkgreason_t)atol(_alpm_strtrim(line)); } else if(strcmp(line, "%SIZE%") == 0) { /* NOTE: the CSIZE and SIZE fields both share the "size" field * in the pkginfo_t struct. This can be done b/c CSIZE diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 9f37f80b..c1518101 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -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, pmpkgreason_t reason) +int SYMEXPORT alpm_db_set_pkgreason(pmdb_t *db, const char *name, alpm_pkgreason_t reason) { ASSERT(db != NULL, return -1); db->handle->pm_errno = 0; diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 75ac94c7..dc890581 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -95,7 +95,7 @@ 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 pmpkgreason_t _pkg_get_reason(pmpkg_t *pkg) { return pkg->reason; } +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; } @@ -246,7 +246,7 @@ off_t SYMEXPORT alpm_pkg_get_isize(pmpkg_t *pkg) return pkg->ops->get_isize(pkg); } -pmpkgreason_t SYMEXPORT alpm_pkg_get_reason(pmpkg_t *pkg) +alpm_pkgreason_t SYMEXPORT alpm_pkg_get_reason(pmpkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index d18020d4..fc1a7c3a 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -58,7 +58,7 @@ struct pkg_operations { const char *(*get_arch) (pmpkg_t *); off_t (*get_size) (pmpkg_t *); off_t (*get_isize) (pmpkg_t *); - pmpkgreason_t (*get_reason) (pmpkg_t *); + alpm_pkgreason_t (*get_reason) (pmpkg_t *); int (*has_scriptlet) (pmpkg_t *); alpm_list_t *(*get_licenses) (pmpkg_t *); @@ -110,7 +110,7 @@ struct __pmpkg_t { int scriptlet; - pmpkgreason_t reason; + alpm_pkgreason_t reason; pmdbinfrq_t infolevel; pmpkgfrom_t origin; /* origin == PKG_FROM_FILE, use pkg->origin_data.file -- cgit v1.2.3-2-g168b From 0a80cf31cfe960b2c62e734aef6e3c662469e917 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 13:56:46 +1000 Subject: Rename pmdepmod_t to alpm_depmod_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 6 +++--- lib/libalpm/deps.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 00d21563..25f7f6db 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -61,7 +61,7 @@ typedef enum _alpm_pkgreason_t { } alpm_pkgreason_t; /** Types of version constraints in dependency specs. */ -typedef enum _pmdepmod_t { +typedef enum _alpm_depmod_t { /** No version constraint */ PM_DEP_MOD_ANY = 1, /** Test version equality (package=x.y.z) */ @@ -74,7 +74,7 @@ typedef enum _pmdepmod_t { PM_DEP_MOD_GT, /** Test for less than some version (package Date: Tue, 28 Jun 2011 13:58:59 +1000 Subject: Rename pmfileconflicttype_t to alpm_fileconflicttype_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 6 +++--- lib/libalpm/conflict.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 25f7f6db..8a7979f2 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -81,10 +81,10 @@ typedef enum _alpm_depmod_t { * Whether the conflict results from a file existing on the filesystem, or with * another target in the transaction. */ -typedef enum _pmfileconflicttype_t { +typedef enum _alpm_fileconflicttype_t { PM_FILECONFLICT_TARGET = 1, PM_FILECONFLICT_FILESYSTEM -} pmfileconflicttype_t; +} alpm_fileconflicttype_t; /** * GPG signature verification options @@ -131,7 +131,7 @@ typedef struct _pmconflict_t { /** File conflict */ typedef struct _pmfileconflict_t { char *target; - pmfileconflicttype_t type; + alpm_fileconflicttype_t type; char *file; char *ctarget; } pmfileconflict_t; 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-2-g168b 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 +++--- 36 files changed, 237 insertions(+), 237 deletions(-) (limited to 'lib/libalpm') 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); -- cgit v1.2.3-2-g168b 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 +- 20 files changed, 127 insertions(+), 127 deletions(-) (limited to 'lib/libalpm') 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); } -- cgit v1.2.3-2-g168b 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 +- 24 files changed, 330 insertions(+), 330 deletions(-) (limited to 'lib/libalpm') 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 -- cgit v1.2.3-2-g168b 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') 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-2-g168b 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 ++-- 7 files changed, 36 insertions(+), 36 deletions(-) (limited to 'lib/libalpm') 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; -- cgit v1.2.3-2-g168b From 6d876f9b6be055d54e50d42a34c267aad64c0b21 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:32:09 +1000 Subject: Rename pmdepmissing_t to alpm_depmissing_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 6 +++--- lib/libalpm/deps.c | 16 ++++++++-------- lib/libalpm/deps.h | 2 +- lib/libalpm/remove.c | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index c23fa4d3..53ff4a9f 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -114,12 +114,12 @@ typedef struct _alpm_depend_t { } alpm_depend_t; /** Missing dependency */ -typedef struct _pmdepmissing_t { +typedef struct _alpm_depmissing_t { char *target; alpm_depend_t *depend; /* this is used in case of remove dependency error only */ char *causingpkg; -} pmdepmissing_t; +} alpm_depmissing_t; /** Conflict */ typedef struct _pmconflict_t { @@ -895,7 +895,7 @@ int alpm_trans_init(alpm_handle_t *handle, pmtransflag_t flags, /** Prepare a transaction. * @param handle the context handle * @param data the address of an alpm_list where a list - * of pmdepmissing_t objects is dumped (conflicting packages) + * of alpm_depmissing_t objects is dumped (conflicting packages) * @return 0 on success, -1 on error (pm_errno is set accordingly) */ int alpm_trans_prepare(alpm_handle_t *handle, alpm_list_t **data); diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 93a7821e..2ec5451e 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -44,12 +44,12 @@ void _alpm_dep_free(alpm_depend_t *dep) FREE(dep); } -static pmdepmissing_t *depmiss_new(const char *target, alpm_depend_t *dep, +static alpm_depmissing_t *depmiss_new(const char *target, alpm_depend_t *dep, const char *causingpkg) { - pmdepmissing_t *miss; + alpm_depmissing_t *miss; - MALLOC(miss, sizeof(pmdepmissing_t), return NULL); + MALLOC(miss, sizeof(alpm_depmissing_t), return NULL); STRDUP(miss->target, target, return NULL); miss->depend = _alpm_dep_dup(dep); @@ -58,7 +58,7 @@ static pmdepmissing_t *depmiss_new(const char *target, alpm_depend_t *dep, return miss; } -void _alpm_depmiss_free(pmdepmissing_t *miss) +void _alpm_depmiss_free(alpm_depmissing_t *miss) { _alpm_dep_free(miss->depend); FREE(miss->target); @@ -263,7 +263,7 @@ alpm_pkg_t SYMEXPORT *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstri * @param remove an alpm_list_t* of packages to be removed * @param upgrade an alpm_list_t* of packages to be upgraded (remove-then-upgrade) * @param reversedeps handles the backward dependencies - * @return an alpm_list_t* of pmdepmissing_t pointers. + * @return an alpm_list_t* of alpm_depmissing_t pointers. */ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglist, alpm_list_t *remove, alpm_list_t *upgrade, int reversedeps) @@ -302,7 +302,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis if(!find_dep_satisfier(upgrade, depend) && !find_dep_satisfier(dblist, depend)) { /* Unsatisfied dependency in the upgrade list */ - pmdepmissing_t *miss; + alpm_depmissing_t *miss; char *missdepstring = alpm_dep_compute_string(depend); _alpm_log(handle, PM_LOG_DEBUG, "checkdeps: missing dependency '%s' for package '%s'\n", missdepstring, alpm_pkg_get_name(tp)); @@ -329,7 +329,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis if(causingpkg && !find_dep_satisfier(upgrade, depend) && !find_dep_satisfier(dblist, depend)) { - pmdepmissing_t *miss; + alpm_depmissing_t *miss; char *missdepstring = alpm_dep_compute_string(depend); _alpm_log(handle, PM_LOG_DEBUG, "checkdeps: transaction would break '%s' dependency of '%s'\n", missdepstring, alpm_pkg_get_name(lp)); @@ -718,7 +718,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t alpm_list_free(targ); for(j = deps; j; j = j->next) { - pmdepmissing_t *miss = j->data; + alpm_depmissing_t *miss = j->data; alpm_depend_t *missdep = miss->depend; /* check if one of the packages in the [*packages] list already satisfies * this dependency */ diff --git a/lib/libalpm/deps.h b/lib/libalpm/deps.h index 8935175d..6ef4cbbe 100644 --- a/lib/libalpm/deps.h +++ b/lib/libalpm/deps.h @@ -29,7 +29,7 @@ void _alpm_dep_free(alpm_depend_t *dep); alpm_depend_t *_alpm_dep_dup(const alpm_depend_t *dep); -void _alpm_depmiss_free(pmdepmissing_t *miss); +void _alpm_depmiss_free(alpm_depmissing_t *miss); alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, alpm_list_t *targets, int reverse); void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit); int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t *pkg, diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index aab49f13..3412774b 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -77,7 +77,7 @@ static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp) while(lp) { alpm_list_t *i; for(i = lp; i; i = i->next) { - pmdepmissing_t *miss = (pmdepmissing_t *)i->data; + alpm_depmissing_t *miss = (alpm_depmissing_t *)i->data; alpm_pkg_t *info = _alpm_db_get_pkgfromcache(handle->db_local, miss->target); if(info) { if(!_alpm_pkg_find(trans->remove, alpm_pkg_get_name(info))) { @@ -105,7 +105,7 @@ static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp) while(lp != NULL) { alpm_list_t *i; for(i = lp; i; i = i->next) { - pmdepmissing_t *miss = (pmdepmissing_t *)i->data; + alpm_depmissing_t *miss = (alpm_depmissing_t *)i->data; void *vpkg; alpm_pkg_t *pkg = _alpm_pkg_find(trans->remove, miss->causingpkg); if(pkg == NULL) { @@ -129,7 +129,7 @@ static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp) /** Transaction preparation for remove actions. * This functions takes a pointer to a alpm_list_t which will be - * filled with a list of pmdepmissing_t* objects representing + * filled with a list of alpm_depmissing_t* objects representing * the packages blocking the transaction. * @param handle the context handle * @param data a pointer to an alpm_list_t* to fill -- cgit v1.2.3-2-g168b 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 ++++---- 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'lib/libalpm') 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); } -- cgit v1.2.3-2-g168b 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 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/libalpm') 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 */ -- cgit v1.2.3-2-g168b From 1fdbe7902219c5ed3e56b921acae4f3a58b9e76e Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:37:16 +1000 Subject: Rename pmgrp_t to alpm_group_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 6 +++--- lib/libalpm/db.c | 8 ++++---- lib/libalpm/db.h | 2 +- lib/libalpm/group.c | 8 ++++---- lib/libalpm/group.h | 4 ++-- lib/libalpm/sync.c | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 90bb5405..5af2efd7 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -137,12 +137,12 @@ typedef struct _alpm_fileconflict_t { } alpm_fileconflict_t; /** Package group */ -typedef struct _pmgrp_t { +typedef struct _alpm_group_t { /** group name */ char *name; /** list of alpm_pkg_t packages */ alpm_list_t *packages; -} pmgrp_t; +} alpm_group_t; /** Package upgrade delta */ typedef struct _pmdelta_t { @@ -411,7 +411,7 @@ alpm_list_t *alpm_db_get_pkgcache(alpm_db_t *db); * @param name of the group * @return the groups entry on success, NULL on error */ -pmgrp_t *alpm_db_readgrp(alpm_db_t *db, const char *name); +alpm_group_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 diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 4c1922d9..248337a9 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -239,7 +239,7 @@ alpm_list_t SYMEXPORT *alpm_db_get_pkgcache(alpm_db_t *db) } /** Get a group entry from a package database. */ -pmgrp_t SYMEXPORT *alpm_db_readgrp(alpm_db_t *db, const char *name) +alpm_group_t SYMEXPORT *alpm_db_readgrp(alpm_db_t *db, const char *name) { ASSERT(db != NULL, return NULL); db->handle->pm_errno = 0; @@ -595,7 +595,7 @@ static int load_grpcache(alpm_db_t *db) for(i = alpm_pkg_get_groups(pkg); i; i = i->next) { const char *grpname = i->data; alpm_list_t *j; - pmgrp_t *grp = NULL; + alpm_group_t *grp = NULL; int found = 0; /* first look through the group cache for a group with this name */ @@ -663,7 +663,7 @@ alpm_list_t *_alpm_db_get_grpcache(alpm_db_t *db) return db->grpcache; } -pmgrp_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target) +alpm_group_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target) { alpm_list_t *i; @@ -672,7 +672,7 @@ pmgrp_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target) } for(i = _alpm_db_get_grpcache(db); i; i = i->next) { - pmgrp_t *info = i->data; + alpm_group_t *info = i->data; if(strcmp(info->name, target) == 0) { return info; diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index 9c6d6052..2f15c33c 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -104,7 +104,7 @@ 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); -pmgrp_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target); +alpm_group_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target); #endif /* _ALPM_DB_H */ diff --git a/lib/libalpm/group.c b/lib/libalpm/group.c index 07acfa89..aefa7be8 100644 --- a/lib/libalpm/group.c +++ b/lib/libalpm/group.c @@ -30,17 +30,17 @@ #include "log.h" #include "alpm.h" -pmgrp_t *_alpm_grp_new(const char *name) +alpm_group_t *_alpm_grp_new(const char *name) { - pmgrp_t* grp; + alpm_group_t* grp; - CALLOC(grp, 1, sizeof(pmgrp_t), return NULL); + CALLOC(grp, 1, sizeof(alpm_group_t), return NULL); STRDUP(grp->name, name, free(grp); return NULL); return grp; } -void _alpm_grp_free(pmgrp_t *grp) +void _alpm_grp_free(alpm_group_t *grp) { if(grp == NULL) { return; diff --git a/lib/libalpm/group.h b/lib/libalpm/group.h index f2a67ca9..ad38c768 100644 --- a/lib/libalpm/group.h +++ b/lib/libalpm/group.h @@ -22,8 +22,8 @@ #include "alpm.h" -pmgrp_t *_alpm_grp_new(const char *name); -void _alpm_grp_free(pmgrp_t *grp); +alpm_group_t *_alpm_grp_new(const char *name); +void _alpm_grp_free(alpm_group_t *grp); #endif /* _ALPM_GROUP_H */ diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 954253d9..0c257684 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -220,7 +220,7 @@ alpm_list_t SYMEXPORT *alpm_find_grp_pkgs(alpm_list_t *dbs, for(i = dbs; i; i = i->next) { alpm_db_t *db = i->data; - pmgrp_t *grp = alpm_db_readgrp(db, name); + alpm_group_t *grp = alpm_db_readgrp(db, name); if(!grp) continue; -- cgit v1.2.3-2-g168b From bfe1771067e372420d857094befd6c6ea5b28495 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:38:38 +1000 Subject: Rename pmdelta_t to alpm_delta_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 4 ++-- lib/libalpm/delta.c | 40 ++++++++++++++++++++-------------------- lib/libalpm/delta.h | 6 +++--- lib/libalpm/sync.c | 6 +++--- 4 files changed, 28 insertions(+), 28 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 5af2efd7..9c321d67 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -145,7 +145,7 @@ typedef struct _alpm_group_t { } alpm_group_t; /** Package upgrade delta */ -typedef struct _pmdelta_t { +typedef struct _alpm_delta_t { /** filename of the delta patch */ char *delta; /** md5sum of the delta file */ @@ -158,7 +158,7 @@ typedef struct _pmdelta_t { off_t delta_size; /** download filesize of the delta file */ off_t download_size; -} pmdelta_t; +} alpm_delta_t; /** Local package or package file backup entry */ typedef struct _pmbackup_t { diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c index 0128e556..c5770bfc 100644 --- a/lib/libalpm/delta.c +++ b/lib/libalpm/delta.c @@ -45,7 +45,7 @@ static alpm_list_t *graph_init(alpm_list_t *deltas, int reverse) alpm_list_free(vertices); return NULL; } - pmdelta_t *vdelta = i->data; + alpm_delta_t *vdelta = i->data; vdelta->download_size = vdelta->delta_size; v->weight = LONG_MAX; v->data = vdelta; @@ -55,11 +55,11 @@ static alpm_list_t *graph_init(alpm_list_t *deltas, int reverse) /* compute the edges */ for(i = vertices; i; i = i->next) { pmgraph_t *v_i = i->data; - pmdelta_t *d_i = v_i->data; + alpm_delta_t *d_i = v_i->data; /* loop a second time so we make all possible comparisons */ for(j = vertices; j; j = j->next) { pmgraph_t *v_j = j->data; - pmdelta_t *d_j = v_j->data; + alpm_delta_t *d_j = v_j->data; /* We want to create a delta tree like the following: * 1_to_2 * | @@ -85,7 +85,7 @@ static void graph_init_size(alpm_handle_t *handle, alpm_list_t *vertices) for(i = vertices; i; i = i->next) { char *fpath, *md5sum; pmgraph_t *v = i->data; - pmdelta_t *vdelta = v->data; + alpm_delta_t *vdelta = v->data; /* determine whether the delta file already exists */ fpath = _alpm_filecache_find(handle, vdelta->delta); @@ -133,7 +133,7 @@ static void dijkstra(alpm_list_t *vertices) v->childptr = v->children; while(v->childptr) { pmgraph_t *v_c = v->childptr->data; - pmdelta_t *d_c = v_c->data; + alpm_delta_t *d_c = v_c->data; if(v_c->weight > v->weight + d_c->download_size) { v_c->weight = v->weight + d_c->download_size; v_c->parent = v; @@ -154,7 +154,7 @@ static off_t shortest_path(alpm_list_t *vertices, const char *to, alpm_list_t ** for(i = vertices; i; i = i->next) { pmgraph_t *v_i = i->data; - pmdelta_t *d_i = v_i->data; + alpm_delta_t *d_i = v_i->data; if(strcmp(d_i->to, to) == 0) { if(v == NULL || v_i->weight < v->weight) { @@ -165,7 +165,7 @@ static off_t shortest_path(alpm_list_t *vertices, const char *to, alpm_list_t ** } while(v != NULL) { - pmdelta_t *vdelta = v->data; + alpm_delta_t *vdelta = v->data; rpath = alpm_list_add(rpath, vdelta); v = v->parent; } @@ -179,9 +179,9 @@ static off_t shortest_path(alpm_list_t *vertices, const char *to, alpm_list_t ** * The shortest path is defined as the path with the smallest combined * size, not the length of the path. * @param handle the context handle - * @param deltas the list of pmdelta_t * objects that a file has + * @param deltas the list of alpm_delta_t * objects that a file has * @param to the file to start the search at - * @param path the pointer to a list location where pmdelta_t * objects that + * @param path the pointer to a list location where alpm_delta_t * objects that * have the smallest size are placed. NULL is set if there is no path * possible with the files available. * @return the size of the path stored, or LONG_MAX if path is unfindable @@ -223,7 +223,7 @@ static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota for(i = vertices; i; i = i->next) { pmgraph_t *v = i->data; - pmdelta_t *vdelta = v->data; + alpm_delta_t *vdelta = v->data; if(strcmp(vdelta->to, to) == 0) { v->weight = vdelta->download_size; @@ -232,7 +232,7 @@ static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota dijkstra(vertices); for(i = vertices; i; i = i->next) { pmgraph_t *v = i->data; - pmdelta_t *vdelta = v->data; + alpm_delta_t *vdelta = v->data; if(v->weight > quota) { unused = alpm_list_add(unused, vdelta->delta); } @@ -259,17 +259,17 @@ alpm_list_t SYMEXPORT *alpm_pkg_unused_deltas(alpm_pkg_t *pkg) /** @} */ -/** Parses the string representation of a pmdelta_t object. +/** Parses the string representation of a alpm_delta_t object. * This function assumes that the string is in the correct format. * This format is as follows: * $deltafile $deltamd5 $deltasize $oldfile $newfile * @param line the string to parse - * @return A pointer to the new pmdelta_t object + * @return A pointer to the new alpm_delta_t object */ /* TODO this does not really belong here, but in a parsing lib */ -pmdelta_t *_alpm_delta_parse(char *line) +alpm_delta_t *_alpm_delta_parse(char *line) { - pmdelta_t *delta; + alpm_delta_t *delta; char *tmp = line, *tmp2; regex_t reg; @@ -284,7 +284,7 @@ pmdelta_t *_alpm_delta_parse(char *line) } regfree(®); - CALLOC(delta, 1, sizeof(pmdelta_t), return NULL); + CALLOC(delta, 1, sizeof(alpm_delta_t), return NULL); tmp2 = tmp; tmp = strchr(tmp, ' '); @@ -312,7 +312,7 @@ pmdelta_t *_alpm_delta_parse(char *line) return delta; } -void _alpm_delta_free(pmdelta_t *delta) +void _alpm_delta_free(alpm_delta_t *delta) { FREE(delta->delta); FREE(delta->delta_md5); @@ -321,10 +321,10 @@ void _alpm_delta_free(pmdelta_t *delta) FREE(delta); } -pmdelta_t *_alpm_delta_dup(const pmdelta_t *delta) +alpm_delta_t *_alpm_delta_dup(const alpm_delta_t *delta) { - pmdelta_t *newdelta; - CALLOC(newdelta, 1, sizeof(pmdelta_t), return NULL); + alpm_delta_t *newdelta; + CALLOC(newdelta, 1, sizeof(alpm_delta_t), return NULL); STRDUP(newdelta->delta, delta->delta, return NULL); STRDUP(newdelta->delta_md5, delta->delta_md5, return NULL); STRDUP(newdelta->from, delta->from, return NULL); diff --git a/lib/libalpm/delta.h b/lib/libalpm/delta.h index 1f38a572..05df4207 100644 --- a/lib/libalpm/delta.h +++ b/lib/libalpm/delta.h @@ -26,9 +26,9 @@ #include "alpm.h" -pmdelta_t *_alpm_delta_parse(char *line); -void _alpm_delta_free(pmdelta_t *delta); -pmdelta_t *_alpm_delta_dup(const pmdelta_t *delta); +alpm_delta_t *_alpm_delta_parse(char *line); +void _alpm_delta_free(alpm_delta_t *delta); +alpm_delta_t *_alpm_delta_dup(const alpm_delta_t *delta); off_t _alpm_shortest_delta_path(alpm_handle_t *handle, alpm_list_t *deltas, const char *to, alpm_list_t **path); diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 0c257684..37753487 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -600,7 +600,7 @@ static int apply_deltas(alpm_handle_t *handle) } for(dlts = delta_path; dlts; dlts = dlts->next) { - pmdelta_t *d = dlts->data; + alpm_delta_t *d = dlts->data; char *delta, *from, *to; char command[PATH_MAX]; size_t len = 0; @@ -704,7 +704,7 @@ static int validate_deltas(alpm_handle_t *handle, alpm_list_t *deltas, EVENT(trans, PM_TRANS_EVT_DELTA_INTEGRITY_START, NULL, NULL); for(i = deltas; i; i = i->next) { - pmdelta_t *d = alpm_list_getdata(i); + alpm_delta_t *d = alpm_list_getdata(i); char *filepath = _alpm_filecache_find(handle, d->delta); if(test_md5sum(trans, filepath, d->delta_md5) != 0) { @@ -766,7 +766,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) /* using deltas */ alpm_list_t *dlts; for(dlts = delta_path; dlts; dlts = dlts->next) { - pmdelta_t *delta = dlts->data; + alpm_delta_t *delta = dlts->data; if(delta->download_size != 0) { files = alpm_list_add(files, strdup(delta->delta)); } -- cgit v1.2.3-2-g168b From cd1e39ba62ea564c1c29a918aa1a4d6aac9a351e Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:39:43 +1000 Subject: Rename pmbackup_t to alpm_backup_t Signed-off-by: Allan McRae --- lib/libalpm/add.c | 6 +++--- lib/libalpm/alpm.h | 4 ++-- lib/libalpm/backup.c | 14 +++++++------- lib/libalpm/backup.h | 8 ++++---- lib/libalpm/be_local.c | 6 +++--- lib/libalpm/be_package.c | 4 ++-- lib/libalpm/remove.c | 4 ++-- 7 files changed, 23 insertions(+), 23 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 3455744f..b8b1ca18 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -252,7 +252,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, if(alpm_list_find_str(handle->noupgrade, entryname)) { notouch = 1; } else { - pmbackup_t *backup; + alpm_backup_t *backup; /* go to the backup array and see if our conflict is there */ /* check newpkg first, so that adding backup files is retroactive */ backup = _alpm_needbackup(entryname, alpm_pkg_get_backup(newpkg)); @@ -303,7 +303,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, /* update the md5 hash in newpkg's backup (it will be the new orginal) */ alpm_list_t *i; for(i = alpm_pkg_get_backup(newpkg); i; i = i->next) { - pmbackup_t *backup = i->data; + alpm_backup_t *backup = i->data; char *newhash; if(!backup->name || strcmp(backup->name, entryname_orig) != 0) { continue; @@ -435,7 +435,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, /* calculate an hash if this is in newpkg's backup */ alpm_list_t *i; for(i = alpm_pkg_get_backup(newpkg); i; i = i->next) { - pmbackup_t *backup = i->data; + alpm_backup_t *backup = i->data; char *newhash; if(!backup->name || strcmp(backup->name, entryname_orig) != 0) { continue; diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 9c321d67..d8fb8349 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -161,10 +161,10 @@ typedef struct _alpm_delta_t { } alpm_delta_t; /** Local package or package file backup entry */ -typedef struct _pmbackup_t { +typedef struct _alpm_backup_t { char *name; char *hash; -} pmbackup_t; +} alpm_backup_t; /* * Logging facilities diff --git a/lib/libalpm/backup.c b/lib/libalpm/backup.c index 408c0e17..0334042c 100644 --- a/lib/libalpm/backup.c +++ b/lib/libalpm/backup.c @@ -33,7 +33,7 @@ #include "util.h" /* split a backup string "file\thash" into the relevant components */ -int _alpm_split_backup(const char *string, pmbackup_t **backup) +int _alpm_split_backup(const char *string, alpm_backup_t **backup) { char *str, *ptr; @@ -58,7 +58,7 @@ int _alpm_split_backup(const char *string, pmbackup_t **backup) /* 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) +alpm_backup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list) { const alpm_list_t *lp; @@ -68,7 +68,7 @@ pmbackup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list) /* run through the backup list and parse out the hash for our file */ for(lp = backup_list; lp; lp = lp->next) { - pmbackup_t *backup = lp->data; + alpm_backup_t *backup = lp->data; if(strcmp(file, backup->name) == 0) { return backup; @@ -78,17 +78,17 @@ pmbackup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list) return NULL; } -void _alpm_backup_free(pmbackup_t *backup) +void _alpm_backup_free(alpm_backup_t *backup) { free(backup->name); free(backup->hash); free(backup); } -pmbackup_t *_alpm_backup_dup(const pmbackup_t *backup) +alpm_backup_t *_alpm_backup_dup(const alpm_backup_t *backup) { - pmbackup_t *newbackup; - CALLOC(newbackup, 1, sizeof(pmbackup_t), return NULL); + alpm_backup_t *newbackup; + CALLOC(newbackup, 1, sizeof(alpm_backup_t), return NULL); STRDUP(newbackup->name, backup->name, return NULL); STRDUP(newbackup->hash, backup->hash, return NULL); diff --git a/lib/libalpm/backup.h b/lib/libalpm/backup.h index be8de97a..39c01a6d 100644 --- a/lib/libalpm/backup.h +++ b/lib/libalpm/backup.h @@ -23,10 +23,10 @@ #include "alpm_list.h" #include "alpm.h" -int _alpm_split_backup(const char *string, pmbackup_t **backup); -pmbackup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list); -void _alpm_backup_free(pmbackup_t *backup); -pmbackup_t *_alpm_backup_dup(const pmbackup_t *backup); +int _alpm_split_backup(const char *string, alpm_backup_t **backup); +alpm_backup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list); +void _alpm_backup_free(alpm_backup_t *backup); +alpm_backup_t *_alpm_backup_dup(const alpm_backup_t *backup); #endif /* _ALPM_BACKUP_H */ diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 06a948c1..19b06bb5 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -683,8 +683,8 @@ int _alpm_local_db_read(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq) } } else if(strcmp(line, "%BACKUP%") == 0) { while(fgets(line, sizeof(line), fp) && strlen(_alpm_strtrim(line))) { - pmbackup_t *backup; - CALLOC(backup, 1, sizeof(pmbackup_t), goto error); + alpm_backup_t *backup; + CALLOC(backup, 1, sizeof(alpm_backup_t), goto error); if(_alpm_split_backup(line, &backup)) { goto error; } @@ -887,7 +887,7 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq) if(info->backup) { fprintf(fp, "%%BACKUP%%\n"); for(lp = info->backup; lp; lp = lp->next) { - pmbackup_t *backup = lp->data; + alpm_backup_t *backup = lp->data; fprintf(fp, "%s\t%s\n", backup->name, backup->hash); } fprintf(fp, "\n"); diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index a372526d..a4c6c559 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -200,8 +200,8 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t * } else if(strcmp(key, "provides") == 0) { newpkg->provides = alpm_list_add(newpkg->provides, strdup(ptr)); } else if(strcmp(key, "backup") == 0) { - pmbackup_t *backup; - CALLOC(backup, 1, sizeof(pmbackup_t), return -1); + alpm_backup_t *backup; + CALLOC(backup, 1, sizeof(alpm_backup_t), return -1); STRDUP(backup->name, ptr, return -1); newpkg->backup = alpm_list_add(newpkg->backup, backup); } else if(strcmp(key, "force") == 0) { diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 3412774b..86571a4f 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -254,7 +254,7 @@ static void unlink_file(alpm_handle_t *handle, alpm_pkg_t *info, const char *fil } } else { /* if the file needs backup and has been modified, back it up to .pacsave */ - pmbackup_t *backup = _alpm_needbackup(filename, alpm_pkg_get_backup(info)); + alpm_backup_t *backup = _alpm_needbackup(filename, alpm_pkg_get_backup(info)); if(backup) { if(nosave) { _alpm_log(handle, PM_LOG_DEBUG, "transaction is set to NOSAVE, not backing up '%s'\n", file); @@ -307,7 +307,7 @@ int _alpm_upgraderemove_package(alpm_handle_t *handle, /* old package backup list */ alpm_list_t *filelist = alpm_pkg_get_files(newpkg); for(b = alpm_pkg_get_backup(newpkg); b; b = b->next) { - const pmbackup_t *backup = b->data; + const alpm_backup_t *backup = b->data; /* safety check (fix the upgrade026 pactest) */ if(!alpm_list_find_str(filelist, backup->name)) { continue; -- cgit v1.2.3-2-g168b From 0aef91bc4fc5e872afe7da1692bf97c027eecf37 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:41:07 +1000 Subject: Rename pmloglevel_t to alpm_loglevel_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 6 +++--- lib/libalpm/log.c | 2 +- lib/libalpm/log.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index d8fb8349..83dad5d8 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -173,14 +173,14 @@ typedef struct _alpm_backup_t { /** * Logging Levels */ -typedef enum _pmloglevel_t { +typedef enum _alpm_loglevel_t { PM_LOG_ERROR = 1, PM_LOG_WARNING = (1 << 1), PM_LOG_DEBUG = (1 << 2), PM_LOG_FUNCTION = (1 << 3) -} pmloglevel_t; +} alpm_loglevel_t; -typedef void (*alpm_cb_log)(pmloglevel_t, const char *, va_list); +typedef void (*alpm_cb_log)(alpm_loglevel_t, const char *, va_list); int alpm_logaction(alpm_handle_t *handle, const char *fmt, ...); /* diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index e8a6e429..eeeaef3c 100644 --- a/lib/libalpm/log.c +++ b/lib/libalpm/log.c @@ -83,7 +83,7 @@ int SYMEXPORT alpm_logaction(alpm_handle_t *handle, const char *fmt, ...) /** @} */ -void _alpm_log(alpm_handle_t *handle, pmloglevel_t flag, const char *fmt, ...) +void _alpm_log(alpm_handle_t *handle, alpm_loglevel_t flag, const char *fmt, ...) { va_list args; diff --git a/lib/libalpm/log.h b/lib/libalpm/log.h index c0813689..a43290d8 100644 --- a/lib/libalpm/log.h +++ b/lib/libalpm/log.h @@ -22,7 +22,7 @@ #include "alpm.h" -void _alpm_log(alpm_handle_t *handle, pmloglevel_t flag, +void _alpm_log(alpm_handle_t *handle, alpm_loglevel_t flag, const char *fmt, ...) __attribute__((format(printf,3,4))); #endif /* _ALPM_LOG_H */ -- cgit v1.2.3-2-g168b From 590a8fcb1e72707d83d04f639385de0d7f2a60c1 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:42:24 +1000 Subject: Rename pmtransflag_t to alpm_transflag_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 8 ++++---- lib/libalpm/trans.c | 4 ++-- lib/libalpm/trans.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 83dad5d8..f922be3c 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -714,7 +714,7 @@ alpm_pkg_t *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_sync); */ /** Transaction flags */ -typedef enum _pmtransflag_t { +typedef enum _alpm_transflag_t { /** Ignore dependency checks. */ PM_TRANS_FLAG_NODEPS = 1, /** Ignore file conflicts and overwrite files. */ @@ -749,7 +749,7 @@ typedef enum _pmtransflag_t { PM_TRANS_FLAG_RECURSEALL = (1 << 16), /** Do not lock the database during the operation. */ PM_TRANS_FLAG_NOLOCK = (1 << 17) -} pmtransflag_t; +} alpm_transflag_t; /** Transaction events. * NULL parameters are passed to in all events unless specified otherwise. @@ -866,7 +866,7 @@ 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(alpm_handle_t *handle); +alpm_transflag_t alpm_trans_get_flags(alpm_handle_t *handle); /** Returns a list of packages added by the transaction. * @param handle the context handle @@ -888,7 +888,7 @@ alpm_list_t * alpm_trans_get_remove(alpm_handle_t *handle); * @param progress progress callback function pointer * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_trans_init(alpm_handle_t *handle, pmtransflag_t flags, +int alpm_trans_init(alpm_handle_t *handle, alpm_transflag_t flags, alpm_trans_cb_event cb_event, alpm_trans_cb_conv conv, alpm_trans_cb_progress cb_progress); diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index fdcdcdc6..29a74bf9 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -48,7 +48,7 @@ */ /** Initialize the transaction. */ -int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, pmtransflag_t flags, +int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, alpm_transflag_t flags, alpm_trans_cb_event event, alpm_trans_cb_conv conv, alpm_trans_cb_progress progress) { @@ -359,7 +359,7 @@ cleanup: return retval; } -pmtransflag_t SYMEXPORT alpm_trans_get_flags(alpm_handle_t *handle) +alpm_transflag_t SYMEXPORT alpm_trans_get_flags(alpm_handle_t *handle) { /* Sanity checks */ CHECK_HANDLE(handle, return -1); diff --git a/lib/libalpm/trans.h b/lib/libalpm/trans.h index 8fd01ae3..962e9ffd 100644 --- a/lib/libalpm/trans.h +++ b/lib/libalpm/trans.h @@ -37,7 +37,7 @@ typedef enum _pmtransstate_t { /* Transaction */ struct __alpm_trans_t { - pmtransflag_t flags; + alpm_transflag_t flags; pmtransstate_t state; alpm_list_t *add; /* list of (alpm_pkg_t *) */ alpm_list_t *remove; /* list of (alpm_pkg_t *) */ @@ -67,7 +67,7 @@ do { \ } while(0) void _alpm_trans_free(alpm_trans_t *trans); -int _alpm_trans_init(alpm_trans_t *trans, pmtransflag_t flags, +int _alpm_trans_init(alpm_trans_t *trans, alpm_transflag_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-2-g168b From 011ef6be0e68dcf148a255c31a9a6efb7429c2f9 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:43:48 +1000 Subject: Rename pmtransevt_t to alpm_transevt_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index f922be3c..78a98b80 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -754,7 +754,7 @@ typedef enum _alpm_transflag_t { /** Transaction events. * NULL parameters are passed to in all events unless specified otherwise. */ -typedef enum _pmtransevt_t { +typedef enum _alpm_transevt_t { /** Dependencies will be computed for a package. */ PM_TRANS_EVT_CHECKDEPS_START = 1, /** Dependencies were computed for a package. */ @@ -829,7 +829,7 @@ typedef enum _pmtransevt_t { PM_TRANS_EVT_DISKSPACE_START, /** Disk space usage was computed for a package */ PM_TRANS_EVT_DISKSPACE_DONE, -} pmtransevt_t; +} alpm_transevt_t; /** Transaction Conversations (ie, questions) */ typedef enum _pmtransconv_t { @@ -853,7 +853,7 @@ typedef enum _pmtransprog_t { } pmtransprog_t; /** Transaction Event callback */ -typedef void (*alpm_trans_cb_event)(pmtransevt_t, void *, void *); +typedef void (*alpm_trans_cb_event)(alpm_transevt_t, void *, void *); /** Transaction Conversation callback */ typedef void (*alpm_trans_cb_conv)(pmtransconv_t, void *, void *, -- cgit v1.2.3-2-g168b From 565e167356c1ec56803454b2b4c617f21296fb67 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:46:58 +1000 Subject: Rename pmtransconv_t to alpm_transconv_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 78a98b80..22fe387d 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -832,7 +832,7 @@ typedef enum _alpm_transevt_t { } alpm_transevt_t; /** Transaction Conversations (ie, questions) */ -typedef enum _pmtransconv_t { +typedef enum _alpm_transconv_t { PM_TRANS_CONV_INSTALL_IGNOREPKG = 1, PM_TRANS_CONV_REPLACE_PKG = (1 << 1), PM_TRANS_CONV_CONFLICT_PKG = (1 << 2), @@ -840,7 +840,7 @@ typedef enum _pmtransconv_t { PM_TRANS_CONV_LOCAL_NEWER = (1 << 4), PM_TRANS_CONV_REMOVE_PKGS = (1 << 5), PM_TRANS_CONV_SELECT_PROVIDER = (1 << 6), -} pmtransconv_t; +} alpm_transconv_t; /** Transaction Progress */ typedef enum _pmtransprog_t { @@ -856,7 +856,7 @@ typedef enum _pmtransprog_t { typedef void (*alpm_trans_cb_event)(alpm_transevt_t, void *, void *); /** Transaction Conversation callback */ -typedef void (*alpm_trans_cb_conv)(pmtransconv_t, void *, void *, +typedef void (*alpm_trans_cb_conv)(alpm_transconv_t, void *, void *, void *, int *); /** Transaction Progress callback */ -- cgit v1.2.3-2-g168b From 1059df7486054c621423436b801681775a2596c3 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:48:50 +1000 Subject: Rename pmtransprog_t to alpm_transprog_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 22fe387d..cf040807 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -843,14 +843,14 @@ typedef enum _alpm_transconv_t { } alpm_transconv_t; /** Transaction Progress */ -typedef enum _pmtransprog_t { +typedef enum _alpm_transprog_t { PM_TRANS_PROGRESS_ADD_START, PM_TRANS_PROGRESS_UPGRADE_START, PM_TRANS_PROGRESS_REMOVE_START, PM_TRANS_PROGRESS_CONFLICTS_START, PM_TRANS_PROGRESS_DISKSPACE_START, PM_TRANS_PROGRESS_INTEGRITY_START, -} pmtransprog_t; +} alpm_transprog_t; /** Transaction Event callback */ typedef void (*alpm_trans_cb_event)(alpm_transevt_t, void *, void *); @@ -860,7 +860,7 @@ typedef void (*alpm_trans_cb_conv)(alpm_transconv_t, void *, void *, void *, int *); /** Transaction Progress callback */ -typedef void (*alpm_trans_cb_progress)(pmtransprog_t, const char *, int, size_t, size_t); +typedef void (*alpm_trans_cb_progress)(alpm_transprog_t, const char *, int, size_t, size_t); /** Returns the bitfield of flags for the current transaction. * @param handle the context handle -- cgit v1.2.3-2-g168b From ddad400900fbf253f6e247f51ef4aeb9d89d8643 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:50:48 +1000 Subject: Rename pmerrno_t to alpm_errno_t Signed-off-by: Allan McRae --- lib/libalpm/alpm.c | 4 ++-- lib/libalpm/alpm.h | 8 ++++---- lib/libalpm/error.c | 4 ++-- lib/libalpm/handle.c | 2 +- lib/libalpm/handle.h | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 4cafa6a3..abbc7db8 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -47,9 +47,9 @@ * @return a context handle on success, NULL on error, err will be set if provided */ alpm_handle_t SYMEXPORT *alpm_initialize(const char *root, const char *dbpath, - enum _pmerrno_t *err) + enum _alpm_errno_t *err) { - enum _pmerrno_t myerr; + enum _alpm_errno_t myerr; const char *lf = "db.lck"; size_t lockfilelen; alpm_handle_t *myhandle = _alpm_handle_new(); diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index cf040807..54a9ba42 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -983,7 +983,7 @@ char *alpm_compute_md5sum(const char *name); /** @addtogroup alpm_api_errors Error Codes * @{ */ -enum _pmerrno_t { +enum _alpm_errno_t { PM_ERR_MEMORY = 1, PM_ERR_SYSTEM, PM_ERR_BADPERMS, @@ -1048,16 +1048,16 @@ enum _pmerrno_t { }; /** Returns the current error code from the handle. */ -enum _pmerrno_t alpm_errno(alpm_handle_t *handle); +enum _alpm_errno_t alpm_errno(alpm_handle_t *handle); /** Returns the string corresponding to an error number. */ -const char *alpm_strerror(enum _pmerrno_t err); +const char *alpm_strerror(enum _alpm_errno_t err); /* End of alpm_api_errors */ /** @} */ alpm_handle_t *alpm_initialize(const char *root, const char *dbpath, - enum _pmerrno_t *err); + enum _alpm_errno_t *err); int alpm_release(alpm_handle_t *handle); const char *alpm_version(void); diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c index fb0493ff..225d8859 100644 --- a/lib/libalpm/error.c +++ b/lib/libalpm/error.c @@ -29,12 +29,12 @@ #include "alpm.h" #include "handle.h" -enum _pmerrno_t SYMEXPORT alpm_errno(alpm_handle_t *handle) +enum _alpm_errno_t SYMEXPORT alpm_errno(alpm_handle_t *handle) { return handle->pm_errno; } -const char SYMEXPORT *alpm_strerror(enum _pmerrno_t err) +const char SYMEXPORT *alpm_strerror(enum _alpm_errno_t err) { switch(err) { /* System */ diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 48b674c0..bb2ce50c 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -303,7 +303,7 @@ static char *canonicalize_path(const char *path) { return new_path; } -enum _pmerrno_t _alpm_set_directory_option(const char *value, +enum _alpm_errno_t _alpm_set_directory_option(const char *value, char **storage, int must_exist) { struct stat st; diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h index c0078b0b..4b366193 100644 --- a/lib/libalpm/handle.h +++ b/lib/libalpm/handle.h @@ -72,7 +72,7 @@ struct __alpm_handle_t { pgp_verify_t sigverify; /* Default signature verification level */ /* error code */ - enum _pmerrno_t pm_errno; + enum _alpm_errno_t pm_errno; }; alpm_handle_t *_alpm_handle_new(void); @@ -81,7 +81,7 @@ void _alpm_handle_free(alpm_handle_t *handle); int _alpm_handle_lock(alpm_handle_t *handle); int _alpm_handle_unlock(alpm_handle_t *handle); -enum _pmerrno_t _alpm_set_directory_option(const char *value, +enum _alpm_errno_t _alpm_set_directory_option(const char *value, char **storage, int must_exist); #endif /* _ALPM_HANDLE_H */ -- cgit v1.2.3-2-g168b From 08fc1db24c9d30f63c9ac858ab2cc50f64f8e38b Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:52:50 +1000 Subject: Rename pmpkgfrom_t to alpm_pkgfrom_t Signed-off-by: Allan McRae --- lib/libalpm/package.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index 5edf40de..87f191bd 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -34,11 +34,11 @@ #include "db.h" #include "signing.h" -typedef enum _pmpkgfrom_t { +typedef enum _alpm_pkgfrom_t { PKG_FROM_FILE = 1, PKG_FROM_LOCALDB, PKG_FROM_SYNCDB -} pmpkgfrom_t; +} alpm_pkgfrom_t; /** Package operations struct. This struct contains function pointers to * all methods used to access data in a package to allow for things such @@ -112,7 +112,7 @@ struct __alpm_pkg_t { alpm_pkgreason_t reason; pmdbinfrq_t infolevel; - pmpkgfrom_t origin; + alpm_pkgfrom_t origin; /* origin == PKG_FROM_FILE, use pkg->origin_data.file * origin == PKG_FROM_*DB, use pkg->origin_data.db */ union { -- cgit v1.2.3-2-g168b From 57b9b19b103a5d48a7116adfd546a516e121329c Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:54:19 +1000 Subject: Rename pmgraph_t to alpm_graph_t Signed-off-by: Allan McRae --- lib/libalpm/delta.c | 22 +++++++++++----------- lib/libalpm/deps.c | 10 +++++----- lib/libalpm/graph.c | 8 ++++---- lib/libalpm/graph.h | 8 ++++---- 4 files changed, 24 insertions(+), 24 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c index c5770bfc..d2c2fe80 100644 --- a/lib/libalpm/delta.c +++ b/lib/libalpm/delta.c @@ -40,7 +40,7 @@ static alpm_list_t *graph_init(alpm_list_t *deltas, int reverse) alpm_list_t *vertices = NULL; /* create the vertices */ for(i = deltas; i; i = i->next) { - pmgraph_t *v = _alpm_graph_new(); + alpm_graph_t *v = _alpm_graph_new(); if(!v) { alpm_list_free(vertices); return NULL; @@ -54,11 +54,11 @@ static alpm_list_t *graph_init(alpm_list_t *deltas, int reverse) /* compute the edges */ for(i = vertices; i; i = i->next) { - pmgraph_t *v_i = i->data; + alpm_graph_t *v_i = i->data; alpm_delta_t *d_i = v_i->data; /* loop a second time so we make all possible comparisons */ for(j = vertices; j; j = j->next) { - pmgraph_t *v_j = j->data; + alpm_graph_t *v_j = j->data; alpm_delta_t *d_j = v_j->data; /* We want to create a delta tree like the following: * 1_to_2 @@ -84,7 +84,7 @@ static void graph_init_size(alpm_handle_t *handle, alpm_list_t *vertices) for(i = vertices; i; i = i->next) { char *fpath, *md5sum; - pmgraph_t *v = i->data; + alpm_graph_t *v = i->data; alpm_delta_t *vdelta = v->data; /* determine whether the delta file already exists */ @@ -109,12 +109,12 @@ static void graph_init_size(alpm_handle_t *handle, alpm_list_t *vertices) static void dijkstra(alpm_list_t *vertices) { alpm_list_t *i; - pmgraph_t *v; + alpm_graph_t *v; while(1) { v = NULL; /* find the smallest vertice not visited yet */ for(i = vertices; i; i = i->next) { - pmgraph_t *v_i = i->data; + alpm_graph_t *v_i = i->data; if(v_i->state == -1) { continue; @@ -132,7 +132,7 @@ static void dijkstra(alpm_list_t *vertices) v->childptr = v->children; while(v->childptr) { - pmgraph_t *v_c = v->childptr->data; + alpm_graph_t *v_c = v->childptr->data; alpm_delta_t *d_c = v_c->data; if(v_c->weight > v->weight + d_c->download_size) { v_c->weight = v->weight + d_c->download_size; @@ -148,12 +148,12 @@ static void dijkstra(alpm_list_t *vertices) static off_t shortest_path(alpm_list_t *vertices, const char *to, alpm_list_t **path) { alpm_list_t *i; - pmgraph_t *v = NULL; + alpm_graph_t *v = NULL; off_t bestsize = 0; alpm_list_t *rpath = NULL; for(i = vertices; i; i = i->next) { - pmgraph_t *v_i = i->data; + alpm_graph_t *v_i = i->data; alpm_delta_t *d_i = v_i->data; if(strcmp(d_i->to, to) == 0) { @@ -222,7 +222,7 @@ static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota vertices = graph_init(deltas, 1); for(i = vertices; i; i = i->next) { - pmgraph_t *v = i->data; + alpm_graph_t *v = i->data; alpm_delta_t *vdelta = v->data; if(strcmp(vdelta->to, to) == 0) { @@ -231,7 +231,7 @@ static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota } dijkstra(vertices); for(i = vertices; i; i = i->next) { - pmgraph_t *v = i->data; + alpm_graph_t *v = i->data; alpm_delta_t *vdelta = v->data; if(v->weight > quota) { unused = alpm_list_add(unused, vdelta->delta); diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 2ec5451e..6ca79c34 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -89,18 +89,18 @@ static alpm_list_t *dep_graph_init(alpm_list_t *targets) alpm_list_t *vertices = NULL; /* We create the vertices */ for(i = targets; i; i = i->next) { - pmgraph_t *vertex = _alpm_graph_new(); + alpm_graph_t *vertex = _alpm_graph_new(); vertex->data = (void *)i->data; vertices = alpm_list_add(vertices, vertex); } /* We compute the edges */ for(i = vertices; i; i = i->next) { - pmgraph_t *vertex_i = i->data; + alpm_graph_t *vertex_i = 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; + alpm_graph_t *vertex_j = j->data; alpm_pkg_t *p_j = vertex_j->data; if(_alpm_dep_edge(p_i, p_j)) { vertex_i->children = @@ -132,7 +132,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, alpm_list_t *newtargs = NULL; alpm_list_t *vertices = NULL; alpm_list_t *vptr; - pmgraph_t *vertex; + alpm_graph_t *vertex; if(targets == NULL) { return NULL; @@ -149,7 +149,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, vertex->state = -1; int found = 0; while(vertex->childptr && !found) { - pmgraph_t *nextchild = vertex->childptr->data; + alpm_graph_t *nextchild = vertex->childptr->data; vertex->childptr = vertex->childptr->next; if(nextchild->state == 0) { found = 1; diff --git a/lib/libalpm/graph.c b/lib/libalpm/graph.c index fc2c9e16..3a7f24b8 100644 --- a/lib/libalpm/graph.c +++ b/lib/libalpm/graph.c @@ -23,17 +23,17 @@ #include "util.h" #include "log.h" -pmgraph_t *_alpm_graph_new(void) +alpm_graph_t *_alpm_graph_new(void) { - pmgraph_t *graph = NULL; + alpm_graph_t *graph = NULL; - CALLOC(graph, 1, sizeof(pmgraph_t), return NULL); + CALLOC(graph, 1, sizeof(alpm_graph_t), return NULL); return graph; } void _alpm_graph_free(void *data) { - pmgraph_t *graph = data; + alpm_graph_t *graph = data; alpm_list_free(graph->children); free(graph); } diff --git a/lib/libalpm/graph.h b/lib/libalpm/graph.h index f76c6004..d4d134b5 100644 --- a/lib/libalpm/graph.h +++ b/lib/libalpm/graph.h @@ -25,16 +25,16 @@ #include "alpm_list.h" -typedef struct __pmgraph_t { +typedef struct __alpm_graph_t { char state; /* 0: untouched, -1: entered, other: leaving time */ off_t weight; /* weight of the node */ void *data; - struct __pmgraph_t *parent; /* where did we come from? */ + struct __alpm_graph_t *parent; /* where did we come from? */ alpm_list_t *children; alpm_list_t *childptr; /* points to a child in children list */ -} pmgraph_t; +} alpm_graph_t; -pmgraph_t *_alpm_graph_new(void); +alpm_graph_t *_alpm_graph_new(void); void _alpm_graph_free(void *data); #endif /* _ALPM_GRAPH_H */ -- cgit v1.2.3-2-g168b From 71fa9f912d65ff9d23d05ca42aa494d1d3f596f2 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:56:29 +1000 Subject: Rename pmpkghash_t to alpm_pkghash_t Signed-off-by: Allan McRae --- lib/libalpm/db.c | 6 +++--- lib/libalpm/db.h | 4 ++-- lib/libalpm/pkghash.c | 26 +++++++++++++------------- lib/libalpm/pkghash.h | 16 ++++++++-------- 4 files changed, 26 insertions(+), 26 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 248337a9..72fef62e 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -484,7 +484,7 @@ void _alpm_db_free_pkgcache(alpm_db_t *db) _alpm_db_free_grpcache(db); } -pmpkghash_t *_alpm_db_get_pkgcache_hash(alpm_db_t *db) +alpm_pkghash_t *_alpm_db_get_pkgcache_hash(alpm_db_t *db) { if(db == NULL) { return NULL; @@ -503,7 +503,7 @@ pmpkghash_t *_alpm_db_get_pkgcache_hash(alpm_db_t *db) alpm_list_t *_alpm_db_get_pkgcache(alpm_db_t *db) { - pmpkghash_t *hash = _alpm_db_get_pkgcache_hash(db); + alpm_pkghash_t *hash = _alpm_db_get_pkgcache_hash(db); if(hash == NULL) { return NULL; @@ -567,7 +567,7 @@ alpm_pkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target) return NULL; } - pmpkghash_t *pkgcache = _alpm_db_get_pkgcache_hash(db); + alpm_pkghash_t *pkgcache = _alpm_db_get_pkgcache_hash(db); if(!pkgcache) { return NULL; } diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index 2f15c33c..fe264f92 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -65,7 +65,7 @@ struct __alpm_db_t { int is_local; /* flags determining validity, loaded caches, etc. */ enum _pmdbstatus_t status; - pmpkghash_t *pkgcache; + alpm_pkghash_t *pkgcache; alpm_list_t *grpcache; alpm_list_t *servers; pgp_verify_t pgp_verify; @@ -97,7 +97,7 @@ int _alpm_local_db_remove(alpm_db_t *db, alpm_pkg_t *info); void _alpm_db_free_pkgcache(alpm_db_t *db); 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_pkghash_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); alpm_pkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target); diff --git a/lib/libalpm/pkghash.c b/lib/libalpm/pkghash.c index 2fd82de3..f6207ada 100644 --- a/lib/libalpm/pkghash.c +++ b/lib/libalpm/pkghash.c @@ -51,12 +51,12 @@ static const size_t prime_list[] = }; /* Allocate a hash table with at least "size" buckets */ -pmpkghash_t *_alpm_pkghash_create(size_t size) +alpm_pkghash_t *_alpm_pkghash_create(size_t size) { - pmpkghash_t *hash = NULL; + alpm_pkghash_t *hash = NULL; size_t i, loopsize; - CALLOC(hash, 1, sizeof(pmpkghash_t), return NULL); + CALLOC(hash, 1, sizeof(alpm_pkghash_t), return NULL); loopsize = sizeof(prime_list) / sizeof(*prime_list); for(i = 0; i < loopsize; i++) { @@ -78,7 +78,7 @@ pmpkghash_t *_alpm_pkghash_create(size_t size) return hash; } -static size_t get_hash_position(unsigned long name_hash, pmpkghash_t *hash) +static size_t get_hash_position(unsigned long name_hash, alpm_pkghash_t *hash) { size_t position; @@ -93,9 +93,9 @@ static size_t get_hash_position(unsigned long name_hash, pmpkghash_t *hash) } /* Expand the hash table size to the next increment and rebin the entries */ -static pmpkghash_t *rehash(pmpkghash_t *oldhash) +static alpm_pkghash_t *rehash(alpm_pkghash_t *oldhash) { - pmpkghash_t *newhash; + alpm_pkghash_t *newhash; size_t newsize, position, i; /* Hash tables will need resized in two cases: @@ -144,7 +144,7 @@ static pmpkghash_t *rehash(pmpkghash_t *oldhash) return newhash; } -static pmpkghash_t *pkghash_add_pkg(pmpkghash_t *hash, alpm_pkg_t *pkg, int sorted) +static alpm_pkghash_t *pkghash_add_pkg(alpm_pkghash_t *hash, alpm_pkg_t *pkg, int sorted) { alpm_list_t *ptr; size_t position; @@ -179,17 +179,17 @@ static pmpkghash_t *pkghash_add_pkg(pmpkghash_t *hash, alpm_pkg_t *pkg, int sort return hash; } -pmpkghash_t *_alpm_pkghash_add(pmpkghash_t *hash, alpm_pkg_t *pkg) +alpm_pkghash_t *_alpm_pkghash_add(alpm_pkghash_t *hash, alpm_pkg_t *pkg) { return pkghash_add_pkg(hash, pkg, 0); } -pmpkghash_t *_alpm_pkghash_add_sorted(pmpkghash_t *hash, alpm_pkg_t *pkg) +alpm_pkghash_t *_alpm_pkghash_add_sorted(alpm_pkghash_t *hash, alpm_pkg_t *pkg) { return pkghash_add_pkg(hash, pkg, 1); } -static size_t move_one_entry(pmpkghash_t *hash, size_t start, size_t end) +static size_t move_one_entry(alpm_pkghash_t *hash, size_t start, size_t end) { /* Iterate backwards from 'end' to 'start', seeing if any of the items * would hash to 'start'. If we find one, we move it there and break. If @@ -226,7 +226,7 @@ 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, alpm_pkg_t *pkg, +alpm_pkghash_t *_alpm_pkghash_remove(alpm_pkghash_t *hash, alpm_pkg_t *pkg, alpm_pkg_t **data) { alpm_list_t *i; @@ -283,7 +283,7 @@ pmpkghash_t *_alpm_pkghash_remove(pmpkghash_t *hash, alpm_pkg_t *pkg, return hash; } -void _alpm_pkghash_free(pmpkghash_t *hash) +void _alpm_pkghash_free(alpm_pkghash_t *hash) { size_t i; if(hash != NULL) { @@ -295,7 +295,7 @@ void _alpm_pkghash_free(pmpkghash_t *hash) free(hash); } -alpm_pkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name) +alpm_pkg_t *_alpm_pkghash_find(alpm_pkghash_t *hash, const char *name) { alpm_list_t *lp; unsigned long name_hash; diff --git a/lib/libalpm/pkghash.h b/lib/libalpm/pkghash.h index ab8fef0c..edd500e9 100644 --- a/lib/libalpm/pkghash.h +++ b/lib/libalpm/pkghash.h @@ -32,7 +32,7 @@ * A combination of a hash table and a list, allowing for fast look-up * by package name but also iteration over the packages. */ -struct __pmpkghash_t { +struct __alpm_pkghash_t { /** data held by the hash table */ alpm_list_t **hash_table; /** number of buckets in hash table */ @@ -43,17 +43,17 @@ struct __pmpkghash_t { alpm_list_t *list; }; -typedef struct __pmpkghash_t pmpkghash_t; +typedef struct __alpm_pkghash_t alpm_pkghash_t; -pmpkghash_t *_alpm_pkghash_create(size_t size); +alpm_pkghash_t *_alpm_pkghash_create(size_t size); -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); +alpm_pkghash_t *_alpm_pkghash_add(alpm_pkghash_t *hash, alpm_pkg_t *pkg); +alpm_pkghash_t *_alpm_pkghash_add_sorted(alpm_pkghash_t *hash, alpm_pkg_t *pkg); +alpm_pkghash_t *_alpm_pkghash_remove(alpm_pkghash_t *hash, alpm_pkg_t *pkg, alpm_pkg_t **data); -void _alpm_pkghash_free(pmpkghash_t *hash); +void _alpm_pkghash_free(alpm_pkghash_t *hash); -alpm_pkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name); +alpm_pkg_t *_alpm_pkghash_find(alpm_pkghash_t *hash, const char *name); #define MAX_HASH_LOAD 0.7 -- cgit v1.2.3-2-g168b From 925f42e460c2a2dd23f84d4504a14540670d1bd6 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:57:47 +1000 Subject: Rename pmtransstate_t to alpm_transstate_t Signed-off-by: Allan McRae --- lib/libalpm/trans.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/trans.h b/lib/libalpm/trans.h index 962e9ffd..9a60e71b 100644 --- a/lib/libalpm/trans.h +++ b/lib/libalpm/trans.h @@ -25,7 +25,7 @@ #include "alpm.h" -typedef enum _pmtransstate_t { +typedef enum _alpm_transstate_t { STATE_IDLE = 0, STATE_INITIALIZED, STATE_PREPARED, @@ -33,12 +33,12 @@ typedef enum _pmtransstate_t { STATE_COMMITING, STATE_COMMITED, STATE_INTERRUPTED -} pmtransstate_t; +} alpm_transstate_t; /* Transaction */ struct __alpm_trans_t { alpm_transflag_t flags; - pmtransstate_t state; + alpm_transstate_t state; 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 *) */ -- cgit v1.2.3-2-g168b From 028b965e1a71aa85ba3772e20146d40d9006d8c9 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 14:59:04 +1000 Subject: Rename pmdbinfrq_t to alpm_dbinfrq_t Signed-off-by: Allan McRae --- lib/libalpm/be_local.c | 4 ++-- lib/libalpm/db.h | 10 +++++----- lib/libalpm/package.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 19b06bb5..2ee71cc0 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -498,7 +498,7 @@ static char *get_pkgpath(alpm_db_t *db, alpm_pkg_t *info) } -int _alpm_local_db_read(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq) +int _alpm_local_db_read(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq) { FILE *fp = NULL; char path[PATH_MAX]; @@ -742,7 +742,7 @@ int _alpm_local_db_prepare(alpm_db_t *db, alpm_pkg_t *info) return retval; } -int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq) +int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq) { FILE *fp = NULL; char path[PATH_MAX]; diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index fe264f92..83fbcc78 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -33,7 +33,7 @@ #include "signing.h" /* Database entries */ -typedef enum _pmdbinfrq_t { +typedef enum _alpm_dbinfrq_t { INFRQ_BASE = 1, INFRQ_DESC = (1 << 1), INFRQ_FILES = (1 << 2), @@ -41,7 +41,7 @@ typedef enum _pmdbinfrq_t { INFRQ_DSIZE = (1 << 4), /* ALL should be info stored in the package or database */ INFRQ_ALL = 0x1F -} pmdbinfrq_t; +} alpm_dbinfrq_t; /** Database status. Bitflags. */ enum _pmdbstatus_t { @@ -87,9 +87,9 @@ 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, alpm_pkg_t *info, pmdbinfrq_t inforeq); +int _alpm_local_db_read(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_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_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq); int _alpm_local_db_remove(alpm_db_t *db, alpm_pkg_t *info); /* cache bullshit */ @@ -99,7 +99,7 @@ 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); alpm_pkghash_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); +int _alpm_db_ensure_pkgcache(alpm_db_t *db, alpm_dbinfrq_t infolevel); alpm_pkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target); /* groups */ void _alpm_db_free_grpcache(alpm_db_t *db); diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index 87f191bd..388a53c8 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -111,7 +111,7 @@ struct __alpm_pkg_t { int scriptlet; alpm_pkgreason_t reason; - pmdbinfrq_t infolevel; + alpm_dbinfrq_t infolevel; alpm_pkgfrom_t origin; /* origin == PKG_FROM_FILE, use pkg->origin_data.file * origin == PKG_FROM_*DB, use pkg->origin_data.db */ -- cgit v1.2.3-2-g168b From 7633c14bd5d8461c28ab900d3ddbec5f649932ee Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 28 Jun 2011 15:00:46 +1000 Subject: Rename _pmdbstatus_t to _alpm_dbstatus_t Signed-off-by: Allan McRae --- lib/libalpm/db.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index 83fbcc78..10464b5c 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -44,7 +44,7 @@ typedef enum _alpm_dbinfrq_t { } alpm_dbinfrq_t; /** Database status. Bitflags. */ -enum _pmdbstatus_t { +enum _alpm_dbstatus_t { DB_STATUS_VALID = (1 << 0), DB_STATUS_PKGCACHE = (1 << 1), DB_STATUS_GRPCACHE = (1 << 2) @@ -64,7 +64,7 @@ struct __alpm_db_t { /* also indicates whether we are RO or RW */ int is_local; /* flags determining validity, loaded caches, etc. */ - enum _pmdbstatus_t status; + enum _alpm_dbstatus_t status; alpm_pkghash_t *pkgcache; alpm_list_t *grpcache; alpm_list_t *servers; -- cgit v1.2.3-2-g168b From f1bb56cebfda9b11ea02754d325ff659014e2caa Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Wed, 29 Jun 2011 15:46:49 +1000 Subject: Rename public functions with grp in their name Using grp instead of group is a small saving at the cost of clarity. Rename the following functions: alpm_option_get_ignoregrps -> alpm_option_get_ignoregroups alpm_option_add_ignoregrp -> alpm_option_add_ignoregroup alpm_option_set_ignoregrps -> alpm_option_set_ignoregroups alpm_option_remove_ignoregrp -> alpm_option_remove_ignoregroup alpm_db_readgrp -> alpm_db_readgroup alpm_db_get_grpcache -> alpm_db_get_groupcache alpm_find_grp_pkgs -> alpm_find_group_pkgs Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 14 +++++++------- lib/libalpm/db.c | 10 +++++----- lib/libalpm/db.h | 2 +- lib/libalpm/handle.c | 8 ++++---- lib/libalpm/sync.c | 4 ++-- 5 files changed, 19 insertions(+), 19 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 54a9ba42..33707dd3 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -311,10 +311,10 @@ int alpm_option_remove_ignorepkg(alpm_handle_t *handle, const char *pkg); * should be ignored by a sysupgrade. * @{ */ -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); +alpm_list_t *alpm_option_get_ignoregroups(alpm_handle_t *handle); +int alpm_option_add_ignoregroup(alpm_handle_t *handle, const char *grp); +int alpm_option_set_ignoregroups(alpm_handle_t *handle, alpm_list_t *ignoregrps); +int alpm_option_remove_ignoregroup(alpm_handle_t *handle, const char *grp); /** @} */ /** Returns the targeted architecture. */ @@ -411,13 +411,13 @@ alpm_list_t *alpm_db_get_pkgcache(alpm_db_t *db); * @param name of the group * @return the groups entry on success, NULL on error */ -alpm_group_t *alpm_db_readgrp(alpm_db_t *db, const char *name); +alpm_group_t *alpm_db_readgroup(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(alpm_db_t *db); +alpm_list_t *alpm_db_get_groupcache(alpm_db_t *db); /** Searches a database with regular expressions. * @param db pointer to the package database to search in @@ -700,7 +700,7 @@ int alpm_db_check_pgp_signature(alpm_db_t *db); * Groups */ -alpm_list_t *alpm_find_grp_pkgs(alpm_list_t *dbs, const char *name); +alpm_list_t *alpm_find_group_pkgs(alpm_list_t *dbs, const char *name); /* * Sync diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 72fef62e..ecb792c9 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -239,7 +239,7 @@ alpm_list_t SYMEXPORT *alpm_db_get_pkgcache(alpm_db_t *db) } /** Get a group entry from a package database. */ -alpm_group_t SYMEXPORT *alpm_db_readgrp(alpm_db_t *db, const char *name) +alpm_group_t SYMEXPORT *alpm_db_readgroup(alpm_db_t *db, const char *name) { ASSERT(db != NULL, return NULL); db->handle->pm_errno = 0; @@ -250,12 +250,12 @@ alpm_group_t SYMEXPORT *alpm_db_readgrp(alpm_db_t *db, const char *name) } /** Get the group cache of a package database. */ -alpm_list_t SYMEXPORT *alpm_db_get_grpcache(alpm_db_t *db) +alpm_list_t SYMEXPORT *alpm_db_get_groupcache(alpm_db_t *db) { ASSERT(db != NULL, return NULL); db->handle->pm_errno = 0; - return _alpm_db_get_grpcache(db); + return _alpm_db_get_groupcache(db); } /** Searches a database. */ @@ -646,7 +646,7 @@ void _alpm_db_free_grpcache(alpm_db_t *db) db->status &= ~DB_STATUS_GRPCACHE; } -alpm_list_t *_alpm_db_get_grpcache(alpm_db_t *db) +alpm_list_t *_alpm_db_get_groupcache(alpm_db_t *db) { if(db == NULL) { return NULL; @@ -671,7 +671,7 @@ alpm_group_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target) return NULL; } - for(i = _alpm_db_get_grpcache(db); i; i = i->next) { + for(i = _alpm_db_get_groupcache(db); i; i = i->next) { alpm_group_t *info = i->data; if(strcmp(info->name, target) == 0) { diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index 10464b5c..5bf05d87 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -103,7 +103,7 @@ int _alpm_db_ensure_pkgcache(alpm_db_t *db, alpm_dbinfrq_t infolevel); 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); +alpm_list_t *_alpm_db_get_groupcache(alpm_db_t *db); alpm_group_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target); #endif /* _ALPM_DB_H */ diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index bb2ce50c..62b2d9ab 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -224,7 +224,7 @@ alpm_list_t SYMEXPORT *alpm_option_get_ignorepkgs(alpm_handle_t *handle) return handle->ignorepkg; } -alpm_list_t SYMEXPORT *alpm_option_get_ignoregrps(alpm_handle_t *handle) +alpm_list_t SYMEXPORT *alpm_option_get_ignoregroups(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); return handle->ignoregrp; @@ -521,14 +521,14 @@ int SYMEXPORT alpm_option_remove_ignorepkg(alpm_handle_t *handle, const char *pk return 0; } -int SYMEXPORT alpm_option_add_ignoregrp(alpm_handle_t *handle, const char *grp) +int SYMEXPORT alpm_option_add_ignoregroup(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(alpm_handle_t *handle, alpm_list_t *ignoregrps) +int SYMEXPORT alpm_option_set_ignoregroups(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(alpm_handle_t *handle, alpm_list_t *ign return 0; } -int SYMEXPORT alpm_option_remove_ignoregrp(alpm_handle_t *handle, const char *grp) +int SYMEXPORT alpm_option_remove_ignoregroup(alpm_handle_t *handle, const char *grp) { char *vdata = NULL; CHECK_HANDLE(handle, return -1); diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 37753487..dcce18d3 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -213,14 +213,14 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) * @pram name the name of the group * @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, +alpm_list_t SYMEXPORT *alpm_find_group_pkgs(alpm_list_t *dbs, const char *name) { alpm_list_t *i, *j, *pkgs = NULL, *ignorelist = NULL; for(i = dbs; i; i = i->next) { alpm_db_t *db = i->data; - alpm_group_t *grp = alpm_db_readgrp(db, name); + alpm_group_t *grp = alpm_db_readgroup(db, name); if(!grp) continue; -- cgit v1.2.3-2-g168b From b1894ccf062059972d39fa855ee7941b666c5db0 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Wed, 29 Jun 2011 15:52:33 +1000 Subject: Rename internal functions with grp in their name The following function renames take place for the same reasoning as the previous commit: _alpm_grp_new -> _alpm_group_new _alpm_grp_free -> _alpm_group_free _alpm_db_free_grpcache -> _alpm_db_free_groupcache _alpm_db_get_grpfromcache -> _alpm_db_get_groupfromcache Signed-off-by: Allan McRae --- lib/libalpm/db.c | 18 +++++++++--------- lib/libalpm/db.h | 4 ++-- lib/libalpm/group.c | 4 ++-- lib/libalpm/group.h | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index ecb792c9..f6f810c0 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -246,7 +246,7 @@ alpm_group_t SYMEXPORT *alpm_db_readgroup(alpm_db_t *db, const char *name) ASSERT(name != NULL && strlen(name) != 0, RET_ERR(db->handle, PM_ERR_WRONG_ARGS, NULL)); - return _alpm_db_get_grpfromcache(db, name); + return _alpm_db_get_groupfromcache(db, name); } /** Get the group cache of a package database. */ @@ -481,7 +481,7 @@ void _alpm_db_free_pkgcache(alpm_db_t *db) _alpm_pkghash_free(db->pkgcache); db->status &= ~DB_STATUS_PKGCACHE; - _alpm_db_free_grpcache(db); + _alpm_db_free_groupcache(db); } alpm_pkghash_t *_alpm_db_get_pkgcache_hash(alpm_db_t *db) @@ -530,7 +530,7 @@ int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t *pkg) alpm_pkg_get_name(newpkg), db->treename); db->pkgcache = _alpm_pkghash_add_sorted(db->pkgcache, newpkg); - _alpm_db_free_grpcache(db); + _alpm_db_free_groupcache(db); return 0; } @@ -556,7 +556,7 @@ int _alpm_db_remove_pkgfromcache(alpm_db_t *db, alpm_pkg_t *pkg) _alpm_pkg_free(data); - _alpm_db_free_grpcache(db); + _alpm_db_free_groupcache(db); return 0; } @@ -613,9 +613,9 @@ static int load_grpcache(alpm_db_t *db) continue; } /* we didn't find the group, so create a new one with this name */ - grp = _alpm_grp_new(grpname); + grp = _alpm_group_new(grpname); if(!grp) { - _alpm_db_free_grpcache(db); + _alpm_db_free_groupcache(db); return -1; } grp->packages = alpm_list_add(grp->packages, pkg); @@ -627,7 +627,7 @@ static int load_grpcache(alpm_db_t *db) return 0; } -void _alpm_db_free_grpcache(alpm_db_t *db) +void _alpm_db_free_groupcache(alpm_db_t *db) { alpm_list_t *lg; @@ -639,7 +639,7 @@ void _alpm_db_free_grpcache(alpm_db_t *db) "freeing group cache for repository '%s'\n", db->treename); for(lg = db->grpcache; lg; lg = lg->next) { - _alpm_grp_free(lg->data); + _alpm_group_free(lg->data); lg->data = NULL; } FREELIST(db->grpcache); @@ -663,7 +663,7 @@ alpm_list_t *_alpm_db_get_groupcache(alpm_db_t *db) return db->grpcache; } -alpm_group_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target) +alpm_group_t *_alpm_db_get_groupfromcache(alpm_db_t *db, const char *target) { alpm_list_t *i; diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index 5bf05d87..7055abd8 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -102,9 +102,9 @@ alpm_list_t *_alpm_db_get_pkgcache(alpm_db_t *db); int _alpm_db_ensure_pkgcache(alpm_db_t *db, alpm_dbinfrq_t infolevel); alpm_pkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target); /* groups */ -void _alpm_db_free_grpcache(alpm_db_t *db); +void _alpm_db_free_groupcache(alpm_db_t *db); alpm_list_t *_alpm_db_get_groupcache(alpm_db_t *db); -alpm_group_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target); +alpm_group_t *_alpm_db_get_groupfromcache(alpm_db_t *db, const char *target); #endif /* _ALPM_DB_H */ diff --git a/lib/libalpm/group.c b/lib/libalpm/group.c index aefa7be8..47458df2 100644 --- a/lib/libalpm/group.c +++ b/lib/libalpm/group.c @@ -30,7 +30,7 @@ #include "log.h" #include "alpm.h" -alpm_group_t *_alpm_grp_new(const char *name) +alpm_group_t *_alpm_group_new(const char *name) { alpm_group_t* grp; @@ -40,7 +40,7 @@ alpm_group_t *_alpm_grp_new(const char *name) return grp; } -void _alpm_grp_free(alpm_group_t *grp) +void _alpm_group_free(alpm_group_t *grp) { if(grp == NULL) { return; diff --git a/lib/libalpm/group.h b/lib/libalpm/group.h index ad38c768..078c9af7 100644 --- a/lib/libalpm/group.h +++ b/lib/libalpm/group.h @@ -22,8 +22,8 @@ #include "alpm.h" -alpm_group_t *_alpm_grp_new(const char *name); -void _alpm_grp_free(alpm_group_t *grp); +alpm_group_t *_alpm_group_new(const char *name); +void _alpm_group_free(alpm_group_t *grp); #endif /* _ALPM_GROUP_H */ -- cgit v1.2.3-2-g168b From fed3e09c94d204b4655656c703a178e6fa2144b3 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Wed, 29 Jun 2011 15:59:48 +1000 Subject: Use ignoregroup rather than ignoregrp in the handle This matches the naming in pacman.conf. Signed-off-by: Allan McRae --- lib/libalpm/handle.c | 12 ++++++------ lib/libalpm/handle.h | 2 +- lib/libalpm/package.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 62b2d9ab..8486851f 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -84,7 +84,7 @@ void _alpm_handle_free(alpm_handle_t *handle) FREELIST(handle->noupgrade); FREELIST(handle->noextract); FREELIST(handle->ignorepkg); - FREELIST(handle->ignoregrp); + FREELIST(handle->ignoregroup); FREE(handle); } @@ -227,7 +227,7 @@ alpm_list_t SYMEXPORT *alpm_option_get_ignorepkgs(alpm_handle_t *handle) alpm_list_t SYMEXPORT *alpm_option_get_ignoregroups(alpm_handle_t *handle) { CHECK_HANDLE(handle, return NULL); - return handle->ignoregrp; + return handle->ignoregroup; } const char SYMEXPORT *alpm_option_get_arch(alpm_handle_t *handle) @@ -524,15 +524,15 @@ int SYMEXPORT alpm_option_remove_ignorepkg(alpm_handle_t *handle, const char *pk int SYMEXPORT alpm_option_add_ignoregroup(alpm_handle_t *handle, const char *grp) { CHECK_HANDLE(handle, return -1); - handle->ignoregrp = alpm_list_add(handle->ignoregrp, strdup(grp)); + handle->ignoregroup = alpm_list_add(handle->ignoregroup, strdup(grp)); return 0; } int SYMEXPORT alpm_option_set_ignoregroups(alpm_handle_t *handle, alpm_list_t *ignoregrps) { CHECK_HANDLE(handle, return -1); - if(handle->ignoregrp) FREELIST(handle->ignoregrp); - handle->ignoregrp = alpm_list_strdup(ignoregrps); + if(handle->ignoregroup) FREELIST(handle->ignoregroup); + handle->ignoregroup = alpm_list_strdup(ignoregrps); return 0; } @@ -540,7 +540,7 @@ int SYMEXPORT alpm_option_remove_ignoregroup(alpm_handle_t *handle, const char * { char *vdata = NULL; CHECK_HANDLE(handle, return -1); - handle->ignoregrp = alpm_list_remove_str(handle->ignoregrp, grp, &vdata); + handle->ignoregroup = alpm_list_remove_str(handle->ignoregroup, grp, &vdata); if(vdata != NULL) { FREE(vdata); return 1; diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h index 4b366193..ae8c7c8d 100644 --- a/lib/libalpm/handle.h +++ b/lib/libalpm/handle.h @@ -62,7 +62,7 @@ struct __alpm_handle_t { alpm_list_t *noupgrade; /* List of packages NOT to be upgraded */ alpm_list_t *noextract; /* List of files NOT to extract */ alpm_list_t *ignorepkg; /* List of packages to ignore */ - alpm_list_t *ignoregrp; /* List of groups to ignore */ + alpm_list_t *ignoregroup; /* List of groups to ignore */ /* options */ int usesyslog; /* Use syslog instead of logfile? */ /* TODO move to frontend */ diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index efdf1be2..31f07325 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -598,7 +598,7 @@ alpm_pkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle) /** Test if a package should be ignored. * * Checks if the package is ignored via IgnorePkg, or if the package is - * in a group ignored via IgnoreGrp. + * in a group ignored via IgnoreGroup. * * @param handle the context handle * @param pkg the package to test @@ -615,7 +615,7 @@ int _alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg) } /* next see if the package is in a group that is ignored */ - for(groups = handle->ignoregrp; groups; groups = alpm_list_next(groups)) { + for(groups = handle->ignoregroup; groups; groups = alpm_list_next(groups)) { char *grp = (char *)alpm_list_getdata(groups); if(alpm_list_find_str(alpm_pkg_get_groups(pkg), grp)) { return 1; -- cgit v1.2.3-2-g168b