cli: automatically detect sources for leftover arguments
[babeltrace.git] / src / cli / babeltrace2-cfg-src-auto-disc.h
1 #ifndef CLI_BABELTRACE_CFG_SRC_AUTO_DISC_H
2 #define CLI_BABELTRACE_CFG_SRC_AUTO_DISC_H
3
4 /*
5 * Copyright (c) 2019 EfficiOS Inc. and Linux Foundation
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 */
25
26 #include <glib.h>
27
28 #include <babeltrace2/babeltrace.h>
29
30 struct auto_source_discovery {
31 /* Array of `struct auto_source_discovery_result *`. */
32 GPtrArray *results;
33 };
34
35 /* Value type of the `auto_source_discovery::results` array. */
36
37 struct auto_source_discovery_result {
38 /*
39 * `plugin_name` and `source_cc_name` are borrowed from the plugin and source
40 * component class (which outlive this structure).
41 */
42 const char *plugin_name;
43 const char *source_cc_name;
44
45 /*
46 * `group` is owned by this structure.
47 *
48 * May be NULL, to mean "no group".
49 */
50 gchar *group;
51
52 /* Array of input strings. */
53 bt_value *inputs;
54 };
55
56 int auto_source_discovery_init(struct auto_source_discovery *auto_disc);
57 void auto_source_discovery_fini(struct auto_source_discovery *auto_disc);
58
59 /*
60 * Given `inputs` a list of strings, query source component classes to discover
61 * which source components should be instantiated to deal with these inputs.
62 *
63 * Return 0 if execution completed successfully, < 0 otherwise.
64 */
65
66 int auto_discover_source_components(
67 const bt_value *plugin_paths,
68 const bt_value *inputs,
69 const char *plugin_filter,
70 const char *component_class_filter,
71 enum bt_logging_level log_level,
72 struct auto_source_discovery *auto_disc);
73
74 #endif /* CLI_BABELTRACE_CFG_SRC_AUTO_DISC_H */
This page took 0.030383 seconds and 4 git commands to generate.