diff options
Diffstat (limited to 'lib/libalpm/pkghash.c')
-rw-r--r-- | lib/libalpm/pkghash.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/libalpm/pkghash.c b/lib/libalpm/pkghash.c index 2fd82de3..f6207ada 100644 --- a/lib/libalpm/pkghash.c +++ b/lib/libalpm/pkghash.c @@ -51,12 +51,12 @@ static const size_t prime_list[] = }; /* Allocate a hash table with at least "size" buckets */ -pmpkghash_t *_alpm_pkghash_create(size_t size) +alpm_pkghash_t *_alpm_pkghash_create(size_t size) { - pmpkghash_t *hash = NULL; + alpm_pkghash_t *hash = NULL; size_t i, loopsize; - CALLOC(hash, 1, sizeof(pmpkghash_t), return NULL); + CALLOC(hash, 1, sizeof(alpm_pkghash_t), return NULL); loopsize = sizeof(prime_list) / sizeof(*prime_list); for(i = 0; i < loopsize; i++) { @@ -78,7 +78,7 @@ pmpkghash_t *_alpm_pkghash_create(size_t size) return hash; } -static size_t get_hash_position(unsigned long name_hash, pmpkghash_t *hash) +static size_t get_hash_position(unsigned long name_hash, alpm_pkghash_t *hash) { size_t position; @@ -93,9 +93,9 @@ static size_t get_hash_position(unsigned long name_hash, pmpkghash_t *hash) } /* Expand the hash table size to the next increment and rebin the entries */ -static pmpkghash_t *rehash(pmpkghash_t *oldhash) +static alpm_pkghash_t *rehash(alpm_pkghash_t *oldhash) { - pmpkghash_t *newhash; + alpm_pkghash_t *newhash; size_t newsize, position, i; /* Hash tables will need resized in two cases: @@ -144,7 +144,7 @@ static pmpkghash_t *rehash(pmpkghash_t *oldhash) return newhash; } -static pmpkghash_t *pkghash_add_pkg(pmpkghash_t *hash, alpm_pkg_t *pkg, int sorted) +static alpm_pkghash_t *pkghash_add_pkg(alpm_pkghash_t *hash, alpm_pkg_t *pkg, int sorted) { alpm_list_t *ptr; size_t position; @@ -179,17 +179,17 @@ static pmpkghash_t *pkghash_add_pkg(pmpkghash_t *hash, alpm_pkg_t *pkg, int sort return hash; } -pmpkghash_t *_alpm_pkghash_add(pmpkghash_t *hash, alpm_pkg_t *pkg) +alpm_pkghash_t *_alpm_pkghash_add(alpm_pkghash_t *hash, alpm_pkg_t *pkg) { return pkghash_add_pkg(hash, pkg, 0); } -pmpkghash_t *_alpm_pkghash_add_sorted(pmpkghash_t *hash, alpm_pkg_t *pkg) +alpm_pkghash_t *_alpm_pkghash_add_sorted(alpm_pkghash_t *hash, alpm_pkg_t *pkg) { return pkghash_add_pkg(hash, pkg, 1); } -static size_t move_one_entry(pmpkghash_t *hash, size_t start, size_t end) +static size_t move_one_entry(alpm_pkghash_t *hash, size_t start, size_t end) { /* Iterate backwards from 'end' to 'start', seeing if any of the items * would hash to 'start'. If we find one, we move it there and break. If @@ -226,7 +226,7 @@ static size_t move_one_entry(pmpkghash_t *hash, size_t start, size_t end) * * @return the resultant hash */ -pmpkghash_t *_alpm_pkghash_remove(pmpkghash_t *hash, alpm_pkg_t *pkg, +alpm_pkghash_t *_alpm_pkghash_remove(alpm_pkghash_t *hash, alpm_pkg_t *pkg, alpm_pkg_t **data) { alpm_list_t *i; @@ -283,7 +283,7 @@ pmpkghash_t *_alpm_pkghash_remove(pmpkghash_t *hash, alpm_pkg_t *pkg, return hash; } -void _alpm_pkghash_free(pmpkghash_t *hash) +void _alpm_pkghash_free(alpm_pkghash_t *hash) { size_t i; if(hash != NULL) { @@ -295,7 +295,7 @@ void _alpm_pkghash_free(pmpkghash_t *hash) free(hash); } -alpm_pkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name) +alpm_pkg_t *_alpm_pkghash_find(alpm_pkghash_t *hash, const char *name) { alpm_list_t *lp; unsigned long name_hash; |