[pacman-dev] [PATCH 2/3] alpm.h: add Doxygen-style doc for pmdepend_t, pmdepmod_t.
Rémy Oudompheng
remyoudompheng at gmail.com
Tue Mar 1 15:17:37 EST 2011
---
lib/libalpm/alpm.h | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 7fa27d8..14a2782 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -593,12 +593,19 @@ int alpm_remove_pkg(pmpkg_t *pkg);
* Dependencies and conflicts
*/
+/** @brief Types of version constraints in dependency specs. */
typedef enum _pmdepmod_t {
+ /** No version constraint */
PM_DEP_MOD_ANY = 1,
+ /** Test version equality (package=x.y.z) */
PM_DEP_MOD_EQ,
+ /** Test for at least a version (package>=x.y.z) */
PM_DEP_MOD_GE,
+ /** Test for at most a version (package<=x.y.z) */
PM_DEP_MOD_LE,
+ /** Test for greater than some version (package>x.y.z) */
PM_DEP_MOD_GT,
+ /** Test for less than some version (package<x.y.z) */
PM_DEP_MOD_LT
} pmdepmod_t;
@@ -617,9 +624,36 @@ const char *alpm_conflict_get_package1(pmconflict_t *conflict);
const char *alpm_conflict_get_package2(pmconflict_t *conflict);
const char *alpm_conflict_get_reason(pmconflict_t *conflict);
+/**
+ * @brief Returns the type of version constraint.
+ * @param dep a dependency info structure
+ * @return the type of version constraint.
+ */
pmdepmod_t alpm_dep_get_mod(const pmdepend_t *dep);
+
+/**
+ * @brief Returns the package name of a dependency constraint.
+ * @param dep a dependency info structure
+ * @return a pointer to an internal string.
+ */
const char *alpm_dep_get_name(const pmdepend_t *dep);
+
+/**
+ * @brief Returns the version specified by a dependency constraint.
+ *
+ * The version information is stored as a string of the form
+ * "1.2.3-4".
+ * @param dep a dependency info structure
+ * @return a pointer to an internal string.
+ */
const char *alpm_dep_get_version(const pmdepend_t *dep);
+
+/**
+ * Returns a newly allocated string representing the dependency
+ * information.
+ * @param dep a dependency info structure
+ * @return a formatted string, e.g. "glibc>=2.12"
+ */
char *alpm_dep_compute_string(const pmdepend_t *dep);
/*
--
1.7.4.1
More information about the pacman-dev
mailing list