rpmhash.h
Go to the documentation of this file.
#ifndef H_RPMHASH
#define H_RPMHASH
#include <rpmiotypes.h>
typedef /*@abstract@*/ /*@refcounted@*/ struct hashTable_s * hashTable;
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*hashEqualityType) (const void * key1, const void * key2)
/*@*/;
int hashEqualityString(const void * key1, const void * key2)
/*@*/;
typedef rpmuint32_t (*hashFunctionType) (rpmuint32_t h, const void * data,
size_t size)
/*@*/;
rpmuint32_t hashFunctionString(rpmuint32_t h, const void * data, size_t size)
/*@*/;
void htAddEntry(hashTable ht, /*@owned@*/ const void * key,
/*@owned@*/ const void * data)
/*@modifies ht */;
int htGetEntry(hashTable ht, const void * key,
/*@null@*/ /*@out@*/ const void * data,
/*@null@*/ /*@out@*/ int * dataCount,
/*@null@*/ /*@out@*/ const void * tableKey)
/*@modifies *data, *dataCount, *tableKey @*/;
const void ** htGetKeys(hashTable ht)
/*@*/;
/*@unused@*/
int htHasEntry(hashTable ht, const void * key)
/*@*/;
/*@unused@*/ /*@null@*/
hashTable htUnlink (/*@killref@*/ /*@null@*/ hashTable ht)
/*@modifies ht @*/;
#define htUnlink(_ht) \
((hashTable)rpmioUnlinkPoolItem((rpmioItem)(_ht), __FUNCTION__, __FILE__, __LINE__))
/*@unused@*/ /*@newref@*/ /*@null@*/
hashTable htLink (/*@null@*/ hashTable ht)
/*@modifies ht @*/;
#define htLink(_ht) \
((hashTable)rpmioLinkPoolItem((rpmioItem)(_ht), __FUNCTION__, __FILE__, __LINE__))
/*@null@*/
hashTable htFree( /*@only@*/ hashTable ht)
/*@modifies ht @*/;
#define htFree(_ht) \
((hashTable)rpmioFreePoolItem((rpmioItem)(_ht), __FUNCTION__, __FILE__, __LINE__))
/*@newref@*/ /*@null@*/
hashTable htCreate(int numBuckets, size_t keySize, int freeData,
/*@null@*/ hashFunctionType fn, /*@null@*/ hashEqualityType eq)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
#ifdef __cplusplus
}
#endif
#endif