From fe4a2a28cae8fb143d7c36da99a0fe8f8c780498 Mon Sep 17 00:00:00 2001 From: Javier Kohen Date: Wed, 6 Nov 2019 16:46:17 -0300 Subject: [PATCH] Expose meta_data_toc function. This is useful for traversing all the meta data elements in a value list, since there is no element to look up the metadata object. For example usage, see https://github.com/Stackdriver/collectd/pull/166 --- src/daemon/utils_cache.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/daemon/utils_cache.c b/src/daemon/utils_cache.c index 672b01f1..5e8cf75b 100644 --- a/src/daemon/utils_cache.c +++ b/src/daemon/utils_cache.c @@ -1003,6 +1003,11 @@ int uc_meta_data_exists(const value_list_t *vl, int uc_meta_data_delete(const value_list_t *vl, const char *key) UC_WRAP(meta_data_delete) + +/* The second argument is called `toc` in the API, but the macro expects + * `key`. */ +int uc_meta_data_toc(const value_list_t *vl, char ***key) UC_WRAP(meta_data_toc) + #undef UC_WRAP /* We need a new version of this macro because the following functions take -- 2.11.0