diff options
author | Remi Collet <remi@remirepo.net> | 2018-02-09 14:20:12 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2018-02-09 14:20:12 +0100 |
commit | ded7f74551635f1e6fb68974416f5fc406ca909f (patch) | |
tree | 35692533c7fa5afa3e32c6de05cf3a333076ffb7 /rpminfo.c | |
parent | 706aa9181a857b95854e7f27b07edc8d4e48503c (diff) |
retrieve array of strings from metadata
Diffstat (limited to 'rpminfo.c')
-rw-r--r-- | rpminfo.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -87,6 +87,23 @@ static void rpm_header_to_zval(zval *return_value, Header h, zend_bool full) case RPM_INT64_TYPE: add_assoc_long(return_value, rpmTagGetName(tag), (zend_long)headerGetNumber(h, tag)); break; + case RPM_STRING_ARRAY_TYPE: + { + struct rpmtd_s keys; + if (headerGet(h, tag, &keys, HEADERGET_MINMEM)) { + const char *key; + zval tmp; + + array_init(&tmp); + while ((key = rpmtdNextString(&keys))) { + add_next_index_string(&tmp, key); + } + add_assoc_zval(return_value, rpmTagGetName(tag), &tmp); + } else { + add_assoc_null(return_value, rpmTagGetName(tag)); + } + } + break; default: val = headerGetAsString(h, tag); if (val) { |