lib: add aliases for Babeltrace structure types
[babeltrace.git] / plugins / utils / trimmer / trimmer.c
index 4806dc6ffdedff932b3769f6785eda6e1aae0242..0c5af14776a0c1865a0dcfd1cadb5e5086a811af 100644 (file)
@@ -48,9 +48,9 @@ struct trimmer *create_trimmer_data(void)
        return g_new0(struct trimmer, 1);
 }
 
-void finalize_trimmer(struct bt_private_component *component)
+void finalize_trimmer(bt_self_component *component)
 {
-       void *data = bt_private_component_get_user_data(component);
+       void *data = bt_self_component_get_user_data(component);
 
        destroy_trimmer_data(data);
 }
@@ -72,7 +72,7 @@ void finalize_trimmer(struct bt_private_component *component)
  *   ss
  */
 static
-int timestamp_from_param(const char *param_name, struct bt_value *param,
+int timestamp_from_param(const char *param_name, bt_value *param,
                struct trimmer *trimmer, struct trimmer_bound *result_bound,
                bt_bool gmt)
 {
@@ -135,7 +135,7 @@ int timestamp_from_param(const char *param_name, struct bt_value *param,
        if (ret == 4) {
                if (!trimmer->date) {
                        /* We don't know which day until we get an event. */
-                       result_bound->lazy_values.hh = hh;
+                       result_bound->lazy_value.hh = hh;
                        result_bound->lazy_values.mm = mm;
                        result_bound->lazy_values.ss = ss;
                        result_bound->lazy_values.ns = ns;
@@ -227,7 +227,7 @@ int timestamp_from_param(const char *param_name, struct bt_value *param,
        if (ret == 3) {
                if (!trimmer->date) {
                        /* We don't know which day until we get an event. */
-                       result_bound->lazy_values.hh = hh;
+                       result_bound->lazy_value.hh = hh;
                        result_bound->lazy_values.mm = mm;
                        result_bound->lazy_values.ss = ss;
                        result_bound->lazy_values.ns = 0;
@@ -292,9 +292,9 @@ lazy:
 
 static
 enum bt_component_status init_from_params(struct trimmer *trimmer,
-               struct bt_value *params)
+               bt_value *params)
 {
-       struct bt_value *value = NULL;
+       bt_value *value = NULL;
        bt_bool gmt = BT_FALSE;
        enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
 
@@ -304,17 +304,13 @@ enum bt_component_status init_from_params(struct trimmer *trimmer,
        if (value) {
                enum bt_value_status value_ret;
 
-               value_ret = bt_value_bool_get(value, &gmt);
-               if (value_ret) {
-                       ret = BT_COMPONENT_STATUS_INVALID;
-                       BT_LOGE_STR("Failed to retrieve clock-gmt value. Expecting a boolean");
-               }
+               gmt = bt_value_bool_get(value);
        }
        if (ret != BT_COMPONENT_STATUS_OK) {
                goto end;
        }
 
-       BT_PUT(value);
+       BT_VALUE_PUT_REF_AND_RESET(value);
         value = bt_value_map_get(params, "begin");
        if (value) {
                if (timestamp_from_param("begin", value,
@@ -325,7 +321,7 @@ enum bt_component_status init_from_params(struct trimmer *trimmer,
                }
        }
 
-       BT_PUT(value);
+       BT_VALUE_PUT_REF_AND_RESET(value);
         value = bt_value_map_get(params, "end");
        if (value) {
                if (timestamp_from_param("end", value,
@@ -337,7 +333,7 @@ enum bt_component_status init_from_params(struct trimmer *trimmer,
        }
 
 end:
-       bt_put(value);
+       bt_value_put_ref(value);
 
        if (trimmer->begin.set && trimmer->end.set) {
                if (trimmer->begin.value > trimmer->end.value) {
@@ -349,7 +345,7 @@ end:
 }
 
 enum bt_component_status trimmer_component_init(
-       struct bt_private_component *component, struct bt_value *params,
+       bt_self_component *component, bt_value *params,
        UNUSED_VAR void *init_method_data)
 {
        enum bt_component_status ret;
@@ -361,19 +357,19 @@ enum bt_component_status trimmer_component_init(
        }
 
        /* Create input and output ports */
-       ret = bt_private_component_filter_add_input_private_port(
+       ret = bt_self_component_filter_add_input_port(
                component, "in", NULL, NULL);
        if (ret != BT_COMPONENT_STATUS_OK) {
                goto error;
        }
 
-       ret = bt_private_component_filter_add_output_private_port(
+       ret = bt_self_component_filter_add_output_port(
                component, "out", NULL, NULL);
        if (ret != BT_COMPONENT_STATUS_OK) {
                goto error;
        }
 
-       ret = bt_private_component_set_user_data(component, trimmer);
+       ret = bt_self_component_set_user_data(component, trimmer);
        if (ret != BT_COMPONENT_STATUS_OK) {
                goto error;
        }
This page took 0.026579 seconds and 4 git commands to generate.