diff options
author | Chantry Xavier <shiningxc@gmail.com> | 2007-07-16 14:08:48 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-07-16 09:21:13 -0400 |
commit | 99572ed8f6f585e5b6ee4c9300b0589b2c75c54a (patch) | |
tree | 205e4696138cade0c07a4034bc10a73a4722b5c0 /lib | |
parent | ab2354e762767e6088e43b6d1e615576701a7bdb (diff) | |
download | pacman-99572ed8f6f585e5b6ee4c9300b0589b2c75c54a.tar.xz |
new pmdepend_t / pmdepmissing_t accessors.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libalpm/alpm.h | 13 | ||||
-rw-r--r-- | lib/libalpm/deps.c | 30 |
2 files changed, 22 insertions, 21 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 8181f2e6..9e641f3e 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -353,12 +353,13 @@ typedef enum _pmdeptype_t { pmdepend_t *alpm_splitdep(const char *depstring); int alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep); -const char *alpm_dep_get_target(pmdepmissing_t *miss); -pmdeptype_t alpm_dep_get_type(pmdepmissing_t *miss); -pmdepmod_t alpm_dep_get_mod(pmdepmissing_t *miss); -const char *alpm_dep_get_name(pmdepmissing_t *miss); -const char *alpm_dep_get_version(pmdepmissing_t *miss); -const char *alpm_depend_get_name(pmdepend_t *dep); +const char *alpm_miss_get_target(pmdepmissing_t *miss); +pmdeptype_t alpm_miss_get_type(pmdepmissing_t *miss); +pmdepend_t *alpm_miss_get_dep(pmdepmissing_t *miss); + +pmdepmod_t alpm_dep_get_mod(pmdepend_t *dep); +const char *alpm_dep_get_name(pmdepend_t *dep); +const char *alpm_dep_get_version(pmdepend_t *dep); /* * File conflicts diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index fd0b2e5f..30c505dd 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -734,7 +734,7 @@ error: return(-1); } -const char SYMEXPORT *alpm_dep_get_target(pmdepmissing_t *miss) +const char SYMEXPORT *alpm_miss_get_target(pmdepmissing_t *miss) { ALPM_LOG_FUNC; @@ -745,7 +745,7 @@ const char SYMEXPORT *alpm_dep_get_target(pmdepmissing_t *miss) return miss->target; } -pmdeptype_t SYMEXPORT alpm_dep_get_type(pmdepmissing_t *miss) +pmdeptype_t SYMEXPORT alpm_miss_get_type(pmdepmissing_t *miss) { ALPM_LOG_FUNC; @@ -756,40 +756,40 @@ pmdeptype_t SYMEXPORT alpm_dep_get_type(pmdepmissing_t *miss) return miss->type; } -pmdepmod_t SYMEXPORT alpm_dep_get_mod(pmdepmissing_t *miss) +pmdepend_t SYMEXPORT *alpm_miss_get_dep(pmdepmissing_t *miss) { ALPM_LOG_FUNC; /* Sanity checks */ - ASSERT(handle != NULL, return(-1)); - ASSERT(miss != NULL, return(-1)); + ASSERT(handle != NULL, return(NULL)); + ASSERT(miss != NULL, return(NULL)); - return miss->depend.mod; + return &miss->depend; } -const char SYMEXPORT *alpm_dep_get_name(pmdepmissing_t *miss) +pmdepmod_t SYMEXPORT alpm_dep_get_mod(pmdepend_t *dep) { ALPM_LOG_FUNC; /* Sanity checks */ - ASSERT(handle != NULL, return(NULL)); - ASSERT(miss != NULL, return(NULL)); + ASSERT(handle != NULL, return(-1)); + ASSERT(dep != NULL, return(-1)); - return miss->depend.name; + return dep->mod; } -const char SYMEXPORT *alpm_dep_get_version(pmdepmissing_t *miss) +const char SYMEXPORT *alpm_dep_get_name(pmdepend_t *dep) { ALPM_LOG_FUNC; /* Sanity checks */ ASSERT(handle != NULL, return(NULL)); - ASSERT(miss != NULL, return(NULL)); + ASSERT(dep != NULL, return(NULL)); - return miss->depend.version; + return dep->name; } -const char SYMEXPORT *alpm_depend_get_name(pmdepend_t *dep) +const char SYMEXPORT *alpm_dep_get_version(pmdepend_t *dep) { ALPM_LOG_FUNC; @@ -797,7 +797,7 @@ const char SYMEXPORT *alpm_depend_get_name(pmdepend_t *dep) ASSERT(handle != NULL, return(NULL)); ASSERT(dep != NULL, return(NULL)); - return dep->name; + return dep->version; } /* vim: set ts=2 sw=2 noet: */ |