-static
-struct implicit_component_args *create_implicit_component_args(void)
-{
- struct implicit_component_args *impl_args =
- g_new0(struct implicit_component_args, 1);
-
- if (!impl_args) {
- goto end;
- }
-
- if (init_implicit_component_args(impl_args, NULL, true)) {
- destroy_implicit_component_args(impl_args);
- impl_args = NULL;
- goto end;
- }
-
-end:
- return impl_args;
-}
-
-static
-int fill_implicit_ctf_inputs_args(GPtrArray *implicit_ctf_inputs_args,
- struct implicit_component_args *base_implicit_ctf_input_args,
- GList *leftovers)
-{
- int ret = 0;
- GList *leftover;
- bt_value_status status;
-
- for (leftover = leftovers; leftover != NULL;
- leftover = g_list_next(leftover)) {
- GString *gs_leftover = leftover->data;
- struct implicit_component_args *impl_args =
- create_implicit_component_args();
-
- if (!impl_args) {
- print_err_oom();
- goto error;
- }
-
- impl_args->exists = true;
- g_string_assign(impl_args->comp_arg,
- base_implicit_ctf_input_args->comp_arg->str);
- g_string_assign(impl_args->params_arg,
- base_implicit_ctf_input_args->params_arg->str);
-
- /*
- * We need our own copy of the extra parameters because
- * this is where the unique path goes.
- */
- BT_VALUE_PUT_REF_AND_RESET(impl_args->extra_params);
- status = bt_value_copy(base_implicit_ctf_input_args->extra_params,
- &impl_args->extra_params);
- if (status != BT_VALUE_STATUS_OK) {
- print_err_oom();
- destroy_implicit_component_args(impl_args);
- goto error;
- }
-
- /* Append unique path parameter */
- ret = append_implicit_component_extra_param(impl_args,
- "path", gs_leftover->str);
- if (ret) {
- destroy_implicit_component_args(impl_args);
- goto error;
- }
-
- g_ptr_array_add(implicit_ctf_inputs_args, impl_args);
- }
-
- goto end;
-
-error:
- ret = -1;
-
-end:
- return ret;
-}
-