int db_mode; /*!< open mode */
int db_perms; /*!< open permissions */
int db_ver; /*!< Berkeley DB version */
- intHash db_checked; /*!< headerCheck()'ed package instances */
+ struct dbChk_s * db_checked;/*!< headerCheck()'ed package instances */
rpmdb db_next;
int db_opens;
int db_ndbi; /*!< No. of tag indices. */
#include "lib/header_internal.h" /* XXX for headerSetInstance() */
#include "debug.h"
+#undef HASHTYPE
+#undef HTKEYTYPE
+#undef HTDATATYPE
+#define HASHTYPE dbChk
+#define HTKEYTYPE unsigned int
+#include "lib/rpmhash.H"
+#include "lib/rpmhash.C"
+#undef HASHTYPE
+#undef HTKEYTYPE
+#undef HTDATATYPE
+
static rpmDbiTag const dbiTags[] = {
RPMDBI_PACKAGES,
RPMDBI_NAME,
if (dbiType(dbi) == DBI_PRIMARY) {
/* Allocate based on max header instance number + some reserve */
if (!verifyonly && (db->db_checked == NULL)) {
- db->db_checked = intHashCreate(1024 + pkgInstance(dbi, 0) / 4,
+ db->db_checked = dbChkCreate(1024 + pkgInstance(dbi, 0) / 4,
uintId, uintCmp, NULL);
}
/* If primary got created, we can safely run without fsync */
db->db_root = _free(db->db_root);
db->db_home = _free(db->db_home);
db->db_fullpath = _free(db->db_fullpath);
- db->db_checked = intHashFree(db->db_checked);
+ db->db_checked = dbChkFree(db->db_checked);
db->_dbi = _free(db->_dbi);
prev = &rpmdbRock;
/* Don't bother re-checking a previously read header. */
if (mi->mi_db->db_checked) {
- if (intHashHasEntry(mi->mi_db->db_checked, mi->mi_offset))
+ if (dbChkHasEntry(mi->mi_db->db_checked, mi->mi_offset))
rpmrc = RPMRC_OK;
}
/* Mark header checked. */
if (mi->mi_db && mi->mi_db->db_checked && rpmrc != RPMRC_FAIL) {
- intHashAddEntry(mi->mi_db->db_checked, mi->mi_offset);
+ dbChkAddEntry(mi->mi_db->db_checked, mi->mi_offset);
}
}
return rpmrc;
headerSetInstance(h, hdrNum);
/* Purge our verification cache on added public keys */
if (db->db_checked && headerIsEntry(h, RPMTAG_PUBKEYS)) {
- intHashEmpty(db->db_checked);
+ dbChkEmpty(db->db_checked);
}
}