}
g_array_free(trace->is_static_listeners, TRUE);
+ trace->is_static_listeners = NULL;
}
bt_object_pool_finalize(&trace->packet_header_field_pool);
if (trace->environment) {
BT_LOGD_STR("Destroying environment attributes.");
bt_attributes_destroy(trace->environment);
+ trace->environment = NULL;
}
if (trace->name.str) {
g_string_free(trace->name.str, TRUE);
+ trace->name.str = NULL;
+ trace->name.value = NULL;
}
if (trace->streams) {
BT_LOGD_STR("Destroying streams.");
g_ptr_array_free(trace->streams, TRUE);
+ trace->streams = NULL;
}
if (trace->stream_classes) {
BT_LOGD_STR("Destroying stream classes.");
g_ptr_array_free(trace->stream_classes, TRUE);
+ trace->stream_classes = NULL;
}
if (trace->stream_classes_stream_count) {
g_hash_table_destroy(trace->stream_classes_stream_count);
+ trace->stream_classes_stream_count = NULL;
}
BT_LOGD_STR("Putting packet header field classe.");
bt_object_put_ref(trace->packet_header_fc);
+ trace->packet_header_fc = NULL;
g_free(trace);
}
return trace->uuid.value;
}
-int bt_private_trace_set_uuid(struct bt_private_trace *priv_trace, bt_uuid uuid)
+void bt_private_trace_set_uuid(struct bt_private_trace *priv_trace,
+ bt_uuid uuid)
{
struct bt_trace *trace = (void *) priv_trace;
memcpy(trace->uuid.uuid, uuid, BABELTRACE_UUID_LEN);
trace->uuid.value = trace->uuid.uuid;
BT_LIB_LOGV("Set trace's UUID: %!+t", trace);
- return 0;
}
BT_ASSERT_FUNC
"%![trace-]+t, entry-name=\"%s\"", trace, name);
ret = bt_attributes_set_field_value(trace->environment, name,
value);
- bt_value_freeze(bt_value_borrow_from_private(value));
+ bt_value_freeze(bt_private_value_borrow_value(value));
if (ret) {
BT_LIB_LOGE("Cannot set trace's environment entry: "
"%![trace-]+t, entry-name=\"%s\"", trace, name);
return ret;
}
-int bt_private_trace_set_private_environment_entry_string(
+int bt_private_trace_set_environment_entry_string(
struct bt_private_trace *priv_trace,
const char *name, const char *value)
{
return ret;
}
-int bt_private_trace_set_private_environment_entry_integer(
+int bt_private_trace_set_environment_entry_integer(
struct bt_private_trace *priv_trace,
const char *name, int64_t value)
{
BT_ASSERT_PRE_NON_NULL(value, "Value");
BT_ASSERT_PRE_VALID_INDEX(index,
bt_attributes_get_count(trace->environment));
- *value = bt_value_borrow_from_private(
+ *value = bt_private_value_borrow_value(
bt_attributes_borrow_field_value(trace->environment, index));
BT_ASSERT(*value);
*name = bt_attributes_get_field_name(trace->environment, index);
BT_ASSERT(*name);
}
-void bt_private_trace_borrow_private_environment_entry_by_index(
+void bt_private_trace_borrow_environment_entry_by_index(
struct bt_private_trace *trace, uint64_t index,
const char **name, struct bt_private_value **value)
{
{
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(name, "Name");
- return bt_value_borrow_from_private(
+ return bt_private_value_borrow_value(
bt_attributes_borrow_field_value_by_name(trace->environment,
name));
}
struct bt_private_value *
-bt_private_trace_borrow_private_environment_entry_value_by_name(
+bt_private_trace_borrow_environment_entry_value_by_name(
struct bt_private_trace *trace, const char *name)
{
return (void *) bt_trace_borrow_environment_entry_value_by_name(
return g_ptr_array_index(trace->streams, index);
}
-struct bt_private_stream *bt_private_trace_borrow_private_stream_by_index(
+struct bt_private_stream *bt_private_trace_borrow_stream_by_index(
struct bt_private_trace *trace, uint64_t index)
{
return (void *) bt_trace_borrow_stream_by_index((void *) trace, index);
}
struct bt_private_stream_class *
-bt_private_trace_borrow_private_stream_class_by_index(
+bt_private_trace_borrow_stream_class_by_index(
struct bt_private_trace *trace, uint64_t index)
{
return (void *) bt_trace_borrow_stream_class_by_index(
}
struct bt_private_stream_class *
-bt_private_trace_borrow_private_stream_class_by_id(
+bt_private_trace_borrow_stream_class_by_id(
struct bt_private_trace *trace, uint64_t id)
{
return (void *) bt_trace_borrow_stream_class_by_id((void *) trace, id);
return trace->packet_header_fc;
}
-int bt_private_trace_set_packet_header_private_field_class(
+int bt_private_trace_set_packet_header_field_class(
struct bt_private_trace *priv_trace,
struct bt_private_field_class *priv_field_class)
{
return (bt_bool) trace->assigns_automatic_stream_class_id;
}
-int bt_private_trace_set_assigns_automatic_stream_class_id(
+void bt_private_trace_set_assigns_automatic_stream_class_id(
struct bt_private_trace *priv_trace, bt_bool value)
{
struct bt_trace *trace = (void *) priv_trace;
trace->assigns_automatic_stream_class_id = (bool) value;
BT_LIB_LOGV("Set trace's automatic stream class ID "
"assignment property: %!+t", trace);
- return 0;
}
BT_HIDDEN