X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lib%2Ftrace-ir%2Ftrace.c;h=d2b58899a2d74761effad899b5e598307b8ca62e;hb=05e2128659970c32648a01255ed870449f05d518;hp=d33a4dc49710e8bfdafba85df38706e644c60f67;hpb=398454ed067b95215c7affbe265fd36edab931ee;p=babeltrace.git diff --git a/lib/trace-ir/trace.c b/lib/trace-ir/trace.c index d33a4dc4..d2b58899 100644 --- a/lib/trace-ir/trace.c +++ b/lib/trace-ir/trace.c @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include @@ -261,7 +261,7 @@ bool trace_has_environment_entry(struct bt_trace *trace, const char *name) static int set_environment_entry(struct bt_trace *trace, const char *name, - struct bt_private_value *value) + struct bt_value *value) { int ret; @@ -274,7 +274,7 @@ int set_environment_entry(struct bt_trace *trace, const char *name, "%![trace-]+t, entry-name=\"%s\"", trace, name); ret = bt_attributes_set_field_value(trace->environment, name, value); - bt_value_freeze(bt_private_value_as_value(value)); + bt_value_freeze(value); if (ret) { BT_LIB_LOGE("Cannot set trace's environment entry: " "%![trace-]+t, entry-name=\"%s\"", trace, name); @@ -291,13 +291,13 @@ int bt_private_trace_set_environment_entry_string( const char *name, const char *value) { int ret; - struct bt_private_value *value_obj; + struct bt_value *value_obj; struct bt_trace *trace = (void *) priv_trace; BT_ASSERT_PRE_NON_NULL(trace, "Trace"); BT_ASSERT_PRE_NON_NULL(name, "Name"); BT_ASSERT_PRE_NON_NULL(value, "Value"); - value_obj = bt_private_value_string_create_init(value); + value_obj = bt_value_string_create_init(value); if (!value_obj) { BT_LOGE_STR("Cannot create a string value object."); ret = -1; @@ -317,12 +317,12 @@ int bt_private_trace_set_environment_entry_integer( const char *name, int64_t value) { int ret; - struct bt_private_value *value_obj; + struct bt_value *value_obj; struct bt_trace *trace = (void *) priv_trace; BT_ASSERT_PRE_NON_NULL(trace, "Trace"); BT_ASSERT_PRE_NON_NULL(name, "Name"); - value_obj = bt_private_value_integer_create_init(value); + value_obj = bt_value_integer_create_init(value); if (!value_obj) { BT_LOGE_STR("Cannot create an integer value object."); ret = -1; @@ -349,15 +349,14 @@ uint64_t bt_trace_get_environment_entry_count(struct bt_trace *trace) void bt_trace_borrow_environment_entry_by_index( struct bt_trace *trace, uint64_t index, - const char **name, struct bt_value **value) + const char **name, const struct bt_value **value) { BT_ASSERT_PRE_NON_NULL(trace, "Trace"); BT_ASSERT_PRE_NON_NULL(name, "Name"); BT_ASSERT_PRE_NON_NULL(value, "Value"); BT_ASSERT_PRE_VALID_INDEX(index, bt_attributes_get_count(trace->environment)); - *value = bt_private_value_as_value( - bt_attributes_borrow_field_value(trace->environment, index)); + *value = bt_attributes_borrow_field_value(trace->environment, index); BT_ASSERT(*value); *name = bt_attributes_get_field_name(trace->environment, index); BT_ASSERT(*name); @@ -365,23 +364,22 @@ void bt_trace_borrow_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) + const char **name, const struct bt_value **value) { bt_trace_borrow_environment_entry_by_index((void *) trace, index, name, (void *) value); } -struct bt_value *bt_trace_borrow_environment_entry_value_by_name( +const struct bt_value *bt_trace_borrow_environment_entry_value_by_name( struct bt_trace *trace, const char *name) { BT_ASSERT_PRE_NON_NULL(trace, "Trace"); BT_ASSERT_PRE_NON_NULL(name, "Name"); - return bt_private_value_as_value( - bt_attributes_borrow_field_value_by_name(trace->environment, - name)); + return bt_attributes_borrow_field_value_by_name(trace->environment, + name); } -struct bt_private_value * +const struct bt_value * bt_private_trace_borrow_environment_entry_value_by_name( struct bt_private_trace *trace, const char *name) {