From 21a9f056fd7d86d18aa7a1700c7f47d93eb1adeb Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Thu, 26 Sep 2019 11:39:35 -0400 Subject: [PATCH] Rename `init` methods to `initialize` We use the full word 'finalize' so why not use the full word 'initialize'. Signed-off-by: Francis Deslauriers Change-Id: I741e2406bf53a8da4b74a5335afcd7ec359727ea Reviewed-on: https://review.lttng.org/c/babeltrace/+/2098 Tested-by: jenkins Reviewed-by: Philippe Proulx --- .../graph/component-class-filter.h | 16 +-- .../babeltrace2/graph/component-class-sink.h | 8 +- .../graph/component-class-source.h | 16 +-- include/babeltrace2/graph/component-class.h | 20 ++-- .../graph/component-descriptor-set.h | 2 +- include/babeltrace2/graph/graph.h | 24 ++--- include/babeltrace2/plugin/plugin-dev.h | 100 +++++++++--------- src/bindings/python/bt2/bt2/mip.py | 2 +- .../bt2/bt2/native_bt_component_class.i.h | 28 ++--- .../python/bt2/bt2/native_bt_graph.i.h | 6 +- src/bindings/python/bt2/bt2/native_bt_mip.i | 2 +- src/bindings/python/bt2/bt2/native_bt_mip.i.h | 4 +- src/lib/graph/component-class-sink-simple.c | 8 +- src/lib/graph/component-class-sink-simple.h | 2 +- src/lib/graph/component-class.c | 24 ++--- src/lib/graph/component-class.h | 10 +- src/lib/graph/component-descriptor-set.c | 4 +- src/lib/graph/graph.c | 20 ++-- src/lib/graph/iterator.c | 8 +- src/lib/plugin/plugin-so.c | 48 ++++----- src/lib/plugin/plugin-so.h | 2 +- src/plugins/ctf/fs-sink/fs-sink.c | 48 ++++----- src/plugins/ctf/fs-sink/fs-sink.h | 2 +- src/plugins/ctf/fs-src/fs.c | 22 ++-- src/plugins/ctf/fs-src/fs.h | 4 +- src/plugins/ctf/lttng-live/lttng-live.c | 22 ++-- src/plugins/ctf/lttng-live/lttng-live.h | 4 +- src/plugins/ctf/plugin.c | 10 +- .../lttng-utils/debug-info/debug-info.c | 34 +++--- .../lttng-utils/debug-info/debug-info.h | 4 +- src/plugins/lttng-utils/plugin.c | 4 +- src/plugins/text/details/details.c | 18 ++-- src/plugins/text/details/details.h | 2 +- src/plugins/text/dmesg/dmesg.c | 28 ++--- src/plugins/text/dmesg/dmesg.h | 4 +- src/plugins/text/plugin.c | 8 +- src/plugins/text/pretty/pretty.c | 12 +-- src/plugins/text/pretty/pretty.h | 2 +- src/plugins/utils/counter/counter.c | 16 +-- src/plugins/utils/counter/counter.h | 2 +- src/plugins/utils/dummy/dummy.c | 12 +-- src/plugins/utils/dummy/dummy.h | 2 +- src/plugins/utils/muxer/muxer.c | 40 +++---- src/plugins/utils/muxer/muxer.h | 4 +- src/plugins/utils/plugin.c | 12 +-- src/plugins/utils/trimmer/trimmer.c | 34 +++--- src/plugins/utils/trimmer/trimmer.h | 4 +- tests/lib/plugin.c | 4 +- tests/lib/test-plugin-plugins/minimal.c | 8 +- tests/lib/test-plugin-plugins/sfs.c | 12 +-- tests/lib/test_graph_topo.c | 12 +-- tests/lib/test_simple_sink.c | 30 +++--- tests/lib/test_trace_ir_ref.c | 6 +- 53 files changed, 390 insertions(+), 390 deletions(-) diff --git a/include/babeltrace2/graph/component-class-filter.h b/include/babeltrace2/graph/component-class-filter.h index 1907fc0f..da06f29c 100644 --- a/include/babeltrace2/graph/component-class-filter.h +++ b/include/babeltrace2/graph/component-class-filter.h @@ -44,8 +44,8 @@ typedef bt_component_class_get_supported_mip_versions_method_status bt_logging_level log_level, bt_integer_range_set_unsigned *supported_versions); -typedef bt_component_class_init_method_status -(*bt_component_class_filter_init_method)( +typedef bt_component_class_initialize_method_status +(*bt_component_class_filter_initialize_method)( bt_self_component_filter *self_component, bt_self_component_filter_configuration *config, const bt_value *params, void *init_method_data); @@ -53,8 +53,8 @@ typedef bt_component_class_init_method_status typedef void (*bt_component_class_filter_finalize_method)( bt_self_component_filter *self_component); -typedef bt_component_class_message_iterator_init_method_status -(*bt_component_class_filter_message_iterator_init_method)( +typedef bt_component_class_message_iterator_initialize_method_status +(*bt_component_class_filter_message_iterator_initialize_method)( bt_self_message_iterator *message_iterator, bt_self_message_iterator_configuration *config, bt_self_component_filter *self_component, @@ -125,9 +125,9 @@ bt_component_class_filter_set_get_supported_mip_versions_method( bt_component_class_filter_get_supported_mip_versions_method method); extern bt_component_class_set_method_status -bt_component_class_filter_set_init_method( +bt_component_class_filter_set_initialize_method( bt_component_class_filter *comp_class, - bt_component_class_filter_init_method method); + bt_component_class_filter_initialize_method method); extern bt_component_class_set_method_status bt_component_class_filter_set_finalize_method( @@ -150,9 +150,9 @@ bt_component_class_filter_set_query_method( bt_component_class_filter_query_method method); extern bt_component_class_set_method_status -bt_component_class_filter_set_message_iterator_init_method( +bt_component_class_filter_set_message_iterator_initialize_method( bt_component_class_filter *comp_class, - bt_component_class_filter_message_iterator_init_method method); + bt_component_class_filter_message_iterator_initialize_method method); extern bt_component_class_set_method_status bt_component_class_filter_set_message_iterator_finalize_method( diff --git a/include/babeltrace2/graph/component-class-sink.h b/include/babeltrace2/graph/component-class-sink.h index 3f6b1f2e..aa56d266 100644 --- a/include/babeltrace2/graph/component-class-sink.h +++ b/include/babeltrace2/graph/component-class-sink.h @@ -44,8 +44,8 @@ typedef bt_component_class_get_supported_mip_versions_method_status bt_logging_level log_level, bt_integer_range_set_unsigned *supported_versions); -typedef bt_component_class_init_method_status -(*bt_component_class_sink_init_method)( +typedef bt_component_class_initialize_method_status +(*bt_component_class_sink_initialize_method)( bt_self_component_sink *self_component, bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); @@ -107,9 +107,9 @@ bt_component_class_sink *bt_component_class_sink_create( extern bt_component_class_set_method_status -bt_component_class_sink_set_init_method( +bt_component_class_sink_set_initialize_method( bt_component_class_sink *comp_class, - bt_component_class_sink_init_method method); + bt_component_class_sink_initialize_method method); extern bt_component_class_set_method_status diff --git a/include/babeltrace2/graph/component-class-source.h b/include/babeltrace2/graph/component-class-source.h index 5d7c4161..d4872b1c 100644 --- a/include/babeltrace2/graph/component-class-source.h +++ b/include/babeltrace2/graph/component-class-source.h @@ -44,8 +44,8 @@ typedef bt_component_class_get_supported_mip_versions_method_status bt_logging_level log_level, bt_integer_range_set_unsigned *supported_versions); -typedef bt_component_class_init_method_status -(*bt_component_class_source_init_method)( +typedef bt_component_class_initialize_method_status +(*bt_component_class_source_initialize_method)( bt_self_component_source *self_component, bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data); @@ -53,8 +53,8 @@ typedef bt_component_class_init_method_status typedef void (*bt_component_class_source_finalize_method)( bt_self_component_source *self_component); -typedef bt_component_class_message_iterator_init_method_status -(*bt_component_class_source_message_iterator_init_method)( +typedef bt_component_class_message_iterator_initialize_method_status +(*bt_component_class_source_message_iterator_initialize_method)( bt_self_message_iterator *message_iterator, bt_self_message_iterator_configuration *config, bt_self_component_source *self_component, @@ -119,9 +119,9 @@ bt_component_class_source_set_get_supported_mip_versions_method( bt_component_class_source_get_supported_mip_versions_method method); extern bt_component_class_set_method_status -bt_component_class_source_set_init_method( +bt_component_class_source_set_initialize_method( bt_component_class_source *comp_class, - bt_component_class_source_init_method method); + bt_component_class_source_initialize_method method); extern bt_component_class_set_method_status bt_component_class_source_set_finalize_method( @@ -139,9 +139,9 @@ bt_component_class_source_set_query_method( bt_component_class_source_query_method method); extern bt_component_class_set_method_status -bt_component_class_source_set_message_iterator_init_method( +bt_component_class_source_set_message_iterator_initialize_method( bt_component_class_source *comp_class, - bt_component_class_source_message_iterator_init_method method); + bt_component_class_source_message_iterator_initialize_method method); extern bt_component_class_set_method_status bt_component_class_source_set_message_iterator_finalize_method( diff --git a/include/babeltrace2/graph/component-class.h b/include/babeltrace2/graph/component-class.h index 324f1238..b68439e8 100644 --- a/include/babeltrace2/graph/component-class.h +++ b/include/babeltrace2/graph/component-class.h @@ -39,11 +39,11 @@ typedef enum bt_component_class_get_supported_mip_versions_method_status { BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, } bt_component_class_get_supported_mip_versions_method_status; -typedef enum bt_component_class_init_method_status { - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, -} bt_component_class_init_method_status; +typedef enum bt_component_class_initialize_method_status { + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, +} bt_component_class_initialize_method_status; typedef enum bt_component_class_port_connected_method_status { BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, @@ -59,11 +59,11 @@ typedef enum bt_component_class_query_method_status { BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT = __BT_FUNC_STATUS_UNKNOWN_OBJECT, } bt_component_class_query_method_status; -typedef enum bt_component_class_message_iterator_init_method_status { - BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, - BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, - BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, -} bt_component_class_message_iterator_init_method_status; +typedef enum bt_component_class_message_iterator_initialize_method_status { + BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, + BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, + BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, +} bt_component_class_message_iterator_initialize_method_status; typedef enum bt_component_class_message_iterator_next_method_status { BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, diff --git a/include/babeltrace2/graph/component-descriptor-set.h b/include/babeltrace2/graph/component-descriptor-set.h index 44b5ec76..e551a70b 100644 --- a/include/babeltrace2/graph/component-descriptor-set.h +++ b/include/babeltrace2/graph/component-descriptor-set.h @@ -48,7 +48,7 @@ bt_component_descriptor_set_add_descriptor( const bt_value *params); extern bt_component_descriptor_set_add_descriptor_status -bt_component_descriptor_set_add_descriptor_with_init_method_data( +bt_component_descriptor_set_add_descriptor_with_initialize_method_data( bt_component_descriptor_set *comp_descriptor_set, const bt_component_class *component_class, const bt_value *params, void *init_method_data); diff --git a/include/babeltrace2/graph/graph.h b/include/babeltrace2/graph/graph.h index 1c03a21e..9ef943d7 100644 --- a/include/babeltrace2/graph/graph.h +++ b/include/babeltrace2/graph/graph.h @@ -91,14 +91,14 @@ typedef bt_graph_listener_func_status typedef void (* bt_graph_listener_removed_func)(void *data); -typedef enum bt_graph_simple_sink_component_init_func_status { - BT_GRAPH_SIMPLE_SINK_COMPONENT_INIT_FUNC_STATUS_OK = __BT_FUNC_STATUS_OK, - BT_GRAPH_SIMPLE_SINK_COMPONENT_INIT_FUNC_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, - BT_GRAPH_SIMPLE_SINK_COMPONENT_INIT_FUNC_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, -} bt_graph_simple_sink_component_init_func_status; - -typedef bt_graph_simple_sink_component_init_func_status -(*bt_graph_simple_sink_component_init_func)( +typedef enum bt_graph_simple_sink_component_initialize_func_status { + BT_GRAPH_SIMPLE_SINK_COMPONENT_INITIALIZE_FUNC_STATUS_OK = __BT_FUNC_STATUS_OK, + BT_GRAPH_SIMPLE_SINK_COMPONENT_INITIALIZE_FUNC_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, + BT_GRAPH_SIMPLE_SINK_COMPONENT_INITIALIZE_FUNC_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, +} bt_graph_simple_sink_component_initialize_func_status; + +typedef bt_graph_simple_sink_component_initialize_func_status +(*bt_graph_simple_sink_component_initialize_func)( bt_self_component_port_input_message_iterator *iterator, void *data); @@ -132,7 +132,7 @@ bt_graph_add_source_component(bt_graph *graph, bt_logging_level log_level, const bt_component_source **component); extern bt_graph_add_component_status -bt_graph_add_source_component_with_init_method_data( +bt_graph_add_source_component_with_initialize_method_data( bt_graph *graph, const bt_component_class_source *component_class, const char *name, const bt_value *params, @@ -147,7 +147,7 @@ bt_graph_add_filter_component(bt_graph *graph, const bt_component_filter **component); extern bt_graph_add_component_status -bt_graph_add_filter_component_with_init_method_data( +bt_graph_add_filter_component_with_initialize_method_data( bt_graph *graph, const bt_component_class_filter *component_class, const char *name, const bt_value *params, @@ -162,7 +162,7 @@ bt_graph_add_sink_component( const bt_component_sink **component); extern bt_graph_add_component_status -bt_graph_add_sink_component_with_init_method_data( +bt_graph_add_sink_component_with_initialize_method_data( bt_graph *graph, const bt_component_class_sink *component_class, const char *name, const bt_value *params, void *init_method_data, bt_logging_level log_level, @@ -170,7 +170,7 @@ bt_graph_add_sink_component_with_init_method_data( extern bt_graph_add_component_status bt_graph_add_simple_sink_component(bt_graph *graph, const char *name, - bt_graph_simple_sink_component_init_func init_func, + bt_graph_simple_sink_component_initialize_func init_func, bt_graph_simple_sink_component_consume_func consume_func, bt_graph_simple_sink_component_finalize_func finalize_func, void *user_data, const bt_component_sink **component); diff --git a/include/babeltrace2/plugin/plugin-dev.h b/include/babeltrace2/plugin/plugin-dev.h index d1ea5988..338423bc 100644 --- a/include/babeltrace2/plugin/plugin-dev.h +++ b/include/babeltrace2/plugin/plugin-dev.h @@ -58,13 +58,13 @@ extern "C" { #define __BT_PLUGIN_VERSION_MINOR 0 /* Plugin initialization function type */ -typedef enum bt_plugin_init_func_status { - BT_PLUGIN_INIT_FUNC_STATUS_OK = __BT_FUNC_STATUS_OK, - BT_PLUGIN_INIT_FUNC_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, - BT_PLUGIN_INIT_FUNC_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, -} bt_plugin_init_func_status; +typedef enum bt_plugin_initialize_func_status { + BT_PLUGIN_INITIALIZE_FUNC_STATUS_OK = __BT_FUNC_STATUS_OK, + BT_PLUGIN_INITIALIZE_FUNC_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, + BT_PLUGIN_INITIALIZE_FUNC_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, +} bt_plugin_initialize_func_status; -typedef bt_plugin_init_func_status (*bt_plugin_init_func)( +typedef bt_plugin_initialize_func_status (*bt_plugin_initialize_func)( bt_self_plugin *plugin); /* Plugin exit function type */ @@ -114,7 +114,7 @@ struct __bt_plugin_descriptor_attribute { /* Attribute's value (depends on attribute's type) */ union { /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT */ - bt_plugin_init_func init; + bt_plugin_initialize_func init; /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT */ bt_plugin_exit_func exit; @@ -171,13 +171,13 @@ enum __bt_plugin_component_class_descriptor_attribute_type { BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION = 0, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP = 1, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD = 2, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD = 3, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD = 3, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD = 4, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD = 5, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD = 6, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD = 7, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD = 8, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD = 9, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD = 9, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD = 10, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD = 11, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD = 12, @@ -212,10 +212,10 @@ struct __bt_plugin_component_class_descriptor_attribute { bt_component_class_filter_get_supported_mip_versions_method filter_get_supported_mip_versions_method; bt_component_class_sink_get_supported_mip_versions_method sink_get_supported_mip_versions_method; - /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD */ - bt_component_class_source_init_method source_init_method; - bt_component_class_filter_init_method filter_init_method; - bt_component_class_sink_init_method sink_init_method; + /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD */ + bt_component_class_source_initialize_method source_initialize_method; + bt_component_class_filter_initialize_method filter_initialize_method; + bt_component_class_sink_initialize_method sink_initialize_method; /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD */ bt_component_class_source_finalize_method source_finalize_method; @@ -238,9 +238,9 @@ struct __bt_plugin_component_class_descriptor_attribute { /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD */ bt_component_class_sink_graph_is_configured_method sink_graph_is_configured_method; - /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD */ - bt_component_class_source_message_iterator_init_method source_msg_iter_init_method; - bt_component_class_filter_message_iterator_init_method filter_msg_iter_init_method; + /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD */ + bt_component_class_source_message_iterator_initialize_method source_msg_iter_initialize_method; + bt_component_class_filter_message_iterator_initialize_method filter_msg_iter_initialize_method; /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD */ bt_component_class_source_message_iterator_finalize_method source_msg_iter_finalize_method; @@ -461,9 +461,9 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ * specific plugin descriptor. * * _id: Plugin descriptor ID (C identifier). - * _x: Initialization function (bt_plugin_init_func). + * _x: Initialization function (bt_plugin_initialize_func). */ -#define BT_PLUGIN_INIT_WITH_ID(_id, _x) \ +#define BT_PLUGIN_INITIALIZE_WITH_ID(_id, _x) \ __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(init, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT, _id, _x) /* @@ -666,10 +666,10 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ * * _id: Plugin descriptor ID (C identifier). * _comp_class_id: Component class descriptor ID (C identifier). - * _x: Initialization method (bt_component_class_source_init_method). + * _x: Initialization method (bt_component_class_source_initialize_method). */ -#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \ - __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, source, _x) +#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \ + __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD, _id, _comp_class_id, source, _x) /* * Defines an initialization method attribute attached to a specific @@ -677,10 +677,10 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ * * _id: Plugin descriptor ID (C identifier). * _comp_class_id: Component class descriptor ID (C identifier). - * _x: Initialization method (bt_component_class_filter_init_method). + * _x: Initialization method (bt_component_class_filter_initialize_method). */ -#define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \ - __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, filter, _x) +#define BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \ + __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD, _id, _comp_class_id, filter, _x) /* * Defines an initialization method attribute attached to a specific @@ -688,10 +688,10 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ * * _id: Plugin descriptor ID (C identifier). * _comp_class_id: Component class descriptor ID (C identifier). - * _x: Initialization method (bt_component_class_sink_init_method). + * _x: Initialization method (bt_component_class_sink_initialize_method). */ -#define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \ - __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, sink, _x) +#define BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \ + __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD, _id, _comp_class_id, sink, _x) /* * Defines a "get supported MIP versions" attribute attached to a @@ -859,10 +859,10 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ * _id: Plugin descriptor ID (C identifier). * _comp_class_id: Component class descriptor ID (C identifier). * _x: Iterator initialization method - * (bt_component_class_source_message_iterator_init_method). + * (bt_component_class_source_message_iterator_initialize_method). */ -#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \ - __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD, _id, _comp_class_id, source, _x) +#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \ + __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD, _id, _comp_class_id, source, _x) /* * Defines an iterator finalize method attribute attached to a specific @@ -931,10 +931,10 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ * _id: Plugin descriptor ID (C identifier). * _comp_class_id: Component class descriptor ID (C identifier). * _x: Iterator initialization method - * (bt_component_class_filter_message_iterator_init_method). + * (bt_component_class_filter_message_iterator_initialize_method). */ -#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \ - __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_msg_iter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD, _id, _comp_class_id, filter, _x) +#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \ + __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_msg_iter_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD, _id, _comp_class_id, filter, _x) /* * Defines an iterator finalize method attribute attached to a specific @@ -1007,9 +1007,9 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ * Defines a plugin initialization function attribute attached to the * automatic plugin descriptor. * - * _x: Initialization function (bt_plugin_init_func). + * _x: Initialization function (bt_plugin_initialize_func). */ -#define BT_PLUGIN_INIT(_x) BT_PLUGIN_INIT_WITH_ID(auto, _x) +#define BT_PLUGIN_INITIALIZE(_x) BT_PLUGIN_INITIALIZE_WITH_ID(auto, _x) /* * Defines a plugin exit function attribute attached to the automatic @@ -1156,10 +1156,10 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ * descriptor. * * _name: Component class name (C identifier). - * _x: Initialization method (bt_component_class_source_init_method). + * _x: Initialization method (bt_component_class_source_initialize_method). */ -#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD(_name, _x) \ - BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x) +#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD(_name, _x) \ + BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(auto, _name, _x) /* * Defines an initialization method attribute attached to a filter @@ -1167,10 +1167,10 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ * descriptor. * * _name: Component class name (C identifier). - * _x: Initialization method (bt_component_class_filter_init_method). + * _x: Initialization method (bt_component_class_filter_initialize_method). */ -#define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD(_name, _x) \ - BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x) +#define BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD(_name, _x) \ + BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(auto, _name, _x) /* * Defines an initialization method attribute attached to a sink @@ -1178,10 +1178,10 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ * descriptor. * * _name: Component class name (C identifier). - * _x: Initialization method (bt_component_class_sink_init_method). + * _x: Initialization method (bt_component_class_sink_initialize_method). */ -#define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(_name, _x) \ - BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x) +#define BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD(_name, _x) \ + BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(auto, _name, _x) /* * Defines a "get supported MIP versions" method attribute attached to a @@ -1344,10 +1344,10 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ * * _name: Component class name (C identifier). * _x: Iterator initialization method - * (bt_component_class_source_message_iterator_init_method). + * (bt_component_class_source_message_iterator_initialize_method). */ -#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(_name, _x) \ - BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x) +#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD(_name, _x) \ + BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_WITH_ID(auto, _name, _x) /* * Defines an iterator finalize method attribute attached to a source @@ -1416,10 +1416,10 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ * * _name: Component class name (C identifier). * _x: Iterator initialization method - * (bt_component_class_filter_message_iterator_init_method). + * (bt_component_class_filter_message_iterator_initialize_method). */ -#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(_name, _x) \ - BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x) +#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD(_name, _x) \ + BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_WITH_ID(auto, _name, _x) /* * Defines an iterator finalize method attribute attached to a filter diff --git a/src/bindings/python/bt2/bt2/mip.py b/src/bindings/python/bt2/bt2/mip.py index 92997f17..fabb0e22 100644 --- a/src/bindings/python/bt2/bt2/mip.py +++ b/src/bindings/python/bt2/bt2/mip.py @@ -47,7 +47,7 @@ def get_greatest_operative_mip_version( if descr.params is not None: params_ptr = descr.params._ptr - status = native_bt.bt2_component_descriptor_set_add_descriptor_with_init_method_data( + status = native_bt.bt2_component_descriptor_set_add_descriptor_with_initialize_method_data( comp_descr_set_ptr, base_cc_ptr, params_ptr, descr.obj ) utils._handle_func_status( diff --git a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h index 15ad4290..4a0fdbcd 100644 --- a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h @@ -193,7 +193,7 @@ bool bt_bt2_is_python_component_class(const bt_component_class *comp_cls) /* Component class proxy methods (delegate to the attached Python object) */ static -bt_component_class_init_method_status component_class_init( +bt_component_class_initialize_method_status component_class_init( bt_self_component *self_component, void *self_component_v, swig_type_info *self_comp_cls_type_swig_type, @@ -202,7 +202,7 @@ bt_component_class_init_method_status component_class_init( { const bt_component *component = bt_self_component_as_component(self_component); const bt_component_class *component_class = bt_component_borrow_class_const(component); - bt_component_class_init_method_status status = __BT_FUNC_STATUS_OK; + bt_component_class_initialize_method_status status = __BT_FUNC_STATUS_OK; PyObject *py_cls = NULL; PyObject *py_comp = NULL; PyObject *py_params_ptr = NULL; @@ -449,7 +449,7 @@ component_class_sink_get_supported_mip_versions( */ static -bt_component_class_init_method_status component_class_source_init( +bt_component_class_initialize_method_status component_class_source_init( bt_self_component_source *self_component_source, bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data) @@ -463,7 +463,7 @@ bt_component_class_init_method_status component_class_source_init( } static -bt_component_class_init_method_status component_class_filter_init( +bt_component_class_initialize_method_status component_class_filter_init( bt_self_component_filter *self_component_filter, bt_self_component_filter_configuration *config, const bt_value *params, void *init_method_data) @@ -477,7 +477,7 @@ bt_component_class_init_method_status component_class_filter_init( } static -bt_component_class_init_method_status component_class_sink_init( +bt_component_class_initialize_method_status component_class_sink_init( bt_self_component_sink *self_component_sink, bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data) @@ -932,14 +932,14 @@ bt_component_class_query_method_status component_class_sink_query( } static -bt_component_class_message_iterator_init_method_status +bt_component_class_message_iterator_initialize_method_status component_class_message_iterator_init( bt_self_message_iterator *self_message_iterator, bt_self_message_iterator_configuration *config, bt_self_component *self_component, bt_self_component_port_output *self_component_port_output) { - bt_component_class_message_iterator_init_method_status status = __BT_FUNC_STATUS_OK; + bt_component_class_message_iterator_initialize_method_status status = __BT_FUNC_STATUS_OK; PyObject *py_comp_cls = NULL; PyObject *py_iter_cls = NULL; PyObject *py_iter_ptr = NULL; @@ -1086,7 +1086,7 @@ end: } static -bt_component_class_message_iterator_init_method_status +bt_component_class_message_iterator_initialize_method_status component_class_source_message_iterator_init( bt_self_message_iterator *self_message_iterator, bt_self_message_iterator_configuration *config, @@ -1101,7 +1101,7 @@ component_class_source_message_iterator_init( } static -bt_component_class_message_iterator_init_method_status +bt_component_class_message_iterator_initialize_method_status component_class_filter_message_iterator_init( bt_self_message_iterator *self_message_iterator, bt_self_message_iterator_configuration *config, @@ -1263,7 +1263,7 @@ bt_component_class_source *bt_bt2_component_class_source_create( goto end; } - ret = bt_component_class_source_set_init_method(component_class_source, component_class_source_init); + ret = bt_component_class_source_set_initialize_method(component_class_source, component_class_source_init); BT_ASSERT(ret == 0); ret = bt_component_class_source_set_finalize_method(component_class_source, component_class_source_finalize); BT_ASSERT(ret == 0); @@ -1285,7 +1285,7 @@ bt_component_class_source *bt_bt2_component_class_source_create( BT_ASSERT(ret == 0); ret = bt_component_class_source_set_get_supported_mip_versions_method(component_class_source, component_class_source_get_supported_mip_versions); BT_ASSERT(ret == 0); - ret = bt_component_class_source_set_message_iterator_init_method( + ret = bt_component_class_source_set_message_iterator_initialize_method( component_class_source, component_class_source_message_iterator_init); BT_ASSERT(ret == 0); ret = bt_component_class_source_set_message_iterator_finalize_method( @@ -1320,7 +1320,7 @@ bt_component_class_filter *bt_bt2_component_class_filter_create( goto end; } - ret = bt_component_class_filter_set_init_method(component_class_filter, component_class_filter_init); + ret = bt_component_class_filter_set_initialize_method(component_class_filter, component_class_filter_init); BT_ASSERT(ret == 0); ret = bt_component_class_filter_set_finalize_method (component_class_filter, component_class_filter_finalize); BT_ASSERT(ret == 0); @@ -1345,7 +1345,7 @@ bt_component_class_filter *bt_bt2_component_class_filter_create( BT_ASSERT(ret == 0); ret = bt_component_class_filter_set_get_supported_mip_versions_method(component_class_filter, component_class_filter_get_supported_mip_versions); BT_ASSERT(ret == 0); - ret = bt_component_class_filter_set_message_iterator_init_method( + ret = bt_component_class_filter_set_message_iterator_initialize_method( component_class_filter, component_class_filter_message_iterator_init); BT_ASSERT(ret == 0); ret = bt_component_class_filter_set_message_iterator_finalize_method( @@ -1380,7 +1380,7 @@ bt_component_class_sink *bt_bt2_component_class_sink_create( goto end; } - ret = bt_component_class_sink_set_init_method(component_class_sink, component_class_sink_init); + ret = bt_component_class_sink_set_initialize_method(component_class_sink, component_class_sink_init); BT_ASSERT(ret == 0); ret = bt_component_class_sink_set_finalize_method(component_class_sink, component_class_sink_finalize); BT_ASSERT(ret == 0); diff --git a/src/bindings/python/bt2/bt2/native_bt_graph.i.h b/src/bindings/python/bt2/bt2/native_bt_graph.i.h index a7193497..0bd8a0b2 100644 --- a/src/bindings/python/bt2/bt2/native_bt_graph.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_graph.i.h @@ -523,7 +523,7 @@ bt_bt2_graph_add_source_component( PyObject *obj, bt_logging_level log_level, const bt_component_source **component) { - return bt_graph_add_source_component_with_init_method_data(graph, + return bt_graph_add_source_component_with_initialize_method_data(graph, component_class, name, params, obj == Py_None ? NULL : obj, log_level, component); } @@ -537,7 +537,7 @@ bt_bt2_graph_add_filter_component( PyObject *obj, bt_logging_level log_level, const bt_component_filter **component) { - return bt_graph_add_filter_component_with_init_method_data(graph, + return bt_graph_add_filter_component_with_initialize_method_data(graph, component_class, name, params, obj == Py_None ? NULL : obj, log_level, component); } @@ -551,7 +551,7 @@ bt_bt2_graph_add_sink_component( PyObject *obj, bt_logging_level log_level, const bt_component_sink **component) { - return bt_graph_add_sink_component_with_init_method_data(graph, + return bt_graph_add_sink_component_with_initialize_method_data(graph, component_class, name, params, obj == Py_None ? NULL : obj, log_level, component); } diff --git a/src/bindings/python/bt2/bt2/native_bt_mip.i b/src/bindings/python/bt2/bt2/native_bt_mip.i index 72087fe1..77cd251c 100644 --- a/src/bindings/python/bt2/bt2/native_bt_mip.i +++ b/src/bindings/python/bt2/bt2/native_bt_mip.i @@ -31,7 +31,7 @@ %} bt_component_descriptor_set_add_descriptor_status -bt_bt2_component_descriptor_set_add_descriptor_with_init_method_data( +bt_bt2_component_descriptor_set_add_descriptor_with_initialize_method_data( bt_component_descriptor_set *comp_descr_set, const bt_component_class *comp_cls, const bt_value *params, PyObject *init_method_data); diff --git a/src/bindings/python/bt2/bt2/native_bt_mip.i.h b/src/bindings/python/bt2/bt2/native_bt_mip.i.h index b0b55dc2..ad9bec9d 100644 --- a/src/bindings/python/bt2/bt2/native_bt_mip.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_mip.i.h @@ -24,11 +24,11 @@ static bt_component_descriptor_set_add_descriptor_status -bt_bt2_component_descriptor_set_add_descriptor_with_init_method_data( +bt_bt2_component_descriptor_set_add_descriptor_with_initialize_method_data( bt_component_descriptor_set *comp_descr_set, const bt_component_class *comp_cls, const bt_value *params, PyObject *obj) { - return bt_component_descriptor_set_add_descriptor_with_init_method_data( + return bt_component_descriptor_set_add_descriptor_with_initialize_method_data( comp_descr_set, comp_cls, params, obj == Py_None ? NULL : obj); } diff --git a/src/lib/graph/component-class-sink-simple.c b/src/lib/graph/component-class-sink-simple.c index 6a9d2e53..27b32808 100644 --- a/src/lib/graph/component-class-sink-simple.c +++ b/src/lib/graph/component-class-sink-simple.c @@ -51,7 +51,7 @@ struct simple_sink_data { }; static -enum bt_component_class_init_method_status simple_sink_init( +enum bt_component_class_initialize_method_status simple_sink_init( bt_self_component_sink *self_comp, bt_self_component_sink_configuration *config, const struct bt_value *params, void *init_method_data) @@ -141,12 +141,12 @@ simple_sink_graph_is_configured( } if (data->init_method_data.init_func) { - bt_graph_simple_sink_component_init_func_status init_status; + bt_graph_simple_sink_component_initialize_func_status init_status; /* Call user's initialization function */ init_status = data->init_method_data.init_func(data->msg_iter, data->init_method_data.user_data); - if (init_status != BT_GRAPH_SIMPLE_SINK_COMPONENT_INIT_FUNC_STATUS_OK) { + if (init_status != BT_GRAPH_SIMPLE_SINK_COMPONENT_INITIALIZE_FUNC_STATUS_OK) { BT_LIB_LOGW_APPEND_CAUSE( "Simple sink component's user's initialization function failed: " "status=%s, %![comp-]+c, %![port-]+p", @@ -204,7 +204,7 @@ struct bt_component_class_sink *bt_component_class_sink_simple_borrow(void) goto end; } - set_method_status = bt_component_class_sink_set_init_method( + set_method_status = bt_component_class_sink_set_initialize_method( simple_comp_cls, simple_sink_init); BT_ASSERT(set_method_status == BT_FUNC_STATUS_OK); set_method_status = bt_component_class_sink_set_finalize_method( diff --git a/src/lib/graph/component-class-sink-simple.h b/src/lib/graph/component-class-sink-simple.h index 9910484f..a6c527de 100644 --- a/src/lib/graph/component-class-sink-simple.h +++ b/src/lib/graph/component-class-sink-simple.h @@ -28,7 +28,7 @@ #include struct simple_sink_init_method_data { - bt_graph_simple_sink_component_init_func init_func; + bt_graph_simple_sink_component_initialize_func init_func; bt_graph_simple_sink_component_consume_func consume_func; bt_graph_simple_sink_component_finalize_func finalize_func; void *user_data; diff --git a/src/lib/graph/component-class.c b/src/lib/graph/component-class.c index 8b5abf9b..be4bbe7a 100644 --- a/src/lib/graph/component-class.c +++ b/src/lib/graph/component-class.c @@ -304,9 +304,9 @@ bt_component_class_sink_set_get_supported_mip_versions_method( } enum bt_component_class_set_method_status -bt_component_class_source_set_init_method( +bt_component_class_source_set_initialize_method( struct bt_component_class_source *comp_cls, - bt_component_class_source_init_method method) + bt_component_class_source_initialize_method method) { BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class"); BT_ASSERT_PRE_NON_NULL(method, "Method"); @@ -318,9 +318,9 @@ 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"); @@ -332,9 +332,9 @@ 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"); @@ -500,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_DEV_COMP_CLS_HOT(comp_cls); - comp_cls->methods.msg_iter_init = method; + 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_DEV_COMP_CLS_HOT(comp_cls); - comp_cls->methods.msg_iter_init = method; + 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; diff --git a/src/lib/graph/component-class.h b/src/lib/graph/component-class.h index 7d494aa3..6536a231 100644 --- a/src/lib/graph/component-class.h +++ b/src/lib/graph/component-class.h @@ -67,9 +67,9 @@ struct bt_component_class_source { struct bt_component_class parent; struct { bt_component_class_source_get_supported_mip_versions_method get_supported_mip_versions; - bt_component_class_source_init_method init; + bt_component_class_source_initialize_method init; bt_component_class_source_finalize_method finalize; - bt_component_class_source_message_iterator_init_method msg_iter_init; + bt_component_class_source_message_iterator_initialize_method msg_iter_initialize; bt_component_class_source_message_iterator_finalize_method msg_iter_finalize; bt_component_class_source_message_iterator_next_method msg_iter_next; bt_component_class_source_message_iterator_seek_ns_from_origin_method msg_iter_seek_ns_from_origin; @@ -85,7 +85,7 @@ struct bt_component_class_sink { struct bt_component_class parent; struct { bt_component_class_sink_get_supported_mip_versions_method get_supported_mip_versions; - bt_component_class_sink_init_method init; + bt_component_class_sink_initialize_method init; bt_component_class_sink_finalize_method finalize; bt_component_class_sink_query_method query; bt_component_class_sink_input_port_connected_method input_port_connected; @@ -98,9 +98,9 @@ struct bt_component_class_filter { struct bt_component_class parent; struct { bt_component_class_filter_get_supported_mip_versions_method get_supported_mip_versions; - bt_component_class_filter_init_method init; + bt_component_class_filter_initialize_method init; bt_component_class_filter_finalize_method finalize; - bt_component_class_filter_message_iterator_init_method msg_iter_init; + bt_component_class_filter_message_iterator_initialize_method msg_iter_initialize; bt_component_class_filter_message_iterator_finalize_method msg_iter_finalize; bt_component_class_filter_message_iterator_next_method msg_iter_next; bt_component_class_filter_message_iterator_seek_ns_from_origin_method msg_iter_seek_ns_from_origin; diff --git a/src/lib/graph/component-descriptor-set.c b/src/lib/graph/component-descriptor-set.c index 34ae2499..b0668a5a 100644 --- a/src/lib/graph/component-descriptor-set.c +++ b/src/lib/graph/component-descriptor-set.c @@ -129,7 +129,7 @@ end: } enum bt_component_descriptor_set_add_descriptor_status -bt_component_descriptor_set_add_descriptor_with_init_method_data( +bt_component_descriptor_set_add_descriptor_with_initialize_method_data( struct bt_component_descriptor_set *comp_descr_set, const struct bt_component_class *comp_cls, const struct bt_value *params, void *init_method_data) @@ -214,7 +214,7 @@ bt_component_descriptor_set_add_descriptor( const struct bt_component_class *comp_cls, const struct bt_value *params) { - return bt_component_descriptor_set_add_descriptor_with_init_method_data( + return bt_component_descriptor_set_add_descriptor_with_initialize_method_data( comp_descr_set, comp_cls, params, NULL); } diff --git a/src/lib/graph/graph.c b/src/lib/graph/graph.c index b3e41d32..591b65d2 100644 --- a/src/lib/graph/graph.c +++ b/src/lib/graph/graph.c @@ -58,7 +58,7 @@ typedef enum bt_graph_listener_func_status (*ports_connected_func_t)(const void *, const void *, const void *, const void *, void *); -typedef enum bt_component_class_init_method_status +typedef enum bt_component_class_initialize_method_status (*comp_init_method_t)(const void *, void *, const void *, void *); struct bt_graph_listener { @@ -1274,7 +1274,7 @@ int add_component_with_init_method_data( const struct bt_component **user_component) { int status = BT_FUNC_STATUS_OK; - enum bt_component_class_init_method_status init_status; + enum bt_component_class_initialize_method_status init_status; struct bt_component *component = NULL; int ret; bool init_can_consume; @@ -1402,7 +1402,7 @@ end: } enum bt_graph_add_component_status -bt_graph_add_source_component_with_init_method_data( +bt_graph_add_source_component_with_initialize_method_data( struct bt_graph *graph, const struct bt_component_class_source *comp_cls, const char *name, const struct bt_value *params, @@ -1422,12 +1422,12 @@ enum bt_graph_add_component_status bt_graph_add_source_component( enum bt_logging_level log_level, const struct bt_component_source **component) { - return bt_graph_add_source_component_with_init_method_data( + return bt_graph_add_source_component_with_initialize_method_data( graph, comp_cls, name, params, NULL, log_level, component); } enum bt_graph_add_component_status -bt_graph_add_filter_component_with_init_method_data( +bt_graph_add_filter_component_with_initialize_method_data( struct bt_graph *graph, const struct bt_component_class_filter *comp_cls, const char *name, const struct bt_value *params, @@ -1447,12 +1447,12 @@ enum bt_graph_add_component_status bt_graph_add_filter_component( enum bt_logging_level log_level, const struct bt_component_filter **component) { - return bt_graph_add_filter_component_with_init_method_data( + return bt_graph_add_filter_component_with_initialize_method_data( graph, comp_cls, name, params, NULL, log_level, component); } enum bt_graph_add_component_status -bt_graph_add_sink_component_with_init_method_data( +bt_graph_add_sink_component_with_initialize_method_data( struct bt_graph *graph, const struct bt_component_class_sink *comp_cls, const char *name, const struct bt_value *params, @@ -1472,13 +1472,13 @@ enum bt_graph_add_component_status bt_graph_add_sink_component( enum bt_logging_level log_level, const struct bt_component_sink **component) { - return bt_graph_add_sink_component_with_init_method_data( + return bt_graph_add_sink_component_with_initialize_method_data( graph, comp_cls, name, params, NULL, log_level, component); } enum bt_graph_add_component_status bt_graph_add_simple_sink_component(struct bt_graph *graph, const char *name, - bt_graph_simple_sink_component_init_func init_func, + bt_graph_simple_sink_component_initialize_func init_func, bt_graph_simple_sink_component_consume_func consume_func, bt_graph_simple_sink_component_finalize_func finalize_func, void *user_data, const bt_component_sink **component) @@ -1506,7 +1506,7 @@ bt_graph_add_simple_sink_component(struct bt_graph *graph, const char *name, goto end; } - status = bt_graph_add_sink_component_with_init_method_data(graph, + status = bt_graph_add_sink_component_with_initialize_method_data(graph, comp_cls, name, NULL, &init_method_data, BT_LOGGING_LEVEL_NONE, component); diff --git a/src/lib/graph/iterator.c b/src/lib/graph/iterator.c index 8af6166a..cb0c6523 100644 --- a/src/lib/graph/iterator.c +++ b/src/lib/graph/iterator.c @@ -298,7 +298,7 @@ int create_self_component_input_port_message_iterator( struct bt_self_component_port_input *self_port, struct bt_self_component_port_input_message_iterator **message_iterator) { - typedef enum bt_component_class_message_iterator_init_method_status (*init_method_t)( + typedef enum bt_component_class_message_iterator_initialize_method_status (*init_method_t)( void *, void *, void *, void *); init_method_t init_method = NULL; @@ -451,7 +451,7 @@ int create_self_component_input_port_message_iterator( (void *) upstream_comp_cls; init_method = - (init_method_t) src_comp_cls->methods.msg_iter_init; + (init_method_t) src_comp_cls->methods.msg_iter_initialize; break; } case BT_COMPONENT_CLASS_TYPE_FILTER: @@ -460,7 +460,7 @@ int create_self_component_input_port_message_iterator( (void *) upstream_comp_cls; init_method = - (init_method_t) flt_comp_cls->methods.msg_iter_init; + (init_method_t) flt_comp_cls->methods.msg_iter_initialize; break; } default: @@ -469,7 +469,7 @@ int create_self_component_input_port_message_iterator( } if (init_method) { - enum bt_component_class_message_iterator_init_method_status iter_status; + enum bt_component_class_message_iterator_initialize_method_status iter_status; BT_LIB_LOGD("Calling user's initialization method: %!+i", iterator); iter_status = init_method(iterator, &iterator->config, upstream_comp, diff --git a/src/lib/plugin/plugin-so.c b/src/lib/plugin/plugin-so.c index 01db0d0a..0f6ec1c6 100644 --- a/src/lib/plugin/plugin-so.c +++ b/src/lib/plugin/plugin-so.c @@ -289,11 +289,11 @@ int bt_plugin_so_init(struct bt_plugin *plugin, union { struct { bt_component_class_source_get_supported_mip_versions_method get_supported_mip_versions; - bt_component_class_source_init_method init; + bt_component_class_source_initialize_method init; bt_component_class_source_finalize_method finalize; bt_component_class_source_query_method query; bt_component_class_source_output_port_connected_method output_port_connected; - bt_component_class_source_message_iterator_init_method msg_iter_init; + bt_component_class_source_message_iterator_initialize_method msg_iter_initialize; bt_component_class_source_message_iterator_finalize_method msg_iter_finalize; bt_component_class_source_message_iterator_seek_ns_from_origin_method msg_iter_seek_ns_from_origin; bt_component_class_source_message_iterator_seek_beginning_method msg_iter_seek_beginning; @@ -303,12 +303,12 @@ int bt_plugin_so_init(struct bt_plugin *plugin, struct { bt_component_class_filter_get_supported_mip_versions_method get_supported_mip_versions; - bt_component_class_filter_init_method init; + bt_component_class_filter_initialize_method init; bt_component_class_filter_finalize_method finalize; bt_component_class_filter_query_method query; bt_component_class_filter_input_port_connected_method input_port_connected; bt_component_class_filter_output_port_connected_method output_port_connected; - bt_component_class_filter_message_iterator_init_method msg_iter_init; + bt_component_class_filter_message_iterator_initialize_method msg_iter_initialize; bt_component_class_filter_message_iterator_finalize_method msg_iter_finalize; bt_component_class_filter_message_iterator_seek_ns_from_origin_method msg_iter_seek_ns_from_origin; bt_component_class_filter_message_iterator_seek_beginning_method msg_iter_seek_beginning; @@ -318,7 +318,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin, struct { bt_component_class_sink_get_supported_mip_versions_method get_supported_mip_versions; - bt_component_class_sink_init_method init; + bt_component_class_sink_initialize_method init; bt_component_class_sink_finalize_method finalize; bt_component_class_sink_query_method query; bt_component_class_sink_input_port_connected_method input_port_connected; @@ -509,19 +509,19 @@ int bt_plugin_so_init(struct bt_plugin *plugin, abort(); } break; - case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD: + case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD: switch (cc_type) { case BT_COMPONENT_CLASS_TYPE_SOURCE: cc_full_descr->methods.source.init = - cur_cc_descr_attr->value.source_init_method; + cur_cc_descr_attr->value.source_initialize_method; break; case BT_COMPONENT_CLASS_TYPE_FILTER: cc_full_descr->methods.filter.init = - cur_cc_descr_attr->value.filter_init_method; + cur_cc_descr_attr->value.filter_initialize_method; break; case BT_COMPONENT_CLASS_TYPE_SINK: cc_full_descr->methods.sink.init = - cur_cc_descr_attr->value.sink_init_method; + cur_cc_descr_attr->value.sink_initialize_method; break; default: abort(); @@ -601,15 +601,15 @@ int bt_plugin_so_init(struct bt_plugin *plugin, abort(); } break; - case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD: + case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD: switch (cc_type) { case BT_COMPONENT_CLASS_TYPE_SOURCE: - cc_full_descr->methods.source.msg_iter_init = - cur_cc_descr_attr->value.source_msg_iter_init_method; + cc_full_descr->methods.source.msg_iter_initialize = + cur_cc_descr_attr->value.source_msg_iter_initialize_method; break; case BT_COMPONENT_CLASS_TYPE_FILTER: - cc_full_descr->methods.filter.msg_iter_init = - cur_cc_descr_attr->value.filter_msg_iter_init_method; + cc_full_descr->methods.filter.msg_iter_initialize = + cur_cc_descr_attr->value.filter_msg_iter_initialize_method; break; default: abort(); @@ -733,7 +733,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin, /* Initialize plugin */ if (spec->init) { - enum bt_plugin_init_func_status init_status; + enum bt_plugin_initialize_func_status init_status; BT_LOGD_STR("Calling user's plugin initialization function."); init_status = spec->init((void *) plugin); @@ -881,7 +881,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin, } if (cc_full_descr->methods.source.init) { - ret = bt_component_class_source_set_init_method( + ret = bt_component_class_source_set_initialize_method( src_comp_class, cc_full_descr->methods.source.init); if (ret) { @@ -932,10 +932,10 @@ int bt_plugin_so_init(struct bt_plugin *plugin, } } - if (cc_full_descr->methods.source.msg_iter_init) { - ret = bt_component_class_source_set_message_iterator_init_method( + if (cc_full_descr->methods.source.msg_iter_initialize) { + ret = bt_component_class_source_set_message_iterator_initialize_method( src_comp_class, - cc_full_descr->methods.source.msg_iter_init); + cc_full_descr->methods.source.msg_iter_initialize); if (ret) { BT_LIB_LOGE_APPEND_CAUSE( "Cannot set source component class's message iterator initialization method."); @@ -1026,7 +1026,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin, } if (cc_full_descr->methods.filter.init) { - ret = bt_component_class_filter_set_init_method( + ret = bt_component_class_filter_set_initialize_method( flt_comp_class, cc_full_descr->methods.filter.init); if (ret) { @@ -1090,10 +1090,10 @@ int bt_plugin_so_init(struct bt_plugin *plugin, } } - if (cc_full_descr->methods.filter.msg_iter_init) { - ret = bt_component_class_filter_set_message_iterator_init_method( + if (cc_full_descr->methods.filter.msg_iter_initialize) { + ret = bt_component_class_filter_set_message_iterator_initialize_method( flt_comp_class, - cc_full_descr->methods.filter.msg_iter_init); + cc_full_descr->methods.filter.msg_iter_initialize); if (ret) { BT_LIB_LOGE_APPEND_CAUSE( "Cannot set filter component class's message iterator initialization method."); @@ -1184,7 +1184,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin, } if (cc_full_descr->methods.sink.init) { - ret = bt_component_class_sink_set_init_method( + ret = bt_component_class_sink_set_initialize_method( sink_comp_class, cc_full_descr->methods.sink.init); if (ret) { diff --git a/src/lib/plugin/plugin-so.h b/src/lib/plugin/plugin-so.h index 0ceb40a6..377fa0d2 100644 --- a/src/lib/plugin/plugin-so.h +++ b/src/lib/plugin/plugin-so.h @@ -48,7 +48,7 @@ struct bt_plugin_so_spec_data { /* Pointers to plugin's memory: do NOT free */ const struct __bt_plugin_descriptor *descriptor; - bt_plugin_init_func init; + bt_plugin_initialize_func init; const struct __bt_plugin_descriptor_version *version; }; diff --git a/src/plugins/ctf/fs-sink/fs-sink.c b/src/plugins/ctf/fs-sink/fs-sink.c index 88396bcf..a0c0e5bb 100644 --- a/src/plugins/ctf/fs-sink/fs-sink.c +++ b/src/plugins/ctf/fs-sink/fs-sink.c @@ -43,11 +43,11 @@ static const char * const in_port_name = "in"; static -bt_component_class_init_method_status ensure_output_dir_exists( +bt_component_class_initialize_method_status ensure_output_dir_exists( struct fs_sink_comp *fs_sink) { - bt_component_class_init_method_status status = - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + bt_component_class_initialize_method_status status = + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; int ret; ret = g_mkdir_with_parents(fs_sink->output_dir_path->str, 0755); @@ -56,7 +56,7 @@ bt_component_class_init_method_status ensure_output_dir_exists( "Cannot create directories for output directory", ": output-dir-path=\"%s\"", fs_sink->output_dir_path->str); - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto end; } @@ -65,24 +65,24 @@ end: } static -bt_component_class_init_method_status +bt_component_class_initialize_method_status configure_component(struct fs_sink_comp *fs_sink, const bt_value *params) { - bt_component_class_init_method_status status = - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + bt_component_class_initialize_method_status status = + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; const bt_value *value; value = bt_value_map_borrow_entry_value_const(params, "path"); if (!value) { BT_COMP_LOGE_STR("Missing mandatory `path` parameter."); - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto end; } if (!bt_value_is_string(value)) { BT_COMP_LOGE_STR("`path` parameter: expecting a string."); - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto end; } @@ -93,7 +93,7 @@ configure_component(struct fs_sink_comp *fs_sink, if (value) { if (!bt_value_is_bool(value)) { BT_COMP_LOGE_STR("`assume-single-trace` parameter: expecting a boolean."); - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto end; } @@ -105,7 +105,7 @@ configure_component(struct fs_sink_comp *fs_sink, if (value) { if (!bt_value_is_bool(value)) { BT_COMP_LOGE_STR("`ignore-discarded-events` parameter: expecting a boolean."); - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto end; } @@ -118,7 +118,7 @@ configure_component(struct fs_sink_comp *fs_sink, if (value) { if (!bt_value_is_bool(value)) { BT_COMP_LOGE_STR("`ignore-discarded-packets` parameter: expecting a boolean."); - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto end; } @@ -131,7 +131,7 @@ configure_component(struct fs_sink_comp *fs_sink, if (value) { if (!bt_value_is_bool(value)) { BT_COMP_LOGE_STR("`quiet` parameter: expecting a boolean."); - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto end; } @@ -168,14 +168,14 @@ end: } BT_HIDDEN -bt_component_class_init_method_status ctf_fs_sink_init( +bt_component_class_initialize_method_status ctf_fs_sink_init( bt_self_component_sink *self_comp_sink, bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data) { - bt_component_class_init_method_status status = - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + bt_component_class_initialize_method_status status = + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; bt_self_component_add_port_status add_port_status; struct fs_sink_comp *fs_sink = NULL; bt_self_component *self_comp = @@ -187,7 +187,7 @@ bt_component_class_init_method_status ctf_fs_sink_init( if (!fs_sink) { BT_COMP_LOG_CUR_LVL(BT_LOG_ERROR, log_level, self_comp, "Failed to allocate one CTF FS sink structure."); - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto end; } @@ -195,7 +195,7 @@ bt_component_class_init_method_status ctf_fs_sink_init( fs_sink->self_comp = self_comp; fs_sink->output_dir_path = g_string_new(NULL); status = configure_component(fs_sink, params); - if (status != BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK) { + if (status != BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK) { /* configure_component() logs errors */ goto end; } @@ -205,12 +205,12 @@ bt_component_class_init_method_status ctf_fs_sink_init( G_FILE_TEST_EXISTS)) { BT_COMP_LOGE("Single trace mode, but output path exists: " "output-path=\"%s\"", fs_sink->output_dir_path->str); - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto end; } status = ensure_output_dir_exists(fs_sink); - if (status != BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK) { + if (status != BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK) { /* ensure_output_dir_exists() logs errors */ goto end; } @@ -219,7 +219,7 @@ bt_component_class_init_method_status ctf_fs_sink_init( NULL, (GDestroyNotify) fs_sink_trace_destroy); if (!fs_sink->traces) { BT_COMP_LOGE_STR("Failed to allocate one GHashTable."); - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto end; } @@ -227,10 +227,10 @@ bt_component_class_init_method_status ctf_fs_sink_init( self_comp_sink, in_port_name, NULL, NULL); switch (add_port_status) { case BT_SELF_COMPONENT_ADD_PORT_STATUS_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto end; case BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto end; default: break; @@ -239,7 +239,7 @@ bt_component_class_init_method_status ctf_fs_sink_init( bt_self_component_set_data(self_comp, fs_sink); end: - if (status != BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK) { + if (status != BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK) { destroy_fs_sink_comp(fs_sink); } diff --git a/src/plugins/ctf/fs-sink/fs-sink.h b/src/plugins/ctf/fs-sink/fs-sink.h index 9f39c296..95d624de 100644 --- a/src/plugins/ctf/fs-sink/fs-sink.h +++ b/src/plugins/ctf/fs-sink/fs-sink.h @@ -66,7 +66,7 @@ struct fs_sink_comp { }; BT_HIDDEN -bt_component_class_init_method_status ctf_fs_sink_init( +bt_component_class_initialize_method_status ctf_fs_sink_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, const bt_value *params, diff --git a/src/plugins/ctf/fs-src/fs.c b/src/plugins/ctf/fs-src/fs.c index 2149b89c..c3b8a2ed 100644 --- a/src/plugins/ctf/fs-src/fs.c +++ b/src/plugins/ctf/fs-src/fs.c @@ -248,7 +248,7 @@ void ctf_fs_iterator_finalize(bt_self_message_iterator *it) } BT_HIDDEN -bt_component_class_message_iterator_init_method_status ctf_fs_iterator_init( +bt_component_class_message_iterator_initialize_method_status ctf_fs_iterator_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_source *self_comp_src, @@ -256,8 +256,8 @@ bt_component_class_message_iterator_init_method_status ctf_fs_iterator_init( { struct ctf_fs_port_data *port_data; struct ctf_fs_msg_iter_data *msg_iter_data = NULL; - bt_component_class_message_iterator_init_method_status ret = - BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_OK; + bt_component_class_message_iterator_initialize_method_status ret = + BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_OK; bt_logging_level log_level; bt_self_component *self_comp = bt_self_component_source_as_self_component(self_comp_src); @@ -269,7 +269,7 @@ bt_component_class_message_iterator_init_method_status ctf_fs_iterator_init( log_level = port_data->ctf_fs->log_level; msg_iter_data = g_new0(struct ctf_fs_msg_iter_data, 1); if (!msg_iter_data) { - ret = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR; + ret = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } @@ -283,19 +283,19 @@ bt_component_class_message_iterator_init_method_status ctf_fs_iterator_init( self_comp); if (!msg_iter_data->msg_iter) { BT_COMP_LOGE_APPEND_CAUSE(self_comp, "Cannot create a CTF message iterator."); - ret = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR; + ret = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } msg_iter_data->ds_file_group = port_data->ds_file_group; if (ctf_fs_iterator_reset(msg_iter_data)) { - ret = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_ERROR; + ret = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_ERROR; goto error; } bt_self_message_iterator_set_data(self_msg_iter, msg_iter_data); - if (ret != BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_OK) { + if (ret != BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_OK) { goto error; } @@ -2390,18 +2390,18 @@ end: } BT_HIDDEN -bt_component_class_init_method_status ctf_fs_init( +bt_component_class_initialize_method_status ctf_fs_init( bt_self_component_source *self_comp_src, bt_self_component_source_configuration *config, const bt_value *params, __attribute__((unused)) void *init_method_data) { struct ctf_fs_component *ctf_fs; - bt_component_class_init_method_status ret = - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + bt_component_class_initialize_method_status ret = + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; ctf_fs = ctf_fs_create(params, self_comp_src, NULL); if (!ctf_fs) { - ret = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + ret = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; } return ret; diff --git a/src/plugins/ctf/fs-src/fs.h b/src/plugins/ctf/fs-src/fs.h index 5f8c4128..63216f88 100644 --- a/src/plugins/ctf/fs-src/fs.h +++ b/src/plugins/ctf/fs-src/fs.h @@ -197,7 +197,7 @@ struct ctf_fs_msg_iter_data { }; BT_HIDDEN -bt_component_class_init_method_status ctf_fs_init( +bt_component_class_initialize_method_status ctf_fs_init( bt_self_component_source *source, bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data); @@ -213,7 +213,7 @@ bt_component_class_query_method_status ctf_fs_query( void *method_data, const bt_value **result); BT_HIDDEN -bt_component_class_message_iterator_init_method_status ctf_fs_iterator_init( +bt_component_class_message_iterator_initialize_method_status ctf_fs_iterator_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_source *self_comp, diff --git a/src/plugins/ctf/lttng-live/lttng-live.c b/src/plugins/ctf/lttng-live/lttng-live.c index 6336ffe5..b6c763d8 100644 --- a/src/plugins/ctf/lttng-live/lttng-live.c +++ b/src/plugins/ctf/lttng-live/lttng-live.c @@ -1443,14 +1443,14 @@ no_session: } BT_HIDDEN -bt_component_class_message_iterator_init_method_status lttng_live_msg_iter_init( +bt_component_class_message_iterator_initialize_method_status lttng_live_msg_iter_init( bt_self_message_iterator *self_msg_it, bt_self_message_iterator_configuration *config, bt_self_component_source *self_comp_src, bt_self_component_port_output *self_port) { - bt_component_class_message_iterator_init_method_status ret = - BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_OK; + bt_component_class_message_iterator_initialize_method_status ret = + BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_OK; bt_self_component *self_comp = bt_self_component_source_as_self_component(self_comp_src); struct lttng_live_component *lttng_live; @@ -1469,7 +1469,7 @@ bt_component_class_message_iterator_init_method_status lttng_live_msg_iter_init( lttng_live_msg_iter = g_new0(struct lttng_live_msg_iter, 1); if (!lttng_live_msg_iter) { - ret = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_ERROR; + ret = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_ERROR; goto end; } @@ -1539,7 +1539,7 @@ bt_component_class_message_iterator_init_method_status lttng_live_msg_iter_init( goto end; error: - ret = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_ERROR; + ret = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_ERROR; lttng_live_msg_iter_destroy(lttng_live_msg_iter); end: return ret; @@ -1840,15 +1840,15 @@ end: } BT_HIDDEN -bt_component_class_init_method_status lttng_live_component_init( +bt_component_class_initialize_method_status lttng_live_component_init( bt_self_component_source *self_comp_src, bt_self_component_source_configuration *config, const bt_value *params, __attribute__((unused)) void *init_method_data) { struct lttng_live_component *lttng_live; - bt_component_class_init_method_status ret = - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + bt_component_class_initialize_method_status ret = + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; bt_self_component *self_comp = bt_self_component_source_as_self_component(self_comp_src); bt_logging_level log_level = bt_component_get_logging_level( @@ -1857,7 +1857,7 @@ bt_component_class_init_method_status lttng_live_component_init( lttng_live = lttng_live_component_create(params, log_level, self_comp); if (!lttng_live) { - ret = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + ret = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } @@ -1865,10 +1865,10 @@ bt_component_class_init_method_status lttng_live_component_init( self_comp_src, "out", NULL, NULL); switch (add_port_status) { case BT_SELF_COMPONENT_ADD_PORT_STATUS_ERROR: - ret = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + ret = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto error; case BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR: - ret = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + ret = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; default: break; diff --git a/src/plugins/ctf/lttng-live/lttng-live.h b/src/plugins/ctf/lttng-live/lttng-live.h index 0c86a687..fd5d742e 100644 --- a/src/plugins/ctf/lttng-live/lttng-live.h +++ b/src/plugins/ctf/lttng-live/lttng-live.h @@ -260,7 +260,7 @@ enum lttng_live_iterator_status { LTTNG_LIVE_ITERATOR_STATUS_UNSUPPORTED = -4, }; -bt_component_class_init_method_status lttng_live_component_init( +bt_component_class_initialize_method_status lttng_live_component_init( bt_self_component_source *self_comp, bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data); @@ -278,7 +278,7 @@ bt_component_class_message_iterator_next_method_status lttng_live_msg_iter_next( bt_message_array_const msgs, uint64_t capacity, uint64_t *count); -bt_component_class_message_iterator_init_method_status lttng_live_msg_iter_init( +bt_component_class_message_iterator_initialize_method_status lttng_live_msg_iter_init( bt_self_message_iterator *self_msg_it, bt_self_message_iterator_configuration *config, bt_self_component_source *self_comp, diff --git a/src/plugins/ctf/plugin.c b/src/plugins/ctf/plugin.c index 27f4e373..96758b01 100644 --- a/src/plugins/ctf/plugin.c +++ b/src/plugins/ctf/plugin.c @@ -48,10 +48,10 @@ BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(fs, "Read CTF traces from the file system."); BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP(fs, "See the babeltrace2-source.ctf.fs(7) manual page."); -BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD(fs, ctf_fs_init); +BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD(fs, ctf_fs_init); BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD(fs, ctf_fs_query); BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD(fs, ctf_fs_finalize); -BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(fs, +BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD(fs, ctf_fs_iterator_init); BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD(fs, ctf_fs_iterator_finalize); @@ -60,7 +60,7 @@ BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD(fs, /* ctf.fs sink */ BT_PLUGIN_SINK_COMPONENT_CLASS(fs, ctf_fs_sink_consume); -BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(fs, ctf_fs_sink_init); +BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD(fs, ctf_fs_sink_init); BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(fs, ctf_fs_sink_finalize); BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD(fs, ctf_fs_sink_graph_is_configured); @@ -76,13 +76,13 @@ BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, lttng_live, "Connect to an LTTng relay daemon and receive CTF streams."); BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(auto, lttng_live, "See the babeltrace2-source.ctf.lttng-live(7) manual page."); -BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, lttng_live, +BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(auto, lttng_live, lttng_live_component_init); BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, lttng_live, lttng_live_query); BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, lttng_live, lttng_live_component_finalize); -BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID(auto, +BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_WITH_ID(auto, lttng_live, lttng_live_msg_iter_init); BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, lttng_live, lttng_live_msg_iter_finalize); diff --git a/src/plugins/lttng-utils/debug-info/debug-info.c b/src/plugins/lttng-utils/debug-info/debug-info.c index fa2a492e..af679596 100644 --- a/src/plugins/lttng-utils/debug-info/debug-info.c +++ b/src/plugins/lttng-utils/debug-info/debug-info.c @@ -1746,15 +1746,15 @@ int init_from_params(struct debug_info_component *debug_info_component, } BT_HIDDEN -bt_component_class_init_method_status debug_info_comp_init( +bt_component_class_initialize_method_status debug_info_comp_init( bt_self_component_filter *self_comp_flt, bt_self_component_filter_configuration *config, const bt_value *params, __attribute__((unused)) void *init_method_data) { int ret; struct debug_info_component *debug_info_comp; - bt_component_class_init_method_status status = - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + bt_component_class_initialize_method_status status = + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; bt_self_component_add_port_status add_port_status; bt_self_component *self_comp = bt_self_component_filter_as_self_component(self_comp_flt); @@ -1779,10 +1779,10 @@ bt_component_class_init_method_status debug_info_comp_init( self_comp_flt, "in", NULL, NULL); switch (add_port_status) { case BT_SELF_COMPONENT_ADD_PORT_STATUS_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto error; case BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; default: break; @@ -1792,10 +1792,10 @@ bt_component_class_init_method_status debug_info_comp_init( self_comp_flt, "out", NULL, NULL); switch (add_port_status) { case BT_SELF_COMPONENT_ADD_PORT_STATUS_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto error; case BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; default: break; @@ -1815,8 +1815,8 @@ error: destroy_debug_info_comp(debug_info_comp); bt_self_component_set_data(self_comp, NULL); - if (status == BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK) { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + if (status == BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK) { + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; } end: return status; @@ -1956,13 +1956,13 @@ end: } BT_HIDDEN -bt_component_class_message_iterator_init_method_status debug_info_msg_iter_init( +bt_component_class_message_iterator_initialize_method_status debug_info_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_filter *self_comp_flt, bt_self_component_port_output *self_port) { - bt_component_class_message_iterator_init_method_status status; + bt_component_class_message_iterator_initialize_method_status status; bt_self_component_port_input_message_iterator_create_from_message_iterator_status msg_iter_status; struct bt_self_component_port_input *input_port = NULL; @@ -1979,13 +1979,13 @@ bt_component_class_message_iterator_init_method_status debug_info_msg_iter_init( input_port = bt_self_component_filter_borrow_input_port_by_name( self_comp_flt, "in"); if (!input_port) { - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_ERROR; goto error; } debug_info_msg_iter = g_new0(struct debug_info_msg_iter, 1); if (!debug_info_msg_iter) { - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } @@ -2008,7 +2008,7 @@ bt_component_class_message_iterator_init_method_status debug_info_msg_iter_init( g_direct_hash, g_direct_equal, (GDestroyNotify) NULL, (GDestroyNotify) debug_info_destroy); if (!debug_info_msg_iter->debug_info_map) { - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } @@ -2021,20 +2021,20 @@ bt_component_class_message_iterator_init_method_status debug_info_msg_iter_init( debug_info_msg_iter->ir_maps = trace_ir_maps_create(self_comp, debug_info_field_name, log_level); if (!debug_info_msg_iter->ir_maps) { - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } ret = bt_fd_cache_init(&debug_info_msg_iter->fd_cache, log_level); if (ret) { - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } bt_self_message_iterator_set_data(self_msg_iter, debug_info_msg_iter); debug_info_msg_iter->input_iterator = self_msg_iter; - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_OK; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_OK; goto end; error: diff --git a/src/plugins/lttng-utils/debug-info/debug-info.h b/src/plugins/lttng-utils/debug-info/debug-info.h index f39f3bb3..6b7a1f15 100644 --- a/src/plugins/lttng-utils/debug-info/debug-info.h +++ b/src/plugins/lttng-utils/debug-info/debug-info.h @@ -35,7 +35,7 @@ #define IP_FIELD_NAME "ip" BT_HIDDEN -bt_component_class_init_method_status debug_info_comp_init( +bt_component_class_initialize_method_status debug_info_comp_init( bt_self_component_filter *self_comp, bt_self_component_filter_configuration *config, const bt_value *params, void *init_method_data); @@ -44,7 +44,7 @@ BT_HIDDEN void debug_info_comp_finalize(bt_self_component_filter *self_comp); BT_HIDDEN -bt_component_class_message_iterator_init_method_status debug_info_msg_iter_init( +bt_component_class_message_iterator_initialize_method_status debug_info_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_filter *self_comp, diff --git a/src/plugins/lttng-utils/plugin.c b/src/plugins/lttng-utils/plugin.c index 9302a5ea..c295c9bb 100644 --- a/src/plugins/lttng-utils/plugin.c +++ b/src/plugins/lttng-utils/plugin.c @@ -45,11 +45,11 @@ BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(lttng_utils, debug_info, "Augment compatible events with debugging information."); BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(lttng_utils, debug_info, "See the babeltrace2-filter.lttng-utils.debug-info(7) manual page."); -BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(lttng_utils, +BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(lttng_utils, debug_info, debug_info_comp_init); BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(lttng_utils, debug_info, debug_info_comp_finalize); -BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID( +BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_WITH_ID( lttng_utils, debug_info, debug_info_msg_iter_init); BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD_WITH_ID( lttng_utils, debug_info, debug_info_msg_iter_seek_beginning); diff --git a/src/plugins/text/details/details.c b/src/plugins/text/details/details.c index 5093aca4..6c47fcfe 100644 --- a/src/plugins/text/details/details.c +++ b/src/plugins/text/details/details.c @@ -388,14 +388,14 @@ void log_configuration(bt_self_component_sink *comp, } BT_HIDDEN -bt_component_class_init_method_status details_init( +bt_component_class_initialize_method_status details_init( bt_self_component_sink *comp, bt_self_component_sink_configuration *config, const bt_value *params, __attribute__((unused)) void *init_method_data) { - bt_component_class_init_method_status status = - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + bt_component_class_initialize_method_status status = + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; bt_self_component_add_port_status add_port_status; struct details_comp *details_comp = NULL; @@ -403,13 +403,13 @@ bt_component_class_init_method_status details_init( in_port_name, NULL, NULL); switch (add_port_status) { case BT_SELF_COMPONENT_ADD_PORT_STATUS_OK: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; break; case BT_SELF_COMPONENT_ADD_PORT_STATUS_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; break; case BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; break; default: abort(); @@ -417,7 +417,7 @@ bt_component_class_init_method_status details_init( details_comp = create_details_comp(comp); if (!details_comp) { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } @@ -432,8 +432,8 @@ bt_component_class_init_method_status details_init( goto end; error: - if (status == BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK) { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + if (status == BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK) { + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; } destroy_details_comp(details_comp); diff --git a/src/plugins/text/details/details.h b/src/plugins/text/details/details.h index 45b09868..7902eabe 100644 --- a/src/plugins/text/details/details.h +++ b/src/plugins/text/details/details.h @@ -161,7 +161,7 @@ struct details_comp { }; BT_HIDDEN -bt_component_class_init_method_status details_init( +bt_component_class_initialize_method_status details_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); diff --git a/src/plugins/text/dmesg/dmesg.c b/src/plugins/text/dmesg/dmesg.c index 3ef752c0..bafe5d03 100644 --- a/src/plugins/text/dmesg/dmesg.c +++ b/src/plugins/text/dmesg/dmesg.c @@ -355,23 +355,23 @@ void destroy_dmesg_component(struct dmesg_component *dmesg_comp) } static -bt_component_class_init_method_status create_port( +bt_component_class_initialize_method_status create_port( bt_self_component_source *self_comp) { - bt_component_class_init_method_status status; + bt_component_class_initialize_method_status status; bt_self_component_add_port_status add_port_status; add_port_status = bt_self_component_source_add_output_port(self_comp, "out", NULL, NULL); switch (add_port_status) { case BT_SELF_COMPONENT_ADD_PORT_STATUS_OK: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; break; case BT_SELF_COMPONENT_ADD_PORT_STATUS_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; break; case BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; break; default: abort(); @@ -381,15 +381,15 @@ bt_component_class_init_method_status create_port( } BT_HIDDEN -bt_component_class_init_method_status dmesg_init( +bt_component_class_initialize_method_status dmesg_init( bt_self_component_source *self_comp_src, bt_self_component_source_configuration *config, bt_value *params, void *init_method_data) { int ret = 0; struct dmesg_component *dmesg_comp = g_new0(struct dmesg_component, 1); - bt_component_class_init_method_status status = - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + bt_component_class_initialize_method_status status = + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; bt_self_component *self_comp = bt_self_component_source_as_self_component(self_comp_src); const bt_component *comp = bt_self_component_as_component(self_comp); @@ -427,7 +427,7 @@ bt_component_class_init_method_status dmesg_init( } status = create_port(self_comp_src); - if (status != BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK) { + if (status != BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK) { goto error; } @@ -440,7 +440,7 @@ error: bt_self_component_set_data(self_comp, NULL); if (status >= 0) { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; } end: @@ -657,7 +657,7 @@ void destroy_dmesg_msg_iter(struct dmesg_msg_iter *dmesg_msg_iter) BT_HIDDEN -bt_component_class_message_iterator_init_method_status dmesg_msg_iter_init( +bt_component_class_message_iterator_initialize_method_status dmesg_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_source *self_comp, @@ -667,8 +667,8 @@ bt_component_class_message_iterator_init_method_status dmesg_msg_iter_init( bt_self_component_source_as_self_component(self_comp)); struct dmesg_msg_iter *dmesg_msg_iter = g_new0(struct dmesg_msg_iter, 1); - bt_component_class_message_iterator_init_method_status status = - BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_OK; + bt_component_class_message_iterator_initialize_method_status status = + BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_OK; if (!dmesg_msg_iter) { BT_COMP_LOGE_STR("Failed to allocate on dmesg message iterator structure."); @@ -698,7 +698,7 @@ error: destroy_dmesg_msg_iter(dmesg_msg_iter); bt_self_message_iterator_set_data(self_msg_iter, NULL); if (status >= 0) { - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_ERROR; } end: diff --git a/src/plugins/text/dmesg/dmesg.h b/src/plugins/text/dmesg/dmesg.h index e997b5e1..178460a0 100644 --- a/src/plugins/text/dmesg/dmesg.h +++ b/src/plugins/text/dmesg/dmesg.h @@ -28,7 +28,7 @@ #include BT_HIDDEN -bt_component_class_init_method_status dmesg_init( +bt_component_class_initialize_method_status dmesg_init( bt_self_component_source *self_comp, bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data); @@ -37,7 +37,7 @@ BT_HIDDEN void dmesg_finalize(bt_self_component_source *self_comp); BT_HIDDEN -bt_component_class_message_iterator_init_method_status dmesg_msg_iter_init( +bt_component_class_message_iterator_initialize_method_status dmesg_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_source *self_comp, diff --git a/src/plugins/text/plugin.c b/src/plugins/text/plugin.c index 097226dc..24e187c3 100644 --- a/src/plugins/text/plugin.c +++ b/src/plugins/text/plugin.c @@ -36,7 +36,7 @@ BT_PLUGIN_LICENSE("MIT"); /* pretty sink */ BT_PLUGIN_SINK_COMPONENT_CLASS(pretty, pretty_consume); -BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(pretty, pretty_init); +BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD(pretty, pretty_init); BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(pretty, pretty_finalize); BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD(pretty, pretty_graph_is_configured); @@ -51,9 +51,9 @@ BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(dmesg, "Read Linux ring buffer lines (dmesg(1) output) from a file or from standard input."); BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP(dmesg, "See the babeltrace2-source.text.dmesg(7) manual page."); -BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD(dmesg, dmesg_init); +BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD(dmesg, dmesg_init); BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD(dmesg, dmesg_finalize); -BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(dmesg, +BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD(dmesg, dmesg_msg_iter_init); BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD(dmesg, dmesg_msg_iter_finalize); @@ -64,7 +64,7 @@ BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_BEGINNING_METHOD(dmes /* details sink */ BT_PLUGIN_SINK_COMPONENT_CLASS(details, details_consume); -BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(details, details_init); +BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD(details, details_init); BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(details, details_finalize); BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD(details, details_graph_is_configured); diff --git a/src/plugins/text/pretty/pretty.c b/src/plugins/text/pretty/pretty.c index 1e2000ee..973e45fe 100644 --- a/src/plugins/text/pretty/pretty.c +++ b/src/plugins/text/pretty/pretty.c @@ -613,24 +613,24 @@ void set_use_colors(struct pretty_component *pretty) } BT_HIDDEN -bt_component_class_init_method_status pretty_init( +bt_component_class_initialize_method_status pretty_init( bt_self_component_sink *comp, bt_self_component_sink_configuration *config, const bt_value *params, __attribute__((unused)) void *init_method_data) { - bt_component_class_init_method_status ret = - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + bt_component_class_initialize_method_status ret = + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; struct pretty_component *pretty = create_pretty(); if (!pretty) { - ret = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + ret = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto end; } if (bt_self_component_sink_add_input_port(comp, in_port_name, NULL, NULL) < 0) { - ret = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + ret = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } @@ -644,7 +644,7 @@ bt_component_class_init_method_status pretty_init( pretty->last_real_timestamp = -1ULL; if (apply_params(pretty, params)) { - ret = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + ret = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto error; } diff --git a/src/plugins/text/pretty/pretty.h b/src/plugins/text/pretty/pretty.h index 02991259..bfa3e3a7 100644 --- a/src/plugins/text/pretty/pretty.h +++ b/src/plugins/text/pretty/pretty.h @@ -93,7 +93,7 @@ struct pretty_component { }; BT_HIDDEN -bt_component_class_init_method_status pretty_init( +bt_component_class_initialize_method_status pretty_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, const bt_value *params, diff --git a/src/plugins/utils/counter/counter.c b/src/plugins/utils/counter/counter.c index f2cdd1a9..1c0ed44e 100644 --- a/src/plugins/utils/counter/counter.c +++ b/src/plugins/utils/counter/counter.c @@ -136,21 +136,21 @@ void counter_finalize(bt_self_component_sink *comp) } BT_HIDDEN -bt_component_class_init_method_status counter_init( +bt_component_class_initialize_method_status counter_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, const bt_value *params, __attribute__((unused)) void *init_method_data) { - bt_component_class_init_method_status status = - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + bt_component_class_initialize_method_status status = + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; bt_self_component_add_port_status add_port_status; struct counter *counter = g_new0(struct counter, 1); const bt_value *step = NULL; const bt_value *hide_zero = NULL; if (!counter) { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } @@ -162,10 +162,10 @@ bt_component_class_init_method_status counter_init( "in", NULL, NULL); switch (add_port_status) { case BT_SELF_COMPONENT_ADD_PORT_STATUS_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto error; case BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; default: break; @@ -205,8 +205,8 @@ bt_component_class_init_method_status counter_init( error: destroy_private_counter_data(counter); - if (status == BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK) { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + if (status == BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK) { + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; } end: diff --git a/src/plugins/utils/counter/counter.h b/src/plugins/utils/counter/counter.h index 3e2fd4e6..437c5272 100644 --- a/src/plugins/utils/counter/counter.h +++ b/src/plugins/utils/counter/counter.h @@ -51,7 +51,7 @@ struct counter { }; BT_HIDDEN -bt_component_class_init_method_status counter_init( +bt_component_class_initialize_method_status counter_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); diff --git a/src/plugins/utils/dummy/dummy.c b/src/plugins/utils/dummy/dummy.c index 20dab799..2d0c6aa4 100644 --- a/src/plugins/utils/dummy/dummy.c +++ b/src/plugins/utils/dummy/dummy.c @@ -48,19 +48,19 @@ void dummy_finalize(bt_self_component_sink *comp) } BT_HIDDEN -bt_component_class_init_method_status dummy_init( +bt_component_class_initialize_method_status dummy_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, const bt_value *params, __attribute__((unused)) void *init_method_data) { - bt_component_class_init_method_status status = - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + bt_component_class_initialize_method_status status = + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; bt_self_component_add_port_status add_port_status; struct dummy *dummy = g_new0(struct dummy, 1); if (!dummy) { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto end; } @@ -68,10 +68,10 @@ bt_component_class_init_method_status dummy_init( "in", NULL, NULL); switch (add_port_status) { case BT_SELF_COMPONENT_ADD_PORT_STATUS_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto error; case BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; default: break; diff --git a/src/plugins/utils/dummy/dummy.h b/src/plugins/utils/dummy/dummy.h index 7801294f..ed5bb887 100644 --- a/src/plugins/utils/dummy/dummy.h +++ b/src/plugins/utils/dummy/dummy.h @@ -33,7 +33,7 @@ struct dummy { }; BT_HIDDEN -bt_component_class_init_method_status dummy_init( +bt_component_class_initialize_method_status dummy_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); diff --git a/src/plugins/utils/muxer/muxer.c b/src/plugins/utils/muxer/muxer.c index 8571b275..54238eb4 100644 --- a/src/plugins/utils/muxer/muxer.c +++ b/src/plugins/utils/muxer/muxer.c @@ -247,13 +247,13 @@ void destroy_muxer_comp(struct muxer_comp *muxer_comp) } BT_HIDDEN -bt_component_class_init_method_status muxer_init( +bt_component_class_initialize_method_status muxer_init( bt_self_component_filter *self_comp_flt, bt_self_component_filter_configuration *config, const bt_value *params, void *init_data) { - bt_component_class_init_method_status status = - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + bt_component_class_initialize_method_status status = + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; bt_self_component_add_port_status add_port_status; bt_self_component *self_comp = bt_self_component_filter_as_self_component(self_comp_flt); @@ -284,9 +284,9 @@ bt_component_class_init_method_status muxer_init( bt_common_func_status_string(add_port_status)); if (add_port_status == BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR) { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; } else { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; } goto error; @@ -300,9 +300,9 @@ bt_component_class_init_method_status muxer_init( bt_common_func_status_string(add_port_status)); if (add_port_status == BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR) { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; } else { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; } goto error; @@ -318,8 +318,8 @@ error: destroy_muxer_comp(muxer_comp); bt_self_component_set_data(self_comp, NULL); - if (status == BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK) { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + if (status == BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK) { + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; } end: @@ -1146,13 +1146,13 @@ void destroy_muxer_msg_iter(struct muxer_msg_iter *muxer_msg_iter) } static -bt_component_class_message_iterator_init_method_status +bt_component_class_message_iterator_initialize_method_status muxer_msg_iter_init_upstream_iterators(struct muxer_comp *muxer_comp, struct muxer_msg_iter *muxer_msg_iter) { int64_t count; int64_t i; - bt_component_class_message_iterator_init_method_status status; + bt_component_class_message_iterator_initialize_method_status status; count = bt_component_filter_get_input_port_count( bt_self_component_filter_as_component_filter( @@ -1161,7 +1161,7 @@ muxer_msg_iter_init_upstream_iterators(struct muxer_comp *muxer_comp, BT_COMP_LOGD("No input port to initialize for muxer component's message iterator: " "muxer-comp-addr=%p, muxer-msg-iter-addr=%p", muxer_comp, muxer_msg_iter); - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_OK; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_OK; goto end; } @@ -1199,20 +1199,20 @@ muxer_msg_iter_init_upstream_iterators(struct muxer_comp *muxer_comp, bt_self_component_port_input_message_iterator_put_ref( upstream_msg_iter); if (int_status) { - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_ERROR; /* muxer_msg_iter_add_upstream_msg_iter() logs errors */ goto end; } } - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_OK; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_OK; end: return status; } BT_HIDDEN -bt_component_class_message_iterator_init_method_status muxer_msg_iter_init( +bt_component_class_message_iterator_initialize_method_status muxer_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_filter *self_comp, @@ -1220,7 +1220,7 @@ bt_component_class_message_iterator_init_method_status muxer_msg_iter_init( { struct muxer_comp *muxer_comp = NULL; struct muxer_msg_iter *muxer_msg_iter = NULL; - bt_component_class_message_iterator_init_method_status status; + bt_component_class_message_iterator_initialize_method_status status; muxer_comp = bt_self_component_get_data( bt_self_component_filter_as_self_component(self_comp)); @@ -1238,7 +1238,7 @@ bt_component_class_message_iterator_init_method_status muxer_msg_iter_init( BT_COMP_LOGE("Recursive initialization of muxer component's message iterator: " "comp-addr=%p, muxer-comp-addr=%p, msg-iter-addr=%p", self_comp, muxer_comp, self_msg_iter); - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_ERROR; goto error; } @@ -1246,7 +1246,7 @@ bt_component_class_message_iterator_init_method_status muxer_msg_iter_init( muxer_msg_iter = g_new0(struct muxer_msg_iter, 1); if (!muxer_msg_iter) { BT_COMP_LOGE_STR("Failed to allocate one muxer component's message iterator."); - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } @@ -1258,7 +1258,7 @@ bt_component_class_message_iterator_init_method_status muxer_msg_iter_init( (GDestroyNotify) destroy_muxer_upstream_msg_iter); if (!muxer_msg_iter->active_muxer_upstream_msg_iters) { BT_COMP_LOGE_STR("Failed to allocate a GPtrArray."); - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } @@ -1267,7 +1267,7 @@ bt_component_class_message_iterator_init_method_status muxer_msg_iter_init( (GDestroyNotify) destroy_muxer_upstream_msg_iter); if (!muxer_msg_iter->ended_muxer_upstream_msg_iters) { BT_COMP_LOGE_STR("Failed to allocate a GPtrArray."); - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } diff --git a/src/plugins/utils/muxer/muxer.h b/src/plugins/utils/muxer/muxer.h index d5eef7ef..da5c0252 100644 --- a/src/plugins/utils/muxer/muxer.h +++ b/src/plugins/utils/muxer/muxer.h @@ -29,7 +29,7 @@ #include "common/macros.h" BT_HIDDEN -bt_component_class_init_method_status muxer_init( +bt_component_class_initialize_method_status muxer_init( bt_self_component_filter *self_comp, bt_self_component_filter_configuration *config, const bt_value *params, void *init_data); @@ -38,7 +38,7 @@ BT_HIDDEN void muxer_finalize(bt_self_component_filter *self_comp); BT_HIDDEN -bt_component_class_message_iterator_init_method_status muxer_msg_iter_init( +bt_component_class_message_iterator_initialize_method_status muxer_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_filter *self_comp, diff --git a/src/plugins/utils/plugin.c b/src/plugins/utils/plugin.c index 3a3932d1..3f46fb65 100644 --- a/src/plugins/utils/plugin.c +++ b/src/plugins/utils/plugin.c @@ -37,7 +37,7 @@ BT_PLUGIN_LICENSE("MIT"); /* sink.utils.dummy */ BT_PLUGIN_SINK_COMPONENT_CLASS(dummy, dummy_consume); -BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(dummy, dummy_init); +BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD(dummy, dummy_init); BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(dummy, dummy_finalize); BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD(dummy, dummy_graph_is_configured); @@ -48,7 +48,7 @@ BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(dummy, /* sink.utils.counter */ BT_PLUGIN_SINK_COMPONENT_CLASS(counter, counter_consume); -BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(counter, counter_init); +BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD(counter, counter_init); BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(counter, counter_finalize); BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD(counter, counter_graph_is_configured); @@ -63,9 +63,9 @@ BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(trimmer, "Discard messages that occur outside a specific time range."); BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP(trimmer, "See the babeltrace2-filter.utils.trimmer(7) manual page."); -BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD(trimmer, trimmer_init); +BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD(trimmer, trimmer_init); BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD(trimmer, trimmer_finalize); -BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(trimmer, +BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD(trimmer, trimmer_msg_iter_init); BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD(trimmer, trimmer_msg_iter_finalize); @@ -76,11 +76,11 @@ BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(muxer, "Sort messages from multiple input ports to a single output port by time."); BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP(muxer, "See the babeltrace2-filter.utils.muxer(7) manual page."); -BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD(muxer, muxer_init); +BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD(muxer, muxer_init); BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD(muxer, muxer_finalize); BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD(muxer, muxer_input_port_connected); -BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(muxer, +BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD(muxer, muxer_msg_iter_init); BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD(muxer, muxer_msg_iter_finalize); diff --git a/src/plugins/utils/trimmer/trimmer.c b/src/plugins/utils/trimmer/trimmer.c index 4e89581f..49fac604 100644 --- a/src/plugins/utils/trimmer/trimmer.c +++ b/src/plugins/utils/trimmer/trimmer.c @@ -561,20 +561,20 @@ end: return ret; } -bt_component_class_init_method_status trimmer_init( +bt_component_class_initialize_method_status trimmer_init( bt_self_component_filter *self_comp_flt, bt_self_component_filter_configuration *config, const bt_value *params, void *init_data) { int ret; - bt_component_class_init_method_status status = - BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + bt_component_class_initialize_method_status status = + BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; bt_self_component_add_port_status add_port_status; struct trimmer_comp *trimmer_comp = create_trimmer_comp(); bt_self_component *self_comp = bt_self_component_filter_as_self_component(self_comp_flt); if (!trimmer_comp) { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } @@ -585,10 +585,10 @@ bt_component_class_init_method_status trimmer_init( self_comp_flt, in_port_name, NULL, NULL); switch (add_port_status) { case BT_SELF_COMPONENT_ADD_PORT_STATUS_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto error; case BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; default: break; @@ -598,10 +598,10 @@ bt_component_class_init_method_status trimmer_init( self_comp_flt, "out", NULL, NULL); switch (add_port_status) { case BT_SELF_COMPONENT_ADD_PORT_STATUS_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto error; case BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR: - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; default: break; @@ -609,7 +609,7 @@ bt_component_class_init_method_status trimmer_init( ret = init_trimmer_comp_from_params(trimmer_comp, params); if (ret) { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; goto error; } @@ -617,8 +617,8 @@ bt_component_class_init_method_status trimmer_init( goto end; error: - if (status == BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK) { - status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR; + if (status == BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK) { + status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR; } if (trimmer_comp) { @@ -662,20 +662,20 @@ void destroy_trimmer_iterator_stream_state( } BT_HIDDEN -bt_component_class_message_iterator_init_method_status trimmer_msg_iter_init( +bt_component_class_message_iterator_initialize_method_status trimmer_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_filter *self_comp, bt_self_component_port_output *port) { - bt_component_class_message_iterator_init_method_status status; + bt_component_class_message_iterator_initialize_method_status status; bt_self_component_port_input_message_iterator_create_from_message_iterator_status msg_iter_status; struct trimmer_iterator *trimmer_it; trimmer_it = g_new0(struct trimmer_iterator, 1); if (!trimmer_it) { - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } @@ -708,7 +708,7 @@ bt_component_class_message_iterator_init_method_status trimmer_msg_iter_init( trimmer_it->output_messages = g_queue_new(); if (!trimmer_it->output_messages) { - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } @@ -716,14 +716,14 @@ bt_component_class_message_iterator_init_method_status trimmer_msg_iter_init( g_direct_equal, NULL, (GDestroyNotify) destroy_trimmer_iterator_stream_state); if (!trimmer_it->stream_states) { - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_MEMORY_ERROR; goto error; } trimmer_it->self_msg_iter = self_msg_iter; bt_self_message_iterator_set_data(self_msg_iter, trimmer_it); - status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_OK; + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_OK; goto end; error: diff --git a/src/plugins/utils/trimmer/trimmer.h b/src/plugins/utils/trimmer/trimmer.h index 7bf5aaa4..35ca974d 100644 --- a/src/plugins/utils/trimmer/trimmer.h +++ b/src/plugins/utils/trimmer/trimmer.h @@ -35,13 +35,13 @@ BT_HIDDEN void trimmer_finalize(bt_self_component_filter *self_comp); BT_HIDDEN -bt_component_class_init_method_status trimmer_init( +bt_component_class_initialize_method_status trimmer_init( bt_self_component_filter *self_comp, bt_self_component_filter_configuration *config, const bt_value *params, void *init_data); BT_HIDDEN -bt_component_class_message_iterator_init_method_status trimmer_msg_iter_init( +bt_component_class_message_iterator_initialize_method_status trimmer_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_filter *self_comp, diff --git a/tests/lib/plugin.c b/tests/lib/plugin.c index ff287c1c..74c185c5 100644 --- a/tests/lib/plugin.c +++ b/tests/lib/plugin.c @@ -41,7 +41,7 @@ static int check_env_var(const char *name) static void reset_test_plugin_env_vars(void) { - g_setenv("BT_TEST_PLUGIN_INIT_CALLED", "0", 1); + g_setenv("BT_TEST_PLUGIN_INITIALIZE_CALLED", "0", 1); g_setenv("BT_TEST_PLUGIN_EXIT_CALLED", "0", 1); } @@ -79,7 +79,7 @@ static void test_minimal(const char *plugin_dir) "bt_plugin_find_all_from_file() succeeds with a valid file"); ok(plugin_set, "bt_plugin_find_all_from_file() returns a plugin set"); - ok(check_env_var("BT_TEST_PLUGIN_INIT_CALLED") == 1, + ok(check_env_var("BT_TEST_PLUGIN_INITIALIZE_CALLED") == 1, "plugin's initialization function is called during bt_plugin_find_all_from_file()"); ok(bt_plugin_set_get_plugin_count(plugin_set) == 1, "bt_plugin_find_all_from_file() returns the expected number of plugins"); diff --git a/tests/lib/test-plugin-plugins/minimal.c b/tests/lib/test-plugin-plugins/minimal.c index c3e7f226..a6ba68e6 100644 --- a/tests/lib/test-plugin-plugins/minimal.c +++ b/tests/lib/test-plugin-plugins/minimal.c @@ -19,10 +19,10 @@ #include #include -static bt_plugin_init_func_status plugin_init(bt_self_plugin *plugin) +static bt_plugin_initialize_func_status plugin_init(bt_self_plugin *plugin) { - g_setenv("BT_TEST_PLUGIN_INIT_CALLED", "1", 1); - return BT_PLUGIN_INIT_FUNC_STATUS_OK; + g_setenv("BT_TEST_PLUGIN_INITIALIZE_CALLED", "1", 1); + return BT_PLUGIN_INITIALIZE_FUNC_STATUS_OK; } static void plugin_exit(void) @@ -35,5 +35,5 @@ BT_PLUGIN(test_minimal); BT_PLUGIN_DESCRIPTION("Minimal Babeltrace plugin with no component classes"); BT_PLUGIN_AUTHOR("Janine Sutto"); BT_PLUGIN_LICENSE("Beerware"); -BT_PLUGIN_INIT(plugin_init); +BT_PLUGIN_INITIALIZE(plugin_init); BT_PLUGIN_EXIT(plugin_exit); diff --git a/tests/lib/test-plugin-plugins/sfs.c b/tests/lib/test-plugin-plugins/sfs.c index 229d0ede..c08f4156 100644 --- a/tests/lib/test-plugin-plugins/sfs.c +++ b/tests/lib/test-plugin-plugins/sfs.c @@ -24,24 +24,24 @@ static bt_component_class_sink_consume_method_status sink_consume( return BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK; } -static bt_component_class_message_iterator_init_method_status +static bt_component_class_message_iterator_initialize_method_status src_dummy_iterator_init_method( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_source *self_comp, bt_self_component_port_output *self_port) { - return BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_OK; + return BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_OK; } -static bt_component_class_message_iterator_init_method_status +static bt_component_class_message_iterator_initialize_method_status flt_dummy_iterator_init_method( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_filter *self_comp, bt_self_component_port_output *self_port) { - return BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_OK; + return BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_STATUS_OK; } static void dummy_iterator_finalize_method( @@ -90,7 +90,7 @@ BT_PLUGIN_VERSION(1, 2, 3, "yes"); BT_PLUGIN_SOURCE_COMPONENT_CLASS(source, dummy_iterator_next_method); BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(source, "A source."); -BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(source, +BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD(source, src_dummy_iterator_init_method); BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD(source, dummy_iterator_finalize_method); @@ -106,7 +106,7 @@ BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(sink, BT_PLUGIN_FILTER_COMPONENT_CLASS(filter, dummy_iterator_next_method); BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(filter, "A filter."); -BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(filter, +BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD(filter, flt_dummy_iterator_init_method); BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD(filter, dummy_iterator_finalize_method); diff --git a/tests/lib/test_graph_topo.c b/tests/lib/test_graph_topo.c index 3689a75b..fedbdd03 100644 --- a/tests/lib/test_graph_topo.c +++ b/tests/lib/test_graph_topo.c @@ -293,7 +293,7 @@ bt_component_class_port_connected_method_status sink_input_port_connected( } static -bt_component_class_init_method_status src_init( +bt_component_class_initialize_method_status src_init( bt_self_component_source *self_comp, bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data) @@ -303,11 +303,11 @@ bt_component_class_init_method_status src_init( ret = bt_self_component_source_add_output_port( self_comp, "out", NULL, NULL); BT_ASSERT(ret == 0); - return BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + return BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; } static -bt_component_class_init_method_status sink_init( +bt_component_class_initialize_method_status sink_init( bt_self_component_sink *self_comp, bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data) @@ -317,7 +317,7 @@ bt_component_class_init_method_status sink_init( ret = bt_self_component_sink_add_input_port(self_comp, "in", NULL, NULL); BT_ASSERT(ret == 0); - return BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + return BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; } static @@ -397,7 +397,7 @@ void init_test(void) src_comp_class = bt_component_class_source_create( "src", src_iter_next); BT_ASSERT(src_comp_class); - ret = bt_component_class_source_set_init_method( + ret = bt_component_class_source_set_initialize_method( src_comp_class, src_init); BT_ASSERT(ret == 0); ret = bt_component_class_source_set_output_port_connected_method( @@ -406,7 +406,7 @@ void init_test(void) sink_comp_class = bt_component_class_sink_create("sink", sink_consume); BT_ASSERT(sink_comp_class); - ret = bt_component_class_sink_set_init_method(sink_comp_class, + ret = bt_component_class_sink_set_initialize_method(sink_comp_class, sink_init); BT_ASSERT(ret == 0); ret = bt_component_class_sink_set_input_port_connected_method( diff --git a/tests/lib/test_simple_sink.c b/tests/lib/test_simple_sink.c index 2ea92a84..13519ddd 100644 --- a/tests/lib/test_simple_sink.c +++ b/tests/lib/test_simple_sink.c @@ -23,12 +23,12 @@ #define NR_TESTS 60 struct test_data { - bt_graph_simple_sink_component_init_func_status init_status; + bt_graph_simple_sink_component_initialize_func_status init_status; bt_graph_simple_sink_component_consume_func_status consume_status; }; static -bt_graph_simple_sink_component_init_func_status simple_init_func( +bt_graph_simple_sink_component_initialize_func_status simple_INITIALIZE_func( bt_self_component_port_input_message_iterator *iterator, void *data) { @@ -58,7 +58,7 @@ void simple_fini_func(void *data) } static -bt_component_class_init_method_status src_init( +bt_component_class_initialize_method_status src_init( bt_self_component_source *self_comp, bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data) @@ -68,7 +68,7 @@ bt_component_class_init_method_status src_init( status = bt_self_component_source_add_output_port(self_comp, "out", NULL, NULL); BT_ASSERT(status == BT_SELF_COMPONENT_ADD_PORT_STATUS_OK); - return BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + return BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; } static @@ -92,7 +92,7 @@ bt_graph *create_graph_with_source(const bt_port_output **out_port) BT_ASSERT(out_port); src_comp_cls = bt_component_class_source_create("src", src_iter_next); BT_ASSERT(src_comp_cls); - set_method_status = bt_component_class_source_set_init_method( + set_method_status = bt_component_class_source_set_initialize_method( src_comp_cls, src_init); BT_ASSERT(set_method_status == BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK); graph = bt_graph_create(0); @@ -111,7 +111,7 @@ bt_graph *create_graph_with_source(const bt_port_output **out_port) static void test_simple_expect_run_once_status( - bt_graph_simple_sink_component_init_func_status init_status, + bt_graph_simple_sink_component_initialize_func_status init_status, bt_graph_simple_sink_component_consume_func_status consume_status, bt_graph_run_once_status exp_run_once_status) { @@ -131,7 +131,7 @@ void test_simple_expect_run_once_status( BT_ASSERT(graph); BT_ASSERT(src_out_port); add_comp_status = bt_graph_add_simple_sink_component(graph, "sink", - simple_init_func, simple_consume_func, simple_fini_func, + simple_INITIALIZE_func, simple_consume_func, simple_fini_func, &test_data, &sink_comp); BT_ASSERT(add_comp_status == BT_GRAPH_ADD_COMPONENT_STATUS_OK); BT_ASSERT(sink_comp); @@ -157,37 +157,37 @@ int main(void) /* Test initialization function status */ test_simple_expect_run_once_status( - BT_GRAPH_SIMPLE_SINK_COMPONENT_INIT_FUNC_STATUS_OK, + BT_GRAPH_SIMPLE_SINK_COMPONENT_INITIALIZE_FUNC_STATUS_OK, BT_GRAPH_SIMPLE_SINK_COMPONENT_CONSUME_FUNC_STATUS_OK, BT_GRAPH_RUN_ONCE_STATUS_OK); test_simple_expect_run_once_status( - BT_GRAPH_SIMPLE_SINK_COMPONENT_INIT_FUNC_STATUS_ERROR, + BT_GRAPH_SIMPLE_SINK_COMPONENT_INITIALIZE_FUNC_STATUS_ERROR, BT_GRAPH_SIMPLE_SINK_COMPONENT_CONSUME_FUNC_STATUS_OK, BT_GRAPH_RUN_ONCE_STATUS_ERROR); test_simple_expect_run_once_status( - BT_GRAPH_SIMPLE_SINK_COMPONENT_INIT_FUNC_STATUS_MEMORY_ERROR, + BT_GRAPH_SIMPLE_SINK_COMPONENT_INITIALIZE_FUNC_STATUS_MEMORY_ERROR, BT_GRAPH_SIMPLE_SINK_COMPONENT_CONSUME_FUNC_STATUS_OK, BT_GRAPH_RUN_ONCE_STATUS_MEMORY_ERROR); /* Test "consume" function status */ test_simple_expect_run_once_status( - BT_GRAPH_SIMPLE_SINK_COMPONENT_INIT_FUNC_STATUS_OK, + BT_GRAPH_SIMPLE_SINK_COMPONENT_INITIALIZE_FUNC_STATUS_OK, BT_GRAPH_SIMPLE_SINK_COMPONENT_CONSUME_FUNC_STATUS_OK, BT_GRAPH_RUN_ONCE_STATUS_OK); test_simple_expect_run_once_status( - BT_GRAPH_SIMPLE_SINK_COMPONENT_INIT_FUNC_STATUS_OK, + BT_GRAPH_SIMPLE_SINK_COMPONENT_INITIALIZE_FUNC_STATUS_OK, BT_GRAPH_SIMPLE_SINK_COMPONENT_CONSUME_FUNC_STATUS_ERROR, BT_GRAPH_RUN_ONCE_STATUS_ERROR); test_simple_expect_run_once_status( - BT_GRAPH_SIMPLE_SINK_COMPONENT_INIT_FUNC_STATUS_OK, + BT_GRAPH_SIMPLE_SINK_COMPONENT_INITIALIZE_FUNC_STATUS_OK, BT_GRAPH_SIMPLE_SINK_COMPONENT_CONSUME_FUNC_STATUS_MEMORY_ERROR, BT_GRAPH_RUN_ONCE_STATUS_MEMORY_ERROR); test_simple_expect_run_once_status( - BT_GRAPH_SIMPLE_SINK_COMPONENT_INIT_FUNC_STATUS_OK, + BT_GRAPH_SIMPLE_SINK_COMPONENT_INITIALIZE_FUNC_STATUS_OK, BT_GRAPH_SIMPLE_SINK_COMPONENT_CONSUME_FUNC_STATUS_AGAIN, BT_GRAPH_RUN_ONCE_STATUS_AGAIN); test_simple_expect_run_once_status( - BT_GRAPH_SIMPLE_SINK_COMPONENT_INIT_FUNC_STATUS_OK, + BT_GRAPH_SIMPLE_SINK_COMPONENT_INITIALIZE_FUNC_STATUS_OK, BT_GRAPH_SIMPLE_SINK_COMPONENT_CONSUME_FUNC_STATUS_END, BT_GRAPH_RUN_ONCE_STATUS_END); diff --git a/tests/lib/test_trace_ir_ref.c b/tests/lib/test_trace_ir_ref.c index 1d565ebd..ab1b920e 100644 --- a/tests/lib/test_trace_ir_ref.c +++ b/tests/lib/test_trace_ir_ref.c @@ -409,13 +409,13 @@ static void test_example_scenario(bt_self_component_source *self_comp) } static -bt_component_class_init_method_status src_init( +bt_component_class_initialize_method_status src_init( bt_self_component_source *self_comp, bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data) { test_example_scenario(self_comp); - return BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + return BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; } static @@ -435,7 +435,7 @@ static void test_example_scenario_in_graph(void) comp_cls = bt_component_class_source_create("src", src_iter_next); BT_ASSERT(comp_cls); - ret = bt_component_class_source_set_init_method(comp_cls, src_init); + ret = bt_component_class_source_set_initialize_method(comp_cls, src_init); BT_ASSERT(ret == 0); graph = bt_graph_create(0); ret = bt_graph_add_source_component(graph, comp_cls, "src-comp", -- 2.34.1