diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-06-06 23:47:37 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-06-06 23:47:37 +0300 |
commit | 05db695ee6cec89b98db87e7b00ecbffb65eb634 (patch) | |
tree | 5b970ab799029e8a5b0ef47deb086e86d1911673 /lib/rpmtd.c | |
parent | d1c9e039a4a245edf470d78dd465f55388cd916c (diff) | |
download | rpm-05db695ee6cec89b98db87e7b00ecbffb65eb634.tar.gz rpm-05db695ee6cec89b98db87e7b00ecbffb65eb634.tar.bz2 rpm-05db695ee6cec89b98db87e7b00ecbffb65eb634.zip |
Add access methods for 64bit integer types to rpmtd
Diffstat (limited to 'lib/rpmtd.c')
-rw-r--r-- | lib/rpmtd.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/rpmtd.c b/lib/rpmtd.c index e1d240842..2c377a450 100644 --- a/lib/rpmtd.c +++ b/lib/rpmtd.c @@ -123,6 +123,16 @@ uint32_t *rpmtdNextUint32(rpmtd td) return res; } +uint64_t *rpmtdNextUint64(rpmtd td) +{ + assert(td != NULL); + uint64_t *res = NULL; + if (rpmtdNext(td) >= 0) { + res = rpmtdGetUint64(td); + } + return res; +} + const char *rpmtdNextString(rpmtd td) { assert(td != NULL); @@ -170,6 +180,20 @@ uint32_t * rpmtdGetUint32(rpmtd td) } return res; } + +uint64_t * rpmtdGetUint64(rpmtd td) +{ + uint64_t *res = NULL; + + assert(td != NULL); + + if (td->type == RPM_INT64_TYPE) { + int ix = (td->ix >= 0 ? td->ix : 0); + res = (uint64_t *) td->data + ix; + } + return res; +} + const char * rpmtdGetString(rpmtd td) { const char *str = NULL; |