diff options
author | Allan McRae <allan@archlinux.org> | 2011-01-25 11:49:34 +1000 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2011-02-04 09:55:45 +1000 |
commit | f8fdce6cb0da4d832ffa730e0dacb5544c1f8154 (patch) | |
tree | eeba547be38459b041b9fa8089f8171ba006ee19 /lib/libalpm/db.h | |
parent | 5dae577a87795e7666f05613cf9aa7207fd17346 (diff) | |
download | pacman-f8fdce6cb0da4d832ffa730e0dacb5544c1f8154.tar.xz |
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 <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/db.h')
-rw-r--r-- | lib/libalpm/db.h | 7 |
1 files changed, 5 insertions, 2 deletions
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 <time.h> /* 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 */ |