lib: rename `bt_object_{get,put}_no` -> `bt_object_{get,put}_ref_no`
[babeltrace.git] / src / lib / plugin / plugin-so.c
index 0f6ec1c6fb5140466a80866880873d9b16e69ed6..00e51b504104c7ecb6de022323ea5fcb2345598f 100644 (file)
@@ -959,51 +959,27 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                        }
 
                        if (cc_full_descr->methods.source.msg_iter_seek_ns_from_origin) {
-                               ret = bt_component_class_source_set_message_iterator_seek_ns_from_origin_method(
-                                       src_comp_class,
-                                       cc_full_descr->methods.source.msg_iter_seek_ns_from_origin);
-                               if (ret) {
-                                       BT_LIB_LOGE_APPEND_CAUSE(
-                                               "Cannot set source component class's message iterator \"seek nanoseconds from origin\" method.");
-                                       status = BT_FUNC_STATUS_MEMORY_ERROR;
-                                       BT_OBJECT_PUT_REF_AND_RESET(src_comp_class);
-                                       goto end;
-                               }
-                       }
-
-                       if (cc_full_descr->methods.source.msg_iter_seek_beginning) {
-                               ret = bt_component_class_source_set_message_iterator_seek_beginning_method(
-                                       src_comp_class,
-                                       cc_full_descr->methods.source.msg_iter_seek_beginning);
-                               if (ret) {
-                                       BT_LIB_LOGE_APPEND_CAUSE(
-                                               "Cannot set source component class's message iterator \"seek beginning\" method.");
-                                       status = BT_FUNC_STATUS_MEMORY_ERROR;
-                                       BT_OBJECT_PUT_REF_AND_RESET(src_comp_class);
-                                       goto end;
-                               }
-                       }
-
-                       if (cc_full_descr->methods.source.msg_iter_can_seek_ns_from_origin) {
-                               ret = bt_component_class_source_set_message_iterator_can_seek_ns_from_origin_method(
+                               ret = bt_component_class_source_set_message_iterator_seek_ns_from_origin_methods(
                                        src_comp_class,
+                                       cc_full_descr->methods.source.msg_iter_seek_ns_from_origin,
                                        cc_full_descr->methods.source.msg_iter_can_seek_ns_from_origin);
                                if (ret) {
                                        BT_LIB_LOGE_APPEND_CAUSE(
-                                               "Cannot set source component class's message iterator \"can seek nanoseconds from origin\" method.");
+                                               "Cannot set source component class's message iterator \"seek nanoseconds from origin\" methods.");
                                        status = BT_FUNC_STATUS_MEMORY_ERROR;
                                        BT_OBJECT_PUT_REF_AND_RESET(src_comp_class);
                                        goto end;
                                }
                        }
 
