};
typedef enum bt_component_status (*bt_component_class_init_method)(
- struct bt_component *component, struct bt_value *params);
+ struct bt_component *component, struct bt_value *params,
+ void *init_method_data);
typedef void (*bt_component_class_destroy_method)(struct bt_component *component);
struct bt_component_class *component_class, const char *name,
struct bt_value *params);
+extern struct bt_component *bt_component_create_with_init_method_data(
+ struct bt_component_class *component_class, const char *name,
+ struct bt_value *params, void *init_method_data);
+
/**
* Get a component's private data.
*
return iterator;
}
-struct bt_component *bt_component_create(
+struct bt_component *bt_component_create_with_init_method_data(
struct bt_component_class *component_class, const char *name,
- struct bt_value *params)
+ struct bt_value *params, void *init_method_data)
{
int ret;
struct bt_component *component = NULL;
goto end;
}
-
type = bt_component_class_get_type(component_class);
if (type <= BT_COMPONENT_CLASS_TYPE_UNKNOWN ||
type > BT_COMPONENT_CLASS_TYPE_FILTER) {
component->initializing = true;
if (component_class->methods.init) {
- ret = component_class->methods.init(component, params);
+ ret = component_class->methods.init(component, params,
+ init_method_data);
component->initializing = false;
if (ret != BT_COMPONENT_STATUS_OK) {
BT_PUT(component);
return component;
}
+struct bt_component *bt_component_create(
+ struct bt_component_class *component_class, const char *name,
+ struct bt_value *params)
+{
+ return bt_component_create_with_init_method_data(component_class, name,
+ params, NULL);
+}
+
const char *bt_component_get_name(struct bt_component *component)
{
const char *ret = NULL;
BT_HIDDEN
enum bt_component_status ctf_fs_init(struct bt_component *source,
- struct bt_value *params)
+ struct bt_value *params, void *init_method_data)
{
struct ctf_fs_component *ctf_fs;
enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
+ (void) init_method_data;
assert(source);
ctf_fs_debug = g_strcmp0(getenv("CTF_FS_DEBUG"), "1") == 0;
BT_HIDDEN
enum bt_component_status ctf_fs_init(struct bt_component *source,
- struct bt_value *params);
+ struct bt_value *params, void *init_method_data);
BT_HIDDEN
void ctf_fs_destroy(struct bt_component *component);
BT_HIDDEN
enum bt_component_status lttng_live_init(struct bt_component *source,
- struct bt_value *params);
+ struct bt_value *params, void *init_method_data);
#endif /* BABELTRACE_PLUGIN_CTF_LTTNG_LIVE_INTERNAL_H */
BT_HIDDEN
enum bt_component_status lttng_live_init(struct bt_component *component,
- struct bt_value *params)
+ struct bt_value *params, void *init_method_data)
{
return BT_COMPONENT_STATUS_OK;
}
}
enum bt_component_status muxer_component_init(
- struct bt_component *component, struct bt_value *params)
+ struct bt_component *component, struct bt_value *params,
+ void *init_method_data)
{
enum bt_component_status ret;
struct muxer *muxer = create_muxer();
+ (void) init_method_data;
if (!muxer) {
ret = BT_COMPONENT_STATUS_NOMEM;
static
enum bt_component_status text_component_init(
- struct bt_component *component, struct bt_value *params)
+ struct bt_component *component, struct bt_value *params,
+ void *init_method_data)
{
enum bt_component_status ret;
struct text_component *text = create_text();
+ (void) init_method_data;
if (!text) {
ret = BT_COMPONENT_STATUS_NOMEM;
}
enum bt_component_status trimmer_component_init(
- struct bt_component *component, struct bt_value *params)
+ struct bt_component *component, struct bt_value *params,
+ void *init_method_data)
{
enum bt_component_status ret;
struct trimmer *trimmer = create_trimmer_data();
+ (void) init_method_data;
if (!trimmer) {
ret = BT_COMPONENT_STATUS_NOMEM;
static
enum bt_component_status writer_component_init(
- struct bt_component *component, struct bt_value *params)
+ struct bt_component *component, struct bt_value *params,
+ void *init_method_data)
{
enum bt_component_status ret;
enum bt_value_status value_ret;
struct writer_component *writer_component = create_writer_component();
struct bt_value *value = NULL;
const char *path;
+ (void) init_method_data;
if (!writer_component) {
ret = BT_COMPONENT_STATUS_NOMEM;