lib: graph: add "self" and some "private" APIs
[babeltrace.git] / include / babeltrace / plugin / plugin.h
CommitLineData
33b34c43
PP
1#ifndef BABELTRACE_PLUGIN_PLUGIN_H
2#define BABELTRACE_PLUGIN_PLUGIN_H
90354d3a
JG
3
4/*
38b48196 5 * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
33b34c43 6 * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
90354d3a
JG
7 *
8 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 *
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:
16 *
17 * The above copyright notice and this permission notice shall be included in
18 * all copies or substantial portions of the Software.
19 *
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
26 * SOFTWARE.
27 */
28
544d0515 29#include <stdint.h>
33b34c43 30#include <stddef.h>
9d408fca
PP
31
32/* For bt_bool */
c55a9f58 33#include <babeltrace/types.h>
33b34c43 34
9d408fca
PP
35/* For enum bt_component_class_type */
36#include <babeltrace/graph/component-class.h>
37
d94d92ac
PP
38/* For enum bt_component_class_source */
39#include <babeltrace/graph/component-class-source.h>
40
41/* For enum bt_component_class_filter */
42#include <babeltrace/graph/component-class-filter.h>
43
44/* For enum bt_component_class_sink */
45#include <babeltrace/graph/component-class-sink.h>
46
47/* For enum bt_property_availability */
48#include <babeltrace/property.h>
49
38b48196
JG
50#ifdef __cplusplus
51extern "C" {
52#endif
633edee0 53
38b48196 54struct bt_plugin;
a8ff38ef 55struct bt_plugin_set;
33b34c43 56struct bt_component_class;
d94d92ac
PP
57struct bt_component_class_source;
58struct bt_component_class_filter;
59struct bt_component_class_sink;
33b34c43 60
33b34c43 61enum bt_plugin_status {
33b34c43 62 BT_PLUGIN_STATUS_OK = 0,
33b34c43 63 BT_PLUGIN_STATUS_ERROR = -1,
d94d92ac 64 BT_PLUGIN_STATUS_NOMEM = -12,
33b34c43
PP
65};
66
2b43acf9
PP
67extern struct bt_plugin *bt_plugin_find(const char *plugin_name);
68
a8ff38ef 69extern struct bt_plugin_set *bt_plugin_create_all_from_file(const char *path);
33b34c43 70
a8ff38ef 71extern struct bt_plugin_set *bt_plugin_create_all_from_dir(const char *path,
c55a9f58 72 bt_bool recurse);
33b34c43 73
a8ff38ef 74extern struct bt_plugin_set *bt_plugin_create_all_from_static(void);
73299554 75
38b48196 76extern const char *bt_plugin_get_name(struct bt_plugin *plugin);
633edee0 77
38b48196 78extern const char *bt_plugin_get_author(struct bt_plugin *plugin);
633edee0 79
38b48196 80extern const char *bt_plugin_get_license(struct bt_plugin *plugin);
633edee0 81
f3bc2010
JG
82extern const char *bt_plugin_get_description(struct bt_plugin *plugin);
83
7c7c0433
JG
84extern const char *bt_plugin_get_path(struct bt_plugin *plugin);
85
d94d92ac
PP
86extern 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);
89
90extern uint64_t bt_plugin_get_source_component_class_count(
91 struct bt_plugin *plugin);
92
93extern uint64_t bt_plugin_get_filter_component_class_count(
94 struct bt_plugin *plugin);
b6de043b 95
d94d92ac
PP
96extern uint64_t bt_plugin_get_sink_component_class_count(
97 struct bt_plugin *plugin);
33b34c43 98
d94d92ac
PP
99extern struct bt_component_class_source *
100bt_plugin_borrow_source_component_class_by_index(
9ac68eb1 101 struct bt_plugin *plugin, uint64_t index);
33b34c43 102
d94d92ac
PP
103extern struct bt_component_class_filter *
104bt_plugin_borrow_filter_component_class_by_index(
105 struct bt_plugin *plugin, uint64_t index);
106
107extern struct bt_component_class_sink *
108bt_plugin_borrow_sink_component_class_by_index(
109 struct bt_plugin *plugin, uint64_t index);
110
111extern struct bt_component_class_source *
112bt_plugin_borrow_source_component_class_by_name(struct bt_plugin *plugin,
113 const char *name);
114
115extern struct bt_component_class_filter *
116bt_plugin_borrow_filter_component_class_by_name(struct bt_plugin *plugin,
117 const char *name);
118
119extern struct bt_component_class_sink *
120bt_plugin_borrow_sink_component_class_by_name(struct bt_plugin *plugin,
121 const char *name);
33b34c43 122
d94d92ac
PP
123extern uint64_t bt_plugin_set_get_plugin_count(
124 struct bt_plugin_set *plugin_set);
a8ff38ef 125
d94d92ac
PP
126extern struct bt_plugin *bt_plugin_set_borrow_plugin_by_index(
127 struct bt_plugin_set *plugin_set, uint64_t index);
a8ff38ef 128
38b48196
JG
129#ifdef __cplusplus
130}
131#endif
90354d3a 132
33b34c43 133#endif /* BABELTRACE_PLUGIN_PLUGIN_H */
This page took 0.045907 seconds and 4 git commands to generate.