-                       if (cc_full_descr->methods.source.msg_iter_can_seek_beginning) {
-                               ret = bt_component_class_source_set_message_iterator_can_seek_beginning_method(
+                       if (cc_full_descr->methods.source.msg_iter_seek_beginning) {
+                               ret = bt_component_class_source_set_message_iterator_seek_beginning_methods(
                                        src_comp_class,
+                                       cc_full_descr->methods.source.msg_iter_seek_beginning,
                                        cc_full_descr->methods.source.msg_iter_can_seek_beginning);
                                if (ret) {
                                        BT_LIB_LOGE_APPEND_CAUSE(
-                                               "Cannot set source component class's message iterator \"can seek beginning\" method.");
+                                               "Cannot set source component class's message iterator \"seek beginning\" methods.");
                                        status = BT_FUNC_STATUS_MEMORY_ERROR;
                                        BT_OBJECT_PUT_REF_AND_RESET(src_comp_class);
                                        goto end;
@@ -1117,51 +1093,27 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                        }
 
                        if (cc_full_descr->methods.filter.msg_iter_seek_ns_from_origin) {
-                               ret = bt_component_class_filter_set_message_iterator_seek_ns_from_origin_method(
-                                       flt_comp_class,
-                                       cc_full_descr->methods.filter.msg_iter_seek_ns_from_origin);
-                               if (ret) {
-                                       BT_LIB_LOGE_APPEND_CAUSE(
-                                               "Cannot set filter component class's message iterator \"seek nanoseconds from origin\" method.");
-                                       status = BT_FUNC_STATUS_MEMORY_ERROR;
-                                       BT_OBJECT_PUT_REF_AND_RESET(flt_comp_class);
-                                       goto end;
-                               }
-                       }
-
-                       if (cc_full_descr->methods.filter.msg_iter_seek_beginning) {
-                               ret = bt_component_class_filter_set_message_iterator_seek_beginning_method(
-                                       flt_comp_class,
-                                       cc_full_descr->methods.filter.msg_iter_seek_beginning);
-                               if (ret) {
-                                       BT_LIB_LOGE_APPEND_CAUSE(
-                                               "Cannot set filter component class's message iterator \"seek beginning\" method.");
-                                       status = BT_FUNC_STATUS_MEMORY_ERROR;
-                                       BT_OBJECT_PUT_REF_AND_RESET(flt_comp_class);
-                                       goto end;
-                               }
-                       }
-
-                       if (cc_full_descr->methods.filter.msg_iter_can_seek_ns_from_origin) {
-                               ret = bt_component_class_filter_set_message_iterator_can_seek_ns_from_origin_method(
+                               ret = bt_component_class_filter_set_message_iterator_seek_ns_from_origin_methods(
                                        flt_comp_class,
+                                       cc_full_descr->methods.filter.msg_iter_seek_ns_from_origin,
                                        cc_full_descr->methods.filter.msg_iter_can_seek_ns_from_origin);
                                if (ret) {
                                        BT_LIB_LOGE_APPEND_CAUSE(
-                                               "Cannot set filter component class's message iterator \"can seek nanoseconds from origin\" method.");
+                                               "Cannot set filter component class's message iterator \"seek nanoseconds from origin\" methods.");
                                        status = BT_FUNC_STATUS_MEMORY_ERROR;
                                        BT_OBJECT_PUT_REF_AND_RESET(flt_comp_class);
                                        goto end;
                                }
                        }
 
-                       if (cc_full_descr->methods.filter.msg_iter_can_seek_beginning) {
-                               ret = bt_component_class_filter_set_message_iterator_can_seek_beginning_method(
+                       if (cc_full_descr->methods.filter.msg_iter_seek_beginning) {
+                               ret = bt_component_class_filter_set_message_iterator_seek_beginning_methods(
                                        flt_comp_class,
+                                       cc_full_descr->methods.filter.msg_iter_seek_beginning,
                                        cc_full_descr->methods.filter.msg_iter_can_seek_beginning);
                                if (ret) {
                                        BT_LIB_LOGE_APPEND_CAUSE(
-                                               "Cannot set filter component class's message iterator \"can seek beginning\" method.");
+                                               "Cannot set filter component class's message iterator \"seek beginning\" methods.");
                                        status = BT_FUNC_STATUS_MEMORY_ERROR;
                                        BT_OBJECT_PUT_REF_AND_RESET(flt_comp_class);
                                        goto end;
@@ -1298,7 +1250,7 @@ struct bt_plugin *bt_plugin_so_create_empty(
 
        spec = plugin->spec_data;
        spec->shared_lib_handle = shared_lib_handle;
-       bt_object_get_no_null_check(spec->shared_lib_handle);
+       bt_object_get_ref_no_null_check(spec->shared_lib_handle);
        goto end;
 
 error:
@@ -1770,7 +1722,7 @@ void bt_plugin_so_on_add_component_class(struct bt_plugin *plugin,
 
        bt_list_add(&comp_class->node, &component_class_list);
        comp_class->so_handle = spec->shared_lib_handle;
-       bt_object_get_no_null_check(comp_class->so_handle);
+       bt_object_get_ref_no_null_check(comp_class->so_handle);
 
        /* Add our custom destroy listener */
        bt_component_class_add_destroy_listener(comp_class,
This page took 0.026019 seconds and 4 git commands to generate.