return hi;
}
-int headerNextIterator(HeaderIterator hi,
- rpmTag * tag,
- rpmTagType * type,
- rpm_data_t * p,
- rpm_count_t * c)
+int headerNext(HeaderIterator hi, rpmtd td)
{
Header h = hi->h;
int slot = hi->next_index;
indexEntry entry = NULL;
int rc;
+ assert(td != NULL);
+ rpmtdReset(td);
+
for (slot = hi->next_index; slot < h->indexUsed; slot++) {
entry = h->index + slot;
if (!ENTRY_IS_REGION(entry))
/* LCL: no clue */
hi->next_index++;
- if (tag)
- *tag = entry->info.tag;
+ td->tag = entry->info.tag;
- rc = copyEntry(entry, type, p, c, 0);
+ rc = copyTdEntry(entry, td, 0);
/* XXX 1 on success */
return ((rc == 1) ? 1 : 0);
}
+int headerNextIterator(HeaderIterator hi,
+ rpmTag * tag,
+ rpmTagType * type,
+ rpm_data_t * p,
+ rpm_count_t * c)
+{
+ struct rpmtd_s td;
+ int rc;
+
+ rc = headerNext(hi, &td);
+ if (tag)
+ *tag = td.tag;
+ if (type)
+ *type = td.type;
+ if (p)
+ *p = td.data;
+ if (c)
+ *c = td.count;
+ return rc;
+}
+
/** \ingroup header
* Duplicate a header.
* @param h header
/** \ingroup header
* Return next tag from header.
* @param hi header tag iterator
+ * @retval td tag data container
+ * @return 1 on success, 0 on failure
+ */
+int headerNext(HeaderIterator hi, rpmtd td);
+
+/** \ingroup header
+ * Return next tag from header.
+ * @param hi header tag iterator
* @retval *tag tag
* @retval *type tag value data type
* @retval *p pointer to tag value(s)