lib: make it mandatory to have seek_X if can_seek_X is defined
[babeltrace.git] / src / lib / graph / component-class.c
index d17dbd4c1c5192fdb22a837351b3eddfb83280f5..9bbf4172e751845d0c1afc2b32fe11457249fef4 100644 (file)
@@ -41,8 +41,8 @@
 #include "component-class.h"
 #include "lib/func-status.h"
 
-#define BT_ASSERT_PRE_COMP_CLS_HOT(_cc) \
-       BT_ASSERT_PRE_HOT(((const struct bt_component_class *) (_cc)),  \
+#define BT_ASSERT_PRE_DEV_COMP_CLS_HOT(_cc) \
+       BT_ASSERT_PRE_DEV_HOT(((const struct bt_component_class *) (_cc)), \
                "Component class", ": %!+C", (_cc))
 
 static
@@ -106,32 +106,32 @@ int bt_component_class_init(struct bt_component_class *class,
        class->type = type;
        class->name = g_string_new(name);
        if (!class->name) {
-               BT_LOGE_STR("Failed to allocate a GString.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString.");
                goto error;
        }
 
        class->description = g_string_new(NULL);
        if (!class->description) {
-               BT_LOGE_STR("Failed to allocate a GString.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString.");
                goto error;
        }
 
        class->help = g_string_new(NULL);
        if (!class->help) {
-               BT_LOGE_STR("Failed to allocate a GString.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString.");
                goto error;
        }
 
        class->plugin_name = g_string_new(NULL);
        if (!class->plugin_name) {
-               BT_LOGE_STR("Failed to allocate a GString.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString.");
                goto error;
        }
 
        class->destroy_listeners = g_array_new(FALSE, TRUE,
                sizeof(struct bt_component_class_destroy_listener));
        if (!class->destroy_listeners) {
-               BT_LOGE_STR("Failed to allocate a GArray.");
+               BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GArray.");
                goto error;
        }
 
@@ -159,7 +159,8 @@ struct bt_component_class_source *bt_component_class_source_create(
                name, method);
        source_class = g_new0(struct bt_component_class_source, 1);
        if (!source_class) {
-               BT_LOGE_STR("Failed to allocate one source component class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one source component class.");
                goto end;
        }
 
@@ -197,7 +198,8 @@ struct bt_component_class_filter *bt_component_class_filter_create(
                name, method);
        filter_class = g_new0(struct bt_component_class_filter, 1);
        if (!filter_class) {
-               BT_LOGE_STR("Failed to allocate one filter component class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one filter component class.");
                goto end;
        }
 
@@ -234,7 +236,8 @@ struct bt_component_class_sink *bt_component_class_sink_create(
                name, method);
        sink_class = g_new0(struct bt_component_class_sink, 1);
        if (!sink_class) {
-               BT_LOGE_STR("Failed to allocate one sink component class.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one sink component class.");
                goto end;
        }
 
@@ -259,13 +262,55 @@ end:
 }
 
 enum bt_component_class_set_method_status
-bt_component_class_source_set_init_method(
+bt_component_class_source_set_get_supported_mip_versions_method(
                struct bt_component_class_source *comp_cls,
-               bt_component_class_source_init_method method)
+               bt_component_class_source_get_supported_mip_versions_method method)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
+       comp_cls->methods.get_supported_mip_versions = method;
+       BT_LIB_LOGD("Set source component class's \"get supported MIP versions\" method: "
+               "%!+C", comp_cls);
+       return BT_FUNC_STATUS_OK;
+}
+
+enum bt_component_class_set_method_status
+bt_component_class_filter_set_get_supported_mip_versions_method(
+               struct bt_component_class_filter *comp_cls,
+               bt_component_class_filter_get_supported_mip_versions_method method)
+{
+       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+       BT_ASSERT_PRE_NON_NULL(method, "Method");
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
+       comp_cls->methods.get_supported_mip_versions = method;
+       BT_LIB_LOGD("Set filter component class's \"get supported MIP versions\" method: "
+               "%!+C", comp_cls);
+       return BT_FUNC_STATUS_OK;
+}
+
+enum bt_component_class_set_method_status
+bt_component_class_sink_set_get_supported_mip_versions_method(
+               struct bt_component_class_sink *comp_cls,
+               bt_component_class_sink_get_supported_mip_versions_method method)
+{
+       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+       BT_ASSERT_PRE_NON_NULL(method, "Method");
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
+       comp_cls->methods.get_supported_mip_versions = method;
+       BT_LIB_LOGD("Set sink component class's \"get supported MIP versions\" method: "
+               "%!+C", comp_cls);
+       return BT_FUNC_STATUS_OK;
+}
+
+enum bt_component_class_set_method_status
+bt_component_class_source_set_initialize_method(
+               struct bt_component_class_source *comp_cls,
+               bt_component_class_source_initialize_method method)
+{
+       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+       BT_ASSERT_PRE_NON_NULL(method, "Method");
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.init = method;
        BT_LIB_LOGD("Set source component class's initialization method: "
                "%!+C", comp_cls);
@@ -273,13 +318,13 @@ bt_component_class_source_set_init_method(
 }
 
 enum bt_component_class_set_method_status
-bt_component_class_filter_set_init_method(
+bt_component_class_filter_set_initialize_method(
                struct bt_component_class_filter *comp_cls,
-               bt_component_class_filter_init_method method)
+               bt_component_class_filter_initialize_method method)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.init = method;
        BT_LIB_LOGD("Set filter component class's initialization method: "
                "%!+C", comp_cls);
@@ -287,13 +332,13 @@ bt_component_class_filter_set_init_method(
 }
 
 enum bt_component_class_set_method_status
-bt_component_class_sink_set_init_method(
+bt_component_class_sink_set_initialize_method(
                struct bt_component_class_sink *comp_cls,
-               bt_component_class_sink_init_method method)
+               bt_component_class_sink_initialize_method method)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.init = method;
        BT_LIB_LOGD("Set sink component class's initialization method: "
                "%!+C", comp_cls);
@@ -307,7 +352,7 @@ bt_component_class_source_set_finalize_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.finalize = method;
        BT_LIB_LOGD("Set source component class's finalization method: "
                "%!+C", comp_cls);
@@ -321,7 +366,7 @@ bt_component_class_filter_set_finalize_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.finalize = method;
        BT_LIB_LOGD("Set filter component class's finalization method: "
                "%!+C", comp_cls);
@@ -335,7 +380,7 @@ bt_component_class_sink_set_finalize_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.finalize = method;
        BT_LIB_LOGD("Set sink component class's finalization method: "
                "%!+C", comp_cls);
@@ -349,7 +394,7 @@ bt_component_class_source_set_query_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.query = method;
        BT_LIB_LOGD("Set source component class's query method: "
                "%!+C", comp_cls);
@@ -363,7 +408,7 @@ bt_component_class_filter_set_query_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.query = method;
        BT_LIB_LOGD("Set filter component class's query method: "
                "%!+C", comp_cls);
@@ -377,7 +422,7 @@ bt_component_class_sink_set_query_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.query = method;
        BT_LIB_LOGD("Set sink component class's query method: "
                "%!+C", comp_cls);
@@ -391,7 +436,7 @@ bt_component_class_filter_set_input_port_connected_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.input_port_connected = method;
        BT_LIB_LOGD("Set filter component class's \"input port connected\" method"
                ": %!+C", comp_cls);
@@ -405,7 +450,7 @@ bt_component_class_sink_set_input_port_connected_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.input_port_connected = method;
        BT_LIB_LOGD("Set sink component class's \"input port connected\" method"
                ": %!+C", comp_cls);
@@ -419,7 +464,7 @@ bt_component_class_source_set_output_port_connected_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.output_port_connected = method;
        BT_LIB_LOGD("Set source component class's \"output port connected\" method"
                ": %!+C", comp_cls);
@@ -433,7 +478,7 @@ bt_component_class_filter_set_output_port_connected_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.output_port_connected = method;
        BT_LIB_LOGD("Set filter component class's \"output port connected\" method"
                ": %!+C", comp_cls);
@@ -447,7 +492,7 @@ bt_component_class_sink_set_graph_is_configured_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.graph_is_configured = method;
        BT_LIB_LOGD("Set sink component class's \"graph is configured\" method"
                ": %!+C", comp_cls);
@@ -455,28 +500,28 @@ bt_component_class_sink_set_graph_is_configured_method(
 }
 
 enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_init_method(
+bt_component_class_source_set_message_iterator_initialize_method(
                struct bt_component_class_source *comp_cls,
-               bt_component_class_source_message_iterator_init_method method)
+               bt_component_class_source_message_iterator_initialize_method method)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
-       comp_cls->methods.msg_iter_init = method;
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
+       comp_cls->methods.msg_iter_initialize = method;
        BT_LIB_LOGD("Set source component class's message iterator initialization method"
                ": %!+C", comp_cls);
        return BT_FUNC_STATUS_OK;
 }
 
 enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_init_method(
+bt_component_class_filter_set_message_iterator_initialize_method(
                struct bt_component_class_filter *comp_cls,
-               bt_component_class_filter_message_iterator_init_method method)
+               bt_component_class_filter_message_iterator_initialize_method method)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
-       comp_cls->methods.msg_iter_init = method;
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
+       comp_cls->methods.msg_iter_initialize = method;
        BT_LIB_LOGD("Set filter component class's message iterator initialization method"
                ": %!+C", comp_cls);
        return BT_FUNC_STATUS_OK;
