X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_db_query.c;h=eb001dee93c1ef55356e1fa805d9c12dbfe82d8c;hb=d54dfab9b049de396e6a38d690d5f18917e093ea;hp=b4ce09abfb3b96c1edf20fc572c9e0fcab0066a9;hpb=bc7992ed0693313a2b1fe282a5bf23f1cc9f8e42;p=collectd.git diff --git a/src/utils_db_query.c b/src/utils_db_query.c index b4ce09ab..eb001dee 100644 --- a/src/utils_db_query.c +++ b/src/utils_db_query.c @@ -539,7 +539,8 @@ void udb_query_free_one (udb_query_t *q) /* {{{ */ * Query public functions */ int udb_query_create (udb_query_t ***ret_query_list, /* {{{ */ - size_t *ret_query_list_len, oconfig_item_t *ci) + size_t *ret_query_list_len, oconfig_item_t *ci, + udb_query_create_callback_t cb) { udb_query_t **query_list; size_t query_list_len; @@ -606,6 +607,15 @@ int udb_query_create (udb_query_t ***ret_query_list, /* {{{ */ q->name); status = udb_config_set_uint (&q->max_version, child); } + else if (cb != NULL) + { + status = (*cb) (q, child); + if (status != 0) + { + WARNING ("db query utils: The configuration callback failed " + "to handle `%s'.", child->key); + } + } else { WARNING ("db query utils: Query `%s': Option `%s' not allowed here.",