rpmProblemType type;
int ignoreProblem;
char * str1;
- unsigned long ulong1;
+ uint64_t num1;
};
/**
void rpmpsAppend(rpmps ps, rpmProblemType type,
const char * pkgNEVR, fnpyKey key,
const char * dn, const char * bn,
- const char * altNEVR, unsigned long ulong1)
+ const char * altNEVR, uint64_t number)
{
rpmProblem p = NULL;
if (ps == NULL) return;
- p = rpmProblemCreate(type, pkgNEVR, key, dn, bn, altNEVR, ulong1);
+ p = rpmProblemCreate(type, pkgNEVR, key, dn, bn, altNEVR, number);
rpmpsAppendProblem(ps, p);
}
fnpyKey key,
const char * dn, const char * bn,
const char * altNEVR,
- unsigned long ulong1)
+ uint64_t number)
{
rpmProblem p = xcalloc(1, sizeof(*p));
char *t;
p->type = type;
p->key = key;
- p->ulong1 = ulong1;
+ p->num1 = number;
p->ignoreProblem = 0;
p->pkgNEVR = (pkgNEVR ? xstrdup(pkgNEVR) : NULL);
return (p->str1);
}
-unsigned long rpmProblemGetLong(const rpmProblem p)
+rpm_loff_t rpmProblemGetDiskNeed(const rpmProblem p)
{
- return (p->ulong1);
+ return (p->num1);
}
char * rpmProblemString(const rpmProblem prob)
rc = rasprintf(&buf,
_("installing package %s needs %ld%cB on the %s filesystem"),
pkgNEVR,
- prob->ulong1 > (1024*1024)
- ? (prob->ulong1 + 1024 * 1024 - 1) / (1024 * 1024)
- : (prob->ulong1 + 1023) / 1024,
- prob->ulong1 > (1024*1024) ? 'M' : 'K',
+ prob->num1 > (1024*1024)
+ ? (prob->num1 + 1024 * 1024 - 1) / (1024 * 1024)
+ : (prob->num1 + 1023) / 1024,
+ prob->num1 > (1024*1024) ? 'M' : 'K',
str1);
break;
case RPMPROB_DISKNODES:
rc = rasprintf(&buf,
- _("installing package %s needs %ld inodes on the %s filesystem"),
- pkgNEVR, (long)prob->ulong1, str1);
+ _("installing package %s needs %llu inodes on the %s filesystem"),
+ pkgNEVR, (long long)prob->num1, str1);
break;
case RPMPROB_REQUIRES:
rc = rasprintf(&buf, _("%s is needed by %s%s"),
altNEVR+2,
- (prob->ulong1 ? "" : _("(installed) ")), pkgNEVR);
+ (prob->num1 ? "" : _("(installed) ")), pkgNEVR);
break;
case RPMPROB_CONFLICT:
rc = rasprintf(&buf, _("%s conflicts with %s%s"),
altNEVR+2,
- (prob->ulong1 ? "" : _("(installed) ")), pkgNEVR);
+ (prob->num1 ? "" : _("(installed) ")), pkgNEVR);
break;
default:
rc = rasprintf(&buf,
if (bp->str1 && strcmp(ap->str1, bp->str1))
return 1;
- if (ap->ulong1 != bp->ulong1)
+ if (ap->num1 != bp->num1)
return 1;
return 0;
* @param dn directory name
* @param bn file base name
* @param altNEVR related (e.g. through a dependency) package name
- * @param ulong1 generic pointer/long attribute
+ * @param number generic number attribute
* @return rpmProblem
*/
rpmProblem rpmProblemCreate(rpmProblemType type,
fnpyKey key,
const char * dn, const char * bn,
const char * altNEVR,
- unsigned long ulong1);
+ uint64_t number);
/** \ingroup rpmps
* Destroy a problem item.
* @todo needs a better name
*/
const char * rpmProblemGetStr(const rpmProblem prob);
+
/** \ingroup rpmps
- * Return generic pointer/long attribute from a problem
+ * Return disk requirement (needed disk space / number of inodes)
+ * depending on problem type. On problem types other than RPMPROB_DISKSPACE
+ * and RPMPROB_DISKNODES return value is undefined.
* @param prob rpm problem
- * @return a generic pointer/long attribute
- * @todo needs a better name
+ * @return disk requirement
*/
-unsigned long rpmProblemGetLong(const rpmProblem prob);
+rpm_loff_t rpmProblemGetDiskNeed(const rpmProblem prob);
/** \ingroup rpmps
* Return formatted string representation of a problem.
* @param dn directory name
* @param bn file base name
* @param altNEVR related (e.g. through a dependency) package name
- * @param ulong1 generic pointer/long attribute
+ * @param number generic number attribute
*/
void rpmpsAppend(rpmps ps, rpmProblemType type,
const char * pkgNEVR,
fnpyKey key,
const char * dn, const char * bn,
const char * altNEVR,
- unsigned long ulong1);
+ uint64_t number);
/** \ingroup rpmps
* Filter a problem set.