Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/cache.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-03-08 18:07:58 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-03-08 18:07:58 +0000
commit4f42a0accb04936acb6eeb640e5bc09a556eac57 (patch)
treebaf6422b479604fa12da47e8243edfcbfdb691a1 /lib/libalpm/cache.c
parent230d9d7ae3c3ebc64e922611567841b6fe692f3f (diff)
all _alpm_XXX_cmp functions are now public
Diffstat (limited to 'lib/libalpm/cache.c')
-rw-r--r--lib/libalpm/cache.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/libalpm/cache.c b/lib/libalpm/cache.c
index 2c03f961..2a98d886 100644
--- a/lib/libalpm/cache.c
+++ b/lib/libalpm/cache.c
@@ -36,13 +36,6 @@
#include "db.h"
#include "cache.h"
-/* Helper function for comparing packages
- */
-static int pkg_cmp(const void *p1, const void *p2)
-{
- return(strcmp(((pmpkg_t *)p1)->name, ((pmpkg_t *)p2)->name));
-}
-
/* Returns a new package cache from db.
* It frees the cache if it already exists.
*/
@@ -66,7 +59,7 @@ int _alpm_db_load_pkgcache(pmdb_t *db)
info->origin = PKG_FROM_CACHE;
info->data = db;
/* add to the collective */
- db->pkgcache = _alpm_list_add_sorted(db->pkgcache, info, pkg_cmp);
+ db->pkgcache = _alpm_list_add_sorted(db->pkgcache, info, _alpm_pkg_cmp);
}
return(0);
@@ -114,7 +107,7 @@ int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg)
return(-1);
}
_alpm_log(PM_LOG_DEBUG, "adding entry '%s' in '%s' cache", newpkg->name, db->treename);
- db->pkgcache = _alpm_list_add_sorted(db->pkgcache, newpkg, pkg_cmp);
+ db->pkgcache = _alpm_list_add_sorted(db->pkgcache, newpkg, _alpm_pkg_cmp);
_alpm_db_free_grpcache(db);
@@ -129,7 +122,7 @@ int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg)
return(-1);
}
- db->pkgcache = _alpm_list_remove(db->pkgcache, pkg, pkg_cmp, (void **)&data);
+ db->pkgcache = _alpm_list_remove(db->pkgcache, pkg, _alpm_pkg_cmp, (void **)&data);
if(data == NULL) {
/* package not found */
return(-1);