struct rpmffi_s * recs;
int numRecs;
int i, fiFX;
- fingerPrint *fp = fi->fps + filenr;
+ fingerPrint *fp = rpmfiFpsIndex(fi, filenr);
int symlinkcount = 0;
struct rpmffi_s ffi = { p, filenr};
return flangs;
}
+struct fingerPrint_s *rpmfiFpsIndex(rpmfi fi, int ix)
+{
+ struct fingerPrint_s * fps = NULL;
+ if (fi != NULL && fi->fps != NULL && ix >= 0 && ix < fi->fc) {
+ fps = fi->fps + ix;
+ }
+ return fps;
+}
+
int rpmfiNext(rpmfi fi)
{
int i = -1;
return rsize;
}
+void rpmfiFpLookup(rpmfi fi, fingerPrintCache fpc)
+{
+ if (fi->fc > 0 && fi->fps == NULL) {
+ fi->fps = xcalloc(fi->fc, sizeof(*fi->fps));
+ }
+ fpLookupList(fpc, fi->dnl, fi->bnl, fi->dil, fi->fc, fi->fps);
+}
FSM_t rpmfiFSM(rpmfi fi)
{
#include <rpm/header.h>
#include <rpm/rpmfi.h>
#include "lib/fsm.h" /* for FSM_t */
-
+#include "lib/fprint.h"
/*
* This limits maximum unique strings (user + group names) from packages to
const char * rpmfiFCapsIndex(rpmfi fi, int ix);
RPM_GNUC_INTERNAL
+struct fingerPrint_s *rpmfiFpsIndex(rpmfi fi, int ix);
+
+RPM_GNUC_INTERNAL
void rpmfiSetFReplacedSize(rpmfi fi, rpm_loff_t newsize);
RPM_GNUC_INTERNAL
rpm_loff_t rpmfiFReplacedSize(rpmfi fi);
+RPM_GNUC_INTERNAL
+void rpmfiFpLookup(rpmfi fi, fingerPrintCache fpc);
+
/* XXX can't be internal as build code needs this */
FSM_t rpmfiFSM(rpmfi fi);
#endif /* _RPMFI_INTERNAL_H */
continue;
fn = rpmfiFN(fi);
- fiFps = fi->fps + i;
+ fiFps = rpmfiFpsIndex(fi, i);
FFlags = rpmfiFFlags(fi);
FMode = rpmfiFMode(fi);
FColor = rpmfiFColor(fi);
numRemoved++;
break;
}
-
- fi->fps = (fc > 0 ? xmalloc(fc * sizeof(*fi->fps)) : NULL);
}
pi = rpmtsiFree(pi);
fc = rpmfiFC(fi);
(void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0);
- fpLookupList(fpc, fi->dnl, fi->bnl, fi->dil, fc, fi->fps);
+ rpmfiFpLookup(fi, fpc);
/* collect symbolic links */
fi = rpmfiInit(fi, 0);
if (fi != NULL) /* XXX lclint */
continue;
ffi.p = p;
ffi.fileno = i;
- rpmFpHashAddEntry(symlinks, fi->fps + i, ffi);
+ rpmFpHashAddEntry(symlinks, rpmfiFpsIndex(fi, i), ffi);
}
(void) rpmswExit(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), fc);