X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=cli%2Fbabeltrace-cfg-cli-args-connect.c;h=e72ff30e9701715a7dfb7bf4db49ad17bc1ca15e;hb=05e2128659970c32648a01255ed870449f05d518;hp=7b4961652b7c532dc7fc97debd5ab4a94c71b883;hpb=398454ed067b95215c7affbe265fd36edab931ee;p=babeltrace.git diff --git a/cli/babeltrace-cfg-cli-args-connect.c b/cli/babeltrace-cfg-cli-args-connect.c index 7b496165..e72ff30e 100644 --- a/cli/babeltrace-cfg-cli-args-connect.c +++ b/cli/babeltrace-cfg-cli-args-connect.c @@ -21,8 +21,7 @@ */ #include -#include -#include +#include #include #include "babeltrace-cfg.h" #include "babeltrace-cfg-cli-args-connect.h" @@ -508,7 +507,7 @@ end: } static int validate_all_components_connected_in_array(GPtrArray *comps, - struct bt_value *connected_components, + const struct bt_value *connected_components, char *error_buf, size_t error_buf_size) { int ret = 0; @@ -536,8 +535,7 @@ static int validate_all_components_connected(struct bt_config *cfg, { size_t i; int ret = 0; - struct bt_private_value *connected_components = - bt_private_value_map_create(); + struct bt_value *connected_components = bt_value_map_create(); if (!connected_components) { ret = -1; @@ -548,13 +546,13 @@ static int validate_all_components_connected(struct bt_config *cfg, struct bt_config_connection *connection = g_ptr_array_index(cfg->cmd_data.run.connections, i); - ret = bt_private_value_map_insert_entry(connected_components, + ret = bt_value_map_insert_entry(connected_components, connection->upstream_comp_name->str, bt_value_null); if (ret) { goto end; } - ret = bt_private_value_map_insert_entry(connected_components, + ret = bt_value_map_insert_entry(connected_components, connection->downstream_comp_name->str, bt_value_null); if (ret) { goto end; @@ -563,7 +561,7 @@ static int validate_all_components_connected(struct bt_config *cfg, ret = validate_all_components_connected_in_array( cfg->cmd_data.run.sources, - bt_private_value_as_value(connected_components), + connected_components, error_buf, error_buf_size); if (ret) { goto end; @@ -571,7 +569,7 @@ static int validate_all_components_connected(struct bt_config *cfg, ret = validate_all_components_connected_in_array( cfg->cmd_data.run.filters, - bt_private_value_as_value(connected_components), + connected_components, error_buf, error_buf_size); if (ret) { goto end; @@ -579,7 +577,7 @@ static int validate_all_components_connected(struct bt_config *cfg, ret = validate_all_components_connected_in_array( cfg->cmd_data.run.sinks, - bt_private_value_as_value(connected_components), + connected_components, error_buf, error_buf_size); if (ret) { goto end; @@ -595,8 +593,8 @@ static int validate_no_duplicate_connection(struct bt_config *cfg, { size_t i; int ret = 0; - struct bt_private_value *flat_connection_names = - bt_private_value_map_create(); + struct bt_value *flat_connection_names = + bt_value_map_create(); GString *flat_connection_name = NULL; if (!flat_connection_names) { @@ -620,9 +618,8 @@ static int validate_no_duplicate_connection(struct bt_config *cfg, connection->downstream_comp_name->str, connection->downstream_port_glob->str); - if (bt_value_map_has_entry(bt_private_value_as_value( - flat_connection_names), - flat_connection_name->str)) { + if (bt_value_map_has_entry(flat_connection_names, + flat_connection_name->str)) { snprintf(error_buf, error_buf_size, "Duplicate connection:\n %s\n", connection->arg->str); @@ -630,7 +627,7 @@ static int validate_no_duplicate_connection(struct bt_config *cfg, goto end; } - ret = bt_private_value_map_insert_entry(flat_connection_names, + ret = bt_value_map_insert_entry(flat_connection_names, flat_connection_name->str, bt_value_null); if (ret) { goto end; @@ -682,7 +679,7 @@ end: } int bt_config_cli_args_create_connections(struct bt_config *cfg, - struct bt_value *connection_args, + const struct bt_value *connection_args, char *error_buf, size_t error_buf_size) { int ret; @@ -695,8 +692,8 @@ int bt_config_cli_args_create_connections(struct bt_config *cfg, } for (i = 0; i < bt_value_array_get_size(connection_args); i++) { - struct bt_value *arg_value = - bt_value_array_borrow_element_by_index( + const struct bt_value *arg_value = + bt_value_array_borrow_element_by_index_const( connection_args, i); const char *arg; struct bt_config_connection *cfg_connection;