Fix: src.ctf.lttng-live: emitting stream end msg with no stream
[babeltrace.git] / include / babeltrace2 / plugin / plugin-const.h
... / ...
CommitLineData
1#ifndef BABELTRACE2_PLUGIN_PLUGIN_CONST_H
2#define BABELTRACE2_PLUGIN_PLUGIN_CONST_H
3
4/*
5 * Copyright (c) 2010-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#ifndef __BT_IN_BABELTRACE_H
27# error "Please include <babeltrace2/babeltrace.h> instead."
28#endif
29
30#include <stdint.h>
31#include <stddef.h>
32
33#include <babeltrace2/types.h>
34#include <babeltrace2/property.h>
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40typedef enum bt_plugin_find_status {
41 BT_PLUGIN_FIND_STATUS_OK = __BT_FUNC_STATUS_OK,
42 BT_PLUGIN_FIND_STATUS_NOT_FOUND = __BT_FUNC_STATUS_NOT_FOUND,
43 BT_PLUGIN_FIND_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
44 BT_PLUGIN_FIND_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
45} bt_plugin_find_status;
46
47extern bt_plugin_find_status bt_plugin_find(const char *plugin_name,
48 bt_bool find_in_std_env_var, bt_bool find_in_user_dir,
49 bt_bool find_in_sys_dir, bt_bool find_in_static,
50 bt_bool fail_on_load_error, const bt_plugin **plugin);
51
52typedef enum bt_plugin_find_all_status {
53 BT_PLUGIN_FIND_ALL_STATUS_OK = __BT_FUNC_STATUS_OK,
54 BT_PLUGIN_FIND_ALL_STATUS_NOT_FOUND = __BT_FUNC_STATUS_NOT_FOUND,
55 BT_PLUGIN_FIND_ALL_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
56 BT_PLUGIN_FIND_ALL_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
57} bt_plugin_find_all_status;
58
59bt_plugin_find_all_status bt_plugin_find_all(bt_bool find_in_std_env_var,
60 bt_bool find_in_user_dir, bt_bool find_in_sys_dir,
61 bt_bool find_in_static, bt_bool fail_on_load_error,
62 const bt_plugin_set **plugin_set);
63
64typedef enum bt_plugin_find_all_from_file_status {
65 BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_OK = __BT_FUNC_STATUS_OK,
66 BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_NOT_FOUND = __BT_FUNC_STATUS_NOT_FOUND,
67 BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
68 BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
69} bt_plugin_find_all_from_file_status;
70
71extern bt_plugin_find_all_from_file_status bt_plugin_find_all_from_file(
72 const char *path, bt_bool fail_on_load_error,
73 const bt_plugin_set **plugin_set);
74
75typedef enum bt_plugin_find_all_from_dir_status {
76 BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_OK = __BT_FUNC_STATUS_OK,
77 BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_NOT_FOUND = __BT_FUNC_STATUS_NOT_FOUND,
78 BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
79 BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
80} bt_plugin_find_all_from_dir_status;
81
82extern bt_plugin_find_all_from_dir_status bt_plugin_find_all_from_dir(
83 const char *path, bt_bool recurse, bt_bool fail_on_load_error,
84 const bt_plugin_set **plugin_set);
85
86typedef enum bt_plugin_find_all_from_static_status {
87 BT_PLUGIN_FIND_ALL_FROM_STATIC_STATUS_OK = __BT_FUNC_STATUS_OK,
88 BT_PLUGIN_FIND_ALL_FROM_STATIC_STATUS_NOT_FOUND = __BT_FUNC_STATUS_NOT_FOUND,
89 BT_PLUGIN_FIND_ALL_FROM_STATIC_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
90 BT_PLUGIN_FIND_ALL_FROM_STATIC_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
91} bt_plugin_find_all_from_static_status;
92
93extern bt_plugin_find_all_from_static_status bt_plugin_find_all_from_static(
94 bt_bool fail_on_load_error, const bt_plugin_set **plugin_set);
95
96extern const char *bt_plugin_get_name(const bt_plugin *plugin);
97
98extern const char *bt_plugin_get_author(const bt_plugin *plugin);
99
100extern const char *bt_plugin_get_license(const bt_plugin *plugin);
101
102extern const char *bt_plugin_get_description(const bt_plugin *plugin);
103
104extern const char *bt_plugin_get_path(const bt_plugin *plugin);
105
106extern bt_property_availability bt_plugin_get_version(
107 const bt_plugin *plugin, unsigned int *major,
108 unsigned int *minor, unsigned int *patch, const char **extra);
109
110extern uint64_t bt_plugin_get_source_component_class_count(
111 const bt_plugin *plugin);
112
113extern uint64_t bt_plugin_get_filter_component_class_count(
114 const bt_plugin *plugin);
115
116extern uint64_t bt_plugin_get_sink_component_class_count(
117 const bt_plugin *plugin);
118
119extern const bt_component_class_source *
120bt_plugin_borrow_source_component_class_by_index_const(
121 const bt_plugin *plugin, uint64_t index);
122
123extern const bt_component_class_filter *
124bt_plugin_borrow_filter_component_class_by_index_const(
125 const bt_plugin *plugin, uint64_t index);
126
127extern const bt_component_class_sink *
128bt_plugin_borrow_sink_component_class_by_index_const(
129 const bt_plugin *plugin, uint64_t index);
130
131extern const bt_component_class_source *
132bt_plugin_borrow_source_component_class_by_name_const(
133 const bt_plugin *plugin, const char *name);
134
135extern const bt_component_class_filter *
136bt_plugin_borrow_filter_component_class_by_name_const(
137 const bt_plugin *plugin, const char *name);
138
139extern const bt_component_class_sink *
140bt_plugin_borrow_sink_component_class_by_name_const(
141 const bt_plugin *plugin, const char *name);
142
143extern void bt_plugin_get_ref(const bt_plugin *plugin);
144
145extern void bt_plugin_put_ref(const bt_plugin *plugin);
146
147#define BT_PLUGIN_PUT_REF_AND_RESET(_var) \
148 do { \
149 bt_plugin_put_ref(_var); \
150 (_var) = NULL; \
151 } while (0)
152
153#define BT_PLUGIN_MOVE_REF(_var_dst, _var_src) \
154 do { \
155 bt_plugin_put_ref(_var_dst); \
156 (_var_dst) = (_var_src); \
157 (_var_src) = NULL; \
158 } while (0)
159
160#ifdef __cplusplus
161}
162#endif
163
164#endif /* BABELTRACE2_PLUGIN_PLUGIN_CONST_H */
This page took 0.024046 seconds and 4 git commands to generate.