ctf: bt_ctf_notif_iter_get_next_notification(): require CC prio. map
[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/*
584e4e78 5 * BabelTrace - Babeltrace Plug-in Interface
90354d3a 6 *
38b48196 7 * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
33b34c43 8 * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
90354d3a
JG
9 *
10 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a copy
13 * of this software and associated documentation files (the "Software"), to deal
14 * in the Software without restriction, including without limitation the rights
15 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16 * copies of the Software, and to permit persons to whom the Software is
17 * furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be included in
20 * all copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 * SOFTWARE.
29 */
30
33b34c43
PP
31#include <stddef.h>
32#include <stdbool.h>
b2e0c907 33#include <babeltrace/graph/component-class.h>
33b34c43 34
38b48196
JG
35#ifdef __cplusplus
36extern "C" {
37#endif
633edee0 38
38b48196 39struct bt_plugin;
33b34c43
PP
40struct bt_component_class;
41
42/**
43 * Status code. Errors are always negative.
44 */
45enum bt_plugin_status {
46 /** No error, okay. */
47 BT_PLUGIN_STATUS_OK = 0,
48 /** General error. */
49 BT_PLUGIN_STATUS_ERROR = -1,
50 /** Memory allocation failure. */
51 BT_PLUGIN_STATUS_NOMEM = -4,
52};
53
2b43acf9
PP
54extern struct bt_plugin *bt_plugin_find(const char *plugin_name);
55
56extern struct bt_component_class *bt_plugin_find_component_class(
57 const char *plugin_name, const char *component_class_name,
58 enum bt_component_class_type component_class_type);
1670bffd 59
6ba0b073 60extern struct bt_plugin **bt_plugin_create_all_from_file(const char *path);
33b34c43
PP
61
62extern struct bt_plugin **bt_plugin_create_all_from_dir(const char *path,
63 bool recurse);
64
65extern struct bt_plugin **bt_plugin_create_all_from_static(void);
73299554 66
38b48196
JG
67/**
68 * Get the name of a plug-in.
69 *
70 * @param plugin An instance of a plug-in
71 * @returns Plug-in name or NULL on error
72 */
73extern const char *bt_plugin_get_name(struct bt_plugin *plugin);
633edee0 74
38b48196
JG
75/**
76 * Get the name of a plug-in's author.
77 *
78 * @param plugin An instance of a plug-in
79 * @returns Plug-in author or NULL on error
80 */
81extern const char *bt_plugin_get_author(struct bt_plugin *plugin);
633edee0 82
38b48196
JG
83/**
84 * Get the license of a plug-in.
85 *
86 * @param plugin An instance of a plug-in
87 * @returns Plug-in license or NULL on error
88 */
89extern const char *bt_plugin_get_license(struct bt_plugin *plugin);
633edee0 90
f3bc2010
JG
91/**
92 * Get the decription of a plug-in.
93 *
94 * @param plugin An instance of a plug-in
95 * @returns Plug-in description or NULL if none is available
96 */
97extern const char *bt_plugin_get_description(struct bt_plugin *plugin);
98
7c7c0433
JG
99/**
100 * Get the path of a plug-in.
101 *
102 * @param plugin An instance of a plug-in
103 * @returns Plug-in path or NULL on error
104 */
105extern const char *bt_plugin_get_path(struct bt_plugin *plugin);
106
b6de043b
PP
107extern enum bt_plugin_status bt_plugin_get_version(struct bt_plugin *plugin,
108 unsigned int *major, unsigned int *minor, unsigned int *patch,
109 const char **extra);
110
33b34c43
PP
111extern int bt_plugin_get_component_class_count(struct bt_plugin *plugin);
112
113extern struct bt_component_class *bt_plugin_get_component_class(
114 struct bt_plugin *plugin, size_t index);
115
116extern
117struct bt_component_class *bt_plugin_get_component_class_by_name_and_type(
118 struct bt_plugin *plugin, const char *name,
d3e4dcd8 119 enum bt_component_class_type type);
33b34c43 120
38b48196
JG
121#ifdef __cplusplus
122}
123#endif
90354d3a 124
33b34c43 125#endif /* BABELTRACE_PLUGIN_PLUGIN_H */
This page took 0.034592 seconds and 4 git commands to generate.