2 * SPDX-License-Identifier: MIT
4 * Copyright 2016 Philippe Proulx <pproulx@efficios.com>
6 * Babeltrace trace converter - parameter parsing
9 #include "common/common.h"
10 #include <babeltrace2/babeltrace.h>
12 #include "babeltrace2-cfg.h"
15 void destroy_gstring(void *data
)
17 g_string_free(data
, TRUE
);
21 * Extracts the various paths from the string arg, delimited by ':' on UNIX,
22 * ';' on Windows, and appends them to the array value object `plugin_paths`.
24 int bt_config_append_plugin_paths(
25 bt_value
*plugin_paths
, const char *arg
)
28 GPtrArray
*dirs
= g_ptr_array_new_with_free_func(destroy_gstring
);
36 ret
= bt_common_append_plugin_path_dirs(arg
, dirs
);
42 for (i
= 0; i
< dirs
->len
; i
++) {
43 GString
*dir
= g_ptr_array_index(dirs
, i
);
45 ret
= bt_value_array_append_string_element(
46 plugin_paths
, dir
->str
);
54 g_ptr_array_free(dirs
, TRUE
);
58 void bt_config_connection_destroy(struct bt_config_connection
*connection
)
64 if (connection
->upstream_comp_name
) {
65 g_string_free(connection
->upstream_comp_name
, TRUE
);
68 if (connection
->downstream_comp_name
) {
69 g_string_free(connection
->downstream_comp_name
, TRUE
);
72 if (connection
->upstream_port_glob
) {
73 g_string_free(connection
->upstream_port_glob
, TRUE
);
76 if (connection
->downstream_port_glob
) {
77 g_string_free(connection
->downstream_port_glob
, TRUE
);
80 if (connection
->arg
) {
81 g_string_free(connection
->arg
, TRUE
);
This page took 0.05239 seconds and 4 git commands to generate.