From f8fdce6cb0da4d832ffa730e0dacb5544c1f8154 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 25 Jan 2011 11:49:34 +1000 Subject: Read pkgcache into hash Read the package information for sync/local databases into a pmpkghash_t structure. Provide a alpm_db_get_pkgcache_list() method that returns the list from the hash object. Most usages of alpm_db_get_pkgcache are converted to this at this stage for ease of implementation. Review whether these are better accessing the hash table directly at a later stage. Signed-off-by: Allan McRae --- lib/libalpm/db.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/db.h') diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index b7fa7ca6..c5b3db69 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -23,6 +23,8 @@ #define _ALPM_DB_H #include "alpm.h" +#include "pkghash.h" + #include /* libarchive */ @@ -54,7 +56,7 @@ struct __pmdb_t { int grpcache_loaded; /* also indicates whether we are RO or RW */ int is_local; - alpm_list_t *pkgcache; + pmpkghash_t *pkgcache; alpm_list_t *grpcache; alpm_list_t *servers; @@ -84,7 +86,8 @@ int _alpm_db_load_pkgcache(pmdb_t *db); 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); -alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db); +pmpkghash_t *_alpm_db_get_pkgcache(pmdb_t *db); +alpm_list_t *_alpm_db_get_pkgcache_list(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); /* groups */ -- cgit v1.2.3-24-g4f1b