Unfortunately it's all a bit messy and entangled. Since this is such
an early WIP, I didn't spend the (substantial) time needed to pick this
into separate changes. The changes in this commit are:
* Create a consistent naming schema for the identity functions:
* Rename "create_identity" to "identity_create_legacy".
* Rename "clone_identity" to "identity_clone".
* Rename "destroy_identity" to "identity_destroy".
* Add "identity_create" to allocate a new identity_t.
* Copy key and value strings within "identity_add_label".
* Make use of "identity_create" and "identity_add_label" in
"identity_clone", "identity_create_legacy" and others that used
to fiddle with the AVL tree directly.
* Remove the "_p" suffix used for pointers. This is quite unusual for
the collectd codebase.
# Conflicts:
# src/daemon/metrics_list_test.c
}
metric_t metric = METRIC_STRUCT_INIT;
- metric.identity = create_identity(plugin, type, data_source, host);
+ metric.identity = identity_create_legacy(plugin, type, data_source, host);
sstrncpy(metric.plugin, plugin, sizeof(metric.plugin));
sstrncpy(metric.type, type, sizeof(metric.type));
metric.ds = plugin_get_ds(metric.type);
return CMD_PARSE_ERROR;
}
- metric.identity = create_identity(plugin, type, data_source, hostname);
+ metric.identity = identity_create_legacy(plugin, type, data_source, hostname);
if (metric.identity == NULL) {
sfree(identifier_copy);
return CMD_PARSE_ERROR;