Fix: src.ctf.lttng-live: emitting stream end msg with no stream
[babeltrace.git] / include / babeltrace2 / plugin / plugin-const.h
CommitLineData
3fd40f46
PP
1#ifndef BABELTRACE2_PLUGIN_PLUGIN_CONST_H
2#define BABELTRACE2_PLUGIN_PLUGIN_CONST_H
90354d3a
JG
3
4/*
0dcb770f 5 * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
90354d3a
JG
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
9df34b44
PP
26#ifndef __BT_IN_BABELTRACE_H
27# error "Please include <babeltrace2/babeltrace.h> instead."
28#endif
29
544d0515 30#include <stdint.h>
33b34c43 31#include <stddef.h>
e0831b38 32
71c5da58 33#include <babeltrace2/types.h>
71c5da58 34#include <babeltrace2/property.h>
834e9996 35
38b48196
JG
36#ifdef __cplusplus
37extern "C" {
38#endif
633edee0 39
fb25b9e3
PP
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,
fb25b9e3
PP
44 BT_PLUGIN_FIND_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
45} bt_plugin_find_status;
2b43acf9 46
fb25b9e3 47extern bt_plugin_find_status bt_plugin_find(const char *plugin_name,
7d8f15e6
PP
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,
01f50d54 50 bt_bool fail_on_load_error, const bt_plugin **plugin);
33b34c43 51
7d8f15e6
PP
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
fb25b9e3
PP
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,
fb25b9e3
PP
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(
01f50d54
PP
72 const char *path, bt_bool fail_on_load_error,
73 const bt_plugin_set **plugin_set);
33b34c43 74
fb25b9e3
PP
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,
fb25b9e3
PP
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(
01f50d54
PP
83 const char *path, bt_bool recurse, bt_bool fail_on_load_error,
84 const bt_plugin_set **plugin_set);
85
fb25b9e3
PP
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,
fb25b9e3
PP
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);
73299554 95
8eee8ea2 96extern const char *bt_plugin_get_name(const bt_plugin *plugin);
633edee0 97
8eee8ea2 98extern const char *bt_plugin_get_author(const bt_plugin *plugin);
633edee0 99
8eee8ea2 100extern const char *bt_plugin_get_license(const bt_plugin *plugin);
633edee0 101
8eee8ea2 102extern const char *bt_plugin_get_description(const bt_plugin *plugin);
f3bc2010 103
8eee8ea2 104extern const char *bt_plugin_get_path(const bt_plugin *plugin);
7c7c0433 105
ee78f405 106extern bt_property_availability bt_plugin_get_version(
8eee8ea2 107 const bt_plugin *plugin, unsigned int *major,
834e9996
PP
108 unsigned int *minor, unsigned int *patch, const char **extra);
109
110extern uint64_t bt_plugin_get_source_component_class_count(
8eee8ea2 111 const bt_plugin *plugin);
834e9996
PP
112
113extern uint64_t bt_plugin_get_filter_component_class_count(
8eee8ea2 114 const bt_plugin *plugin);
b6de043b 115
834e9996 116extern uint64_t bt_plugin_get_sink_component_class_count(
8eee8ea2 117 const bt_plugin *plugin);
33b34c43 118
8eee8ea2 119extern const bt_component_class_source *
3eff3102 120bt_plugin_borrow_source_component_class_by_index_const(
8eee8ea2 121 const bt_plugin *plugin, uint64_t index);
33b34c43 122
8eee8ea2 123extern const bt_component_class_filter *
3a2cb327 124bt_plugin_borrow_filter_component_class_by_index_const(
8eee8ea2 125 const bt_plugin *plugin, uint64_t index);
834e9996 126
8eee8ea2 127extern const bt_component_class_sink *
3a2cb327 128bt_plugin_borrow_sink_component_class_by_index_const(
8eee8ea2 129 const bt_plugin *plugin, uint64_t index);
834e9996 130
8eee8ea2 131extern const bt_component_class_source *
7b53201c 132bt_plugin_borrow_source_component_class_by_name_const(
8eee8ea2 133 const bt_plugin *plugin, const char *name);
834e9996 134
8eee8ea2 135extern const bt_component_class_filter *
7b53201c 136bt_plugin_borrow_filter_component_class_by_name_const(
8eee8ea2 137 const bt_plugin *plugin, const char *name);
834e9996 138
8eee8ea2 139extern const bt_component_class_sink *
7b53201c 140bt_plugin_borrow_sink_component_class_by_name_const(
8eee8ea2 141 const bt_plugin *plugin, const char *name);
33b34c43 142
8eee8ea2 143extern void bt_plugin_get_ref(const bt_plugin *plugin);
8c6884d9 144
8eee8ea2 145extern void bt_plugin_put_ref(const bt_plugin *plugin);
8c6884d9
PP
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
38b48196
JG
160#ifdef __cplusplus
161}
162#endif
90354d3a 163
3fd40f46 164#endif /* BABELTRACE2_PLUGIN_PLUGIN_CONST_H */
This page took 0.062415 seconds and 4 git commands to generate.