int db_no_fsync; /*!< no-op fsync for db */
};
-#undef HASHTYPE
-#undef HTKEYTYPE
-#undef HTDATATYPE
-#define HASHTYPE intHash
-#define HTKEYTYPE unsigned int
-#include "lib/rpmhash.H"
-#undef HASHTYPE
-#undef HTKEYTYPE
-
/** \ingroup rpmdb
* Describes the collection of index databases used by rpm.
*/
#undef HTKEYTYPE
#undef HTDATATYPE
-#define HASHTYPE intHash
+#define HASHTYPE removedHash
#define HTKEYTYPE unsigned int
+#define HTDATATYPE struct rpmte_s *
#include "rpmhash.C"
#undef HASHTYPE
#undef HTKEYTYPE
+#undef HTDATATYPE
/**
* Check for supported payload format in header.
if (dboffset == 0) return 1;
/* Filter out duplicate erasures. */
- if (intHashHasEntry(tsmem->removedPackages, dboffset)) {
+ if (removedHashHasEntry(tsmem->removedPackages, dboffset)) {
return 0;
}
if (p == NULL)
return 1;
- intHashAddEntry(tsmem->removedPackages, dboffset);
+ removedHashAddEntry(tsmem->removedPackages, dboffset, p);
if (tsmem->orderCount >= tsmem->orderAlloced) {
tsmem->orderAlloced += (tsmem->orderCount - tsmem->orderAlloced) + tsmem->delta;
return rc;
}
-int rpmdbPruneIterator(rpmdbMatchIterator mi, intHash hdrNums)
+int rpmdbPruneIterator(rpmdbMatchIterator mi, removedHash hdrNums)
{
- if (mi == NULL || hdrNums == NULL || intHashNumKeys(hdrNums) <= 0)
+ if (mi == NULL || hdrNums == NULL || removedHashNumKeys(hdrNums) <= 0)
return 1;
if (!mi->mi_set)
assert(mi->mi_set->count > 0);
for (from = 0; from < num; from++) {
- if (intHashHasEntry(hdrNums, mi->mi_set->recs[from].hdrNum)) {
+ if (removedHashHasEntry(hdrNums, mi->mi_set->recs[from].hdrNum)) {
mi->mi_set->count--;
continue;
}
extern "C" {
#endif
+#undef HASHTYPE
+#undef HTKEYTYPE
+#undef HTDATATYPE
+#define HASHTYPE removedHash
+#define HTKEYTYPE unsigned int
+#define HTDATATYPE struct rpmte_s *
+#include "rpmhash.H"
+#undef HASHTYPE
+#undef HTKEYTYPE
+#undef HTDATATYPE
+
/** \ingroup rpmdb
* Reference a database instance.
* @param db rpm database
* @param hdrNums hash of package instances
* @return 0 on success, 1 on failure (bad args)
*/
-int rpmdbPruneIterator(rpmdbMatchIterator mi, intHash hdrNums);
+int rpmdbPruneIterator(rpmdbMatchIterator mi, removedHash hdrNums);
/** \ingroup rpmdb
* Create a new, empty match iterator (for purposes of extending it
}
tsmem->orderCount = 0;
- intHashEmpty(tsmem->removedPackages);
+ removedHashEmpty(tsmem->removedPackages);
return;
}
(void) rpmtsCloseDB(ts);
- tsmem->removedPackages = intHashFree(tsmem->removedPackages);
+ tsmem->removedPackages = removedHashFree(tsmem->removedPackages);
tsmem->order = _free(tsmem->order);
ts->members = _free(ts->members);
tsmem = xcalloc(1, sizeof(*ts->members));
tsmem->delta = 5;
tsmem->addedPackages = NULL;
- tsmem->removedPackages = intHashCreate(128, uintId, uintCmp, NULL);
+ tsmem->removedPackages = removedHashCreate(128, uintId, uintCmp, NULL, NULL);
tsmem->orderAlloced = 0;
tsmem->orderCount = 0;
tsmem->order = NULL;
/* Transaction set elements information */
typedef struct tsMembers_s {
- intHash removedPackages; /*!< Set of packages being removed. */
+ removedHash removedPackages; /*!< Set of packages being removed. */
rpmal addedPackages; /*!< Set of packages being installed. */
rpmte * order; /*!< Packages sorted by dependencies. */
/* Is this package being removed? */
installedPkg = rpmdbGetIteratorOffset(mi);
- beingRemoved = intHashHasEntry(tsmem->removedPackages, installedPkg);
+ beingRemoved = removedHashHasEntry(tsmem->removedPackages, installedPkg);
h = headerLink(h);
headerGet(h, RPMTAG_BASENAMES, &bnames, hgflags);