@@ -489,7 +534,7 @@ bt_component_class_source_set_message_iterator_finalize_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_finalize = method;
        BT_LIB_LOGD("Set source component class's message iterator finalization method"
                ": %!+C", comp_cls);
@@ -503,7 +548,7 @@ bt_component_class_filter_set_message_iterator_finalize_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_finalize = method;
        BT_LIB_LOGD("Set filter component class's message iterator finalization method"
                ": %!+C", comp_cls);
@@ -511,113 +556,65 @@ bt_component_class_filter_set_message_iterator_finalize_method(
 }
 
 enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_seek_ns_from_origin_method(
+bt_component_class_filter_set_message_iterator_seek_ns_from_origin_methods(
                struct bt_component_class_filter *comp_cls,
-               bt_component_class_filter_message_iterator_seek_ns_from_origin_method method)
+               bt_component_class_filter_message_iterator_seek_ns_from_origin_method seek_method,
+               bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method can_seek_method)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
-       BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
-       comp_cls->methods.msg_iter_seek_ns_from_origin = method;
+       BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
+       comp_cls->methods.msg_iter_seek_ns_from_origin = seek_method;
+       comp_cls->methods.msg_iter_can_seek_ns_from_origin = can_seek_method;
        BT_LIB_LOGD("Set filter component class's message iterator \"seek nanoseconds from origin\" method"
                ": %!+C", comp_cls);
        return BT_FUNC_STATUS_OK;
 }
 
 enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_seek_ns_from_origin_method(
+bt_component_class_source_set_message_iterator_seek_ns_from_origin_methods(
                struct bt_component_class_source *comp_cls,
-               bt_component_class_source_message_iterator_seek_ns_from_origin_method method)
+               bt_component_class_source_message_iterator_seek_ns_from_origin_method seek_method,
+               bt_component_class_source_message_iterator_can_seek_ns_from_origin_method can_seek_method)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
-       BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
-       comp_cls->methods.msg_iter_seek_ns_from_origin = method;
-       BT_LIB_LOGD("Set source component class's message iterator \"seek nanoseconds from origin\" method"
+       BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
+       comp_cls->methods.msg_iter_seek_ns_from_origin = seek_method;
+       comp_cls->methods.msg_iter_can_seek_ns_from_origin = can_seek_method;
+       BT_LIB_LOGD("Set source component class's message iterator \"seek nanoseconds from origin\" methods"
                ": %!+C", comp_cls);
        return BT_FUNC_STATUS_OK;
 }
 
 enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_seek_beginning_method(
+bt_component_class_filter_set_message_iterator_seek_beginning_methods(
                struct bt_component_class_filter *comp_cls,
-               bt_component_class_filter_message_iterator_seek_beginning_method method)
+               bt_component_class_filter_message_iterator_seek_beginning_method seek_method,
+               bt_component_class_filter_message_iterator_can_seek_beginning_method can_seek_method)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
-       BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
-       comp_cls->methods.msg_iter_seek_beginning = method;
-       BT_LIB_LOGD("Set filter component class's message iterator \"seek beginning\" method"
+       BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
+       comp_cls->methods.msg_iter_seek_beginning = seek_method;
+       comp_cls->methods.msg_iter_can_seek_beginning = can_seek_method;
+       BT_LIB_LOGD("Set filter component class's message iterator \"seek beginning\" methods"
                ": %!+C", comp_cls);
        return BT_FUNC_STATUS_OK;
 }
 
 enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_seek_beginning_method(
+bt_component_class_source_set_message_iterator_seek_beginning_methods(
                struct bt_component_class_source *comp_cls,
-               bt_component_class_source_message_iterator_seek_beginning_method method)
+               bt_component_class_source_message_iterator_seek_beginning_method seek_method,
+               bt_component_class_source_message_iterator_can_seek_beginning_method can_seek_method)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
-       BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
-       comp_cls->methods.msg_iter_seek_beginning = method;
-       BT_LIB_LOGD("Set source component class's message iterator \"seek beginning\" method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_can_seek_beginning_method(
-               struct bt_component_class_filter *comp_cls,
-               bt_component_class_filter_message_iterator_can_seek_beginning_method method)
-{
-       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
-       BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
-       comp_cls->methods.msg_iter_can_seek_beginning = method;
-       BT_LIB_LOGD("Set filter component class's message iterator \"can seek beginning\" method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_can_seek_beginning_method(
-               struct bt_component_class_source *comp_cls,
-               bt_component_class_source_message_iterator_can_seek_beginning_method method)
-{
-       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
-       BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
-       comp_cls->methods.msg_iter_can_seek_beginning = method;
-       BT_LIB_LOGD("Set source component class's message iterator \"can seek beginning\" method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_can_seek_ns_from_origin_method(
-               struct bt_component_class_filter *comp_cls,
-               bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method method)
-{
-       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
-       BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
-       comp_cls->methods.msg_iter_can_seek_ns_from_origin = method;
-       BT_LIB_LOGD("Set filter component class's message iterator \"can seek nanoseconds from origin\" method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_can_seek_ns_from_origin_method(
-               struct bt_component_class_source *comp_cls,
-               bt_component_class_source_message_iterator_can_seek_ns_from_origin_method method)
-{
-       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
-       BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
-       comp_cls->methods.msg_iter_can_seek_ns_from_origin = method;
-       BT_LIB_LOGD("Set source component class's message iterator \"can seek nanoseconds from origin\" method"
+       BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
+       comp_cls->methods.msg_iter_seek_beginning = seek_method;
+       comp_cls->methods.msg_iter_can_seek_beginning = can_seek_method;
+       BT_LIB_LOGD("Set source component class's message iterator \"seek beginning\" methods"
                ": %!+C", comp_cls);
        return BT_FUNC_STATUS_OK;
 }
@@ -629,7 +626,7 @@ bt_component_class_set_description(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(description, "Description");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        g_string_assign(comp_cls->description, description);
        BT_LIB_LOGD("Set component class's description: "
                "addr=%p, name=\"%s\", type=%s",
@@ -645,7 +642,7 @@ enum bt_component_class_set_help_status bt_component_class_set_help(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(help, "Help");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        g_string_assign(comp_cls->help, help);
        BT_LIB_LOGD("Set component class's help text: %!+C", comp_cls);
        return BT_FUNC_STATUS_OK;
@@ -653,21 +650,21 @@ enum bt_component_class_set_help_status bt_component_class_set_help(
 
 const char *bt_component_class_get_name(const struct bt_component_class *comp_cls)
 {
-       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+       BT_ASSERT_PRE_DEV_NON_NULL(comp_cls, "Component class");
        return comp_cls->name->str;
 }
 
 enum bt_component_class_type bt_component_class_get_type(
                const struct bt_component_class *comp_cls)
 {
-       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+       BT_ASSERT_PRE_DEV_NON_NULL(comp_cls, "Component class");
        return comp_cls->type;
 }
 
 const char *bt_component_class_get_description(
                const struct bt_component_class *comp_cls)
 {
-       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+       BT_ASSERT_PRE_DEV_NON_NULL(comp_cls, "Component class");
        return comp_cls->description &&
                comp_cls->description->str[0] != '\0' ?
                comp_cls->description->str : NULL;
@@ -676,7 +673,7 @@ const char *bt_component_class_get_description(
 const char *bt_component_class_get_help(
                const struct bt_component_class *comp_cls)
 {
-       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+       BT_ASSERT_PRE_DEV_NON_NULL(comp_cls, "Component class");
        return comp_cls->help &&
                comp_cls->help->str[0] != '\0' ? comp_cls->help->str : NULL;
 }
This page took 0.032475 seconds and 4 git commands to generate.