diff options
-rw-r--r-- | lib/rpmtd.c | 20 | ||||
-rw-r--r-- | lib/rpmtd.h | 14 |
2 files changed, 34 insertions, 0 deletions
diff --git a/lib/rpmtd.c b/lib/rpmtd.c index d1c49cf33..daac14542 100644 --- a/lib/rpmtd.c +++ b/lib/rpmtd.c @@ -96,6 +96,26 @@ int rpmtdNext(rpmtd td) return i; } +uint32_t *rpmtdNextUint32(rpmtd td) +{ + assert(td != NULL); + uint32_t *res = NULL; + if (rpmtdNext(td) >= 0) { + res = rpmtdGetUint32(td); + } + return res; +} + +const char *rpmtdNextString(rpmtd td) +{ + assert(td != NULL); + const char *res = NULL; + if (rpmtdNext(td) >= 0) { + res = rpmtdGetString(td); + } + return res; +} + char * rpmtdGetChar(rpmtd td) { char *res = NULL; diff --git a/lib/rpmtd.h b/lib/rpmtd.h index c5e4a8fc3..30d28c0c8 100644 --- a/lib/rpmtd.h +++ b/lib/rpmtd.h @@ -87,6 +87,20 @@ int rpmtdInit(rpmtd td); int rpmtdNext(rpmtd td); /** \ingroup rpmtd + * Iterate over uint32_t type tag data container. + * @param td Tag data container + * @return Pointer to next value, NULL on termination or error + */ +uint32_t *rpmtdNextUint32(rpmtd td); + +/** \ingroup rpmtd + * Iterate over string / string array type tag data container. + * @param td Tag data container + * @return Pointer to next value, NULL on termination or error + */ +const char *rpmtdNextString(rpmtd td); + +/** \ingroup rpmtd * Return char data from tag container. * For scalar return type, just return pointer to the integer. On array * types, return pointer to current iteration index. If the tag container |