1 #ifndef BABELTRACE_PLUGIN_PLUGIN_H
2 #define BABELTRACE_PLUGIN_PLUGIN_H
5 * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
8 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 * Permission is hereby granted, free of charge, to any person obtaining a copy
11 * of this software and associated documentation files (the "Software"), to deal
12 * in the Software without restriction, including without limitation the rights
13 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 * copies of the Software, and to permit persons to whom the Software is
15 * furnished to do so, subject to the following conditions:
17 * The above copyright notice and this permission notice shall be included in
18 * all copies or substantial portions of the Software.
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33 #include <babeltrace/types.h>
35 /* For enum bt_component_class_type */
36 #include <babeltrace/graph/component-class.h>
38 /* For enum bt_component_class_source */
39 #include <babeltrace/graph/component-class-source.h>
41 /* For enum bt_component_class_filter */
42 #include <babeltrace/graph/component-class-filter.h>
44 /* For enum bt_component_class_sink */
45 #include <babeltrace/graph/component-class-sink.h>
47 /* For enum bt_property_availability */
48 #include <babeltrace/property.h>
56 struct bt_component_class
;
57 struct bt_component_class_source
;
58 struct bt_component_class_filter
;
59 struct bt_component_class_sink
;
61 enum bt_plugin_status
{
62 BT_PLUGIN_STATUS_OK
= 0,
63 BT_PLUGIN_STATUS_ERROR
= -1,
64 BT_PLUGIN_STATUS_NOMEM
= -12,
67 extern struct bt_plugin
*bt_plugin_find(const char *plugin_name
);
69 extern struct bt_plugin_set
*bt_plugin_create_all_from_file(const char *path
);
71 extern struct bt_plugin_set
*bt_plugin_create_all_from_dir(const char *path
,
74 extern struct bt_plugin_set
*bt_plugin_create_all_from_static(void);
76 extern const char *bt_plugin_get_name(struct bt_plugin
*plugin
);
78 extern const char *bt_plugin_get_author(struct bt_plugin
*plugin
);
80 extern const char *bt_plugin_get_license(struct bt_plugin
*plugin
);
82 extern const char *bt_plugin_get_description(struct bt_plugin
*plugin
);
84 extern const char *bt_plugin_get_path(struct bt_plugin
*plugin
);
86 extern enum bt_property_availability
bt_plugin_get_version(
87 struct bt_plugin
*plugin
, unsigned int *major
,
88 unsigned int *minor
, unsigned int *patch
, const char **extra
);
90 extern uint64_t bt_plugin_get_source_component_class_count(
91 struct bt_plugin
*plugin
);
93 extern uint64_t bt_plugin_get_filter_component_class_count(
94 struct bt_plugin
*plugin
);
96 extern uint64_t bt_plugin_get_sink_component_class_count(
97 struct bt_plugin
*plugin
);
99 extern struct bt_component_class_source
*
100 bt_plugin_borrow_source_component_class_by_index(
101 struct bt_plugin
*plugin
, uint64_t index
);
103 extern struct bt_component_class_filter
*
104 bt_plugin_borrow_filter_component_class_by_index(
105 struct bt_plugin
*plugin
, uint64_t index
);
107 extern struct bt_component_class_sink
*
108 bt_plugin_borrow_sink_component_class_by_index(
109 struct bt_plugin
*plugin
, uint64_t index
);
111 extern struct bt_component_class_source
*
112 bt_plugin_borrow_source_component_class_by_name(struct bt_plugin
*plugin
,
115 extern struct bt_component_class_filter
*
116 bt_plugin_borrow_filter_component_class_by_name(struct bt_plugin
*plugin
,
119 extern struct bt_component_class_sink
*
120 bt_plugin_borrow_sink_component_class_by_name(struct bt_plugin
*plugin
,
127 #endif /* BABELTRACE_PLUGIN_PLUGIN_H */